## TestU01: A C library for empirical testing of random number generators (2007)

### Cached

### Download Links

- [www.iro.umontreal.ca]
- [ftp.vim.org]
- [chuck.ucs.indiana.edu]
- [ftp.genotec.ch]
- [spout.ussg.indiana.edu]
- [ftp.riken.go.jp]
- [ftp.genotec.ch]
- [ftp.vim.org]
- DBLP

### Other Repositories/Bibliography

Venue: | ACM Transactions on Mathematical Software |

Citations: | 26 - 1 self |

### BibTeX

@ARTICLE{Simard07testu01:a,

author = {Richard Simard and Université De Montréal},

title = {TestU01: A C library for empirical testing of random number generators},

journal = {ACM Transactions on Mathematical Software},

year = {2007},

pages = {2007}

}

### OpenURL

### Abstract

We introduce TestU01, a software library implemented in the ANSI C language, and offering a collection of utilities for the empirical statistical testing of uniform random number generators (RNGs). It provides general implementations of the classical statistical tests for RNGs, as well as several others tests proposed in the literature, and some original ones. Predefined tests suites for sequences of uniform random numbers over the interval (0, 1) and for bit sequences are available. Tools are also offered to perform systematic studies of the interaction between a specific test and the structure of the point sets produced by a given family of RNGs. That is, for a given kind of test and a given class of RNGs, to determine how large should be the sample size of the test, as a function of the generator’s period length, before the generator starts to fail the test systematically. Finally, the library provides various types of generators implemented in generic form, as well as many specific generators proposed in the literature or found in widely-used software. The tests can be applied to instances of the generators predefined in the library, or to user-defined generators, or to streams of random numbers produced by any kind of device or stored in files. Besides introducing TestU01, the paper provides a survey and a classification of statistical tests for RNGs. It also applies batteries of tests to a long list of widely used RNGs.

### Citations

1455 |
An Introduction to Probability Theory
- Feller
- 1971
(Show Context)
Citation Context ...n changes. The theoretical probabilities for these ACM Transactions on Mathematical Software, Vol. V, No. N, Month 20YY.20 · Pierre L’Ecuyer and Richard Simard statistics under H B 0 are as follows [=-=Feller 1968-=-]: P [H = k] = P [Sℓ = 2k − ℓ] = pℓ,2k−ℓ P [M = y] = pℓ,y + pℓ,y+1, 0 ≤ y ≤ ℓ, P [J = k] = pk,0 pℓ−k,0, P [Py = k] = (y/k)pk,y, P [R = y] = pℓ−y,y, 0 ≤ k ≤ ℓ, k even, 0 ≤ y ≤ ℓ/2, P [C = y] = 2pℓ−1,2y... |

675 |
The Art of Computer Programming, volume 2: Seminumerical Algorithms
- Knuth
- 1988
(Show Context)
Citation Context ...atical analysis of their period lengths and of the uniformity of the vectors of successive values that they produce over their entire period length; that’s how independence is assessed theoretically [=-=Knuth 1998-=-; L’Ecuyer 2004]. However, once they have been selected and implemented, they must also be tested empirically. Statistical tests are also required for RNGs based (totally or partially) on physical dev... |

439 |
Algebraic Coding Theory
- Berlekamp
- 1968
(Show Context)
Citation Context ...rrence obeyed by the sequence. It is nondecreasing in ℓ and increases by integer-sized jumps at certain values of ℓ. In our implementation, Lℓ is computed (updated) by the Berlekamp-Massey algorithm [=-=Berlekamp 1984-=-; Massey 1969] and requires O(n2 log n) time overall. If the entire binary sequence follows a linear recurrence of order k ≪ n (this is the case for several widely-used classes of generators; see Sect... |

324 |
Monte Carlo: Concepts, Algorithms and Applications
- FISHMAN
- 1995
(Show Context)
Citation Context ...t p-value as pl = 1 − pr = P [Y < y | H0] in this case; in the example, this would give pl = 0. Several authors have advocated and/or applied a two-level (or second-order) procedure for testing RNGs [=-=Fishman 1996-=-; Knuth 1998; L’Ecuyer 1992; Marsaglia 1985]. The idea is to generate N “independent” copies of Y , say Y1, . . . , YN, by replicating the first-order test N times on disjoint subsequences of the gene... |

196 |
The Design of Rijndael
- Daemen, Rijmen
- 2002
(Show Context)
Citation Context ...ni and Srinivasan 2000]. These generators pass all the tests. ISAAC was designed for cryptography by Jenkins [1996]. AES uses the Advanced Encryption standard based on the Rijndael cipher [NIST 2001; =-=Daemen and Rijmen 2002-=-] with a 128-bit key, in output feedback mode (OFB), in counter mode (CTR), and in key counter mode (KTR). The KTR mode uses a counter as key that is increased by 1 at each encryption iteration. AES u... |

