in reply to Random Math Question
If you have a set of N things, then there are N! possible permutations, or shufflings, of that set. A shuffle algorithm is fair (and random) if every possible permutation can be a result of the algorithm, and with an equal chance. For instance, if you have the set "A, B, C", the algorithm should return "A, B, C" 1 out of 6 times, "A, C, B" 1 out of 6 times, "B, A, C" 1 out of 6 times, etc.
But the only difference between different runs of the program is the "state" of you random number generator, for whatever "state" is meaningful (seed for a typical PRNG, bitsequence to be read from /dev/u?random). Your sequence of random numbers must be able to distinguish between at least N! - in this case 100,000!. For a PRNG that's available in Perl or many OSses, where the sequence returned depends only on the seed, it means the seed must be large enough to have at least 100,000! different states.
As others have calculated, that requires more than a million bits. And this is only a lower bound, your algorithm must be good enough as well.
Alternatively, you must read more than a million bits from some device that generates random bits. /dev/random on Linux for instance, or a camera in front of a lava lamp. Brownian motion and radioactive decay are other good sources to generate random bits with, although I do not know of any implementations.
|
---|