# Card Tricks: Hummer’s 1-2-3 Trick

Who doesn’t love a good card trick? Many card tricks rely on math and can be a way to demonstrate mathematical concepts, or they can just be a fun way to amaze your friends. Here’s one that was invented by Bob Hummer.

This trick illustrates the concept of permutations. A permutation is basically the order of arrangement in a set. For the set {1,2,3}, there are 6 possible permutations: {1,2,3}, {1,3,2}, {2,1,3}, {2,3,1}, {3,1,2}, and {3,2,1}. In the first step of the trick, the magician asks the volunteer to make an unknown transposition, which is when you swap one element with another. For example, transposing 1 with 3 in {1,2,3} gives {3,2,1}.

Procedure:

1. Place an ace, 2, and 3 on the table as shown above. (You can use any three cards, but it is easiest to remember 1,2,3.)
2. Turn your back and ask your friend to choose one of the cards without telling you, remember what it is, and flip it over. Then ask your friend switch the positions of the 2 remaining cards and flip those over.
3. Now, pick up the cards in this order: left card on the bottom, middle card in the middle, right card on the top.
4. “Shuffle” the cards, by moving top cards to the bottom 1 or 2 cards at a time. Stop when you have moved 4, 7, or 10 cards from the top to the bottom.
5. Place the cards facedown on the table in this order: top card in the middle, next card on the right, and last card on the left.
6. Imagine the cards in the reverse order as the original positions (3, 2, 1).
7. Have the friend guess which card is theirs and flip it over, but not tell you whether they are right or not.
8. If the card is in the expected position (i.e., they flip over the first card and it is the 3), you know they picked the correct card and you can say “Congratulations!”
9. If the card your friend flips is not in the expected position, it must have been one of the switched cards. This card, and the card in the place you would have expected the flipped card to be in, are not the correct cards. For example, if they flip over the first card and it is the ace, this card and the 3rd card (the expected position of the ace) are not the correct cards. (Remember, the cards should be in reverse order at this point.) So, flip the 2nd Say, “I think you were looking for this one.”

This trick works because you are picking up the cards in a way that reverses their order, which is equivalent to the transposing 1 and 3. By revealing one the cards allows, you can determine which two cards were switched by your friend.

# Rubik’s Cube Math

Over the Christmas break, while on vacation with extended family, my son learned how to solve the Rubik’s Cube (a.k.a. magic cube) from his older cousin. He became somewhat obsessed and worked on it until he could solve it himself. One of the things he told me when he got his new cube was, “Mom, the colors can be arranged in over 43 quintillion ways!” This is why it is so hard to solve; there are too many different permutations. You’d never land on the solution by randomly turning the sides. The number of permutations is calculated with the equation:

The first term, 8!, comes from the fact that there are 8! (read 8 factorial) ways to arrange the 8 corner “cubies” (8! = 8 x 7 x 6 x 5 x 4 x 3 x 2 x 1). The next term is 37, because there are 3 colors on a corner cubie and 7 of the corners can be oriented independently. (“Oriented” differs from “arranged” in that arranged refers to moving a cubies to different locations on the cube, while oriented refers to the cubie being at the same corner but rotated to show a different color on top.) The orientation of the eighth cubie depends on the preceding seven. The next term, 12!, is the number of ways to arrange the edges. This term must be divided by 2 because it is an even permutation. Eleven edge cubies (with 2 colors each) can be flipped independently, with 12th depending on the preceding ones, giving 211.

If you are interested in a more in-depth explanation, there is a powerpoint presentation here, and paper here.

Most people solve the Rubik’s cube by memorizing sequences of moves called “algorithms”. In mathematics, the term algorithm means a step-by-step procedure for calculations. Many algorithms, especially those used later in the solution, are designed to move a cubie to a specific spot without moving parts of the cube that have already been moved into place. If you are interested in learning basic algorithms for solving the cube, there is a solving guide available at Rubiks.com. People into “speedcubing” learn algorithms that make it possible to solve the cube in fewer moves, but requires learning more algorithms used with specific patterns on the cube.

Puzzles like the Rubik’s Cube can also be investigated through mathematical group theory. Group theory is the study of the algebraic  structures called groups. A group is a set of elements together with an operation that combines any two of its elements to form a third element also in the set while satisfying the group axioms (these are closure, associativity, identity and invertibility). For example, the set of integers together with the addition operation; the addition of any two integers forms another integer. The Rubik’s group is the group corresponding to possible moves.