RANDU: A Poorly Conceived "Random" Number Generator
(IBM, SYSTEM/360)
[It was still out there as late at 1999!
Ref: Compaq Fortran
Language Reference Manual (Order Number: AA-Q66SD-TK) September 1999
(formerly DIGITAL Fortran and DEC Fortran 90)]
- RANDU, an LCG with m = 231, a = 216 + 3 = 65,539, c = 0
[ie., x i+1 = 65539x i mod (231)]
has a major failing as per G. Marsaglia's observations regarding LCG random numbers,
"Random Numbers Fall Mainly in The Planes", Proceedings of the National Academy of Sciences,
61, pp. 25-28 (1968). In particular, for an LCG with m = 231, triples produced using
consecutive values fall into no more than 2,344 planes in 3-space. For RANDU, the choice
of multiplier is particularly unfortunate, because RANDU triples fall in just 15 planes.
This realization was a motivator for the development of the spectral test for n-space
uniformity. This matters because many problems addressed by the Monte Carlo method
(eg., the determination of random neutron diffusion in fissile material) require large
numbers of random points in n-space.
- The point plot below has 32,000 "random" triples generated using RANDU and demonstrates that they
distribute in just 15 planes; ie., RANDU fails badly for generating random n-tuples with
n = 3. The plot image was generated using an application written by Y. S. Chua, UNF [2004]
- 96,000 consecutive RANDU values were collapsed to points of the form
(x 0, x 1, x 2), (x 3, x 4, x 5), . . .
with the number stream ranged to 0 - 1000 by using FLOOR(0.5+1000x i / 231)
-
Note that for RANDU, a triple of successive values
(x i, x i+1, x i+2) has the property that
- 9x i - 6x i+1 + x i+2 = 0 (mod 231)
[9x i - 6x i+1 + x i+2 =
9x i - 6ax i + a2x i =
(a - 3)2 x i = (216)2 x i=
231 2x i = 0 (mod 231)]
Hence Marsaglia's Theorem applies, so each of the triples lies on one
of the set of parallel planes defined by the equations
9x - 6y + z = 0, ±1, ±2, .... with
at most 9+6+0=15 of these intersecting the 231 x 231 x 231 cube
containing the triples.
|
animated view
|
|