Marsaglia's theorem
In computational number theory, Marsaglia's theorem connects modular arithmetic and analytic geometry to describe the flaws with the pseudorandom numbers resulting from a linear congruential generator. As a direct consequence, it is now widely considered that linear congruential generators are weak for the purpose of generating random numbers. Particularly, it is inadvisable to use them for simulations with the Monte Carlo method or in cryptographic settings, such as issuing a public key certificate, unless specific numerical requirements are satisfied. Poorly chosen values for the modulus and multiplier in a Lehmer random number generator will lead to a short period for the sequence of random numbers. Marsaglia's result may be further extended to a mixed linear congruential generator. [1]
For example, with RANDU, we have [math]\displaystyle{ m = 2^{32} }[/math], and in three dimensions, it shows that all the points fall into at most [math]\displaystyle{ floor((2^{31}\times 3!)^{1/3}) = 2344 }[/math] planes. The actual RANDU algorithm, which uses [math]\displaystyle{ k = 65539 }[/math], is much worse. All the points in fact fall into 15 planes.
Main statement
Consider a Lehmer random number generator with
- [math]\displaystyle{ r_{i+1} \equiv kr_i\mod m }[/math]
for any modulus [math]\displaystyle{ m }[/math] and multiplier [math]\displaystyle{ k }[/math] where each [math]\displaystyle{ 0\lt r_i \lt m }[/math], and define a sequence
- [math]\displaystyle{ u_1 = \frac{r_1} m, u_2 = \frac{r_2} m, u_3 = \frac{r_3} m , \ldots }[/math]
Define the points
- [math]\displaystyle{ \pi_1 = (u_1, \ldots, u_n), \pi_2 = (u_2, \ldots, u_{n+1}), \pi_3 = (u_3, \ldots, u_{n+2}), \ldots }[/math]
on a unit [math]\displaystyle{ n }[/math]-cube formed from successive terms of the sequence of [math]\displaystyle{ u }[/math]. With such a multiplicative number generator, all [math]\displaystyle{ n }[/math]-tuples of resulting random numbers lie in at most [math]\displaystyle{ (n!m)^{1/n} }[/math] hyperplanes. Additionally, for a choice of constants [math]\displaystyle{ c_1,c_2, \ldots, c_n }[/math] which satisfy the congruence
- [math]\displaystyle{ c_1 + c_2k+c_3k^2 + \cdots + c_n k^{n-1} \equiv 0 \mod m, }[/math]
there are at most [math]\displaystyle{ |c_1| + |c_2| + \cdots + |c_n| }[/math] parallel hyperplanes which contain all [math]\displaystyle{ n }[/math]-tuples produced by the generator. Proofs for these claims may be found in Marsaglia's original paper. [2]
References
- ↑ "An A Priori Determination of Serial Correlation in Computer Generated Random Numbers". Mathematics of Computation 15 (76): 383–389. October 1961. doi:10.2307/2003027. https://www.ams.org/journals/mcom/1961-15-076/S0025-5718-1961-0144489-8/S0025-5718-1961-0144489-8.pdf.
- ↑ "Random Numbers Fall Mainly in the Planes". PNAS 61 (1): 25–28. September 1968. doi:10.1073/pnas.61.1.25. PMID 16591687. PMC 285899. Bibcode: 1968PNAS...61...25M. https://www.pnas.org/content/61/1/25.full.pdf.
Original source: https://en.wikipedia.org/wiki/Marsaglia's theorem.
Read more |