Mersenne Twister
Mersenne Twister
Main page

Mersenne Twister

logo
Community Hub0 subscribers

Mersenne Twister

logo
Community Hub0 subscribers
What are your thoughts?
Be the first to start a discussion here.
Be the first to start a discussion here.
Mersenne Twister

The Mersenne Twister is a general-purpose pseudorandom number generator (PRNG) developed in 1997 by Makoto Matsumoto (松本 眞) and Takuji Nishimura (西村 拓士). Its name derives from the choice of a Mersenne prime as its period length.

The Mersenne Twister was created specifically to address most of the flaws found in earlier PRNGs.

The most commonly used version of the Mersenne Twister algorithm is based on the Mersenne prime . The standard implementation of that, MT19937, uses a 32-bit word length. There is another implementation (with five variants) that uses a 64-bit word length, MT19937-64; it generates a different sequence.

A pseudorandom sequence of -bit integers of period is said to be -distributed to -bit accuracy if the following holds:

For a w-bit word length, the Mersenne Twister generates integers in the range .

The Mersenne Twister algorithm is based on a matrix linear recurrence over the finite field . The algorithm is a twisted generalised feedback shift register (twisted GFSR, or TGFSR) of rational normal form (TGFSR(R)), with state bit reflection and tempering. The basic idea is to define a series through a simple recurrence relation, and then output numbers of the form , where is an invertible -matrix called a tempering matrix.

The general algorithm is characterized by the following quantities:

with the restriction that is a Mersenne prime. This choice simplifies the primitivity test and k-distribution test needed in the parameter search.

See all
User Avatar
No comments yet.