In
computational number theory
In mathematics and computer science, computational number theory, also known as algorithmic number theory, is the study of
computational methods for investigating and solving problems in number theory and arithmetic geometry, including algorithm ...
, Marsaglia's theorem connects
modular arithmetic
In mathematics, modular arithmetic is a system of arithmetic for integers, where numbers "wrap around" when reaching a certain value, called the modulus. The modern approach to modular arithmetic was developed by Carl Friedrich Gauss in his book ...
and
analytic geometry
In classical mathematics, analytic geometry, also known as coordinate geometry or Cartesian geometry, is the study of geometry using a coordinate system. This contrasts with synthetic geometry.
Analytic geometry is used in physics and engineerin ...
to describe the flaws with the
pseudorandom numbers
A pseudorandom sequence of numbers is one that appears to be Statistical randomness, statistically random, despite having been produced by a completely Deterministic system, deterministic and repeatable process.
Background
The generation of ran ...
resulting from a
linear congruential generator
A linear congruential generator (LCG) is an algorithm that yields a sequence of pseudo-randomized numbers calculated with a discontinuous piecewise linear equation. The method represents one of the oldest and best-known pseudorandom number generat ...
. 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
Monte Carlo methods, or Monte Carlo experiments, are a broad class of computational algorithms that rely on repeated random sampling to obtain numerical results. The underlying concept is to use randomness to solve problems that might be determi ...
or in cryptographic settings, such as issuing a
public key certificate
In cryptography, a public key certificate, also known as a digital certificate or identity certificate, is an electronic document used to prove the validity of a public key. The certificate includes information about the key, information about the ...
, unless specific numerical requirements are satisfied. Poorly chosen values for the modulus and multiplier in a
Lehmer random number generator The Lehmer random number generator (named after D. H. Lehmer), sometimes also referred to as the Park–Miller random number generator (after Stephen K. Park and Keith W. Miller), is a type of linear congruential generator (LCG) that oper ...
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.
Main statement
Consider a
Lehmer random number generator The Lehmer random number generator (named after D. H. Lehmer), sometimes also referred to as the Park–Miller random number generator (after Stephen K. Park and Keith W. Miller), is a type of linear congruential generator (LCG) that oper ...
with
:
for any modulus
and multiplier
where each
, and define a sequence
:
Define the points
:
on a unit
-cube formed from successive terms of the sequence of
. With such a multiplicative number generator, all
-tuples of resulting random numbers lie in at most
hyperplanes. Additionally, for a choice of constants
which satisfy the congruence
:
there are at most
parallel hyperplanes which contain all
-tuples produced by the generator. Proofs for these claims may be found in Marsaglia's original paper.
References
{{reflist
Theorems in number theory
Random number generation