Computing Atlas

How Computing Was Built
Sign In
Text size
100%
Theme
Algorithm

Mersenne Twister Algorithm

Numerical Algorithm

The Mersenne Twister is a general purpose pseudorandom number generator built to produce long, statistically well-behaved sequences of numbers for simulation and modeling work. Makoto Matsumoto and Takuji Nishimura developed it in 1997 specifically to overcome weaknesses in earlier random number generators of the time. It works by combining a twisted generalized feedback shift register, a linear recurrence computed over bit vectors, with a later tempering step that improves the statistical quality of the raw output. Its name comes from the choice of a Mersenne prime to set its period length; the most widely used version, MT19937, repeats only after two to the power of 19,937 minus one values, an enormously long cycle that has made the algorithm the default random number generator in many programming languages, though it is not suitable for cryptographic use because its output can be predicted once enough of the sequence has been observed.

Comments (0)
No comments yet. Be the first to share a thought.
Reader Challenges (0)
No disputes yet. Spotted an error or a better source? Open the first one.