Professional Documents
Culture Documents
Linear Congruential Generators: Random Numbers Fall Mainly in The Planes. - George Marsaglia (1968)
Linear Congruential Generators: Random Numbers Fall Mainly in The Planes. - George Marsaglia (1968)
LINEAR CONGRUENTIAL
GENERATORS
The linear congruential method is the most popular algorithm for random num-
ber generation in the field of computer simulations. The linear congruential
generator (LeG) is defined by
Xn = aXn- 1 +c (modM),
Xn
where a, c, and M are integers and X n , n = 1,2, ... , is a sequence of integers with
o~ Xn < M. The normalized sequence Un, n = 1,2, ... , is a random number
sequence in [0,1). The following results tell us how to choose the parameters
a, c, and M to obtain the maximal period lengths.
Theorem 3.1 An LeG with the parameters (a, c, M) has period length M if
and only if
(i) gcd(c, M) = 1;
Theorem 3.2 An LeG with the parameters (a, 0, M) has a maximal period
length A(M) if and only if
(i) gcd(Xo, M) = 1;
(ii) a is a primitive element modulo M.
If ar < M, it is easy to see that no overflow occur when we use the RHS. On
the basis of this idea, Schrage (see [16]) implemented the generator GGL in
an efficient and portable way.