How many shuffles does a deck need
Seven riffle shuffles (split the deck in two, let the packets fall interleaved) leave a 52-card deck 0.334 away from uniform in total variation. Put that deck beside one a computer arranged at random: even the shrewdest check anyone can run identifies the shuffled one only 66.7 percent of the time, against 50 percent for a guess. Measured by information, 3.52 percent survives five shuffles; for colours alone the separation distance is 0.317 by the sixth; the full order is still 0.278 away after twelve. The exact table here was recomputed in exact integer arithmetic and agrees with the 1992 original.
In March 2023 Diaconis gave the Chen-Jung Hsu Lectures at National Taiwan University's Astronomy-Mathematics Building, three days on the mathematics of shuffling. My stochastic calculus lecturer, Chii-Ruey Hwang, cancelled a week of class and told us all to go; he was also one of the two interviewers two days before the lectures. The room was AstroMath 202, my favourite room on campus.
A new deck comes out of its box with each suit running from ace to king. You start shuffling. After how many shuffles can you deal?
Seven. The answer comes from a 1992 paper in the Annals of Applied Probability, where Dave Bayer and Persi Diaconis give a closed formula for the chance of any arrangement after shuffles and prove that shuffles suffice to mix cards. The number holds only when three things are true at once: the deck has 52 cards, the shuffle is a riffle (split the deck in two and let the packets fall interleaved, the way cards are usually shuffled), and the measure of how far the deck still sits from random is total variation distance. Change the deck or change the distance and a different number comes out.
Diaconis was born in New York in 1945, left home at fourteen to tour with the card magician Dai Vernon, took a mathematics degree from City College of New York in January 1971, and finished a Harvard doctorate under Frederick Mosteller in 1974; Martin Gardner's letter to Harvard described him as one of the best card mechanics in the country. The question he wanted answered came from the table: how much of the original order survives a shuffle.
What one shuffle leaves of the original order
The model proposed by Gilbert and Shannon, and independently by Reeds, writes a shuffle in two steps: cut the deck in two according to a binomial distribution, then interleave, dropping the next card from the left packet with probability when and cards remain in the two packets. The paper reports that experiments show this to be a good description of how people actually shuffle. Every number below is computed under that model.
One shuffle divides the original order in two: the cards from the left packet still ascend among themselves, and so do those from the right. Such a maximal ascending run is a rising sequence, a second shuffle splits each run into at most two, and after shuffles the deck holds at most of them.
1/7·Start
Levin and Peres give a third equivalent description: label each card with a fair coin flip and pull all the cards labelled 0 to the top, keeping their relative order, which is exactly the inverse of one riffle shuffle. Do that times and every card carries a -bit label, with the deck sorted lexicographically by label. There are only labels, so the deck falls into at most groups, which read forwards are the at most rising sequences. Waiting until every card holds a distinct label is the birthday problem, and the book uses it to prove the bound . That bound is looser than the exact Bayer-Diaconis result and needs nothing beyond the birthday calculation.
8 rising sequences
the ceiling after 3 shuffles is 8
a uniformly random deck averages 26.5 (sd 2.10)
A uniformly random deck averages 26.5 runs with a standard deviation of 2.10, and the chance of 16 or fewer is . A deck shuffled four times holds at most 16, so counting runs catches it, and the count is wrong about once in two million tries.
How to measure the distance from random
Counting runs is only one test among many. Take every test at once, including the ones nobody has thought of, and what comes out is the total variation distance: find the event whose probability differs most between the two distributions, and the size of that gap is
where is the distribution after shuffles and is uniform over the 52! arrangements. Aldous and Diaconis used it to ask how far a deck sits from uniform after shuffles, and warned that the distance is unforgiving of small deviations. Their example is a glimpse of the bottom card: the other 51 are genuinely random, and the distance is nonetheless .
The same quantity can be written as a wager. Two decks lie on the table, one shuffled times and one put in a genuinely random order by a computer, and you have to say which is which. Any method is allowed: count the rising sequences, turn over the top card and see whether the ace of spades is still there, look at the pattern of reds and blacks, spread all 52 out and compare at leisure. Blind guessing succeeds half the time, and the best method available succeeds with probability . That expression comes straight from the definition: take to be the event whose probability differs most, and call the deck shuffled whenever the outcome lands in .
Five shuffles give 96.2 percent, six give 80.7, seven give 66.7, eight 58.4, ten 52.1. The first four are all 100 percent, because counting runs already wins: four shuffles leave at most 16 runs, and a random deck produces 16 or fewer about once in two million.
Defined this way the distance covers tests nobody has invented yet. It takes a maximum rather than an average: in the bottom-card example almost every other event has barely moved, and the distance is near 1 all the same.
The exact numbers for 52 cards: 1.000 down to 0.043
Theorem 1 gives the chance of arrangement after shuffles as , where counts the rising sequences of . The arrangement enters the formula only through , so a sum over 52! terms collapses to 52 and the distance can be computed exactly.
after 7: distance 0.3341, told apart 66.7% of the time
For 52 cards the first four shuffles all give 1.000, followed by 0.924, 0.614, 0.334, 0.167, 0.085 and 0.043. Here . A distance that holds at 1 and then drops within a short window has a name, the cutoff phenomenon, which Aldous and Diaconis identified in shuffling problems in 1986.
The numbers in the figure were recomputed here from the same formula in exact integer arithmetic: seven deck sizes, from 1 to 10, seventy values, all agreeing with Table 3 of the paper. Take the deck to 312 cards and the first seven shuffles are still 1.000, with 0.565 remaining at ten.
Said another way: cards guessed correctly
The paper calls total variation difficult to explain to nonspecialists, and offers a second measure: guess the cards one at a time, turning each over after the guess, and count how many come out right. Against a uniformly random deck the best strategy averages cards.
- k shuffles
- k shuffles then a cut
Five shuffles leave 6.56 correct, two cards above a properly mixed deck; six leave 5.51, about one card above; after that the excess roughly halves each time.
A casino equipment manufacturer once sent the three authors a ten-shelf shuffling machine to evaluate, and the engineers' own tests had all looked satisfactory. The authors showed that after a single pass a knowledgeable player could average 9.5 correct guesses, against 4.5 for a well-shuffled deck, and that figure convinced the company. Passing a fixed battery of tests establishes only that those statistics look ordinary.
Caring only about colours takes fewer shuffles
Seven answers a question about the full arrangement of the deck. A blackjack player does not care whether the seven of spades precedes the seven of hearts, and a player betting on colour never looks at suits.
Assaf, Diaconis and Soundararajan take up exactly this case: when only some features of the deck matter, the requirement drops from to . Their distance is separation, so the numbers cannot be set beside the earlier figure, while the five curves within this one compare directly: the full order is still 0.278 away after twelve shuffles, blackjack values reach 0.366 by the ninth, and colour alone is at 0.317 by the sixth.
Trefethen and Trefethen worked in information instead, finding that 3.52% of the information in a 52-card deck survives five shuffles and 0.92% survives six, along a curve that decays smoothly with no cutoff. They draw no recommendation from it. Their closing line is that which measure matters more to gamblers and card players is presumably game dependent.
Three questions to test yourself
Three questions, each built on a phrasing that circulates. Explanations follow the answers.
- 1
Which reading of “a 52-card deck needs seven shuffles” is the accurate one?
- 2
Why does a deck shuffled four times or fewer fail even to look random?
- 3
A casino supplier's engineers ran their own checks on a shuffling machine and saw nothing wrong; the three authors ruled it unusable. Where do the two standards differ?
Which statements hold, which are misreadings
The same result, in the phrasings that hold up and in the misreadings that keep coming back, each with the sentence that fixes it.
Said this way, it is right
Quoting the number together with its distance tells the reader what 0.334 means: no test can do better than a 33 percent edge.
Same deck, same distance, different question. "Random enough" is only meaningful once the use is named.
A conclusion reaches exactly as far as its model does. Whether hands match the model is an empirical question, separate from the theorem.
Said this way, it is wrong
The distance falls continuously from 1 towards 0 and never reaches it: 0.334 at seven, 0.043 at ten. Reading the steep part as a threshold turns a curve into a switch.
Write that mixing drops sharply between the fifth and eighth shuffle, and that the distance at seven is 0.334.
Seven belongs to 52 cards. The same formula gives five or six for 32 cards, eight or nine for 104, and eleven or more for 312, tracking (3/2) log2 n.
State the deck size first, then quote the number that goes with it.
Measured by information, 3.52 percent remains after five shuffles and 0.92 percent after six, with no cut-off at all. The paper closes by saying that which measure matters more to gamblers and card players is presumably game dependent. Change the distance and the answer changes.
Say "0.334 at seven under total variation; 3.52 percent of the information left at five and 0.92 percent at six", and keep the criterion inside the sentence.
Passing a fixed set of tests says only that those statistics look normal. The ten-shelf machine passed the engineers' own tests while letting a knowledgeable player guess 9.5 cards per run, against 4.5 for a well-shuffled deck.
Compute a distance, or a quantity that ranges over all tests such as the expected number of correct guesses under the best strategy.
What this piece does not claim
Every number above is computed under the Gilbert-Shannon-Reeds model. Whether real hands follow it is a separate question; the paper cites experiments reported by Diaconis in 1988, which this site has not examined. None of the tables applies to a deck with repeated cards, as when two decks are shuffled together or only part of one is dealt.
The guessing figures come from simulation, 100,000 runs per entry, under a strategy the paper describes as conjecturally optimal without proving it. In the separation table only the first row is exact; the rest come from an approximation, and the paper notes that the red-black row disagrees with the exact values 0.8898 and 0.8897 at one and two shuffles.
Nor is there advice here about how many times to shuffle. That question needs someone to say first what the deck is for, and whoever is using it decides that.