Session 9 of 13 · · 55 min

Gilbreath - Lie Detector

In the “Lie Detector” card trick, a performer can seemingly detect when a spectator is lying about the color of a card. The trick uses the Gilbreath Principle, which ensures that when cards are dealt into two piles from a specially arranged deck, the cards in corresponding positions will have opposite colors.

The Gilbreath Principle is a mathematical property that allows for seemingly impossible predictions. In performance, the performer secretly knows the colors of the cards in the spectator’s pile because they are the opposite of the colors in their own pile. This creates the illusion of mind-reading or lie detection.

Session notes

Chapter 5 opens with the Gilbreath Principle: an invariant that survives a genuine riffle shuffle. Today we covered one effect and stated the first version; the proofs and the Mandelbrot connection come later in the week.

0:00 The chapter’s full title is “From the Gilbreath Principle to the Mandelbrot Set”, two things with no obvious connection to each other; the connection comes on Tuesday. The Numberphile video on Gilbreath is recommended viewing before tomorrow.

3:10 The effect: spread the deck to show it looks random, cut freely, deal cards one at a time until a spectator says stop, then riffle shuffle the dealt pile back into the rest. An ordinary, imperfect riffle that the spectator can perform. The book uses a computer as a genuine participant, and so did I.

4:47 Deal the top 20 cards into two piles of ten. Round one: I look at each card in my pile, announce red or black truthfully or not, and the group guesses whether I am lying; I log each guess as correct or wrong. Round two: the spectators go through their pile the same way, and the computer calls lie or truth.

7:11 Pratik caught my first lie; over ten cards the group ran at roughly fifty percent, with Ravi and Sunita also guessing.

11:27 The computer went ten out of ten, with Pratik and Neeta choosing when to lie. Pratik: the riffle is what makes this baffling.

14:53 The computer received ten bits, correct or wrong, that seem entirely outside anyone’s control; the riffle was genuine; yet the effect is deterministic. With enough memory you could run the computation yourself, though ten cards is a lot to hold.

19:18 Sunita asked whether a second riffle preserves the invariant; I believed not. We returned to this at the end.

21:21 The deck alternates red and black and is otherwise shuffled; a quick spread does not give it away. I used two decks with different backs for the explanation.

22:26 One essential detail: the cards dealt off come off one at a time, reversing their order. A plain split and riffle does not work.

23:34 The first Gilbreath principle: start from an alternating deck, deal off any number of cards, riffle the two piles together; every pair from the top is one red and one black. Not alternating in general, but balanced in pairs. The book notes that classrooms rarely produce a clean argument for every pair, not just the first; proof tomorrow.

24:35 The general version: any cyclic property survives. If every block of four from the top has one card of each suit, a Gilbreath shuffle preserves this in groups of four; likewise for blocks of thirteen and ranks. Dealing the shuffled deck in twos, fours and thirteens is already an impressive demonstration.

26:43 The mechanism: the -th card of one pile of ten has the opposite colour from the -th card of the other. Knowing my pile gives the spectator’s pile exactly. If you can keep your pile visible, or make notes, you need no computer.

29:48 The computer version: “correct” and “wrong” each appear as a word and an emoji; I click the word for a black card and the emoji for a red one, regardless of truth, lie or guess, and that is all the computer learns. The book’s version types C or W into a prompt, with a leading space for black and none for red; in class someone once noticed the spaces but not the pattern. Pratik: not a hidden button, just where you click.

35:04 Two ingredients: complementation via Gilbreath, and a covert channel to the computer. Arguably a sleight, but one that only works because of the principle; keep the drama on the bluffing.

39:26 The chapter’s first, simpler effect: after the shuffle, reach under the table and bring up pairs as if sorting by touch, each one red and one black; returning each pair red over black restores the alternating arrangement and it can be repeated. The book calls the lie detector a subtler use. Sunita: tell the audience the computer can now read minds.

41:30 Tomorrow: the poker effect (a flush and a straight flush from an audience-shuffled deck), the ultimate Gilbreath principle characterising which properties survive and the permutations one shuffle can produce (parallel to Hummer), and a Gilbreath–de Bruijn combination with open questions.

44:33 Sunita argued that two riffles break the invariant: after one shuffle pairs are RB or BR, and an adversarial second riffle can bring four blacks together. Pratik: a run of three same-coloured cards is impossible after one shuffle; after two, it can occur.

50:35 An odd cut after the shuffle can split a pair and yield red, red, black, black. Cut and riffle freely before; once the shuffle is done, leave the deck.

51:36 Sunita: after two riffles no monochromatic run can exceed four, since each pre-shuffle pile has runs of at most two. Whether weaker balance holds, say every eight cards, is unclear; one could probably design two riffles that stay unbalanced for a long prefix.

54:44 Up next: the poker hands and the ultimate Gilbreath principle.

To think about

  • Prove the first Gilbreath principle for every pair, not just the first.
  • Prove that the reversal is necessary by finding a counterexample with a plain split.
  • Show the “every four cards, all four suits” version.
  • Characterise the longest monochromatic run after two Gilbreath shuffles.
  • Design your own effect based on the principle.

An interactive demo from the original page is parked while the card-interactives library is built; the text above stands on its own.