# Binary Numbers Magic Trick

#### Here is a trick that you can do at home.

1. Cut out the 5 cards below. You are now ready to do the trick.
2. Give the 5 cards to a friend, and ask them to pick a secret number between 1 and 31, and to give you back all the cards that have their number on it.
3. You can figure out their secret number by adding together all of the first numbers on the cards they gave back to you. For example, if they gave you back the top and middle card, then their number would be 20, because the first numbers on these cards are 16 and 4, which add up to 20.

#### Why does it work?

Remember how to write the numbers from 1 to 31 in binary? See the chart below if you forgot. The sequence of 1's and 0's in a binary number tell us which powers of 2 add up to make the number. For example, 19 = 16+2+1, so in binary we write 10011.

Now notice that the number 19 appears only on the first, fourth, and fifth cards above. That is, 19 appears on the cards with first numbers 16, 2, and 1, and it does not appear on the cards 8 or 4.

The 5 cards correspond to the powers of 2. The numbers that are on the first card (with "16" as the first number) are the ones that have a "1" in the 16's position when we write it in binary. The numbers on the "8" card are those with a "1" in the 8 position in binary. And so on for the other cards. So, when you add up first numbers on the cards that a "secret" number is on, you are adding up the powers of two that add up to the secret number!