in reply to A reproducible shuffle? ("stable shuffle")

AK108,
Admittedly, I haven't read most of this thread. It sounds like what you want is shuffle() that takes 1 or 2 arguments. With one argument (the list), it will return a random permutation of a list along with an ID. If called with two arguments (the list and an ID), it will return the exact same permutation every time.

If this sounds like what you want, there may be a way to create a rank()/unrank() routine for permutations. I have done it for combinations before. If nothing else, you could create a permutations iterator where the ID is the number of iterations to generate the desired shuffle. You could then just have the iterator loop ID times.

Cheers - L~R

  • Comment on Re: A reproducible shuffle? ("stable shuffle")

Replies are listed 'Best First'.
Re^2: A reproducible shuffle? ("stable shuffle")
by AK108 (Friar) on Feb 04, 2008 at 19:17 UTC
    Yes, that is what I have in mind. I'll take a while to digest the code and see if it will work.