in reply to Re^4: Upper limit to Mersenne Twister Algorithm?
in thread Upper limit to Mersenne Twister Algorithm?

A 32-bit PRNG will inevitably repeat after at most 2**32 numbers. It will usually repeat some numbers much earlier than that. And if you are using fewer bits (eg. rand( 100 ) it will repeat even earlier still. This is both inevitable and desirable. If it didn't repeat occasionally, it wouldn't be random!

The significant statistic is the number of rands you can obtain before the sequence starts to repeat. This is called the period. For the MT, the period is 219937 - 1. Which means you could draw a new rand every nanosecond for the next 106000 years, and still not see the sequence repeat.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
RIP an inspiration; A true Folk's Guy

Replies are listed 'Best First'.
Re^6: Upper limit to Mersenne Twister Algorithm?
by tritan (Sexton) on Aug 30, 2010 at 21:37 UTC

    Ahh, okay. Thank you! That was both very concise and informative : )