Help for this page
my %bias = (1 => 1, 2 => 1);
$rand = $k if rand($sum += $v) <= $v;
# This simplifies to:
# $rand = 1 if rand(1) <= 1
# this is always true. That's wrong.
my $sum = 0;
$sum += $_ foreach (values %bias);
call it version 1.0
destroy all evidence that I tried
pay someone else to do it for me
have some cake
try two more times so my failure is statistically significant
Results (156 votes). Check out past polls.