What a shuffled deck still remembers
I have played poker at home with friends and in an online card room, and I know the three common ways to shuffle: the riffle, which splits the deck in two and interleaves the halves; the overhand, which drops blocks from one hand to the other; and mixing the cards face down on the table. At the home games I never wrote down how many times the deck was shuffled each hand. But one question stayed with me: does a deck that looks mixed really lose the structure it had?
This note has no physical shuffles yet: no real deck is measured here, mine or anyone’s. What follows is what can be proven with a mathematical model and what comes out of simulating it, and at the end, what that does not let you conclude. It is the math of the cards, not an invitation to gamble. Every figure from the model and the simulation comes from the code of the tool that goes with this note, with its seed, so you can repeat it.
Four ways to measure the order that is left
The deck starts in order: ♠ A…K, ♥ A…K, ♣ A…K, ♦ A…K. After shuffling, you can measure how much it still looks like that order in four ways:
- In place: how many cards are still in the same position. In order, 52; in a random deck, 1 on average.
- Rising sequences: find card 1, then card 2 further down, then card 3 further down; when the next one is higher up, another sequence starts. In order, 1; at random, 26.50 on average.
- Pairs still together: cards that still have the card that followed them right below. In order, 51; at random, 0.98.
- Relative order: of the 1,326 pairs of cards, the share still in the starting order. In order, 1; at random, 0.500.
Each one looks at a different structure, and that matters later.
What is proven: the riffle model
The Gilbert, Shannon and Reeds (GSR) model describes a riffle like this: the cut comes from a binomial, like counting heads in 52 coin flips, and cards drop from the two packets with probability proportional to how many each one has left. In 1992, Dave Bayer and Persi Diaconis proved that, under that model, the probability of an order after k riffles depends only on how many rising sequences it has. With that, you can compute exactly, without simulating, how far the deck is from a random one.
| Riffles | Distance to random | Randomness so far (bits) | Expected sequences |
|---|---|---|---|
| 1 | 1.000 | 52.00 | 2.00 |
| 3 | 1.000 | 155.71 | 7.95 |
| 4 | 1.000 | 198.31 | 14.10 |
| 5 | 0.924 | 217.64 | 19.61 |
| 6 | 0.614 | 223.51 | 22.95 |
| 7 | 0.334 | 225.06 | 24.71 |
| 8 | 0.167 | 225.45 | 25.60 |
| 10 | 0.043 | 225.57 | 26.28 |
| Random | 0 | 225.58 | 26.50 |
The distance is total variation distance: 1 means someone with the right test always tells that deck apart from a random one; 0, never. After four riffles it is still 1.000. After six, 0.614. After seven it drops to 0.334, and from there it halves with each extra riffle. That is where the famous “seven” comes from.
There is also a bound that does not depend on any table. A random deck has log2(52!) = 225.58 bits of uncertainty. A GSR riffle puts in at most 52 bits, one per card. Four riffles are not enough even in the best case: just to be able to get there, it takes at least five.
And a rule that holds for any riffle, whoever does it: it at most doubles the rising sequences. With k clean riffles there cannot be more than 2k. If a deck “shuffled three times” has 12 sequences, there was something besides three riffles, or a mistake when it was copied.
What is simulated: a thousand decks per condition
This is what a simulated deck looks like after a single riffle. The cut split the first 22 cards (♠ A…K and ♥ A…9) from the other 30 (♥ 10…K, ♣ and ♦); each packet kept its order and the riffle only interleaved them. That is why it has exactly 2 rising sequences, even though no card stayed in its place. It is a simulation of the model, not a photo of a real deck.

For the other measures I simulated 1,000 decks for each number of riffles, with seed 1, each one starting in order:
| Riffles | In place | Sequences | Pairs together | Relative order |
|---|---|---|---|---|
| 0 (in order) | 52 | 1 | 51 | 1.000 |
| 1 | 1.95 | 2.00 | 25.59 | 0.749 |
| 2 | 1.32 | 4.00 | 12.77 | 0.627 |
| 3 | 1.14 | 7.96 | 6.25 | 0.562 |
| 4 | 1.03 | 14.07 | 3.45 | 0.532 |
| 5 | 1.03 | 19.50 | 1.99 | 0.514 |
| 7 | 1.02 | 24.69 | 1.21 | 0.505 |
| 10 | 1.00 | 26.22 | 1.02 | 0.504 |
| Random | 1 | 26.50 | 0.98 | 0.500 |
Look at the “In place” column. After three riffles it is already at 1.14, almost the same as a random deck. If that were all you measured, you would say three are enough. But in that same row the sequences are at 7.96 out of 26.50, there are still six pairs together where a random deck would have one, and the exact distance is still 1.000: the deck keeps so much structure that it can always be told apart from a random one.
Sequences are the slowest measure. Even after seven riffles, the central 90 % of GSR decks have between 21 and 28, and that of a random deck, between 23 and 30. The two ranges overlap: with a single deck you cannot tell whether it got seven riffles or is random. The difference shows up in the average of many.
Few cards in place does not prove randomness
The clearest counterexample is the perfect faro: split the deck into two exact halves of 26 and alternate card by card, keeping the top card on top. It has no randomness at all; its entropy is zero. And still:
| Faros | In place | Sequences | Pairs together | Relative order |
|---|---|---|---|---|
| 4 | 4 | 16 | 0 | 0.525 |
| 5 | 2 | 32 | 0 | 0.565 |
| 8 | 52 | 1 | 51 | 1.000 |
After five faros, the deck has two cards in place, no pairs together and 32 rising sequences, more than a random deck. By two of the measures it looks better shuffled than a random one. After eight, it is back exactly in the starting order.
That is why no single measure says a deck is well shuffled. Each one looks at one structure, and a shuffle with no randomness can erase exactly the one you are looking at. My hunch, which this note does not prove: a very even riffle by hand looks more like a faro, so it would mix less than it seems.
The other ways to shuffle
The table above holds for the riffle under the GSR model. For the other two ways I have no count of my own, only what the sources say, and they do not fully agree:
- Overhand. It is much slower. Math Fun Facts says it takes about 2,500 passes for a 52-card deck; Hackaday, attributing it to research by Jason Fulman and Persi Diaconis for an upcoming book, says 10,000 to 11,000. Neither page shows where the figure comes from. What they share is the order of magnitude: thousands, not seven.
- Mixing on the table. In 2015, Quanta reported Diaconis’s preliminary experiments: 100 decks per duration, mixed for 15 seconds, 30 and one minute, and ten statistical tests. The 15-second decks failed the test of pairs still together; the 30- and 60-second ones passed all ten. The article makes clear that this does not prove 30 seconds are enough, and Diaconis’s idea that one minute is enough in practice was not proven at the time.
What this note does not let you conclude
- How a person shuffles. A riffle by hand does not have to follow the GSR model: some people cut more evenly, others drop blocks of several cards. The tables above are the model’s, not anyone’s.
- That seven riffles are always enough. The seven is a result under GSR and with total variation distance. With another measure or another way of shuffling, the number changes. It is a reference, not a guarantee.
- That a real deck is random. There are 52! possible orders, a 68-digit number. With a few decks you can only see whether they keep structure a random deck would not have, and whether they look like what the model predicts.
- Anything about physical shuffles. This note goes out without them. If I run the test with a real deck, I will add it here with its data, as an update.
Try it with your decks
To try it with your decks, there is Is it well shuffled?: it runs in the browser, computes the exact table, simulates decks with the seed you choose and has a box to paste the orders of real decks. The experiment is simple: put the deck in order, do k riffles with no cuts or overhand passes, and write down the 52 cards from top to bottom. Every deck has to start in order again. The tool checks that all 52 are there with no repeats, flags a deck with more sequences than k riffles allow, and compares it against the model. It sends nothing.
Shuffling is not just moving the cards around. It is reducing the information that the current order still keeps about the previous one. A deck can look mixed and still remember where it came from; the useful question is not whether we shuffle, but how much randomness we are really putting in.
Israel Negrete Lepe is an electronics engineer. Twenty-five years making different systems work together under real conditions: from the sensor, the vehicle or the transaction to the backend, the data, security and operations. Today, increasingly, edge AI. I take on projects by the hour or by deliverable: israel0negrete@gmail.com.