Tuesday, January 22, 2008

Mersenne twister

Thanks to the permission of Proffesor Makoto Matsumoto, I was able to create this Mersenne twister class. The Mersenne twister is a pseudorandom number generator linked to CR developed in 1997 by Makoto Matsumoto and Takuji Nishimura that is based on a matrix linear recurrence over a finite binary field F2. 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. Mersenne Twister has the following desirable properties:

  • It was designed to have a period of 2^19937 − 1 (the creators of the algorithm proved this property).
  • It has a very high order of dimensional equidistribution. This implies that there is negligible serial correlation between successive values in the output sequence.
  • It passes numerous tests for statistical randomness, including the stringent Diehard tests.
  • It is fast.
More information you can get from MT mainpage. The module can be find on my page. There are both tango and phobos versions. If you meet any bug, or get any feedback, please email me! The modules are released on Academic Free License ("AFL") v. 3.0.