63. Pi Day Magic

class: tweener| impressiveness: 5/5| factors: math, presentation | requires: calculator | watch full episode

Audio Commentary:

(00:01:30)

James Grime is a freakin’ wizard. He’s the mathematician from Cambridge University who calculated the true odds in the “Playing the Odds” chapter, and a couple of years ago he came to me with an idea to celebrate Pi Day by performing the biggest interactive magic trick I’d ever seen. Pi Day (March 14th, or 3/14 — get it?) is an all-around geeky “holiday” popular on the internet, and it seemed like the perfect event to attempt a math-related, internet-based magic trick.

With the help of some programmer friends, James developed a script that controlled our twitter accounts and allowed us to perform the trick individually for thousands of people worldwide, all day long. It was a total blast, and the trick is a real fooler. James mentioned that he’s been able to fool countless math professors with it, and it only requires a calculator. You can perform it in person, over the phone, or (as we did) even over twitter.

The Setup: Have your friend grab a calculator and start multiplying random single digits together. Have him multiply as many digits as he wants, the more random the numbers, the better. Make a string something like 6 x 2 x 3 x 7 x 4 x 8 x 2 x 9 x 3… and so on. Have him stop once he’s made a 7-, 8-, or 9-digit number somewhere between one million and one billion.

From this gigantic number, have him choose any single digit to be his “secret” number. That’s the one you’re going to try to figure out. Amazingly, even though you had no idea what numbers he multiplied and no idea what his final gigantic number was… all you need to hear are all the digits except his secret number, and you’ll be able to guess it correctly.

The Math: This sounds absolutely impossible, and when James performed it on me I was completely stunned. The key to this trick is to emphasize the randomness of the single digits they choose multiply. The trick won’t work if somebody just keeps multiplying 7’s repeatedly, so make sure to specifically mention that they need to use a lot of different numbers when they multiply.

The odds are, as they keep multiplying random numbers, sooner or later they’ll hit a multiple of 9. Once they do, no matter what they choose to multiply afterward, the result will also be a multiple of 9. And there are some tricky things you can do with multiples of 9.

One property of multiples of 9 is that all of the digits that make up the number will always add up to be a multiple of 9. Look at a few examples:

It even works with really, really big multiples of 9:


So if you’re given all the numbers except their secret number, you can figure out their secret number by adding up all the other digits and calculating how much more you’d need to add to reach a multiple of 9.

Let’s take the number we created above, 1,693,440. If your mark selected “6” as his secret number, he’d tell you all the other digits, and you’d add up 1 + 9 + 3 + 4 + 4 + 0 to get 21. The next-highest multiple of 9 is 27, so you’d subtract 21 from 27 to get his secret number: 6.

Another example, just for practice: I’ve got a secret number, but all the other digits are 4, 3, 4, 5, 6, and 0. If you add them together, 4 + 3 + 4 + 5 + 6 + 0 = 22. 27 is the next highest multiple of 9, so 27 – 22 = 5, my secret number.

“But what if they don’t hit 9 when they’re multiplying random numbers?”

Incredibly, the trick will probably still work! They might miss 9, but as long they hit 3 twice, you’ll still be in multiples of 9. Just make sure to emphasize that they use as many different numbers as they can to make their number as unpredictable as possible.

One special case: The only time the trick hits a snag is when you add up all the digits and discover the sum is already a multiple of 9. When this happens, it means their secret digit is either a 0 or 9. I’ll usually handle this by saying “Hmm… this is a tough one… it’s definitely a 0 or a 9…” As I say this, I’ll pay careful attention to their expression. Often times, they’ll react right as I say their number. If they don’t give any reaction, I’ll make an educated guess based on the other digits. If the digits are 2 7 0 0 0 0 0, then I’ll guess their secret number is also a 0. If the digits are 3 9 1 1 0 4 0, then I’ll be more likely to guess 9.