RANDU

From Free net encyclopedia

Image:Randu.png RANDU is an infamous linear congruential pseudorandom number generator which has been used since the 1960s. It is defined by the recurrence:

<math>V_{j+1} \equiv (65539 V_j) \mod 2^{31}</math>

with <math>V_0</math> odd.

It is widely considered to be one of the most ill-conceived random number generators designed. Notably, it fails the spectral test badly for dimensions greater than 2.

The reason for choosing this particular values is that with a 32 bit integer word size the aritmetic of mod <math>2^{31}</math> and <math>65539=2^{16}+3</math> calculations could be done quickly. To show the problem with this values let's consider the following calculation where every term should be taken mod <math>2^{31}</math>, we start by writing the recursive relation as:

<math>x_{k+2}=2^{16}+3 x_{k+1}=(2^{16}+3 )^2x_{k}</math>

which becomes, after expanding the cuadratic factor in:

<math>x_{k+2}=(2^{32}+6 \cdot2^{16} +9 )x_{k}=[6 \cdot (2^{16}+3)-9]x_{k}</math>

and allow us to show the enormous correlation between three points as:

<math>x_{k+2}=6x_{k+1}-9x_{k}</math>

As a result of this correlation the points in three dimesional space fall in a ridicoulsy small number of planes, 15 to be exact. As a result of the wide use of RANDU in the early 70's many results from that time are seen as suspicious.

...its very name RANDU is enough to bring dismay into the eyes and stomachs of many computer scientists!Donald Knuth
One of us recalls producing a “random” plot with only 11 planes, and being told by his computer center’s programming consultant that he had misused the random number generator: “We guarantee that each number is random individually, but we don’t guarantee that more than one of them is random.” Figure that out. —Press, William H., et al. (1992).

References

  • Donald E. Knuth, The Art of Computer Programming, Volume 2: Seminumerical Algorithms, 3rd edition (Addison-Wesley, Boston, 1998).
  • Press, William H., et al. (1992). Numerical Recipes in Fortran 77: The Art of Scientific Computing, 2nd edition. ISBN 052143064X.fr:RANDU