skip to main content
article

Common defects in initialization of pseudorandom number generators

Published:01 September 2007Publication History
Skip Abstract Section

Abstract

We demonstrate that a majority of modern random number generators, such as the newest version of rand.c, ranlux, and combined multiple recursive generators, have some manifest correlations in their outputs if the initial state is filled up using another linear recurrence with similar modulus. Among 58 available generators in the GNU scientific library, 40 show such defects. This is not because of the recursion, but because of carelessly chosen initialization schemes in the implementations. A good initialization scheme eliminates this phenomenon.

References

  1. Biham, E. and Shamir, A. 1991. Differential cryptanalysis of DES-like cryptosystems. J. Cryptol. 4, 1, 3--72.Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. GNU. 2004. GNU scientific library version 1.6. http://www.gnu.org/software/gsl/.Google ScholarGoogle Scholar
  3. James, F. 1994. Ranlux: A fortran implementation of the high-quality pseudorandom number generator of Lüscher. Comput. Phys. Commun. 79, 1 (Feb.), 111--114.Google ScholarGoogle ScholarCross RefCross Ref
  4. Knuth, D. E. 1997. The Art of Computer Programming, vol. 2. Seminumerical Algorithms, 3rd ed. Addison-Wesley, Reading, MA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. L'Ecuyer, P. 1996. Combined multiple recursive random number generators. Oper. Res. 44, 5, 816--822.Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. L'Ecuyer, P. 1992. Testing random number generators. In Proceedings of the IEEE Winter Simulation Conference (Arlington VA). 305--313. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. L'Ecuyer, P. 1993. A search for good multiple recursive random number genarators. ACM Trans. Model.Comput. Simul. 3, 2 (Apr.), 87--98. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. L'Ecuyer, P., Simard, R., Chen, E. J., and Kelton, W. D. 2002. An object-oriented random number package with many long streams and substreams. Oper. Res. 50, 6, 1073--1075. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. L'Ecuyer, P. and Andres, T. H. 1997. A random number generator based on the combination of four LCGs. Math. Comput. Simul. 44, 44, 99--107. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Lüscher, M. 1994. A portable high-quality random number generator for lattice field theory simulations. Comput. Phys. Commun. 79, 1 (Feb.), 100--110.Google ScholarGoogle ScholarCross RefCross Ref
  11. Mascagni, M. and Srinivasan, A. 2004. Parameterizing parallel multiplicative lagged-Fibonacci generators. Parallel Comput. 30, 7 (Jul.), 899--916.Google ScholarGoogle ScholarCross RefCross Ref
  12. Mascagni, M. and Srinivasan, A. 2000. Algorithm 806: SPRNG: A scalable library for pseudorandom number generation. ACM Trans. Math. Softw. 26, 3, 436--461. http://sprng.cs.fsu.edu/. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Matsui, M. 1994. Linear cryptanalysis method for DES cipher. In Proceedings of the International Workshop on Theory and Applications Advances in Cryptology (EuroCrypt) (Lofthus, Norway). Lecture Notes in Computer Science, 765. Springer. 386--397. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Matsumoto, M. and Nishimura, T. 1998. Mersenne twister: A 623-dimensionally equidistributed uniform pseudorandom number generator. ACM Trans. Model. Comput. Simul. 8, 1 (Jan.), 3--30. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Matsumoto, M. and Nishimura, T. 2003. Sum-Discrepancy test on pseudorandom number generators. Math. Comput. Simul. 62, 3--61, 431--442. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Matsumoto, M. and Nishimura, T. 2000. The dynamic creation of pseudorandom number generators. In Monte Carlo and Quasi-Monte Carlo Methods. Springer, 56--69.Google ScholarGoogle Scholar
  17. Tezuka, S., L'Ecuyer, P., and Couture, R. 1994. On the add-with-carry and subtract-with-borrow random number generators. ACM Trans. Model. Comput. Simul. 3, 4, 315--331. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Common defects in initialization of pseudorandom number generators

    Recommendations

    Reviews

    Soubhik Chakraborty

    It is a well-known fact that numbers generated by an arbitrarily selected seed for a pseudorandom number generator (PRNG) may not be statistically random. This paper demonstrates that many modern random number generators have some noticeable patterns, when initial seeds are chosen through a linear recurrence. Matsumoto et al. painstakingly experiment with 58 generators and discover as many as 40 to be defective. Further investigation reveals that the unwanted patterns are caused by the wrong choice of initialization rather than recursion. Accordingly, they advise PRNG designers to use a nonsystematic choice of seeds, or supply a better initialization scheme [1,2], and to test the randomness of the n -th output x ( n , s ) corresponding to a given seed s by varying both n and s . An interesting aspect missed by Matsumoto et al. is that PRNGs generally have a cycle, which, after completion, generates the same sequence, whereas the sequence of decimals of irrational numbers, such as pi, is nonrepeating and nonterminating. Pi, in fact, has been already proposed as a random number generator and the allegation that it is “less random than we thought” has been recently refuted by Marsaglia [3]. Of course, one has to generate these decimals easily and quickly on the computer. Examining some function of pi, rather than pi itself, is a worthwhile proposition. Online Computing Reviews Service

    Access critical reviews of Computing literature here

    Become a reviewer for Computing Reviews.

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader