My Mathematical Magic Show: Part 5e

As discussed earlier in this blog, here’s one of my favorite mathematical magic tricks. The trick works best when my audience has access to a calculator (including the calculator on a phone). The patter:

Write down any five-digit number you want. Just make sure that the same digit repeated (not something like 88,888).

(pause)

Now scramble the digits of your number, and write down the new number. Just be sure that any repeated digits appear the same number of times. (For example, if your first number was 14,232, your second number could be 24,231 or 13,422.)

(pause)

Is everyone done? Now subtract the smaller of the two numbers from the bigger, and write down the difference. Use a calculator if you wish.

(pause)

Has everyone written down the difference. Good. Now, pick any nonzero digit in the difference, and scratch it out.

(pause)

(I point to someone.) Which numbers did you not scratch out?

The audience member will say something like, “8, 2, 9, and 6.” To which I’ll reply in three seconds or less, “The number you scratched out was a 2.”

Then I’ll turn to someone else and ask which numbers were not scratched out. She’ll say something like, “3, 2, 0, and 7.” I’ll answer, “You scratched out a 6.”

green line

As discussed in a previous post, the difference found by the audience member must be a multiple of 9. Since the sum of the digits of a multiple of 9 must also be a multiple of 9, the magician can quickly figure out the missing digit. In the previous example, 3+2+0+7=12. Since the next multiple of 9 after 12 is 18, the magician knows that the missing digit is 18-12 = 6.

To speed things up (and to reduce the possibility of a mental arithmetic mistake), the magician doesn’t actually have to add up all of the digits. If the audience member gives a digit of either 0 or 9, then the magician can ignore that digit for purposes of the trick. Likewise, if the magician notices that some subset of the given digits add up to 9, then those digits can be effectively ignored. In the current example, the magician could ignore the 0 and also the 2 and 7 (since 2+7=9). That leaves only the 3, and clearly one needs to add 6 to 3 to get the next multiple of 9.

I was a little curious about how often this happens — how often the magician can get away with these shortcuts to find the missing digits. So I did some programming in Mathematica. Here’s what I found. If the audience starts with a 5-digit number, so that the difference must be some multiple of 9 between 9 and 99,999:

  • There are 690 multiples (out of 11,111, or about 6%) that do not reduce at all (for example, 57,888). So the magician can expect to do the full addition about one-sixth of the time.
  • There are 5535 multiples (about 50%) whose digits can be divided into subsets that sum to 9. So, about half the time, the magician can expect to quickly find the missing digit without having to add past 9.

I’ve put on my mathematical wish-list some kind of theorem about this splitting of digits of multiples of 9s.

My Mathematical Magic Show: Index

I’m doing something that I should have done a long time ago: collecting a series of posts into one single post. The links below show the mathematical magic show that I’ll perform from time to time.

Part 1: Introduction.

Part 2a, Part 2b, and Part 2c: The 1089 trick.

Part 3a, Part 3b, and Part 3c: A geometric magic trick.

Part 4a: Part 4b, Part 4c, and Part 4d: A trick using binary numbers.

Part 5a, Part 5b, Part 5c, and Part 5d: A trick using the rule for checking if a number is a multiple of 9.

Part 7: The Fitch-Cheney card trick, which is perhaps the slickest mathematical card trick ever devised.

Part 8a, Part 8b, and Part 8c: A trick using Pascal’s triangle.

Part 9: Mentally computing n given n^5 if 10 \le n \le 99.

Part 10: A mathematical optical illusion.

Part 11: The 27-card trick, which requires representing numbers in base 3.

Part 6: The Grand Finale.

And, for the sake of completeness, here’s a picture of me just before I performed an abbreviated version of this show for UNT’s Preview Day for high school students thinking about enrolling at my university.

magician

My Mathematical Magic Show: Part 11

A couple years ago, I learned the 27-card trick, which is probably the most popular trick in my current repertoire. In this first video, Matt Parker performs this trick as well as the 49-card trick.

Here’s a quick explanation from the American Mathematical Society for how the magician performs this trick. In short, the magician needs to do some mental arithmetic quickly.

The 27 card trick is based on the ternary number system, sometimes called the base 3 system.

Suppose the volunteer chooses a card and also chooses the number 18. You want to make her chosen card move to the 18th position in the deck, which means you need 17 cards above it. You first need to express 17 in base 3, writing it as a three digit number. For the procedure used in this trick, it’s also handy to write the digits in backward order: 1s digit first, 3s digit second, and 9s digit last. In this backward base 3 notation 17 becomes 221, since 17 = 2×30 + 2×31 + 1×32.

With the understanding that 2 = bottom, 1 = middle, and 0 = top, the number 17 becomes “bottom-bottom-middle.”

Now deal the cards into three piles. The subject identifies the pile containing her card. That pile should be placed at the position indicated by the 1s digit, which is 2, or bottom. After picking up the three piles with the pile containing the chosen card on the bottom, deal the cards a second time into three piles. This time place the pile containing the chosen card in the position indicated by the 3s digit, which is also 2, or bottom. Finally, after placing the pile containing the subject’s card on the bottom, deal the cards into three piles for a third time. When picking up the piles, this time place the pile containing her card in the position indicated by the 9s digit, which is 1, or middle. Deal out 17 cards. The 18th will be her card.

Making a schematic picture of the deck, like Matt does in his second video [below], should convince you that this procedure does precisely what is claimed. But there is no substitute for actually doing it—take 27 cards and try it!

Of course this procedure will work regardless of which position the subject chooses, for her choice is always a number between 1 and 27. This means you need between 0 and 26 cards on top of it, and in base 3 we have 0 = 000 (top-top-top) and 26 = 222 (bottom-bottom-bottom). Every possible position that the subject can choose corresponds to a unique base 3 representation.

In general, if you deal a pack of nk cards into n piles, have the subject identify the pile that contains her card, and repeat this procedure k times, you can place her card at any desired position in the deck. The idea is the same: Subtract one from the desired position number, and convert the result to base n as a k digit number. The ones digit of this number tells you where to place the packet containing her card after the first deal (n – 1 = bottom, 0 = top), and the procedure continues for the remaining deals.

In Mathematics, Magic and Mystery (Dover, 1956), Martin Gardner discusses the long history and many variations of this effect. See Chapter 3, “From Gergonne to Gargantua.”

In this Numberphile video, Matt Parker explains why the trick works.

My Mathematical Magic Show: Part 10

This magic trick is an optical illusion instead of a pure magic trick, but it definitely is a crowd-pleaser. This illusion is called Sugihara’s Impossible Cylinder:

This is actually a mathematical magic trick. As detailed by David Richeson in Math Horizons, there is a fair amount of math that goes into creating this unique shape. He also provided this interacted Geogebra applet as well as a printable pdf file for creating this illusion.

My Mathematical Magic Show: Index

I’m doing something that I should have done a long time ago: collecting a series of posts into one single post. The links below show the mathematical magic show that I’ll perform from time to time.

Part 1: Introduction.

Part 2a, Part 2b, and Part 2c: The 1089 trick.

Part 3a, Part 3b, and Part 3c: A geometric magic trick.

Part 4a: Part 4b, Part 4c, and Part 4d: A trick using binary numbers.

Part 5a, Part 5b, Part 5c, and Part 5d: A trick using the rule for checking if a number is a multiple of 9.

Part 7: The Fitch-Cheney card trick, which is perhaps the slickest mathematical card trick ever devised.

Part 8a, Part 8b, and Part 8c: A trick using Pascal’s triangle.

Part 9: Mentally computing n given n^5 if 10 \le n \le 99.

Part 6: The Grand Finale.

And, for the sake of completeness, here’s a recent picture of me just before I performed an abbreviated version of this show for UNT’s Preview Day for high school students thinking about enrolling at my university.

magician

 

My Mathematical Magic Show: Part 9

This mathematical trick was not part of my Pi Day magic show but probably should have been. I first read about this trick in one of Martin Gardner‘s books when I was a teenager, and it’s amazing how impressive this appears when performed. I particularly enjoy stumping my students with this trick, inviting them to figure out how on earth I pull it off.

Here’s a video of the trick, courtesy of Numberphile:

Summarizing, there’s a way of quickly determining x given the value of x^5 if x is a positive integer less than 100:

  • The ones digit of x will be the ones digit of x^5.
  • The tens digit of x can be obtained by listening to how big x^5 is. This requires a bit of memorization (and I agree with the above video that the hardest ones to quickly determine in a magic show are the ones less than 40^5 and the ones that are slightly larger than a billion):
    • 10: At least 10,000.
    • 20: At least 3 million.
    • 30: At least 24 million.
    • 40: At least 100 million.
    • 50: At least 300 million.
    • 60: At least 750 million.
    • 70: At least 1.6 billion.
    • 80: At least 3.2 billion.
    • 90: At least 5.9 billion.

 

 

 

 

 

 

 

My Mathematical Magic Show: Index

I’m doing something that I should have done a long time ago: collecting a series of posts into one single post. The links below show the mathematical magic show that I’ll perform from time to time.

Part 1: Introduction.

Part 2a, Part 2b, and Part 2c: The 1089 trick.

Part 3a, Part 3b, and Part 3c: A geometric magic trick.

Part 4a: Part 4b, Part 4c, and Part 4d: A trick using binary numbers.

