Marsaglia's theorem

From The Right Wiki
Revision as of 01:08, 28 January 2024 by imported>Cosmia Nebula (RANDU)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

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×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
Three-dimensional plot 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

ri+1krimodm

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

u1=r1m,u2=r2m,u3=r3m,

Define the points

π1=(u1,,un),π2=(u2,,un+1),π3=(u3,,un+2),

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,,cn which satisfy the congruence

c1+c2k+c3k2++cnkn10modm,

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]

References

  1. Greenberger, Martin (October 1961). "An A Priori Determination of Serial Correlation in Computer Generated Random Numbers" (PDF). Mathematics of Computation. 15 (76): 383–389. doi:10.2307/2003027. JSTOR 2003027.
  2. Marsaglia, George (September 1968). "Random Numbers Fall Mainly in the Planes" (PDF). PNAS. 61 (1): 25–28. Bibcode:1968PNAS...61...25M. doi:10.1073/pnas.61.1.25. PMC 285899. PMID 16591687.