Your First Colour-Window Routine
Cut a packet of sixteen cards as often as you like and deal the top four. Tell me only whether each one is black or red, and I name all four cards.
Watch the lectureLecture 16 · Your first performable colour-window routine
Try it
You are all four spectators. You choose every cut and you report the colours; the cards follow the real rules.
Why it works
Lay the prepared packet out face up: ace, two, three and four of clubs; ace, two, three and four of hearts; then five of clubs, five and six of hearts, six and seven of clubs, seven of hearts, eight of clubs, eight of hearts. Write each black card as 0 and each red card as 1, and the packet becomes the bit pattern 0000 1111 0110 0101.
A straight cut lifts a block from the top and puts it underneath. Nothing inside either block changes order, and the old bottom card now sits directly above the old top card. So think of the sixteen cards as a circle: a cut only chooses where you start reading it.
Your four colours are the four bits that start at that place. This particular circle was built so that all sixteen starting places give sixteen different four-bit words, including the three that run across the join from the bottom back to the top. A four-bit word has exactly sixteen possibilities, so every word appears once, and the word you report points to one place.
A cut only chooses where the circle starts, and each pattern of four colours occurs at exactly one place on it.
Step through it below. The ring is the same sixteen cards, bent so that the bottom card touches the top card.
The price of using every word is that no word is left over to mean “someone made a mistake”. If the true colours are 0000 and the last spectator says red by accident, the report 0001 is a perfectly good address: it points one place further on, to 2♣ 3♣ 4♣ A♥. Nothing in the four bits announces the error, which is why the performer repeats the report back before naming any cards.
The names come from the second layer of the preparation. Wherever the pattern asks for a 0, take the next club in rising order; wherever it asks for a 1, take the next heart. The pattern has eight 0s and eight 1s, so the ace to eight of each suit fit exactly. Swap a club with a heart and the windows change; swap two clubs and the windows survive, but the names on your sheet go stale. The challenge lets you test both.
Challenge
Repair a packet in which two cards were swapped, or build a stack of your own. Either way, the checker deals from all sixteen cuts and names any two windows that share a colour word.
Perform it yourself
Set-up
- Take the ace to eight of clubs and the ace to eight of hearts: eight black cards and eight red cards, all different.
- Stack them face down so that, from the top, they read: A♣ 2♣ 3♣ 4♣ A♥ 2♥ 3♥ 4♥ 5♣ 5♥ 6♥ 6♣ 7♣ 7♥ 8♣ 8♥.
- To remember it, remember the colours 0000 1111 0110 0101 (black 0, red 1). For each 0 take the next club, for each 1 take the next heart, always in rising order.
- Check before anyone arrives: read all sixteen colours against the pattern, then walk once around every starting place with the sheet below, including the three that wrap from the bottom to the top.
- Set out four numbered places, 1 to 4. During your first performances, use the sheet openly and tell the audience it is a learning aid. The spectators give it nothing but four colours.
Performance
- Hand over the packet. “Give it a straight cut: lift a block from the top, put it on the bottom, and keep both blocks in order. Cut again if you like.”
- “Deal the top four cards separately to places one, two, three and four. Keep the rest together.”
- Each spectator looks at their own card and remembers its full name.
- Ask for colours only, in place order: place 1 first, place 4 last. Repeat the four colours back and let them correct you now, before anything is revealed.
- Find the word on the sheet and name the cards one at a time: “The first card is the six of clubs. Please show it.”
Handling warnings
- Only straight cuts. A shuffle, or swapping two cards, is not a cut and can break the code.
- Read the places in the order the cards were dealt. Do not collect the four into a pile and read from its top: that reverses the word, and a reversed word is still a valid address, just the wrong one (0010 read backwards is 0100, which names 8♣ 8♥ A♣ 2♣).
- A misreported colour cannot be detected: every four-colour word is a real address. Confirm the report before you reveal.
- To reset, put the card from place 4 on the packet, then place 3, then 2, then 1. The packet is again the same circle, so you can go straight into another round. When in doubt, rebuild from the printed order.
The lookup sheet
Sorted by colour word for quick reading. The sheet order is not the packet order: each row starts at the position shown.
Going deeper
A rule that builds this exact stack
Start with four blacks. After that, take a red whenever the four newest colours would form a word you have not seen yet; otherwise take a black. Continue until you have sixteen cards. This “prefer red” rule produces exactly 0000 1111 0110 0101, the pattern of our packet. (In the literature it is the “prefer one” construction, usually credited to M. H. Martin, 1934.)
The checks on this page confirm it for this size by computing it; a general proof that the greedy rule never gets stuck too early takes more work.
Other stacks, and the graph behind them
Our pattern is not the only one. Episode 19 builds a different sixteen-position cycle, 0000 1001 1010 1111, by walking an Euler tour through a graph whose eight vertices are the three-bit contexts and whose sixteen edges are the four-bit words. With the same next-club, next-heart rule it becomes the packet A♣ 2♣ 3♣ 4♣ A♥ 5♣ 6♣ 2♥ 3♥ 7♣ 4♥ 8♣ 5♥ 6♥ 7♥ 8♥, and the report 0001 then names 2♣ 3♣ 4♣ A♥. Try it in the challenge’s build mode. This cycle also comes from the mirror-image greedy rule, “prefer black”: start with four reds and take a black whenever it gives a new window. That gives 1111 0000 1001 1010, the same cycle read from a different start. It is often called the Ford sequence, the de Bruijn cycle that comes first in dictionary order.
The graph story, with its proof that such a tour always exists, is told on the companion page Five Colours, Five Cards, which uses thirty-two cards and five-colour windows.
Decoding without a sheet
For the thirty-two-card packet, Diaconis and Graham replace the sheet with two short rules. First, read the five bits as a card: two suit bits (00 clubs, 01 spades, 10 diamonds, 11 hearts) and three rank bits (001 is an ace, … , 111 is a seven, and 000 means eight). So 01001 is the ace of spades. Second, get the next window by a shift: abcde becomes bcde followed by (a XOR c), which appends 1 when a and c differ and 0 when they agree.
Starting from 01001, the rule gives 10010, then 00101, 01011 and 10110; those five words name A♠ 2♦ 5♣ 3♠ 6♦. Applied by itself, the rule visits the thirty-one nonzero words and leaves 00000 fixed, so the full thirty-two-card packet needs one explicit patch: 10000 goes to 00000, and 00000 goes to 00001.
Our sixteen-card stack was built by the next-club, next-heart rule instead, so its names are not the binary words themselves. At sixteen rows, the sheet is the simpler tool.
A design review for any colour-window trick
Write down four things. What is hidden: the starting place in a known circle. Which actions are allowed: straight cuts only. What is observed: four colours in dealing order. What decodes it: the sheet. Then check every allowed case, not a few impressive ones.
Counting gives a necessary condition: sixteen starting places need at least sixteen possible reports, and four colours give exactly 2 × 2 × 2 × 2 = 16. Counting is not sufficient; the challenge’s damaged packets have the right count and still collide. And colour and identity are separate layers: a sheet can be wrong even when every colour window is unique.
Sources
Colm Mulcahy, Mathematical Card Magic: Fifty-Two New Effects, printed pp. 252–256. The colour-pattern effect is adapted here to one sixteen-card cycle, with the colours complemented to keep this course’s convention of black = 0, red = 1. Mulcahy’s presentation can repeat the sixteen-card cycle inside a larger packet.
Persi Diaconis and Ron Graham, Magical Mathematics, Chapter 2: the Euler-tour construction (printed pp. 20–24) and the shift-register decoder (pp. 26–29). The cycles are named after N. G. de Bruijn.