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.
| [reply] [d/l] |
I ran it on your solution and got similar results to those obtained by JavaFan's solution.. Maybe the test or the interpretation of the test is wrong. Looking at absolute numbers seems wrong.
| [reply] [d/l] |
| [reply] [d/l] [select] |
| [reply] |