in reply to Re^6: How to generate different random numbers?
in thread How to generate distinct random numbers?
Therefore, a random shuffle (or multiple random shuffles, depending on the desired cardinality) can be transformed algorithmically into a random numberUnless you enumerate all of the permutations of the set, I don't know how this could possibly work. Even if you are, you're reducing the size of your output number drastically.
There are n! ways to permute a set of n items. There are n**n ways to choose n items from a set of n with replacement. The limit as n tends to zero of n!/n**n is zero. What this means is that compared with the cardinality of just choosing n random numbers from 1 to n, generating a random number with from a random shuffle gets progressively worse for larger n. This would imply (well, to me anyways) that if you're looking for a random number, better to do it directly than to first shuffle and then transform that shuffle into one.
A random number need not necessarily be chosen from an infinite setPoint conceded. I mis-spoke.
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: How to generate different random numbers?
by Pragma (Scribe) on Sep 08, 2004 at 18:16 UTC | |
by thor (Priest) on Sep 08, 2004 at 22:01 UTC | |
by Pragma (Scribe) on Sep 08, 2004 at 22:14 UTC |