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.

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.

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.