TODO: try with a different random number generator (i.e. more reliably uniform)

Unless the size of the array is approaching the period length of the PRNG, then the quality of the PRNG has little or no effect upon the quality of the shuffling.

Neither the quality of any given shuffle; nor the quality of successive shuffles; nor the quality of any group of shuffles.

I'm not going to try and explain that beyond saying it is the nature of modular arithmetic; but by way of evidence I offer this. The standard PRNG used in perl 5.10 on windows is the notorious MSC rand that has only 15-bits: 0-32767.

However, if you use F-Y to shuffle any size array with less that 32767 elements; no matter a how many times you do it (within the bounds of reasonable values: say a human lifetime) then you will not detect any bias using simple std deviations or other simple correlation tools.

Eg. Run this code with any $L < 32767, and any $N, and try to find some bias using your test and you will fail:

#! perl -slw use strict; use Data::Dump qw[ pp ]; our $N //= 1e6; our $L //= 50; my %counts; ++$counts{ int( rand $L ) } for 1 .. $N; pp \%counts;
C:\test>junk77 -L=5 -N=1e7 { "0" => 1999935, 1 => 2000440, 2 => 1999682, 3 => 2001882, 4 => 19980 +61 } C:\test>junk77 -L=5 -N=1e7 { "0" => 1999465, 1 => 2000290, 2 => 1999884, 3 => 1999629, 4 => 20007 +32 } C:\test>junk77 -L=5 -N=1e7 { "0" => 1999025, 1 => 1999024, 2 => 2000250, 3 => 1999085, 4 => 20026 +16 } C:\test>junk77 -L=5 -N=1e7 { "0" => 1999941, 1 => 2001174, 2 => 1998446, 3 => 1999105, 4 => 20013 +34 } C:\test>junk77 -L=5 -N=1e7 { "0" => 1998594, 1 => 1999564, 2 => 2002043, 3 => 2000208, 4 => 19995 +91 } C:\test>junk77 -L=5 -N=1e8 { "0" => 19998201, 1 => 20012390, 2 => 19994928, 3 => 19998284, 4 => 1 +9996197 } C:\test>junk77 -L=50 -N=1e7 { "0" => 199673, 1 => 200117, 2 => 199619, 3 => 200785, 4 => 199947, 5 => 201072, 6 => 200075, 7 => 200212, 8 => 200173, 9 => 200781, 10 => 199524, 11 => 200163, 12 => 199981, 13 => 200973, 14 => 200483, 15 => 199633, 16 => 199506, 17 => 200081, 18 => 199572, 19 => 200733, 20 => 198890, 21 => 200602, 22 => 199665, 23 => 199819, 24 => 199935, 25 => 199939, 26 => 199868, 27 => 199960, 28 => 199116, 29 => 199926, 30 => 200444, 31 => 200205, 32 => 199426, 33 => 199787, 34 => 199578, 35 => 199312, 36 => 200249, 37 => 199743, 38 => 201357, 39 => 200411, 40 => 200164, 41 => 200179, 42 => 199436, 43 => 199302, 44 => 200279, 45 => 199640, 46 => 199267, 47 => 199733, 48 => 199664, 49 => 201001, }

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". The enemy of (IT) success is complexity.
In the absence of evidence, opinion is indistinguishable from prejudice. Suck that fhit

In reply to Re^2: Shuffling CODONS by BrowserUk
in thread Shuffling CODONS by WouterVG

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.