![]() | ||
RANDU is a linear congruential pseudorandom number generator of the Park–Miller type, which has been used since the 1960s. It is defined by the recurrence:
Contents
with the initial seed number,
IBM's RANDU is widely considered to be one of the most ill-conceived random number generators ever designed. It fails the spectral test badly for dimensions greater than 2, and every integer result is odd. However, at least eight low-order bits are dropped when converted to single-precision (32 bit, 24 bit mantissa) floating-point.
The reason for choosing these particular values is that with a 32-bit-integer word size, the arithmetic of mod 231 and
Problems with multiplier and modulus
To show the problem with these values, of multiplier 65539 and modulus 231, consider the following calculation where every term should be taken mod 231. Start by writing the recursive relation as:
which becomes, after expanding the quadratic factor:
and allows us to show the correlation between three points as:
As a result of this correlation, the points in three-dimensional space (mod 231) fall in 15 planes. As a result of the wide use of RANDU in the early 1970s, many results from that time are seen as suspicious.
This misbehavior was already detected in 1963 on a 36-bit computer, and carefully reimplemented on the 32-bit IBM System/360. It was believed to have been widely purged by the early 1990s
Sample output
The start and end of the RANDU’s output period for the initial seed