Section 4 · The Gilbreath Principle
The Spectator Deals Poker
Twenty-five cards, five hands of five. You choose where to split, you control every drop of the riffle, and you do all the dealing. My prediction, made before you start: hand 1 will be a flush, hand 5 a straight, and the flush will win.
Watch the lectureLecture 34 · The spectator deals the winning poker hands
Try it
You choose a number from 10 to 15, deal that many, and riffle once by choosing which packet each card comes from. Then you deal twice. The cards stay face down until the end.
Why it works
The packet is prepared in three regions. The top five cards are spades (2 to 6). The middle fifteen are the ranks A K Q J 10, three times over, in clubs, hearts and diamonds only, with the suits cycling ♣ ♥ ♦. The bottom five are spades again (A, 7, 8, 9, 10). Two proofs and one routing argument finish the job.
The front five make a straight. Number the cards 1 to 25 from the top. If you deal j cards, the dealt pile starts at card j and walks back towards the top; the rest starts at card j + 1 and walks forward. As in every Gilbreath shuffle, the cards that have come out at any moment form one unbroken stretch of the original numbering, grown outwards from the split. With j between 10 and 15, each pile has at least five middle cards before its first spade (j − 5 on one side, 20 − j on the other), so the first five cards out are five consecutive middle cards: A, K, Q, J and 10 once each. Five consecutive cards of a ♣ ♥ ♦ cycle can’t all share a suit, so it is a straight and not a flush.
The back five are spades. With a split from 10 to 15, each pile ends with five spades. So any non-spade still has five spades below it in its own pile, and they must all come out after it. No non-spade can be among the last five cards.
The deals carry those groups to hands 5 and 1. The practice deal puts the first five shuffled cards at the bottoms of the five piles and the last five on the tops. Collected in order, the piles become five blocks of five; the second deal gives the first card of every block to hand 1 and the last card of every block to hand 5.
The first five cards of the shuffle are an unbroken stretch from the middle, so they make the straight; the last five can only be spades; and the double deal sends the tops of the piles to hand 1 and the bottoms to hand 5.
Step through the checked example below (a split of 12, alternating drops), or your own shuffle once you have done one. The 25 cards keep their identities from start to finish; watch the five-by-five grid turn on its side during the deals.
Challenge: break the promise
Your goal: make the prediction fail, then say which step of the proof broke. In this experiment you may split anywhere from 1 to 24, and you may turn one practice pile over as you collect. The cards are face up so you can aim.
Perform it yourself
Set-up
- Stack these 25 cards face down, top to bottom: 2♠ 3♠ 4♠ 5♠ 6♠ · A♣ K♥ Q♦ J♣ 10♥ · A♦ K♣ Q♥ J♦ 10♣ · A♥ K♦ Q♣ J♥ 10♦ · A♠ 7♠ 8♠ 9♠ 10♠. Check it card by card; every card is different.
- Lay out five numbered spaces, and write the prediction: “Hand 1 will be a flush. Hand 5 will be a straight that is not a flush. The flush wins.”
- Do not cut the prepared packet.
Performance
- Ask for a number from ten through fifteen. The spectator deals exactly that many cards, one at a time and face down, into an empty space, keeping the rest in order.
- They riffle the two packets together once, keeping the order within each. No cut afterwards.
- Practice deal: clockwise into the five spaces, one card per space, new cards on top, until all 25 are dealt.
- Collect: lift pile 5, put pile 4 on top of it, then pile 3, pile 2 and finally pile 1. Do not turn any pile over.
- Deal again, clockwise, into five hands. Turn over hand 5 first: A, K, Q, J, 10 in mixed suits, a straight. Arrange it for display only after reading it. Then turn over hand 1: five spades, a flush, which beats the straight.
- Promise only that comparison. The other three hands are not part of the prediction; reveal them for curiosity if you like.
If something goes wrong
- A number outside the range. “For this experiment, choose any whole number from ten through fifteen.”
- A request to cut or reshuffle afterwards. “The prediction uses this one interleaving. We will deal from this result.”
- A pile is turned over or spilled. “That changes the route to the final hands. We will reset and run the deal again.” Reset to the exact prepared stack.
- The riffle is awkward. Build the shuffle by choosing the next top card from either packet, laying them in a row from left to right, then gather from the rightmost card first so the gathered packet reads like the row. Don’t reverse the row.
Going deeper
Prefixes are intervals, and nothing else is possible
Number a deck 1 to N and write the shuffled deck as a list: π(i) is the original card now at position i. For the shuffle 3 4 5 2 6 7 1 8, π(1) = 3 and π(4) = 2. Every Gilbreath shuffle has the property you used above: each prefix of the list, read as a set, is an interval of integers. There is a quick test. A prefix of length k with smallest value a and largest value b is an interval exactly when b − a + 1 = k.
The converse is true too. If every prefix of a list is an interval, a Gilbreath shuffle produces it: if the list starts with t, put cards t − 1, …, 1 in one pile and t, …, N in the other; each next value must sit just left or just right of the stretch used so far, which is the top of one pile. So 3 4 5 2 6 7 1 8 comes from piles 2 1 and 3 4 5 6 7 8 with the drops R R R L R R L R. These are exactly the Gilbreath permutations.
The list 3 4 1 2 5 6 7 8 is not one: its first three values have a hole at 2. Physically, card 1 cannot come out while card 2 sits on top of it. Direction matters as well. The inverse of our example, which records where each old card went, is 7 4 1 2 3 5 6 8, and it fails at once: 7 and 4 leave a gap.
How much freedom does one riffle allow?
Build a Gilbreath permutation backwards. Its last entry must be an end of the full interval 1 to N, either 1 or N; remove it and the rest is again an interval, whose last entry is again one of its two ends. That is a left-or-right choice at each of N − 1 stages, and the last remaining value has no choice. Different choice strings give different lists, so there are exactly 2N−1 Gilbreath permutations.
With four cards that is 8 of the 24 orders: 1234, 2134, 2314, 2341, 3214, 3241, 3421, 4321. With eight cards it is 128 of 40,320, one in 315. With 25 cards it is 224 = 16,777,216 Gilbreath orders, against about 1.55 × 1025 orders in all.
Counting descriptions is different. Allowing every split from 0 to N, there are 2N split-and-drop descriptions, so each order has exactly two: the first card can come from either pile. The legal shuffles for this trick, splits 10 to 15 with every interleaving, number 25,852,920 descriptions.
A second riffle breaks the guarantee. Start with red, black, red, black; one Gilbreath shuffle gives 2 3 1 4, coloured black, red, red, black, and both pairs are mixed. Reverse-deal the top three of that and drop the last card under them: 1 3 2 4, coloured red, red, black, black. The second shuffle’s input was no longer alternating, so the theorem had nothing to say. A computer check shows two Gilbreath shuffles reach all 24 orders of four cards but only 104 of the 120 orders of five: a finite observation, not a formula.
A deck meets a quadratic map, and the Mandelbrot set
Fix a real number c, start at x0 = 0 and repeat x ↦ x2 + c. The orbit of 0 is called the critical orbit, because 0 is where the parabola turns (its slope is zero there). For c = −1 the orbit is 0, −1, 0, −1, …, an exact return to 0 after two steps. For c = −2 it is 0, −2, 2, 2, …, which settles but never returns to 0. For c = 1 it is 0, 1, 2, 5, 26, … and escapes. The real values of c whose orbit stays bounded form the interval from −2 to 1/4, endpoints included.
When the orbit of 0 returns to 0 after exactly n steps, it visits n distinct real numbers, and these can be put in order on the line. Here is the bridge, one visible step at a time, for the period-three parameter c* ≈ −1.75488, the real root of c3 + 2c2 + c + 1 = 0:
- Orbit. 0, then about −1.75488, then about 1.32472, then back to 0.
- Rank. Sorted on the line, −1.75488 is rank 1, 0 is rank 2, 1.32472 is rank 3. In time order the ranks read 2, 1, 3.
- Forward map F. Where does each rank go next? 1 → 3, 2 → 1, 3 → 2, so F = 3 1 2. Its prefix 3 1 has a gap: not a Gilbreath permutation.
- Invert. G sends each rank to its predecessor, the rank that F sends to it. Since F(2) = 1, F(3) = 2 and F(1) = 3, we get G(1) = 2, G(2) = 3, G(3) = 1, so G = 2 3 1. Prefixes {2}, {2, 3}, {1, 2, 3}: all intervals.
- Shuffle. Reverse-deal the top two of 1 2 3 (piles 2 1 and 3) and drop L, R, L: the deck reads 2 3 1.
| Period | c (approx.) | Ranks in time order | F | G = F−1 |
|---|---|---|---|---|
| 2 | −1 (exact) | 2 1 | 2 1 | 2 1 |
| 3 | −1.75488 | 2 1 3 | 3 1 2 | 2 3 1 |
| 4 | −1.31070 | 3 1 4 2 | 4 3 1 2 | 3 4 2 1 |
| 4 | −1.94080 | 2 1 4 3 | 4 1 2 3 | 2 3 4 1 |
Every G in the table is a Gilbreath permutation, and each is a single cycle through all its labels. Diaconis and Graham state the theorem behind this, from work associated with Milnor, Thurston and Sullivan: for each n, the real parameters whose critical orbit returns to 0 after exactly n steps (and not sooner) correspond one-to-one with the Gilbreath permutations of n labels that form a single n-cycle. The small counts match: one for period 2, one for period 3 (only 2 3 1 among the four Gilbreath permutations of three cards), two for period 4. We have checked examples; the full theorem is deep, and it is stated here, not proved. The decimals are rounded; each parameter is pinned down exactly by its polynomial, and for period four by a rational interval checked with exact arithmetic.
In the complex plane, the same rule z ↦ z2 + c defines the Mandelbrot set: the parameters c whose orbit from 0 stays bounded. Its intersection with the real axis is exactly [−2, 1/4], and our periodic parameters sit on that segment. That is the whole bridge: real, exactly periodic critical orbits, read through ranks and an inverse. A parameter such as c = i belongs to the set (its orbit 0, i, −1 + i, −i, −1 + i, … repeats) but 0 never returns and its points do not lie on a line to be ranked, so it gets no card permutation. The deck does not contain the fractal; it shares an exact combinatorial pattern with a precise slice of it.
Checked by computer
For this page we ran the whole routine, both deals included, for every legal choice: all six splits from 10 to 15 and every interleaving, 25,852,920 shuffles. In every one, hand 1 was five spades and hand 5 was A K Q J 10 in mixed suits. (In 610,470 of them hand 1 was in fact a straight flush, 2♠ to 6♠, which beats a straight just as well.) The checked example in “Why it works” matches the course’s verified state exactly.
Outside the range the guarantee is gone, though not always the result. Every split from 1 to 24 still puts five spades last. The front can fail: a split of 9 lets the first five cards include the 6♠, and a split of 5 can even put 6♠ 5♠ 4♠ 3♠ 2♠, a straight flush, in hand 5. A split of 16 survives for every interleaving, but not because of the proof: its buffer condition fails there (R has only four middle cards before the A♠). It holds by an accident of this stack, since the only spade that can reach the front five is the A♠, and it completes A K Q J 10.
Sources
Persi Diaconis and Ron Graham, Magical Mathematics (Princeton, 2012), Chapter 5: pp. 66–67 for the prepared-packet double deal; pp. 68–71 and 80–83 for the interval characterisation and the count; pp. 72–78 for the quadratic map, with the theorem on p. 77.
This version corrects two details of the printed routine: the split is restricted to 10–15, and with ordinary face-down dealing the straight arrives in hand 5. The middle suits cycle ♣ ♥ ♦ so that the straight can never also be a flush.
The shuffle is named for Norman Gilbreath, who discovered its hidden order in the late 1950s. Course episodes 34 (performance), 35 and 36 (Gilbreath permutations and their count), and 37–39 (the quadratic map and the Mandelbrot set).