in reply to Re^3: Functional shuffle
in thread Functional shuffle
Furthermore, if we have a sequence of N elements and associate with each element a key -- a random number uniformly distributed within 0, M-1 (where N!>M>=N), we have the configurational space of size M^N (i.e., M^N ways to key the sequence). There are N! possible permutations of the sequence. Alas, for N>2 and M<N!, M^N is not evenly divisible by N!. Therefore, certain permutations are bound to be a bit more likely than the others.
I would further argue that even when M (the period of the psuedo-random number generator) is larger than N, M^N is still not divisible by N! in general. The Fisher-Yates shuffle applies decreasing probabilities as it moves down the deck; the sorting shuffle uses uniform ones. That is the key difference.
I believe the discussion under A bad shuffle is also applicable.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: Functional shuffle
by tlm (Prior) on Apr 02, 2005 at 17:38 UTC | |
by Anonymous Monk on Apr 04, 2005 at 09:26 UTC | |
Re^5: Functional shuffle
by tlm (Prior) on Apr 02, 2005 at 20:46 UTC | |
by tall_man (Parson) on Apr 03, 2005 at 04:09 UTC | |
by tlm (Prior) on Apr 03, 2005 at 04:59 UTC |