4 ms·
It's "obvious" (in a somewhat unreasonable sense of that word) that this can't give a truly random permutation of the elements of the array. Since the only rand
by gjm11 17y ago
It's "obvious" (in a somewhat unreasonable sense of that word) that this can't give a truly random permutation of the elements of the array. Since the only randomness comes from coin-flips, the probability of any particular outcome must be a rational number whose denominator is a power of 2. But there are n! permutations of n objects, and for n > 2 this isn't a power of 2, so they can't all be being selected with equal probability.
- andrewcooke 17y agoi've been thinking about this.... take three coins, arrange them from left to right. i will show how to select one of the three coins with probability 1/3. toss all three. repeat until only one shows heads. select that coin. so i think you are wrong :o)