in reply to Re^5: How likely is rand() to repeat?
in thread How likely is rand() to repeat?
Given just four different values for the seed, how can you pick from 24,
I didn't say it could generate all those sequences. Only that from any given starting point, the non-repeating sequence could be any permutation of those 24 permutations.
Sure. But how many different such sequences can it make?
That's the wrong question. When generating the OPs 25-char sequences, you don't re-seed before starting each new sequence. You seed (implicitely) once and then follow that sequence until you have enough.
Therefore the upper bound is the length of the non-repeating sequence (the period) the prng can generate. (4.31e+6001 in the Mersenne Twister).
Of course, that is further constrained because of the modulo operation to bring the generated random values into the 0 .. 61 range. hence 6.45e44.
For the 15-bit RCPRNG built-in to perl on win32, the period (at least when seeded(1), seems (by experiment) to be 214741815.
Which looks suspiciously close to 2^31, but not quite.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^7: How likely is rand() to repeat?
by JavaFan (Canon) on Mar 09, 2012 at 10:37 UTC | |
by BrowserUk (Patriarch) on Mar 09, 2012 at 11:50 UTC | |
by JavaFan (Canon) on Mar 09, 2012 at 14:02 UTC | |
by BrowserUk (Patriarch) on Mar 09, 2012 at 16:46 UTC | |
by JavaFan (Canon) on Mar 09, 2012 at 17:37 UTC | |
|