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. For example, with RANDU, we have m = 2 32 {\displaystyle m=2^{32}} , and in three dimensions, it shows that all the points fall into at most f l o o r ( ( 2 31 × 3 ! ) 1 / 3 ) = 2344 {\displaystyle floor((2^{31}\times 3!)^{1/3})=2344} planes. The actual RANDU algorithm, which uses k = 65539 {\displaystyle k=65539} , is much worse. All the points in fact fall into 15 planes.
Main statement Consider a Lehmer random number generator with
r i + 1 ≡ k r i mod m {\displaystyle r_{i+1}\equiv kr_{i}\mod m}
for any modulus m {\displaystyle m} and multiplier k {\displaystyle k} where each 0 < r i < m {\displaystyle 0<r_{i}<m} , and define a sequence
u 1 = r 1 m , u 2 = r 2 m , u 3 = r 3 m , … {\displaystyle u_{1}={\frac {r_{1}}{m}},u_{2}={\frac {r_{2}}{m}},u_{3}={\frac {r_{3}}{m}},\ldots }
Define the points
π 1 = ( u 1 , … , u n ) , π 2 = ( u 2 , … , u n + 1 ) , π 3 = ( u 3 , … , u n + 2 ) , … {\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 }
on a unit n {\displaystyle n} -cube formed from successive terms of the sequence of u {\displaystyle u} . With such a multiplicative number generator, all n {\displaystyle n} -tuples of resulting random numbers lie in at most ( n ! m ) 1 / n {\displaystyle (n!m)^{1/n}} hyperplanes. Additionally, for a choice of constants c 1 , c 2 , … , c n {\displaystyle c_{1},c_{2},\ldots ,c_{n}} which satisfy the congruence
c 1 + c 2 k + c 3 k 2 + ⋯ + c n k n − 1 ≡ 0 mod m , {\displaystyle c_{1}+c_{2}k+c_{3}k^{2}+\cdots +c_{n}k^{n-1}\equiv 0\mod m,}
there are at most | c 1 | + | c 2 | + ⋯ + | c n | {\displaystyle |c_{1}|+|c_{2}|+\cdots +|c_{n}|} parallel hyperplanes which contain all n {\displaystyle n} -tuples produced by the generator. Proofs for these claims may be found in Marsaglia's original paper.
References
