Royal Hummer
Royal Hummer
Most of the playables here were made with help from a bunch of LLMs from within Windsurf. I mostly used Claude 3.7 without thinking, but frequently also appealed to Gemini, GPT-4o and Deepseek. Any bugs in the implementations here are very likely prompting error :) Please leave a comment if you find an issue, or if you have any suggestions! The interactives are best viewed on desktop and are not particularly optimized for mobile.
In the opening trick of the book, we work with four cards, let’s call them A,B,C,D. Stack them up in your hand, all cards face-down, make note of the bottom card (say X
), and perform the following steps:
INIT.
Push the top card to the bottom and flip the top card.CUT AND FLIP TWO.
Take the top two cards and flip them over. Give the deck a cut anywhere you like. Repeat this step as many times as you want.FINAL.
Flip the top card to the bottom, take the next card to the bottom and flip the top card.
The outcome: the card X
faces one way and all other cards face the other way, no matter how many times step 2 is executed. Try this below!
The trick is known as Baby Hummer in magic circles. It was invented by magician Charles Hudson as a variation on an original trick by a truly eccentric genius named Bob Hummer.
Why does this work?
Let’s consider what happens with a stack of ten initially face-down cards when we repeatedly apply the CUT-AND-FLIP-2 action.
Number of face up cards at odd positions: 5
Number of face up cards at even positions: 5
Note that the number of face up cards at odd positions and even positions remain equal after each action, assuming that we start with all cards face up. Why?
Assume that the claim is true after 0
to denote a face down state and 1
to denote a face up state, there are four possible scenarios:
00
->11
01
->01
10
->10
11
->00
In cases (2) and (3), the number of face up cards at odd positions and even positions remains the same as before. In case (1), the number of face up cards at odd positions increases by one and the number of face up cards at even positions also increases by one. In case (4), the number of face up cards at odd positions decreases by one and the number of face up cards at even positions also decreases by one. Thus equality is maintained.
Now we turn to the cut: depending on where we cut, either every card that was in a even position before remains in an even position and every card that was in an odd position before remains in an odd position; or every card that was in an even position before moves to an odd position and every card that was in an odd position before moves to an even position. In both cases, equality is evidently maintained.
You can extend this argument to scenarios where the start state has a difference in the number of face up cards in even and odd positions, and conclude that CATO operations will always maintain the difference.
A very natural question to ask is what patterns/configurations are reachable from, say, the identity permutation with all cards face up, using only CATO operations.
Suppose we have a pattern 0
denoting a face-down state and 1
denoting a face-up state).
For each position
We state this claim here without proof. The games below let you get some practice with CATO operations!
Food for thought: what if the starting permutation was different? Do you gain additional reacahable permutations if you are allowed to flip any even number of cards?
I hope you have fun with the games below, where you’re given a target pattern to achieve using only CATO operations :)