Share |

Friday, April 9, 2010

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!

Counting in Binary:

Math Telepathy

This is a stunning magic performed by the computer.

Follow the instructions. In the process you will be requested to compute the difference of two natural numbers (although on second thought, the omission of the decimal point appears not at all important.) See that you do not make a silly mistake. The magic fails in the face of ill preparedness. (As is well known in the magic circles, if a spell may go wrong, it will.) So, if you wish, you can use a calculator to compute that difference. In any event, it may be a good idea to double check your result.

Number Guessing Game

In this simple game, your computer does all the work. You only have to press one of the buttons, "Yes" or "No". This is how you play. At the beginning (or after pressing "Reset"), you think of a positive integer less than 100. At any time, the computer will display a set of numbers. In response, press either "Yes" or "No" depending on whether your number is on the screen or not. After a while the computer will guess your number. See for yourself.

Calendar Magic

With the second button on the left reading "Set", drag the cursor inside the table and select a square array of dates. Once you are satisfied with your selection, click the button. The label will change to "Play". While playing pick up dates inside the select area. One in each row and in each column. Sum up selected dates. The sum that also appears in the lower right corner does not depend on selection of dates inside the square but only on the square itself. See if you can verify or even prove this.

Arithmetic Magic Matrix

Select exactly one square in every row and in every column and check that the sum (or the product) of numbers in the selected squares does not depend on your selections. Can you explain why? How are these tables constructed? Try small sizes, 2×2, 3×3, etc.

Two Numbers Guessing Game

As you might have noticed, the two numbers of which you are asked to select one, always have different parities: one is always even, the other is always odd. You are also asked to multiply one of them by an even number, the other by an odd number. It's always the case that one of the products is even. The other may be either even or odd. In the former case, the sum of two products is even, in the latter case it's odd. Checking the parity of the sum, I can immediately tell which number you selected.

Barcode Magic

The ubiquitous barcodes serve as the basis for the following computer magic. The applet below is made to represent the standard barcode representation of the UPC-A codse . This is something that is commonly (and not quite correctly) referred to as the barcode. Do the following: pick up a product. It could be a bottle of Cola, an ice cream pack, or anything else with an UPC-A code and a barcode on it. Initially the applet displays 12 question marks. By clicking on them you can upgrade each to any decimal digit. Do this with 11 digits and leave one question mark. Press the "Check" button. The computer will announce the missing digit.

Magic in a Square

N2 numbers are arranged in a square pattern. Select one of the numbers and try answering computer queries. After two attempts, computer will reveal your selected number.

An Arithmetic Magic Trick

Think of a 2-digit integer. Subtract from the number the sum of its digits and find the result in the table below. Note that each cell of the table contains a number and a geometric shape. Concentrate hard on the shape that shares a cell with the result of your calculations. When ready, press the "Check it!" button ...