Marsaglia's theorem explained

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

m=232

, and in three dimensions, it shows that all the points fall into at most

floor((231 x 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

ri+1\equivkri\modm

for any modulus

m

and multiplier

k

where each

0<ri<m

, and define a sequence

u1=

r1
m,

u2=

r2
m,

u3=

r3
m

,\ldots

Define the points

\pi1=(u1,\ldots,un),\pi2=(u2,\ldots,un+1),\pi3=(u3,\ldots,un+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

c1,c2,\ldots,cn

which satisfy the congruence

c1+c2k+c

2
3k

++cnkn-1\equiv0\modm,

there are at most

|c1|+|c2|++|cn|

parallel hyperplanes which contain all

n

-tuples produced by the generator. Proofs for these claims may be found in Marsaglia's original paper. [2]

Notes and References

  1. An A Priori Determination of Serial Correlation in Computer Generated Random Numbers . Martin . Greenberger . Martin Greenberger . Mathematics of Computation. October 1961 . 15 . 76 . 383–389 . 10.2307/2003027 . 2003027 . free .
  2. Random Numbers Fall Mainly in the Planes . George . Marsaglia . George Marsaglia . . September 1968 . 61 . 1 . 25–28 . 10.1073/pnas.61.1.25 . free . 1968PNAS...61...25M . 285899 . 16591687 .