Riffle Shuffle — Definition, Formula & Example
A riffle shuffle is the familiar way of shuffling cards: you cut the deck into two packets and let the cards drop back together, interleaved. The Gilbert-Shannon-Reeds (GSR) model turns this into an exact probability rule, so you can calculate how random a deck is after a given number of shuffles.
In the GSR model of a deck of cards, cut off the top cards with probability . Then drop cards one at a time from the bottoms of the packets. If the packets currently hold and cards, the next card comes from the first packet with probability . As a result, each of the pairs (cut, interleaving) is equally likely. A single GSR shuffle produces only permutations with at most 2 rising sequences, which are maximal runs of consecutive values that appear left to right in the deck.
Key Formula
Where:
- = Probability that the deck is in arrangement after GSR shuffles of a deck that starts in order
- = Number of cards in the deck
- = Number of riffle shuffles performed
- = Number of rising sequences in
Worked Example
Problem: A 4-card deck starts in order 1, 2, 3, 4. After one GSR riffle shuffle, what is the probability that the deck reads 3, 1, 4, 2? How does that compare with the probability that the deck is still in order 1, 2, 3, 4?
Step 1: Count the rising sequences in 3, 1, 4, 2. Card 2 sits to the right of card 1, so 1, 2 is one run. Card 3 sits to the left of card 2, so a new run starts at 3, and card 4 lies to its right. That gives two runs, {1, 2} and {3, 4}. This is a cut into 1, 2 | 3, 4 followed by an interleaving.
Step 2: Apply the formula with , , .
Step 3: The ordered deck has one rising sequence, . Many different cuts can each drop back into the original order, so this arrangement is the most likely. By contrast, 4, 3, 2, 1 has and probability .
Answer: The probability of 3, 1, 4, 2 is . The probability that the deck stays in order is , five times larger and far above the uniform value . One shuffle is nowhere near random.
Why It Matters
Bayer and Diaconis (1992) used this formula to show that a 52-card deck stays far from random until about 7 riffle shuffles. After that, the total variation distance to uniform drops off sharply. The result is a standard example of the cutoff phenomenon in Markov chain mixing times. It is the standard reference point for anyone who tests whether a shuffling procedure is fair.
Common Mistakes
Mistake: Assuming one riffle shuffle can produce any arrangement of the deck.
Correction: One shuffle reaches only permutations with at most 2 rising sequences. That is orders, or just 12 of the 24 orders for 4 cards. For 52 cards, is tiny compared with , so you need repeated shuffles.
