
On Thu, Mar 26, 2009 at 11:19 PM, Jan Kanis <jan.kanis@phil.uu.nl> wrote:
Just out of curiosity, would doing
l = range(2082) random.shuffle(l) random.shuffle(l)
give me (with a high probability) one of those permutations that is unreachable with a single shuffle? If so, I'd presume you could get any shuffle (in case you really cared) by calling random.shuffle repeatedly and reseeding the prng in between.
I'm a bit rusty on the math, but that doesn't have to be the case. If all the permutations produced by random.shuffle() form a subgroup, or lie in a subgroup, then what you'll get is just another permutation from that subgroup, regardless of the randomness you put inside. -- Imri Goldberg -------------------------------------- www.algorithm.co.il/blogs/ -------------------------------------- -- insert signature here ----