Wednesday, January 17, 2007


Number tricks

The other day, a friend sent me to this web site, and asked how it works. The web site has a Flash program that runs through a little animated "I'll tell you what number you picked" thing. To save you the trouble, here's what it does:

Want to let me read your mind?

On a piece of paper, write down a 3 or 4 digit number. Make it completely random with lots of different digits, like 3435 of 6732.

Jumble up all the digits in your number to make another number. So if you chose 4765 you could make 5467.

And now that you have the two numbers, subtract the smaller number from the larger one. Eg. 5467 minus 4765.

OK, now draw a circle around one of the digits in your answer (but don't pick a zero coz that's already a circle). And don't let me see it!

Finally, jumble up all the numbers in your answer and type them in, except for the one you circled. So if your answer was 5560 you could draw a circle around one of the fives and type in 650 or 560.

[You type in the digits and continue.]

So many numbers... [delay]

But you picked... [delay]

This one!

...and, of course, it tells you which digit you'd circled.

It's a simple one, and depends upon an interesting aspect of numbers: any two numbers that are anagrams of each other have the same remainder when you divide them by nine — that is, they're congruent modulo 9. We can see this by observing the technique of “casting out nines”. When you take a number and cast out nines, you add the individual digits of the number to get another number, then you add the digits of that, repeating the process until you have a one-digit number. That number is the remainder upon dividing the original number by 9 (if the number is 9, the remainder is zero — the number is a multiple of 9).

Let's use their example of 4765: 4+7+6+5 = 22. Then 2+2 = 4. And if we divide 4765 by 9, we get 529 with a remainder of 4. But since addition is commutative, it doesn't matter what order the digits are in — the answer will always be 4: 5+4+6+7 = 22; 7+5+6+4 = 22; etc.

Now, modulo arithmetic tells us that if we subtract two numbers that have the same remainder like that — that are congruent modulo <n>, where n=9 in this case, we always get a multiple of <n>. And, indeed, 5467-4765 = 702, and 702 = 9*78.

Going back to the casting out nines technique, since the number we have at this point is a multiple of 9, the sum of its digits must always be a multiple of 9. That's true no matter how many digits the number has; take 3108213, for example: 3+1+0+8+2+1+3 = 18, which is 9*2. So if we take out any of the digits and show you the rest, you can easily see which one we took out: 3+1+0+2+1+3 = 10, so the missing digit has to be 8 to make a multiple of 9. We wouldn't be able to distinguish the removal of a 0 from that of a 9, which is why the instructions found a reason to tell us we mayn't choose the 0.

The delays are in there at the end, of course, just to make it seem like it's doing something hard.

It says to start with a 3 or 4 digit number, which makes it easier on you the first time. But you can try it with a number of any size; it will always work.

1 comment:

Ray said...

"But you can try it with a number of any size; it will always work."

Except for a single digit...