Next: , Up: random generators   [Index]


49.8.1 The Mersenne twister

The Mersenne twister is a pseudorandom number generator developed in 1997 by Makoto Matsumoto and Takuji Nishimura:

Matsumoto Makoto and Nishimura Takuji. “Mersenne twister: a 623–dimensionally equidistributed uniform pseudo–random number generator”. 1998. ACM Transactions on Modeling and Computer Simulation.

it provides for fast generation of very high–quality pseudorandom numbers, having been designed specifically to rectify many of the flaws found in older algorithms. Its name derives from the fact that period length is chosen to be a Mersenne prime15.

The following bindings are exported by the (vicare crypto randomisations mersenne) library.

Function: make-random-source/mersenne

Build and return a new randomness source using the Mersenne generator.

The state returned by random-source-state-ref is a Scheme vector of length 626, whose first value is the symbol random-source-state/mersenne. The other values are integers representable with 32 bits.

The random-source-seed! function for this generator, must be applied tot a numbers maker returning integers representable with 32 bits.

(vicare crypto randomisations mersenne) initialises the generator drawing 32 bits integer numbers from a specifically built MRG32k3a randomness source, which in turn is initialised with the default (vicare crypto randomisations) seeds. L’Ecuyer’s MRG32k3a generator


Footnotes

(15)

Wikipedia contributors, “Mersenne twister”, Wikipedia, The Free Encyclopedia, http://en.wikipedia.org/w/index.php?title=Mersenne_twister&oldid=299648661 (accessed July 1, 2009).