In this paper, a new algorithm named Mersenne Twister (MT) for generating uniform pseudorandom numbers is proposed. For a particular choice of parameters, the algorithm provides a super astronomical period of 2 19937 0 1 and 623-dimensional equidistribution up to 32 bits accuracy, while consuming a working area of only 624 words. This is a new variant of the previously proposed generators TGFSR, modied so as to admit a Mersenne-prime period. The characteristic polynomial has many terms. The distribution up to v bits accuracy for 1 v 32 is also shown to be good.Also, an algorithm to check the primitivity of the characteristic polynomial of MT with computational complexity O(p 2 ) is given, where p is the degree of the polynomial.We implemented this generator as a portable C-code. It passed several stringent statistical tests, including diehard. The speed is comparable to other modern generators.These merits are a consequence of the ecient algorithms unique to polynomial calculations over the two-element eld.
T he fastest long-period random number generators currently available are based on linear recurrences modulo 2. So far, software that provides multiple disjoint streams and substreams has not been available for these generators because of the lack of efficient jump-ahead facilities. In principle, it suffices to multiply the state (a k-bit vector) by an appropriate k Ă— k binary matrix to find the new state far ahead in the sequence. However, when k is large (e.g., for a generator such as the popular Mersenne twister, for which k = 19 937), this matrix-vector multiplication is slow, and a large amount of memory is required to store the k Ă— k matrix. In this paper, we provide a faster algorithm to jump ahead by a large number of steps in a linear recurrence modulo 2. The method uses much less than the k 2 bits of memory required by the matrix method. It is based on polynomial calculus modulo the characteristic polynomial of the recurrence, and uses a sliding window algorithm for the multiplication.
Abstract. We introduce a theoretical test, named weight discrepancy test, on pseudorandom number generators. This test measures the χ 2 -discrepancy between the distribution of the number of ones in some specified bits in the generated sequence and the binomial distribution, under the assumption that the initial value is randomly selected.This test can be performed for most generators based on a linear recursion over the two-element field 2, and predicts with high precision for which sample size the generator will be rejected by a classical statistical test called the weight distribution test.This test may be considered as a theoretical version of a one-dimensional random walk test. Differently from the empirical tests which can reject only very bad generators, this test assigns a ranking to generators. Thus it is useful to select good generators, similarly to the spectral tests and the k-distribution tests. This test rejects practically all generators linear over 2 that are known to fail in some physical tests although they pass k-distribution tests.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.