Prime modulus multiplicative linear congruential generator

From SklogWiki
Revision as of 17:32, 20 February 2007 by Carl McBride (talk | contribs)
Jump to navigation Jump to search

yn+1≡ayn+b(modm),

The parameter m should be prime and as large as possible without causing a numerical overflow on the computer that it is running on. For example, for a 32-bit (31 bit + 1 sign bit) word size then the logical choice of m is the Mersenne prime

m=231−1=2147483647,

with a=75 (a positive primitive root of m see Ref.s 1 and 2), and b=0. With these parameters one is able to generate a series of 2.147×109 pseudo-random numbers from one seed value. For an interesting discussion on how to choose an initial seed value see Ref. 3. For a list of other values of m and a see Ref.4 and for its use on 64-bit computers see Ref. 5.

References

  1. [CACM_1966_09_0432]
  2. [IBM_1969_02_0136]
  3. [CACM_2003_46_0090]
  4. [MC_1999_68_249]
  5. [CPC_1997_103_0103]