No such thing as a small change | |
PerlMonks |
Re: Re: Fisher-Yates theoryby gjb (Vicar) |
on Jul 24, 2003 at 08:06 UTC ( [id://277469]=note: print w/replies, xml ) | Need Help?? |
IMHO the definition of a "good" shuffle algorithm is that starting from a sequence, each of its permutations has the same probability to be the outcome of the shuffle on that starting sequence. Many "home grown" algorithms violate this criterion and hence are to be considered, well, bad shuffle algorithms. Fisher & Yates satisfies this criterion however (the proof is left as "homework" to the original poster). You can have a look at Algorithm::Numerical::Shuffle for references as well as a short discussion. Just my 2 cents, -gjb-
In Section
Meditations
|
|