It sounds like you're frustrated, so here's a few lines of C code
that'll do about what you describe.  Note that the use of large values
for the standard deviation will make the code go very slow from
repetitive looping.  The divide by 10 is to make it not be too slow with
a degree of randomness of 100.  randn returns a normally distributed
random number.



float standard_deviation = degree_of_randomness/10;
double r;
do{
  r = abs(randn(seed))*standard_deviation;
}while (r >= (range+1))
return floor(r);



1. Get a random, normally distributed, variable
   (using your favorite API to do that)
2. If it's negative, make it positive
Use your favorite function for generating a normally distributed random
variable.  If it's negative, make it positive.

Multiply it by some 

On Tue, 2007-11-06 at 22:03 -0500, Mike Hill wrote:
> Folks...
> 
> First, let me say how much pleasure my reading of this list has given 
> me.  I love that folks are out there cranking on this problem.  Truly, 
> it's one of the great problems.
> 
> I have a rather strange request.  I am a statistical idiot, in both 
> senses of 'statistical'.  After scrolling through a half-dozen stat 
> tutorials online, I find myself completely unable to grasp how I'd get 
> the effect I want even if I wanted to use floats, which I don't.  As you 
> will soon be aware, I don't even have the language to figure out how to 
> describe my problem.  Seeing as how there are so many MC algorithm 
> workers on the list, I thought I'd turn to you for some guidance.
> 
> The essence of my idea is that I want a psuedo-random algorithm which 
> takes as a parameter a 'degree-of-randomness' value.  Something along 
> these lines:
> 
> int choose( int range, int degree-of-randomness)
> 
> Returns an integer in [0-range] distributed depending on the value of 
> degree-of-randomness.  At degree-of-randomness 100, I want the 
> distribution to be uniform.  At degree-of-randomness 0, I want the 
> distribution to be  -- I don't even know what to call this -- 
> half-of-a-normal-distribution  with the steepness proportionately 
> related to degree-of-randomness.
> 
> Am I making *any* sense?  If so, you may need some sort of psychiatric 
> help, or alternatively, you could do me the favor of explaining how to 
> ask for what I want or even how to actually get it.  :)
> 
> Cheers, and thanks,
> Hill
> 
> 
> _______________________________________________
> computer-go mailing list
> computer-go@computer-go.org
> http://www.computer-go.org/mailman/listinfo/computer-go/

_______________________________________________
computer-go mailing list
computer-go@computer-go.org
http://www.computer-go.org/mailman/listinfo/computer-go/

Reply via email to