Marsaglia's theorem

{{short description|Describes flaws with the pseudorandom numbers from a linear congruential generator}}

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.{{cite journal

|title=An A Priori Determination of Serial Correlation in Computer Generated Random Numbers

|first=Martin |last=Greenberger |authorlink=Martin Greenberger

|journal= Mathematics of Computation|date=October 1961 |volume=15 |issue=76 |pages=383–389

|doi=10.2307/2003027 |jstor=2003027 |doi-access=free

|url=https://www.ams.org/journals/mcom/1961-15-076/S0025-5718-1961-0144489-8/S0025-5718-1961-0144489-8.pdf

}}

For example, with RANDU, we have m = 2^{32}, and in three dimensions, it shows that all the points fall into at most floor((2^{31}\times 3!)^{1/3}) = 2344 planes. The actual RANDU algorithm, which uses k = 65539, is much worse. All the points in fact fall into 15 planes.

File:Randu.png of 100,000 values generated with RANDU. Each point represents 3 consecutive pseudorandom values. It is clearly seen that the points fall in 15 two-dimensional planes.]]

Main statement

Consider a Lehmer random number generator with

: r_{i+1} \equiv kr_i\mod m

for any modulus m and multiplier k where each 0< r_i < m , and define a sequence

: u_1 = \frac{r_1} m, u_2 = \frac{r_2} m, u_3 = \frac{r_3} m , \ldots

Define the points

: \pi_1 = (u_1, \ldots, u_n), \pi_2 = (u_2, \ldots, u_{n+1}), \pi_3 = (u_3, \ldots, u_{n+2}), \ldots

on a unit n-cube formed from successive terms of the sequence of u. With such a multiplicative number generator, all n-tuples of resulting random numbers lie in at most (n!m)^{1/n} hyperplanes. Additionally, for a choice of constants c_1,c_2, \ldots, c_n which satisfy the congruence

: c_1 + c_2k+c_3k^2 + \cdots + c_n k^{n-1} \equiv 0 \mod m,

there are at most |c_1| + |c_2| + \cdots + |c_n| parallel hyperplanes which contain all n-tuples produced by the generator. Proofs for these claims may be found in Marsaglia's original paper.{{cite journal

|title=Random Numbers Fall Mainly in the Planes

|first=George |last=Marsaglia |authorlink=George Marsaglia

|journal=PNAS |date=September 1968 |volume=61 |issue=1 |pages=25–28

|doi=10.1073/pnas.61.1.25 |doi-access=free |bibcode=1968PNAS...61...25M |pmc=285899

|url=https://www.pnas.org/content/61/1/25.full.pdf |pmid=16591687

}}

References