Riffle a new deck a few times and it looks thoroughly mixed. Dave Bayer and Persi Diaconis showed why that look misleads. An ideal riffle leaves traces of the original order, and they take several riffles to wash out. Seven Riffles lets you watch those traces in one seeded deck, beside an exact calculation for every possible deck.

Predict first

Before you open it, write down two guesses. How many riffles does a 52-card deck need? And after a single riffle, how much of the original order can survive?

Try it

A fresh deck runs 1 to 52 from left, the top of the deck, to right. Each card keeps the color of its starting place.

  1. Press One riffle. With the starting seed, 1, the deck is cut after 30 cards: cards 1–30 on top, 31–52 below. Cards then fall from the bottom of each half, more often from the half with more cards left.
  2. Slide Close-up to place 3. Card 1 sits there now. The close-up begins 31, 32, 1, 33, 34, 2, 3, and card 1’s thread, cards 1–30, lights up.
  3. Drag Riffles to 4, then 6, then 7. Read the panel at the bottom left and the panel at the bottom right separately.
  4. Press Deal a new sample deck. The left panel changes. The right panel does not.

Try it yourself

What you’ll see

The arcs above the cards are threads. Each joins a card to the next card number when that card still lies below it. So every unbroken chain is a run of the old order; the tool calls them rising sequences. One riffle leaves two here, 1–30 and 31–52. With seed 1, riffles one to seven leave 2, 4, 8, 14, 20, 23 and 27 threads. The ceiling is 2, 4, 8, 16, 32, 52 and 52.

The right panel measures something else. It compares the model’s chances for all 52! orders after that many ideal riffles with a perfect mix. In a perfect mix, every order is equally likely. This total variation distance stays at 1.000, to three decimals, through four riffles. It reads 0.924 at five, 0.614 at six and 0.334 at seven. After that it roughly halves with each riffle: 0.167, 0.085, 0.043.

Why it happens

A riffle never reverses either half, so one riffle of a fresh deck leaves at most two threads. Each later riffle can at most double the count, so m riffles leave at most 2m. A perfectly mixed deck averages 26.5 threads. After four riffles, with 16 as the limit, almost every order is still impossible. That is why the distance barely moves at first.

From six riffles on, every order is possible, but not equally likely. Bayer and Diaconis give the chance of one exact order after m riffles as C(2m + 52 − r, 52) / 252m. Here r is the order’s thread count. Orders with fewer threads keep extra weight until more riffles wash it out.

What the model leaves out

These are ideal Gilbert–Shannon–Reeds riffles. Real hands drop clumps and cut unevenly, and overhand shuffles and casino machines work differently. The 0.5 line is a chosen yardstick, not a definition of random. Seven riffles bring the ideal distance under it, not to zero, and other measures of mixing give other counts. Seed 1’s 27 threads after seven riffles is one sample, not a verdict. No single deck can show the distance, because it describes every deck at once.

The next question

Why does each riffle after seven roughly halve the distance? Drag from 7 to 10 and compare the bars. The 34.9-second film follows the same seed-1 riffles from the fresh deck to seven.

How many riffles mix a deck? · 34.9-second film · Watch with transcript

Keep exploring

Up next

  1. 0:36Short · MathKeep squaring and adding. Does it escape?
  2. 0:36Short · MoneyHow much can compound interest really grow?
  3. 0:33Short · NatureWhy do sunflower seeds form spirals?

Sources & further reading

Make the next question an experiment.

Browse independent creators who make big ideas visible.

Find an explainer