Mersenne twister: a 623-dimensionally equidistributed uniform pseudo-random number generator

A new algorithm called Mersenne Twister (MT) is proposed for generating uniform pseudorandom numbers. For a particular choice of parameters, the algorithm provides a super astronomical period of 2<supscrpt>19937</supscrpt> −1 and 623-dimensional equidistribution up to 32-bit accuracy, while using a working area of only 624 words. This is a new variant of the previously proposed generators, TGFSR, modified so as to admit a Mersenne-prime period. The characteristic polynomial has many terms. The distribution up to <italic>v</italic> bits accuracy for 1 ≤ <italic>v</italic> ≤ 32 is also shown to be good. An algorithm is also given that checks the primitivity of the characteristic polynomial of MT with computational complexity <italic>O(p<supscrpt>2</supscrpt>)</italic> where <italic>p</italic> is the degree of the polynomial. We implemented this generator in portable C-code. It passed several stringent statistical tests, including diehard. Its speed is comparable to other modern generators. Its merits are due to the efficient algorithms that are unique to polynomial calculations over the two-element field.

[1]  Donald Ervin Knuth,et al.  The Art of Computer Programming , 1968 .

[2]  James H. Lindholm An analysis of the pseudo-randomness properties of subsequences of long m -sequences , 1968, IEEE Trans. Inf. Theory.

[3]  N. S. Barnett,et al.  Private communication , 1969 .

[4]  Ted G. Lewis,et al.  Generalized Feedback Shift Register Pseudorandom Number Algorithm , 1973, JACM.

[5]  J. P. R. Tootill,et al.  An Asymptotically Random Tausworthe Sequence , 1973, JACM.

[6]  Staffan A. Fredricsson Pseudo-randomness properties of binary shift register sequences (Corresp.) , 1975, IEEE Trans. Inf. Theory.

[7]  Donald E. Knuth,et al.  The art of computer programming. Vol.2: Seminumerical algorithms , 1981 .

[8]  László Lovász,et al.  Factoring polynomials with rational coefficients , 1982 .

[9]  Shu Tezuka,et al.  The k-distribution of generalized feedback shift register pseudorandom numbers , 1983, CACM.

[10]  Arjen K. Lenstra,et al.  Factoring multivariate polynomials over finite fields , 1983, J. Comput. Syst. Sci..

[11]  Arjen K. Lenstra Factoring Multivariate Polynomials over Finite Fields , 1985, J. Comput. Syst. Sci..

[12]  Shu Tezuka,et al.  Lattice structure of pseudorandom sequences from shift-register generators , 1990, 1990 Winter Simulation Conference Proceedings.

[13]  M. Fushimi Random number generation with the recursion X t =X t-3p ⊕X t-3q , 1990 .

[14]  A. Compagner The hierarchy of correlations in random binary sequences , 1991 .

[15]  G. Marsaglia,et al.  A New Class of Random Number Generators , 1991 .

[16]  Pierre L'Ecuyer,et al.  Efficient and portable combined Tausworthe random number generators , 1990, TOMC.

[17]  P. L’Ecuyer,et al.  Supplement to On the Distribution of k-Dimensional Vectors for Simple and Combined Tausworthe Sequences , 1991 .

[18]  Makoto Matsumoto,et al.  Twisted GFSR generators , 1992, TOMC.

[19]  J. Heringa,et al.  New Primitive Trinomials Of Mersenne-Exponent Degrees For Random-Number Generation , 1992 .

[20]  Alan M. Ferrenberg,et al.  Monte Carlo simulations: Hidden errors from "good" random number generators. , 1992, Physical review letters.

[21]  Shu Tezuka,et al.  On the lattice structure of the add-with-carry and subtract-with-borrow random number generators , 1993, TOMC.

[22]  H. Niederreiter Factorization of polynomials and some linear-algebra problems over finite fields , 1993 .

[23]  Makoto Matsumoto,et al.  Twisted GFSR generators II , 1994, TOMC.

[24]  S. Tezuka The k -dimensional distribution of combined GFSR sequences , 1994 .

[25]  Pierre L'Ecuyer,et al.  Uniform random number generation , 1994, Ann. Oper. Res..

[26]  S. Tezuka A UNIFIED VIEW OF LONG-PERIOD RANDOM NUMBER GENERATORS , 1994 .

[27]  S. Tezuka Uniform Random Numbers: Theory and Practice , 1995 .

[28]  手塚 集 Uniform random numbers : theory and practice , 1995 .

[29]  Shu Tezuka,et al.  Uniform Random Numbers , 1995 .

[30]  H. Niederreiter The Multiple-Recursive Matrix Method for Pseudorandom Number Generation , 1995 .

[31]  Pierre L'Ecuyer,et al.  Maximally equidistributed combined Tausworthe generators , 1996, Math. Comput..

[32]  Makoto Matsumoto,et al.  Strong deviations from randomness in m-sequences based on trinomials , 1996, TOMC.

[33]  Kenneth J. Giuliani Factoring Polynomials with Rational Coeecients , 1998 .

[34]  P. Hellekalek Good random number generators are (not so) easy to find , 1998 .