How many shuffles? Seven — and the first four do almost nothing

Riffle a deck — split it in two and let the halves fall together — and you would think three or four times would do. It doesn’t. The mathematicians David Bayer and Persi Diaconis worked out exactly how close a 52-card deck gets to perfectly random after each riffle, and the answer is that it barely moves for four shuffles, then mixes fast. Seven riffles is the first point at which its distance from random falls below one half.

Riffles to mix a 52-card deck

7

How mixed the deck is after each riffle

The measure is “distance from random”: near 1 means someone who knows how the deck started can tell it apart from a shuffled one almost every time, 0 means nobody could.

RifflesDistance from random
11.000
21.000
31.000
41.000
50.924
60.614
70.334
80.167
90.085
100.043
110.022
120.011

Four riffles leave the deck at 1.000 — still essentially unmixed. The fifth brings it to 0.924, the sixth to 0.614, and the seventh is the first under one half, at 0.334. From there, every extra riffle cuts what is left roughly in half. One half is just a line to read the table by; the shape is the real answer — flat, then a sudden drop, then halving. That drop after a long flat stretch is what mathematicians call a cutoff.

Why the first four riffles are not enough

A riffle keeps each half in its own order and only weaves the halves together. Take A 2 3 4 5 6, cut it into A 2 3 and 4 5 6, and riffle: it might land as A 4 2 5 3 6. Read along it looking for A, then 2, then 3: they come in order, left to right. To find 4 you have to go back to the start. So the deck is two rising sequences, A 2 3 and 4 5 6, woven together. Each riffle can at most double the number of rising sequences, so after four there are at most 16.

A properly shuffled deck has 26.5 rising sequences on average. Four riffles cannot make that many, so a four-times-riffled deck still looks nothing like a shuffled one. Five riffles can make up to 32, which is exactly where the table starts to fall. Bayer and Diaconis open their paper with a card trick built on this, Jordan’s “Premo”: after three riffles a deck is usually eight rising sequences, so a card a spectator moves usually ends up as a ninth sequence on its own, and the performer can spot it.

One suit, ace to king, in order. Riffle it and watch how much order survives. A suit is only 13 cards, and a smaller pack mixes sooner: by the same formula, a suit gets under one half after 4 riffles where a full deck needs 7. So expect it to look scrambled earlier than the table above — that is the size of the pack, not the table being wrong.

A 2 3 4 5 6 7 8 9 10 J Q K

Not shuffled yet: one rising sequence, the whole suit in order.

How many orders there are

A deck of 52 can be in 52 × 51 × 50 × … × 1 orders, written 52! and read “52 factorial”:

80,658,175,170,943,878,571,660,636,856,403,766,975,289,505,440,883,277,824,000,000,000,000

That is a 68-digit number, about 8.07 × 1067. It turns the birthday paradox on its head. Shared birthdays turn up fast because there are only 365 of them; with 52! possible orders, the same arithmetic says you would need about 1.06 × 1034 properly shuffled decks before two of them were more likely than not to match.

What the model assumes

These figures describe the riffle shuffle as Bayer and Diaconis model it: the deck is cut roughly in half and the cards fall from each half with a chance proportional to how many it still holds. They cite experiments by Diaconis showing this is a good description of how people actually riffle. Other kinds of shuffle, such as the overhand shuffle, are a different question and are not covered here.

Seven is also the answer for one particular way of measuring “random”. Wikipedia’s article on shuffling sums up the argument since: under a different measure the Trefethens concluded six is enough, Diaconis and colleagues later suggested four will do for card games where suits do not matter, and for a few games even seven is not enough. It also reports the view, from the New York Times’s 1990 account of this work, that two to four shuffles is good enough for casual play. So seven is the answer to “when does the deck stop giving anything away?”, not to “how many do I need at the kitchen table?”.

Questions people ask

How many times should you shuffle a deck of cards?
Seven riffle shuffles. Bayer and Diaconis showed that a 52-card deck stays almost completely unmixed for the first four riffles and starts to mix at the fifth. After 7 its distance from random is down to 0.334, the first time it is under one half, and each riffle after that roughly halves it.
How many ways can a deck of cards be arranged?
52 factorial, written 52!: a 68-digit number, about 8.07 × 10^67. It is printed in full on this page.

Check it yourself

The distance table is computed exactly from Bayer and Diaconis’s formula, and must match their published table before it ships.

  1. Shuffling — Wikipedia — the readable one

    Seven riffles under Bayer and Diaconis’s measure, the model being a good fit to how people really shuffle, and the later arguments for six, and for four in some games. Start here.

  2. Trailing the Dovetail Shuffle to Its Lair — David Bayer and Persi Diaconis, Annals of Applied Probability, 1992 — the proof (a journal paper)

    Theorem 1, the exact chance of any arrangement after any number of riffles, which this page’s table is computed from; and Table 1, the distance for 1 to 10 riffles of 52 cards, which it reproduces to the three decimals printed. Also the card trick, the rising sequences and the cutoff. The 13-card figures for the demo come from the same formula.

  3. This page’s dataset — Odds The Law

    The distance after 1 to 12 riffles, 52! in full, and the other figures here.

Try next

How the site works out its numbers is on the methodology page.

Odds The Law uses cookies for analytics and to show ads. Decline and neither will load. See our Privacy Policy for details.