next up previous

3.4 Summary of LCG Properties

Following Anderson [3], we summarize the salient features and the recommendations for three widely used types of linear, congruential random number generators.

Multiplicative, congruential generators are adequate to good for many applications. They are not acceptable... for high-dimensional work. They can be very good if speed is a major consideration. Prime moduli are best. However, moduli of the form are faster on binary computers. -- Anderson (1990)

:

The full period of m = is obtained if and only if , and c is odd (often chosen as 1). Low-order bits are not random!

:

The maximum period of this generator is (one-quarter the modulus), and is obtained if and only if or (5 is preferred) and the initial seed is odd. Low-order bits are not random!

:

The maximum period of this generator is p-1 and is obtained if and only if a is a primitive element modulo p. Note that there is always one integer which maps only to itself. (In the case of c = 0, maps to itself.) Low-order bits may or may not be random! Park and Miller [47] recommend the following, portable generator: , a = 16,807, and c = 0. The code random.f, based upon Park and Miller's algorithm, is supplied with this package. Note that, even when c is non-zero, the maximum period of this generator is still one less than the modulus.

(See exercises 8, 8, and 8.)