[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: about the random number generator




Quoth John Heidemann <[email protected]> :

>  Getting a good RNG is important to us.
>  I'm no number-theory expert either, but it looks to me like
>  your RNG is the basically same mechanism as the one in ns 2.0
>  with a different initial seed.  My understanding was that the seed
>  A=16807 had a known long period, so I'm not sure what weakness you're
>  refering to.  Both of the CACM papers referred to in rng.cc suggest
>  that A=16807 is not a bad choice.

Both multipliers have the same long period of m=2^31-2.
Law & Kelton's book recommends a=630360016 over a=16807 siting
Fishman and Moore's work. Unlike their 1986 CACM paper
where they checked global randomness of rn generators,
Fishman and Moore's 1982 JASA paper covers statistical tests for
local randomness and cites a=16807 to be poor. But as both multipliers
are worse than others recommended in Fishman and Moore's CACM paper
in terms of global randomness, the best would be to implement a rn generator
using one of those good multipliers. I haven't found any code implementing
one of those, and hope someone can dig up and post it.

Since the rn generator with a=16807 has been out there for quite a while,
it'd be interesting to hear what people's experiences are with it.

Thanks.
-Sue