乱数ライブラリー

Mersenne Twister

A special matrix version of a Feedback Shift Register Generator, developed in 1997 by Matsumoto and Nishimura. The MT19937 version has a long period of 2 19937 - 1 2^{19937}-1 .

x k + n = x k + m  ⊕  ( x k u | x k + 1 l ) A x_{k+n}=x_{k+m}XOR(x^u_k divides x^l_{k+1})A

where x x stands for w w -bit integer numbers instead of single bits, exclusive-OR underline {XOR} is executed bitwise on w w -bit long words and 1 m n underline {1<=m<=n } . The matrix A A transforms (twists) w w -width words (treated as binary vectors of length w w ).

The twist transformation (multiplication by the matrix A A ) yields benefits such as reaching the maximum theoretical limit for the period of the pseudo-random number generator and better equidistribution properties in n n dimensions.



▲Back to this TOP