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.


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.

The start of some sanity?


In reply to Re^6: How likely is rand() to repeat? by BrowserUk
in thread How likely is rand() to repeat? by desertrat

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.