The Math · 03

The Gilbert–Shannon–Reeds model.

Every shuffle recorded here is produced by simulating a real riffle shuffle (cut, interleave, repeat) using the model mathematicians treat as the standard description of how a human hand actually does it.

What GSR describes

Named for Edgar Gilbert, Claude Shannon, and Jim Reeds, the model breaks one riffle shuffle into two physical steps and gives each one a precise probability:

  1. Cut. The deck splits into two packets. The size of the left packet follows a Binomial(52, ½) distribution: equivalent to flipping 52 fair coins and counting the heads. Most cuts land close to an even 26/26 split, but a real hand doesn't cut exactly in half every time, and neither does this.
  2. Interleave. The two packets merge back together one card at a time. At each step, the next card is dropped from whichever packet has more cards remaining in it, weighted proportionally, so a packet with 30 cards left is more likely to drop next than one with 5. Multi-card clumps falling together aren't a separate rule; they're just what this weighting produces on its own, the same way they show up in a real riffle.

That's it: no explicit “drop 1, 2, or 3 cards” table, no fixed cut point. The physical randomness of a hand cutting and riffling a deck is captured by two probability distributions, and the model is exactly what Bayer and Diaconis used to derive the seven-shuffles result.

Not the algorithm certified poker rooms use

This is a deliberate choice, and it's worth being explicit about it. Certified online poker platforms don't simulate a physical shuffle at all: they run the Fisher–Yates algorithm driven by a cryptographically secure random number generator, audited by independent testing labs such as GLI and BMM. Fisher–Yates walks through the deck once and, for each position, swaps in a uniformly random remaining card. The result is a perfectly uniform random permutation, generated directly, in one pass, with no notion of “cutting” or “riffling” involved at all.

ShuffleArchive doesn't do that, on purpose. The project isn't “produce a uniformly random deck order.” Fisher–Yates already solves that problem perfectly, and more cheaply. The project is “simulate what real riffle shuffling produces, at scale, and see whether it ever repeats itself.” GSR is the model of that specific physical process; Fisher–Yates is a model of nothing: it's a direct draw from the uniform distribution. Both approaches land very close to uniform in outcome (that's the entire point of the seven-shuffles result), but they answer different questions, and this site is built to answer the second one.

How it's implemented here

One pass is the cut and interleave above, plus a 75% chance of one more cut at a uniform position between card 5 and card 47, the way a player often squares and cuts the deck again after riffling. One archived shuffle chains 7 to 13 of these passes together, starting from a freshly sorted deck.

Every random decision in that chain (each of the 52 coin flips for a cut, every weighted draw during an interleave, whether to cut again) is drawn from a cryptographically secure random number generator, never a language's default pseudo-random generator. A model of real shuffling is only meaningful if the randomness feeding it is actually unpredictable; see methodology for the full implementation and how the results get archived.