Quant Memo
Foundational

How Many Riffle Shuffles Randomise a Deck

The surprising result that a 52-card deck needs about seven riffle shuffles to become close to truly random — and the rising-sequence intuition behind why the number is neither one nor a hundred.

Question you'll actually be asked: "How many times do you need to riffle-shuffle a deck of cards before it's well mixed?" Most people guess based on intuition — "a couple should do it," or "you can never really randomize a deck by hand." The real answer, made famous by Bayer and Diaconis's analysis, is a specific and surprising number: about seven riffle shuffles for a standard 52-card deck. The interesting part isn't memorizing "seven" — it's understanding why the mixing happens abruptly rather than gradually, which is the actual insight being tested.

What a riffle shuffle actually does

A riffle shuffle splits the deck into two packets and interleaves them card by card. Mathematically, the number of "rising sequences" — maximal runs of cards that are still in their original relative order — roughly doubles with each shuffle: one shuffle from a sorted deck produces at most 2 rising sequences, two shuffles at most 4, and after kk shuffles, at most 2k2^k rising sequences. A deck is only "well shuffled" once it has enough rising sequences that no meaningful structure survives, and since 2k2^k needs to approach the deck size of 52 for the structure to disappear, klog2(52)5.7k \approx \log_2(52) \approx 5.7 — which is why the answer lands around 6–7, not 2 and not 20.

The "cutoff phenomenon": why it's not gradual

The striking mathematical result isn't just the number 7 — it's that randomness arrives suddenly rather than gradually. After 4 shuffles, the deck is still measurably far from random (an expert can detect leftover order, for instance via poker hands still showing statistically unusual patterns). After 7 shuffles, the deck is close enough to uniformly random that no practical test can distinguish it from a perfect shuffle. This sharp transition — barely random, then suddenly random, in the span of just 2–3 more shuffles — is called a cutoff phenomenon, and it shows up in many mixing processes beyond cards (this is why "how many shuffles" has a crisp answer instead of a vague "it depends").

Worked example: rising sequences by hand on a small deck

Take a tiny 4-card deck in order 1,2,3,41,2,3,4. One riffle shuffle might split it into (1,2)(1,2) and (3,4)(3,4) and interleave to get 1,3,2,41,3,2,4. Count rising sequences (maximal runs still increasing relative to original order): 1,21,2 is one run and 3,43,4 is another — 2 rising sequences, matching the "at most 21=22^1=2" bound. Shuffle again, splitting 1,3,2,41,3,2,4 into (1,3)(1,3) and (2,4)(2,4), interleaving to 1,2,3,41,2,3,4 or 2,1,4,32,1,4,3 or similar: rising sequences can now go up to 4. For a 4-card deck, log2(4)=2\log_2(4) = 2, and indeed 2 riffle shuffles are enough to essentially randomize a 4-card deck — matching the pattern that scales up to "7 for 52 cards."

shuffle number shuffle 7: effectively random 52 rising sequences
Rising sequences roughly double with each shuffle — barely any structure is removed for the first 3-4 shuffles, then the count rushes toward 52 and the deck crosses into practical randomness around shuffle 7: the cutoff phenomenon.

A riffle shuffle roughly doubles the number of rising sequences each time, so mixing a deck of nn cards takes about log2(n)\log_2(n) shuffles — for n=52n=52, that's about log2(52)5.7\log_2(52) \approx 5.7, rounding to the well-known result of 7 shuffles for practical randomness. Mixing arrives as a sharp cutoff, not a gradual fade, meaning 4 shuffles leave detectable structure while 7 essentially don't.

If asked "how many shuffles for a deck of nn cards" for some nn other than 52, the fast mental-math move is log2(n)\log_2(n), rounded up — for a 32-card deck (as used in some card games), that's log2(32)=5\log_2(32) = 5 shuffles, not 7.

The common wrong answer is "one shuffle randomizes it" (confusing "looks shuffled to the eye" with "is statistically random") or "you can never fully randomize by hand" (confusing "takes many shuffles" with "impossible"). Both miss the actual finding: a specific, finite, and fairly small number of shuffles suffices, and it's derivable from log2(n)\log_2(n) rather than being either 1 or infinity.

Related concepts

Practice in interviews

Further reading

  • Bayer & Diaconis, Trailing the Dovetail Shuffle to its Lair (1992)
ShareTwitterLinkedIn