I don't see any unfairness.

Okay, try running this and see if it changes your mind.

#! perl -slw use strict; our $N ||= 1e6; my %stats; my @data = 'A' .. 'Z'; for my $n ( 1 .. $N ) { my @scratch = @data; foreach my $first ( @data ) { for my $j ( reverse $#scratch -2 .. $#scratch ) { my $r = rand( $j + 1 ); @scratch[ $j, $r ] = @scratch[ $r, $j ]; if( $scratch[ $j ] eq $first ) { my $r = rand $j; @scratch[ $j, $r ] = @scratch[ $r, $j ]; } } ++$stats{ $_ } for @scratch[ -3 .. -1 ]; } system 'cls'; printf "%8d\n", $n; printf "%s : %6d ( %+3d ) %s\n", $_, $stats{ $_ }, $stats{ $_ } - ( 3 * $n ), '#' x abs( $stats{ $_ } - ( 3 * $n ) ) for @data; }
Over time, the variance should tend to converge towards zero for all choices, but every time I run this, one or two of the choices show no signs of converging. Indeed, their variance just seems to grow. Not mathematical proof of unfairness--I can't work out how to apply a Chi Squared test to this kind of data--but sufficient to convince me that there is something hookey.

BTW, you'll need a wide terminal to see the effect at it's best. Mine is set to 1000 wide. Setting a small font also helps as the numbers grow.


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.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

In reply to Re^8: Array problem by BrowserUk
in thread Array problem by Anonymous Monk

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.