136 | Testing random number generators - L’Ecuyer - 1992 |

127 | Modern cryptography, probabilistic proofs and pseudorandomness, volume 17 of Algorithms and Combinatorics
- Goldreich
- 1999
(Show Context)
Citation Context ...n is unpredictability of the forthcoming numbers. The theoretical analysis of RNGs in cryptology is usually asymptotic, in the framework of computational complexity theory [Knuth 1998; Lagarias 1993; =-=Goldreich 1999-=-]. Nonlinear recurrences and/or output functions are used, which prevents one from measuring the uniformity of the set Ψt. As a result, empirical testing is even more necessary. 3. STATISTICAL TESTING... |

105 | E¢ cient and portable combined random number generators - L’Ecuyer - 1988 |

78 | Good parameters and implementations for combined multiple resursive random number generators - L’Ecuyer - 1999 |

75 | Maximally equidistributed combined Tausworthe generators - L’Ecuyer - 1996 |

74 | Asymptotic theory of certain "goodness of fit" criteria based on stochastic processes - Anderson, Darling - 1952 |

63 | An exhaustive analysis of multiplicative congruential random number generators with modulus 2 31 -1 - Fishman, Moore - 1986 |

60 | Distribution Theory for Tests Based on the Sample Distribution Function - Durbin - 1973 |

51 | Random numbers for simulation - L’Ecuyer - 1990 |

49 |
Monte Carlo simulations: Hidden errors from “good” random number generators
- Ferrenberg, Landau, et al.
- 1992
(Show Context)
Citation Context ...ture that permits some classes of generators to run very fast is often the source of major statistical weaknesses, which sometimes lead to totally wrong simulation results [Couture and L’Ecuyer 1994; =-=Ferrenberg et al. 1992-=-; L’Ecuyer and Simard 1999; L’Ecuyer et al. 2002; L’Ecuyer and Touzin 2004; Panneton and L’Ecuyer 2005; Tezuka et al. 1994]. Practical tools for detecting these deficiencies are needed. Offering a ric... |

49 | Tables of Maximally Equidistributed Combined LFSR Generators - L’Ecuyer - 1998 |

40 |
A non-linear congruential pseudorandom number generator
- EICHENAUER, LEHN
- 1986
(Show Context)
Citation Context ...sh. Inversive generators. These RNGs use nonlinear recurrences. The inversive congruential generator ICG (m, a, b) uses the recurrence xj+1 = (axj + b) mod m, where xx = 1 mod m if x ̸= 0, and 0 = 0 [=-=Eichenauer and Lehn 1986-=-]. The output is uj = xj/m. ICG(2 31 − 1, 1, 1) was suggested by Eichenauer-Herrmann [1992]. ICG(2 31 − 1, 22211, 11926380) was suggested by Hellekalek [1995]. The explicit inversive congruential gene... |

39 | Explicit inversive congruential pseudorandom numbers with power of two modulus - Eichenauer-Herrmann, Ickstadt - 1994 |

39 | A very fast shift-register sequence random number generator - Kirkpatrick, Stoll - 1981 |

39 | Software for uniform random number generation: Distinguishing the good and the - L’Ecuyer |

34 | A random number generator based on the combination of four LCGs. Mathematics of Computer Simulation - L’Ecuyer, Andres - 1997 |

31 | Combined multiple recursive random number generators - L’Ecuyer - 1996 |

30 | On the lattice structure of certain linear congruential sequences related to AWC/SWB generators - Couture, L’Ecuyer - 1994 |

