Image: Alexbuirds, public domainSeven shuffles, how many riffles make a deck random
A deck of 52 cards shuffled once is nowhere near random, and almost everyone who plays cards knows it. What is less known is that the same is true after four shuffles, still largely true after five, and suddenly false after seven. The result comes from a 1992 paper by Dave Bayer and Persi Diaconis, and the numbers in it are the reason casinos and bridge clubs now shuffle seven times or use a machine.
What a riffle shuffle does
In a riffle shuffle you cut the deck into two packets, roughly but not exactly in half, and let the cards fall from your thumbs so that the packets interleave. Few people interleave perfectly. The usual mathematical description, called the Gilbert-Shannon-Reeds model after the three people who proposed it in the 1950s, says that the cut point follows a binomial distribution, so a 26 and 26 split is the most likely but 24 and 28 is common, and that the cards then drop in proportion to the size of the packet they come from. If the left hand holds 20 cards and the right 10, the next card comes from the left with probability two thirds.
Diaconis, who was a professional magician before he was a professor of statistics at Stanford University, checked this model against people shuffling, and it holds well for ordinary players. Card sharps can do much better, and that is the point of what they do.
A single riffle leaves the deck with at most two rising sequences: if the cards were in order before, the cards from the left packet still appear in order among themselves, and so do the cards from the right. A second shuffle allows up to four rising sequences, a third eight, and so on. After \(k\) shuffles there are at most \(2^k\) rising sequences. A fully random deck of 52 cards has, typically, about 26. You need \(2^k\) to be comfortably above 26, which already suggests that five shuffles are too few and that something happens around six or seven.
Measuring the distance from random
To say how far a shuffled deck is from random you need a number. Bayer and Diaconis used the total variation distance. Take every possible arrangement of the deck, and there are \(52!\), about \(8 \times 10^{67}\) of them. A perfectly random shuffle gives each arrangement the same probability. A deck shuffled \(k\) times gives some arrangements more probability than that and others less. The total variation distance is the largest amount by which the probability of any event, under the shuffled deck, differs from its probability under the random one.
That definition has a practical meaning. If the distance is 0.3, there is some bet, some property of the deck such as "the ace of spades is in the top half", whose probability is off by 0.3 from what a random deck would give, and a player who knows which bet can exploit it. If the distance is 0.01, no bet can be more than one percentage point off. Here are the values for 52 cards.
| Shuffles | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
|---|---|---|---|---|---|---|---|---|---|---|
| Distance from random | 1.000 | 1.000 | 1.000 | 1.000 | 0.924 | 0.614 | 0.334 | 0.167 | 0.085 | 0.043 |
After four shuffles the distance is still 1.000 to three decimal places, which means there are arrangements a random deck could produce that four shuffles cannot produce at all. The distance then falls steeply: from 0.92 to 0.33 in two shuffles, and it roughly halves with every shuffle after that. Seven is where Bayer and Diaconis drew the line, and the newspapers reported "seven shuffles" when the paper appeared. The paper itself, Trailing the Dovetail Shuffle to its Lair, is free to read in the Annals of Applied Probability.
Why the drop is sudden
The curve in the table is not a gentle slope. It stays flat at its maximum, falls over about three shuffles, and then tails off. This shape, a flat start followed by an abrupt drop, is called a cutoff, and Diaconis has spent much of his career showing that it is the rule rather than the exception for processes that mix something up. The reason, in the case of cards, is the rising sequences. For the first few shuffles the deck simply cannot reach most arrangements, so the distance cannot move. Once \(2^k\) passes the number of rising sequences a random deck typically has, the constraint vanishes within a shuffle or two.
The general formula is that about \(\tfrac{3}{2} \log_2 n\) riffle shuffles are needed for a deck of \(n\) cards. For 52 cards that is \(1.5 \times 5.7 = 8.6\), a little above the seven that the exact calculation gives, and the formula says how the number grows: double the deck and you need about one and a half more shuffles, not twice as many. A six-deck shoe of 312 cards, as used in casino blackjack, needs about twelve.
What it means at the kitchen table
For a game of bridge or poker after one or two shuffles, the previous hand is still visible in the current one. Bridge players have known for a century that a deck gathered up trick by trick and shuffled twice produces hands with long suits more often than chance would. The clumps survive. Diaconis has estimated that a player who knows how a deck was shuffled four times and tracks a few cards can win a guessing game at a rate far above chance.
Perfect shuffles make things worse rather than better. A perfect riffle, in which the deck is split exactly 26 and 26 and the cards fall strictly alternately, is a fixed permutation, and eight of them in a row return a 52-card deck to exactly the order it started in. Magicians use this. Randomness comes from the imperfection, the uneven cut and the clumps of two or three cards that fall together.
Other shuffles have other numbers. The overhand shuffle, where you drop small packets from one hand into the other, needs about 10,000 repetitions to randomize 52 cards, which nobody does. Smooshing the cards face down on the table and mixing them with both hands, as casinos do for baccarat, works in about a minute, and Diaconis and colleagues have studied that too.
Why a statistician cares
Shuffling is a Markov chain: the next arrangement depends only on the current one and the shuffle, and the question of how many steps until the chain forgets where it started is the question of mixing time. The same question decides how long a Markov chain Monte Carlo simulation must run before its output can be trusted, which is what Unit 12 of the Statistics Masterclass needs when it fits a Bayesian model by simulation. The cards are the case where the answer can be worked out exactly, and that exact answer taught the field what to expect elsewhere.
The calculation also shows what probability can and cannot say. It cannot tell you the order of the deck after seven shuffles. It can tell you that no bet on that order is more than a third of a probability point away from what a random deck would give, and after ten shuffles no more than four hundredths. That is the kind of statement Unit 3 teaches you to make, and the research spotlight of that unit features Diaconis's other famous piece of coin-and-card physics, the slightly biased coin toss.


