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

Updated! Does my question make more sense now?

  • Comment on Re^2: Upper limit to Mersenne Twister Algorithm?

Replies are listed 'Best First'.
Re^3: Upper limit to Mersenne Twister Algorithm?
by JavaFan (Canon) on Aug 30, 2010 at 17:14 UTC
    Not at all. In fact, it even makes less sense. What do you mean by "breaks down in its ability to be random"? Note that for every PRNG, given the algorithm, seed and sequence number, the rest of the sequence is 100% predictable.

      Well, I'm referring to where, after enough iterations, the function begins to repeat itself. My understanding is that the regular rand() function, on certain systems, has a ceiling on the number of random numbers it produces. Such that if you run enough simulations, you will begin getting the same numbers as before. Therefore, I guess my main question was whether this ceiling was relatively high for the TM 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.