# choosing a uniform random permutation of cards

The following problem was presented:

We want to start a game with a uniform random permutation of a deck of cards.

Each permutation should appear with probability $1/52!$.

If we want to do it efficiently, it is clear that we can't just choose a random number in range $[1,52!]$ and take the appropriate permutation.

They offered to design a Markov Chain that will simulate some technique of mixing cards.

For example: riffle shuffle or moving card to the top of the deck.

Then because the special Markov chain is irreducible, a-periodic and double stochastic, the stationary distribution will be the uniform one.

My question is why can't we just randomly pick the first card in the permutation (out of 52), then pick the second card (out of 51) and so on. Will it not be a uniformly picked permutation?

• Google random permutation algorithm. And see stackoverflow.com/questions/7902391/… Jun 25, 2017 at 16:53
• What you propose in your last paragraph will give you a uniformly distributed random permutation. Since I have R on this machine, I'd do this: a <- rank(runif(52)) $\qquad$ Jun 25, 2017 at 17:14