in reply to Re^7: How to generate different random numbers?
in thread How to generate distinct random numbers?

Unless you enumerate all of the permutations of the set, I don't know how this could possibly work.
That's exactly what I'm doing; there is no need to limit yourself to individually selected numbers. If you treat each shuffled set as a random selection from the set of all possible shuffles, then you have a perfectly good random number, equivalent to a randomly selected integer from 1 to N!. If you do M shuffles, you can select random numbers from a set of size N! ^ M. It doesn't take a very large N and/or M to reach the cardinality needed from cryptographic applications.
  • Comment on Re^8: How to generate different random numbers?

Replies are listed 'Best First'.
Re^9: How to generate different random numbers?
by thor (Priest) on Sep 08, 2004 at 22:01 UTC
    This works in theory. I think that it would become pretty unwieldy in practice though. Given a permutation of a set (let's say {5 1 3 2 4}), which permutation is that of {1 2 3 4 5}? The fourteenth or the forty-second? Wouldn't you have to pre-compute and store all of the permutations for this to work?

    thor

    Feel the white light, the light within
    Be your own disciple, fan the sparks of will
    For all of us waiting, your kingdom will come

      Yes, in practice, it would be absurd. I never claimed that this would be a good way to generate random numbers. I was merely responding to the misguided belief that a random shuffle was somehow any less random than a random selection from a finite set. It is not, and the theoretical ability to generate random numbers from a shuffle is what proves the point. QED, etc etc.