Re: Random number generators




mensanator@xxxxxxxxxxx wrote:
Robert Israel wrote:
In article <eeqftg$kl$1@xxxxxxxxxxxxxxxxxxxxxxxxxx>,
rancid moth <rancidmoth@xxxxxxxxx> wrote:

Im not very familiar with RNG's or the mathematics behind them, but I have a
mate who uses a built in RNG implemented within a database environment. He
has tested it and from a set of 2 million numbers he performed 2 million
generations. the set he ended up with had about 32 thousand numbers. It
strikes me as rather small given the size of the sample and the number of
test. However I have no prior experience or much knowledge about it, and to
make things worse we can not find out _how_ or what algorithm this RNG uses.

My aim of this post is to obtain feedback by those more knowledgeable about
such things as to whether or not the above stats seem reasonable for a
_good_ RNG or more standard for a bad one.

I guess there is some possibility that the RNG stores more than 15 bits
internally and just reports 15 bits, but I suspect it's more likely that
this is just a 15-bit PRNG. Not only will it only give you 32768
different results, after producing those it will repeat the same ones
in the same order: it has a period of just 32768.

But doesn't the Mersenne Twister have a period greater
than it's bit size? Can't the same 32768 values be given
in more than one order?

Of course (e.g. feed the output from the Mersenne Twister
into a 15 bit variable) but what do you think is meant by
"I guess there is some possibility that the RNG stores more than 15
bits
internally and just reports 15 bits". The 15 bits refers to the
number
of bits of state, not the number of bits of output.

-William Hughes
For almost any
application where you'll ask for a random number more than that many
times, this is really really bad news.

Robert Israel israel@xxxxxxxxxxx
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia Vancouver, BC, Canada

.



Relevant Pages

  • Re: Random number generators
    ... make things worse we can not find out _how_ or what algorithm this RNG uses. ... The original Mersenne twister regularly reports 32 bit numbers, ... are those of the Statistics Department or of Purdue University. ... Herman Rubin, Department of Statistics, Purdue University ...
    (sci.math)
  • Re: Random numbers (was Re: array to generate words)
    ... a non-core RNG implementation. ... Note thought that while Mersenne Twister produces a nice sequence of random numbers for simulations, it is not cryptographically secure; that is, an attacker can easilyrecognize an MT-generated sequence, and predict the next elements. ... Although it's very unlikely, if an attacker could observe all of the random output of the RNG for a long enough sequence, they could relatively easily reverse engineer the seed and predict all future output of the RNG, thus losing our clients lots of money. ...
    (comp.lang.java.programmer)
  • Re: This time I have decided to Ascend
    ... Jakob Creutzig writes: ... an excellent RNG (the Mersenne twister is supposed to ... > it has a long cycle time; ...
    (rec.games.roguelike.nethack)
  • Re: looking for a good implementation of random number generator?
    ... looking for good quality libraries. ... continuous uniform RNG. ... consider the Mersenne Twister. ... There is a "new and improved" version of it available now, called SFMT. ...
    (comp.programming)
  • Re: This time I have decided to Ascend
    ... > produce random strings that won't repeat in our lifetimes) ... > would settle all doubt. ... The Mersenne twister is not a good RNG simply because ...
    (rec.games.roguelike.nethack)