in reply to Re: random elements from array - new twist
in thread random elements from array - new twist
You have a bad shuffle. It does not give equal odds of all combinations coming up. It trivially cannot, if your array has n elements then all of your probabilities have to be multiples of 1/n**n which does not evenly divide n! - the number of possible permutations you are choosing between.
How to do it right is a FAQ.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: random elements from array - new twist
by BrowserUk (Patriarch) on Nov 05, 2002 at 18:23 UTC | |
by jsprat (Curate) on Nov 05, 2002 at 19:49 UTC | |
by BrowserUk (Patriarch) on Nov 05, 2002 at 20:06 UTC | |
by petral (Curate) on Nov 08, 2002 at 19:48 UTC | |
by Anonymous Monk on Nov 06, 2002 at 03:26 UTC | |
by BrowserUk (Patriarch) on Nov 06, 2002 at 03:34 UTC |
In Section
Seekers of Perl Wisdom