Section 4 · The Gilbreath Principle
The Lie Detector
You shuffle the cards yourself. Then you look at your cards one at a time and call out a colour, truthfully or not, as you please. Before you show each card, the verdict arrives: true, or lie. It is right every time.
Watch the lectureLecture 30 · The deck becomes a lie detector
Try it
You cut, deal and riffle the cards, and you choose who gets which pile. Then you make the claims. Lie as often as you like.
Why it works
Start with the set-up. The sixteen cards alternate red, black, red, black from the top. Cutting can’t spoil that: the deck has an even number of cards, so the bottom card and the top card have different colours, and a cut only rotates the alternation.
Dealing a few cards onto the table and riffling them back in is a Gilbreath shuffle. It looks thorough, but it leaves a promise behind. Read the shuffled deck in pairs from the top (cards 1 and 2, cards 3 and 4, and so on) and every pair holds one red card and one black card. Why that happens is the subject of Perfectly Mixed Pairs; here we use it.
Now the deal: left, right, left, right. The first card of each pair goes left, the second goes right. Each new card lands on top of its pile, so both piles come out in reverse: the last pair dealt is on top of both. Read the two piles from the top, side by side, and the cards at the same position are the two halves of one pair.
Every card you hold has a partner at the same position in my pile, and that partner is the opposite colour.
Step through it with the example below. It uses the real sixteen cards, so you can follow any one of them from the set-up to the verdict.
The decoder, in one line
That is all the computer needs. As I turn my cards over, it writes down the opposite of each colour it sees. When you claim a colour for your card, it compares your claim with the matching entry. The same colour means true; a different colour means a lie. It never sees your card, and it never needs to know what you intended.
Write black as 0 and red as 1. If my card at some position is a, the expected colour of yours is 1 − a. Your claim q is true exactly when q = 1 − a. Here are the first three positions of the example shuffle above, where my pile begins 2♣, A♥, 3♥, with some claims you might make:
| Position | My card, a | Expected, 1 − a | Your claim, q | Verdict |
|---|---|---|---|---|
| 1 | 2♣ black (0) | red (1) | red (1) | true |
| 2 | A♥ red (1) | black (0) | red (1) | lie |
| 3 | 3♥ red (1) | black (0) | black (0) | true |
Your hidden cards there are 2♥, A♣ and 8♣: red, black, black, exactly as expected. The record knows colours, nothing more. A predicted red could be a heart or a diamond, of any rank. And the arithmetic only works because the physical deal lined the partners up; no amount of fast calculation can repair a broken correspondence.
Challenge: keep the record honest
Two complementary packets of four cards. You see mine; predict the hidden one, top to bottom. Each round announces something that happened to the packets. Update the record to match, or say why no prediction is possible.
Perform it yourself
Set-up
- Take the ace to eight of hearts and the ace to eight of clubs.
- Arrange them face down so that, from the top, they read A♥, A♣, 2♥, 2♣, 3♥, 3♣, … , 8♥, 8♣. The colours alternate red, black, red, black.
- Have a scorekeeper with a phone or laptop, or simply a sheet of paper with eight numbered boxes and something to cover them.
Performance
- The spectator cuts the packet as often as they like.
- They deal some cards, one at a time and face down, onto the table, and stop before they run out. Anything from 1 to 15 works; 5 to 11 feels natural.
- They riffle the dealt cards into the cards still in their hand, once. Each packet keeps its order and every card is used. No cut after the shuffle.
- Deal the whole packet alternately into two piles: left, right, left, right, each new card on top. Strictly alternate. Two left then two right would put both halves of a pair in the same pile.
- The spectator chooses which pile you use. They keep the other face down and must not rearrange it.
- Round one. Turn your cards over one at a time from the top. Only after a card is face up does the scorekeeper record its colour, and they record the card, never what you said. (If you like, claim a colour before each reveal, truthfully or not, and let the spectator judge. They will find it hard.) Used cards go into an audit row, never back on top.
- Check the record has all eight colours before you go on.
- Round two. The spectator looks privately at their top card and says “red” or “black”, truthfully or not. Compare the claim with the next entry: the opposite of your card at the same position. Same colour: “true”. Different: “lie”. Give the verdict before they show the card, then let them show it and put it in their own audit row.
Without a computer
After each of your cards is shown, the scorekeeper writes the opposite colour in the next numbered box and covers it. In round two, uncover one box per claim and compare.
When something goes wrong
- A colour was entered wrongly: say so, correct that one entry, and keep the card’s position.
- A pile was reordered or spilled, or someone wants a second shuffle: “That changes the setup.” Reset the packet openly. Never give a verdict the method no longer supports.
Going deeper
Both piles reverse, and by the same rule
Number the pairs 1 to m in the order they leave the shuffled deck (here m = 8). Each pile receives one card from pair 1 first and one card from pair m last, and the last arrival is on top. So the card at position j from the top of either pile came from pair m + 1 − j. The same formula on both sides is why the partners line up.
Nothing here requires either pile to alternate. If the left pile receives red, red, black, red, it ends up reading red, black, red, red from the top, with two reds together. The right pile reads black, red, black, black. Looking for alternation inside one pile is the wrong test; the pattern lives between the piles.
Reverse the hidden pile, reverse the record
Suppose my packet showed red, black, red, red, so the record says black, red, black, black. If the hidden packet alone is now dealt one card at a time onto the table, it reads black, black, red, black. The old record would get position 1 right by luck and fail at position 2. A lucky first match is not evidence that the method survived.
If you know exactly what happened, apply the same change to the record: reverse it. Then claims of black, red, red, black get the verdicts true, lie, true, true, all correct. If both packets get the same rearrangement before anything is recorded, nothing needs updating at all: every old pair moves to the same new position. If the hidden packet was mixed and nobody saw how, there is no position map to apply. The colours are still two of each, but the record can no longer say which comes next.
Gathering the piles breaks the pairing
Take a left pile red, red, black, red and its complementary right pile black, black, red, black. Put the left pile on top of the right and deal again, alternately, into two piles. The new piles read red, black, black, red and black, black, red, red. Positions 2 and 4 now hold matching colours. The cards are all still there, but their order decides which cards get compared, and the new deal pairs them differently.
Three ways a performance can fail
Ask three questions, in this order. Are we holding exactly the intended cards? A missing or duplicated card shifts every later position. Which rearrangement happened to each packet? A cut, a reversal or a gathering can keep every card while changing the order. Did the right observations reach the record? A colour entered wrongly spoils one entry, not the principle.
Trace a failure backwards until you reach the first broken link. Blame the last formula only when everything before it holds.
Sources
Persi Diaconis and Ron Graham, Magical Mathematics (Princeton, 2012), Chapter 5, pp. 63–65: Curry’s lie-detector presentation of the Gilbreath principle. This page follows the course’s adaptation: sixteen cards, an alternate deal into two piles, and an audited scorekeeper who records only colours that have been shown.
The principle is Norman Gilbreath’s. For the proof that every aligned pair is mixed, see Perfectly Mixed Pairs, and Colm Mulcahy, Mathematical Card Magic (CRC Press, 2013), Chapter 6.
Course episodes 30 (performance) and 31 (decoding and diagnosis).