Part 5a, Part 5b, Part 5c, and Part 5d: A trick using the rule for checking if a number is a multiple of 9.

Part 7: The Fitch-Cheney card trick, which is perhaps the slickest mathematical card trick ever devised.

Part 8a, Part 8b, and Part 8c: A trick using Pascal’s triangle.

Part 6: The Grand Finale.

And, for the sake of completeness, here’s a recent picture of me just before I performed an abbreviated version of this show for UNT’s Preview Day for high school students thinking about enrolling at my university.

magician

 

My Mathematical Magic Show: Part 8c

This mathematical trick was not part of my Pi Day magic show but probably should have been… I’ve performed this for my Precalculus classes in the past but flat forgot about it when organizing my Pi Day show. The next time I perform a magic show, I’ll do this one right after the 1089 trick. (I think I learned this trick from a Martin Gardner book when I was young, but I’m not sure about that.)

Here’s a description of the trick. I give my audience a deck of cards and ask them to select six cards between ace and nine (in other words, no tens, jacks, queens, or kings). The card are placed face up, side by side.

After about 5-10 seconds, I secretly write a pull out a card from the deck and place it face down above the others.

 

pascalcardtrick1

I then announce that we’re going to some addition together… with the understanding that I’ll never write down a number larger than 9. For example, the 4 and 6 of spades are next to each other. Obviously, 4+6 = 10, but my rule is that I’m going to write down a number larger than 9. So I’ll subtract 9 whenever necessary: 10-9 = 1. Since 1 corresponds to ace, I place an ace about the 4 and 6 of spades.

Continuing in this way (and having the audience participate in the arithmetic so that this doesn’t get boring), I eventually get to this position:

pascalcardtrick5

Finally, I add the two cards at the top (and, in this case, subtract 9) to get 6+9-9 = 6, and I dramatically turn over the last card to reveal a 6.

pascalcardtrick6

I’ll often perform this trick when teaching Precalculus, as the final answer involving Pascal’s triangle. As discussed yesterday, suppose that the six cards are a, b, c, d, e, and f. Forgetting for now about subtracting by 9, here’s how the triangle unfolds (turning the triangle upside down):

a \qquad \qquad \qquad \quad b \qquad \qquad \qquad \quad c \qquad \qquad \qquad \quad d \qquad \qquad \qquad \quad e \qquad \qquad \qquad \quad f

a+b \qquad \qquad \qquad b+c \qquad \qquad \qquad c+d \qquad \qquad \qquad d+e \qquad \qquad \qquad e+f

a+2b+c \qquad \qquad b+2c+d \qquad \qquad c+2d+e \qquad \qquad d+2e+f

a+3b+3c+d \qquad \quad b+3c+3d+e \qquad \quad c+3d+3e+f

a+4b+6c+4d+e \qquad b+4c+6d+5e+f

a+5b+10c+10d+5e+f

 Not surprisingly, the coefficients in the above chart involve the numbers in Pascal’s triangle. Indeed, the reason that I chose to use 6 cards (as opposed to any other number of cards) is that the bottom row has only 1, 5, and 10 as coefficients, and 10 \equiv 1 (\mod 9). Therefore, the only tricky part of the calculation is multiplying b+e by 5, as the final answer can then be found by adding the remaining four numbers.

My students usually find this to be a clever application of Pascal’s triangle for impressing their friends after class.

green lineP.S. After typing this series, it hit me that it’s really easy to do this trick mod 10 (which means getting rids of only the face cards prior to the trick). All the magician has to do is subtly ensure that the second and fifth cards are both even or both odd, so that b+e is even and hence 5(b+e) is a multiple of 10. Therefore, since 10c+10d is also a multiple of 10, the answer will be just a+f or a+f-10.

(If the magician can’t control the placement of the second and fifth cards so that one is even and one is odd, the answer will be just a+f+5 or a+f-5.)

Henceforth, I’ll be doing this trick mod 10 instead of mod 9.

 

My Mathematical Magic Show: Part 8b

This mathematical trick was not part of my Pi Day magic show but probably should have been… I’ve performed this for my Precalculus classes in the past but flat forgot about it when organizing my Pi Day show. The next time I perform a magic show, I’ll do this one right after the 1089 trick. (I think I learned this trick from a Martin Gardner book when I was young, but I’m not sure about that.)

Here’s a description of the trick. I give my audience a deck of cards and ask them to select six cards between ace and nine (in other words, no tens, jacks, queens, or kings). The card are placed face up, side by side.

After about 5-10 seconds, I secretly write a pull out a card from the deck and place it face down above the others.

 

pascalcardtrick1

I then announce that we’re going to some addition together… with the understanding that I’ll never write down a number larger than 9. For example, the 4 and 6 of spades are next to each other. Obviously, 4+6 = 10, but my rule is that I’m going to write down a number larger than 9. So I’ll subtract 9 whenever necessary: 10-9 = 1. Since 1 corresponds to ace, I place an ace about the 4 and 6 of spades.

Continuing in this way (and having the audience participate in the arithmetic so that this doesn’t get boring), I eventually get to this position:

pascalcardtrick5

Finally, I add the two cards at the top (and, in this case, subtract 9) to get 6+9-9 = 6, and I dramatically turn over the last card to reveal a 6.

pascalcardtrick6

How does this trick work? This is an exercise in modular arithmetic (see also Wikipedia). Suppose that the six cards are a, b, c, d, e, and f. Forgetting for now about subtracting by 9, here’s how the triangle unfolds (turning the triangle upside down):

a \qquad \qquad \qquad \quad b \qquad \qquad \qquad \quad c \qquad \qquad \qquad \quad d \qquad \qquad \qquad \quad e \qquad \qquad \qquad \quad f

a+b \qquad \qquad \qquad b+c \qquad \qquad \qquad c+d \qquad \qquad \qquad d+e \qquad \qquad \qquad e+f

a+2b+c \qquad \qquad b+2c+d \qquad \qquad c+2d+e \qquad \qquad d+2e+f

a+3b+3c+d \qquad \quad b+3c+3d+e \qquad \quad c+3d+3e+f

a+4b+6c+4d+e \qquad b+4c+6d+5e+f

a+5b+10c+10d+5e+f

 Therefore, the top card will simply be a+5b+10c+10d+5e+f minus a multiple of 9.

That’s a pretty big calculation for the magician to do on the spot. Fortunately, 9c + 9d is also a multiple of 9, and so the top card will be

 a+5b+10c+10d+5e+f - (9c + 9d) minus a multiple of 9, or

5(b+e) + a +  c + d +  f minus a multiple of 9.

For the case at hand, b = 6 and e =8, so 5(b+e) = 70. That’s still a big number to keep straight when performing the trick. However, since I’m going to be subtracting 9’s anyway, I can do this faster by replacing the 8 by 8 - 9 = -1. So, for the purposes of the trick, 5(b+e) = 5 \times (6-1) = 25, and I subtract 18 to get 7.

I now add the rest of the cards, subtracting 9 as I go along. For this example, I’d add the 2 first to get 9, which is 0 after subtracting another 9. I then add the remaining cards of 4, 3, and 8 (remembering that the 8 is basically 8-9 = -1, yielding 4+3-1 = 6. So the top card has to be 6.

The key point of this calculation is to subtract 9 whenever possible to keep the numbers small, making it easier to do in your head when performing the trick.

 

My Mathematical Magic Show: Part 8a

This mathematical trick was not part of my Pi Day magic show but probably should have been… I’ve performed this for my Precalculus classes in the past but flat forgot about it when organizing my Pi Day show. The next time I perform a magic show, I’ll do this one right after the 1089 trick. (I think I learned this trick from a Martin Gardner book when I was young, but I’m not sure about that.)

Here’s a description of the trick. I give my audience a deck of cards and ask them to select six cards between ace and nine (in other words, no tens, jacks, queens, or kings). The card are placed face up, side by side.

After about 5-10 seconds, I secretly write a pull out a card from the deck and place it face down above the others.

 

 

pascalcardtrick1

I then announce that we’re going to some addition together… with the understanding that I’ll never write down a number larger than 9. For example, the 4 and 6 of spades are next to each other. Obviously, 4+6 = 10, but my rule is that I’m going to write down a number larger than 9. So I’ll subtract 9 whenever necessary: 10-9 = 1. Since 1 corresponds to ace, I place an ace about the 4 and 6 of spades.

Next, I consider the 6 of spades and 2 of diamonds. Adding, I get 8. That’s less than 9, so I pull an 8 out of the deck.

Next, 2+3 = 5, so I pull out a 5 from the deck.

Next, 8+8=16, and 16-9=7. So I pull out a 7.

(To keep this from getting dry, I have the audience perform the arithmetic with me.)

pascalcardtrick2

On the the next row. The next cards are 1+8 = 9, 8+5-9 = 4, 5+2 =7, and 2+7 = 9.

pascalcardtrick3

On the the next row. The next cards are 9+4-9=4, $latex $4+7-9 = 2$, and 7+9-9 = 7.

pascalcardtrick4

Almost there: 4+2 = 6 and 2+7= 9.

 

pascalcardtrick5

Finally, 6+9-9 = 6, and I dramatically turn over the last card to reveal a 6.

 

pascalcardtrick6

 

Naturally, everyone wonders how I knew what the last card would be without first getting all of the cards in the middle. I’ll discuss this in tomorrow’s post.