Gilbreath Principle in Action
THEOREM. The Ultimate Gilbreath Principle. For a permutation of , the following four properties are equivalent:
- is a Gilbreath permutation.
- For each , the top cards are distinct modulo .
- For each and with , the cards , are distinct modulo .
- For each , the top cards are consecutive in .
The Gilbreath Principle is a fascinating mathematical property that works with sequences of numbers.
Deal off any number of cards from a deck arranged 1, 2, …, N and riffle shuffle the two piles: the Gilbreath Principle states that after the riffle shuffle, adjacent pairs of cards will always contain one card from each of the original piles.
Session notes
Chapter 5 of Magical Mathematics ends with counting Gilbreath permutations and the Ultimate Gilbreath Principle, their complete characterisation.
0:36 No new effects. The book’s Gilbreath effects are the lie detector and the poker hands; “A little bit of magic” is a de Bruijn variation, left open-ended rather than a concrete trick. YouTube has many more Gilbreath effects, often with sleight of hand, which we will not cover.
3:42 A Gilbreath permutation: start from (left is top), deal off cards reversing them, then riffle preserving internal order. How many exist, and how to recognise one?
5:48 The book states . My binary-labelling attempt failed: not every bit string is a valid riffle. Pratik: with 8 dealt from 20, there are riffles.
10:32 Saraswati: there are Gilbreath permutations with cards dealt (positions chosen, order forced). Summing over gives , twice the book’s count.
12:44 The extreme cases, identity and full reversal, are distinct and not the culprit, and there is no obvious symmetry.
15:51 Checking by hand: dealing off one card gives 123, 213, 231; dealing off two gives 213, 231, 321 and repeats. Four permutations, not eight; each appears exactly twice.
21:25 The card at the cut can be the last of the dealt pile or the first of the rest; the outcome is the same either way. A Gilbreath permutation decomposes into a decreasing run and an increasing run sharing exactly one element at the junction (Saraswati). The true count is .
24:44 The book’s bijection: choose ; place at positions and fill the rest with in order. For , : positions 3 and 5 receive 2 and 1; the remaining positions receive 3, 4, 5. With one gets 5 4 3 2 1, the full reversal, which is why dealing off all cards needs no separate case.
29:27 Any Gilbreath permutation’s dealt-card positions recover an that regenerates it, and every describes a valid riffle. Excluding position 1 from forces the junction card into the undealt pile and resolves the double-count. Hence .
37:19 Example: arises from dealing off five cards and from dealing off four; the maximal decreasing run from the top and the maximal increasing run share one element (Pratik: like a longest-subsequence decomposition). The convention disambiguates.
43:35 Pratik: the overcount argument and the book’s subset argument are morally the same proof.
44:37 Roughly of Gilbreath permutations are cyclic; cyclic ones correspond to zeros of a recursively defined polynomial family, which is where the Mandelbrot set enters the chapter title. This is stated with references, not proved.
45:38 The Ultimate Gilbreath Principle (statement above): we covered properties 2, 3, and 4. Property 4, which I found cutest: the top cards form a consecutive set of integers for every .
47:05 Example, : a Gilbreath outcome whose top five are 5 4 6 7 8, as a set , so the sixth card must be 3 or 9. It was 3, so the seventh must be 2 or 9.
49:42 Property 4 holds because you can replay the riffle backwards. The top run of the outcome comes from one pile, and the top of the other pile continues exactly where that run left off, because the dealt pile was reversed. Each drop from the dealt pile extends the top- set downward; each drop from the other pile extends it upward. Saraswati: induction on the drops; Pratik agreed it is always consecutive.
52:52 Property 4 implies property 2 immediately ( consecutive integers have distinct residues mod ); property 3 follows for sliding blocks.
54:58 For the converse, a participant argued via maximal consecutive chunks from the dealt pile and from the rest: the first elements of and are adjacent integers (as in 6 5 4 followed by 7), which lets you reverse-engineer the riffle. Fine print left open.
1:01:07 Not covered: applications citing Knuth (disk storage) and Penrose (aperiodic tilings); de Bruijn’s variant with two equal halves (say spades and diamonds alternating against clubs and hearts alternating) where a free cut after the riffle still guarantees one of two properties; two-dimensional analogues, noted as wide open.
1:04:19 Up next: chapter 6, perfect shuffles and other shuffles, with JavaScript standing in for dexterity.
To think about
- List the four Gilbreath permutations of and the eight of ; verify the count.
- Write out the bijection with subsets of carefully.
- Prove property 4 by induction on the drops of the riffle.
- Prove that property 4 implies the permutation is Gilbreath.
- Count cyclic Gilbreath permutations for small ; compare with .