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.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
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.

In reply to Re^2: Challenge: Detecting sequences. by BrowserUk
in thread Challenge: Detecting sequences. by BrowserUk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.