30 | A search for good multiple recursive random number generators - L’Ecuyer, Blouin, et al. - 1993 |

29 | Sums of functions of nearest neighbor distances, moment bounds, limit theorems and a goodness of fit test. The Annals of Probability - Bickel, Breiman - 1983 |

28 | Multiplicative congruential random number generators with modulus 2 β : An exhaustive analysis for β = 32 and a partial analysis for β = 48 - Fishman - 1990 |

27 | Recommendation for random number generation using deterministic random bit generators - Barker, Kelsey - 2012 |

27 |
RANLUX: A Fortran implementation of high-quality pseudorandom number generator of Luscher
- James
(Show Context)
Citation Context ...’Ecuyer 1997a]. SWB(2 24 , 10, 24), SWB(2 32 − 5, 22, 43), and SWB(2 31 , 8, 48) were proposed by Marsaglia and Zaman [1991]. SWB(2 24 , 10, 24)[24, ℓ], called RANLUX, was advocated in [Lüscher 1994; =-=James 1994-=-] with luxury levels ℓ = 24, 48, 97, 223, 389. In its original form it returns only 24-bit output values. For our tests, we use a version with 48 bits of precision obtained by adding two successive nu... |

25 | Digital search trees again revisited: the internal path length perspective - Kirschenhofer, Prodinger, et al. - 1994 |

23 | Inversive Pseudorandom Number Generators: Concepts, Results and Links
- Hellekalek
- 1995
(Show Context)
Citation Context ... The explicit inversive congruential generator EICG (m, a, b) uses the recurrence xj = (a j + b) mod m with output uj = xj/m. EICG(2 31 − 1, 1, 1) and EICG(2 31 − 1, 1288490188, 1) were suggested by [=-=Hellekalek 1995-=-; 1998]. A significant drawback of inversive RNGs is that they require modular inversion, a slow and costly operation. All the inversive generators tested here have a short period and fail the tests. ... |

23 | 2005. Simulation in Java with SSJ - L’Ecuyer, Buist |

21 |
The serial test for sampling numbers and other tests for randomness
- Good
- 1953
(Show Context)
Citation Context ...at measure the overall discrepancy between the counts Xj and their expectation λ = n/k are generally called serial tests of uniformity [Knuth 1998; L’Ecuyer et al. 2002]. In the original serial test [=-=Good 1953-=-; Knuth 1998], the distance to the exact distribution is measured by the chi-square test statistic X 2 = k−1 ∑ j=0 (Xj − λ) 2 which has approximately a chi-square distribution with k − 1 degrees of fr... |

21 | lattice structures for vectors of non-successive values produced by some linear recurrences - L’ECUYER |

20 | Distribution properties of multiply-with-carry random number generators - Couture, L’Ecuyer - 1997 |

18 |
An extreme value theory for long head runs, Probability Theory and Related
- Gordon, Schilling, et al.
- 1986
(Show Context)
Citation Context ...with a chi-square test. Bit sequences that follow linear recurrences fail this test for large enough m, because of the linear dependencies. Longest run of 1’s. The longest head run test [Földes 1979; =-=Gordon et al. 1986-=-] is a variant of the run test that looks at the length Y of the longest substring of successive 1’s in a string of length m. This is repeated n times and the empirical distribution of the n realizati... |

16 | Empirical evidence concerning AES - Hellekalek, Wegenkittl |

15 | Note on Marsaglia’s xorshift random number generators - Brent - 2004 |

15 |
Empirical tests of binary keystreams
- Erdmann
- 1992
(Show Context)
Citation Context ...The sample autocorrelation of lag ℓ in a bit sequence, defined as Aℓ = n−ℓ−1 ∑ i=0 bi ⊕ bi+ℓ, where ⊕ is the exclusive-or operation (or addition modulo 2), also defines an interesting test statistic [=-=Erdmann 1992-=-]. Under H B 0 , Aℓ has the binomial distribution with parameters (n − ℓ, 1/2), which is approximately normal when n − ℓ is large. Run and gap tests. The binary counterpart of the run test can be defi... |

15 | Pseudorandom numbers - Lagarias - 1993 |

15 | Combined generators with components from different families - L’Ecuyer, Granger-Piché - 2003 |

11 |
Don’t trust parallel Monte Carlo
- HELLEKALEK
- 1998
(Show Context)
Citation Context ...ingle or combined), cubic and combined cubic generators, and inversive generators (explicit and implicit). In experiments already performed with specific classes of generators and tests [L’Ecuyer and =-=Hellekalek 1998-=-; L’Ecuyer et al. 2000; L’Ecuyer and Simard 2001], the results were often surprisingly regular, in the sense that a regression model of the form log n0 = a log ρ + δ, where a is a constant and δ a sma... |

10 | Tests based on sum-functions of spacings for uniform random numbers - L’Ecuyer - 1997 |

9 | Random number generation for the new century - Deng, Lin |

8 |
Aspects of Local Linear Complexity
- Carter
- 1989
(Show Context)
Citation Context ...e evolution of Lℓ. The jump complexity test counts the number J of jumps in the linear complexity. Under HB 0 and for large n, J is approximately normally distributed with mean and variance given by [=-=Carter 1989-=-; Niederreiter 1991; Wang 1997]. The jump size test counts how many jumps of each size there are and compares these frequencies to the theoretical distribution (a geometric with parameter 1/2) by a ch... |

7 | On the theorems of Kolmogorov-Smirnov - Darling - 1960 |

6 |
Pseudorandom number generator for massively parallel molecular-dynamics simulations
- Holian, Percus, et al.
- 1994
(Show Context)
Citation Context ...the tests. Other nonlinear generators. SNWeyl is a shuffled version of a nested Weyl generator defined by νj = m(j(jα mod 1) mod 1)+1/2, uj = νj(νjα mod 1) mod 1, where m = 1234567 and α = √ 2 mod 1 [=-=Holian et al. 1994-=-; Liang and Whitlock 2001]. Without the shuffling, the generator is much worse. These RNGs have been used in statistical physics. They are not portable, since their output depends on the processor and... |

4 |
Random Number Generation
- Brown
(Show Context)
Citation Context .../2 22 ⌋ + ⌊x2i+1/2 21 ⌋)/2 53 . This is an improvement over drand48, but still not acceptable. LCG(2 48 , 5 19 , 0) has been the traditional MCNP generator used at the Los Alamos National Laboratory [=-=Brown and Nagaya 2002-=-]. LCG(2 48 , 33952834046453, 0) is one of the LCGs with “optimal multipliers” found by Fishman [1990]; it is used in LAPACK. LCG(2 48 , 44485709377909, 0) was used on CRAY systems and is provided as ... |

3 |
Random number generation is too important to be left to chance
- COVEYOU
- 1969
(Show Context)
Citation Context ... worse. These RNGs have been used in statistical physics. They are not portable, since their output depends on the processor and the compiler, and they also fail the tests. Coveyou-32 and Coveyou-64 [=-=Coveyou 1969-=-] are quadratic generators with recurrence xj+1 = xj(xj + 1) mod 2 ℓ , with ℓ = 32 and 64 respectively. They both fail, although the larger one is better behaved. The multiplicative lagged Fibonacci g... |

3 |
The limit distribution of the length of the longest head run
- FÖLDES
- 1979
(Show Context)
Citation Context ...nder H B 0 , with a chi-square test. Bit sequences that follow linear recurrences fail this test for large enough m, because of the linear dependencies. Longest run of 1’s. The longest head run test [=-=Földes 1979-=-; Gordon et al. 1986] is a variant of the run test that looks at the length Y of the longest substring of successive 1’s in a string of length m. This is repeated n times and the empirical distributio... |

3 |
Coupon collector’s test for random digits
- Greenwood
- 1955
(Show Context)
Citation Context ...m length The tests in this category produce each subsequence by generating numbers uj until some event happens, and the required number of uj’s is random. For example, in the coupon collector’s test [=-=Greenwood 1955-=-; Knuth 1998], we partition the interval (0, 1) in d pieces of equal sizes and count how many random numbers uj must ACM Transactions on Mathematical Software, Vol. V, No. N, Month 20YY.16 · Pierre L... |