Prime modulus multiplicative linear congruential generator
- Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle y_{n+1}\equiv ay_n + b~~~(\mod ~m),}
The parameter Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle 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 Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle m} is the Mersenne prime
- Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \left.m\right.=2^{31} -1=2147483647} ,
with Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle a=7^5} (a positive primitive root of Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle m} see Ref.s 1 and 2), and . With these parameters one is able to generate a series of Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle 2.147 \times 10^9} 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 Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle m} and Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle a} see Ref.4 and for its use on 64-bit computers see Ref. 5.
References
- D. W. Hutchinson, "A New Uniform Pesudorandom Number Generator", Communications of the ACM, 9 pp. 432-433 (1966)
- P. A. W. Lewis and A. S. Goodman and J. M. Miller, "A pseudo-random number generator for the System/360", IBM Systems Journal 2 pp. 136 (1969)
- G. Marsaglia, "Seeds for Random Number Generators",Communications of the ACM, 46 pp. 90-93 (2003)
- [http://dx.doi.org/
- [http://dx.doi.org/
- [MC_1999_68_249]
- [CPC_1997_103_0103]