MersenneTwister
Last edit January 26, 2007
A good general purpose
PseudoRandomNumberGenerator
.
This is the basic PRNG for
PythonLanguage
and
RubyLanguage
, and it or one like it (i.e. fast and with a large period) should be adopted by every language under the sun.
It is annoying that
PythonLanguage
and many other implementations, including
PerlLanguage
, only allow one
LongInteger
as a seed, even though there are 624 unsigned longs (2496 bits) holding the state of the generator, and the
CeeLanguage
reference implementation does allow a full seed.
But in Python the
LongInteger
can be arbitrarily long... So where's the problem (for Python)?
See
http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html
.
See
IndirectionShiftAccumulateAddCount
for a fast big PRNG that's cryptographically strong.