However, simple generators (unlike the Mersenne Twister) are really deterministic, so if you observe the same number a second time,
A generator of the integers 0 .. 2, can generate those 3 values in 6 different sequences:
a: 0 1 2 b: 0 2 1 c: 1 0 2 d: 1 2 0 e: 2 0 1 f: 2 1 0
And those 6 (sub)sequences can be output in 720 permutations before repetition is required:
a b c d e f a b c d f e a b c e d f a b c e f d a b c f d e a b c f e d a b d c e f a b d c f e ... f e c d b a f e d a b c f e d a c b f e d b a c f e d b c a f e d c a b f e d c b a
That's not strictly true, because it is likely that some 18-digit overlaps between two subsequences will replicate an earlier subsequence.
But then, the last 2 digits of subsequence a, and the first digit of subsequence b; form an out-of-sync repetition of subsequence d. and given that MT can only produce 2**32 values; similar, out-of-sync subsequence repetitions have to have occurred many times to arrive at the 2**19937-1 periodicity.
So, repetition of a single value, or even a single subsequence is not an indicator that periodicity has been reached.
In reply to Re^2: Challenge: Detecting sequences.
by BrowserUk
in thread Challenge: Detecting sequences.
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |