My wife showed me a puzzling card magic trick from @jeremytanmagic that she was recommended in her Instagram feed. I can’t find the link to the specific reel, so I’ll add it in if I do.
At first, I was immediately convinced that the trick involved some sleight of hand, and couldn’t be done by directly following the instructions given. It felt like with the shuffling and “randomness” introduced in the particular way of flipping cards in Step 3, there couldn’t be any way to guarantee that the four aces would turn up the way they do. But my wife persisted in trying the trick out herself, and lo and behold — it worked. I was quite stumped, and resolved to figure out how.
Doing the trick
Here’s a textual description of the magic trick, though watching the original is probably a better way to understand what to do.
Take the 4 aces and 12 of any other cards from a standard 52-card playing deck.
In the 16-card deck, orient the aces face-up, and the rest of the cards face-down.
Shuffle the deck without changing the orientation of the cards.
Deal the cards one at a time into a new pile, while alternating between dealing them as is and flipping them. So deal, deal and flip, deal, deal and flip, etc. until you’ve dealt all 16 cards into a new deck.
Repeat the process, but now deal two cards at a time and allow the audience to choose whether to deal the pair as is or flip it before dealing.
Lay the cards out in a $4 \times 4$ pattern as follows, with the first card in the deck numbered “1”, the second numbered “2” and so on.
Now allow the audience to choose between the left or top edge to “fold in”. For example, if they choose the left edge, for every pile of cards (currently just a single card) in the first column, you flip it onto its neighbor. So card 1 gets flipped onto card 2, card 8 flipped onto card 7 and so on. For a row flip, you’d flip 1 onto 8, 2 onto 7 and so on. Keep this process going until all cards have been folded into the bottom-right corner, leaving only one pile left.
Going through the deck now, you can reveal to your audience that despite the seemingly arbitrary flipping and reordering, the orientation of the cards is back to having the aces facing one way and the rest of the cards facing the other.
How it works
The key to the trick is in thinking of each card in terms of the parity of its orientation, and in examining how each operation alters it. Think of the parity of a card as being whether it is face-up or face-down. The way the trick works is that all the operations together end up flipping the parity of the two groups, so they end up with the opposite parities at the end, despite the seemingly arbitrary shuffling.
The boustrophedon layout of the cards in Step 6 also works such that Steps 4 and 7 preserve the parity of the anti-diagonals. It is helpful to use the layout to visualize the mechanism of the trick, despite the actual layout happening only in Step 6.
Steps 1—3 simply are the setup. At this point, all aces have odd parity (face-up), and other cards have even parity.
The layout used in Step 6, numbered in deal order. The snake path means cards that are adjacent in the deck are adjacent on the board.
Step 4 flips the parity of the anti-diagonals due to the boustrophedon layout. Notice how the anti-diagonals alternate between odd and even parity. This step also ensures every pair of cards has one flipped and one unflipped card, which will become relevant in Step 5.
The board’s anti-diagonals (running bottom-left to top-right) alternate parity, splitting the cells into two colours.
After Step 4. The flipped cards are exactly one colour of the board — the cells where row + column is even.
In Step 5, not flipping a pair preserves parity, while flipping a pair inverts parity but also swaps the cards. This means that despite whatever the audience chooses, the original parity of the position is preserved. If we assume all pairs were flipped:
After Step 5, assuming every pair was flipped. The two cards in each pair swap places, but each cell keeps its orientation, so the pattern matches Step 4 whatever the audience chooses.
Step 6 simply lays out the cards in the boustrophedon layout for the audience.
Step 7 flips each row or column until it reaches the bottom-right corner.
Step 7 folds the columns in to the right and the rows in downward, collapsing every card onto the bottom-right cell.
In essence, every card has its parity flipped a number of times equal to its Manhattan distance from the bottom-right. For a $4 \times 4$ grid, the distances are:
Each card is turned over once for every fold that reaches it — its Manhattan distance to the corner. Cells at an odd distance (shaded) finish flipped.
Notice that anti-diagonals alternate between even and odd parity. A cell with an even number of flips will retain its original parity, while a cell with an odd number of flips will flip its parity. The net effect is that the odd-parity anti-diagonals go through an odd number of flips (and flip their parity), while the even-parity anti-diagonals go through an even number of flips (and retain their parity).
After Step 7, every cell is shaded: each card was flipped exactly once, in Step 4 or in Step 7. Both groups end up with their parity inverted, but still opposite each other.
Thus, despite all the operations, we’re back to the (roughly) original state of parity, where the aces have one kind of parity and the other cards have the opposite. The actual parity ends up getting flipped for both sets of cards, which can be easily remedied while making the final reveal to your audience.
The Python script here can be used to simulate the entire trick with audience preferences to verify it works. Run it with:
| |
Of course, nothing about the trick is specific to aces. It could have been done with any other card group.
Another explanation of the trick is provided by the mathemagician Dr. Arthur Benjamin here.