[computer-go] Random
Don Dailey
drdailey at cox.net
Thu May 15 05:49:34 PDT 2008
If you are looking for a cheap fast and simple random number generator,
A post by George Marsaglia, an expert/guru on random number generation
has several and a C implemention.
These are one line generators, coded as macros. He also discusses
the period and quality of each of them.
This is a gem of a post on sci.stat.math,sci.math if you are
interested in RNG:
http://www.math.niu.edu/~rusin/known-math/99/RNG
- Don
Heikki Levanto wrote:
>> In addition, xor_shift is better than builtin rand() and faster and
>> much smaller than MT.
>>
>
> I don't know that much about random numbers, so excuse my ignorance. But a
> bit of googling got me to the Park - Miller Minimal Standard random number
> generator
> http://www.firstpr.com.au/dsp/rand31/p1192-park.pdf
>
> >From what I read, it should be quite sufficient for go programs. It is
> dead simple and fast:
>
> long int pmrand() {
> const long int a=16807;
> const long int m= ( 1 << 31 ) -1;
> pmrandseed = ( pmrandseed * a ) % m ;
> return pmrandseed;
> } /* pmrand */
>
>
> Should I worry about this not being good enough?
>
> - Heikki
>
>
>
>
More information about the computer-go
mailing list