# 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 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.

# 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 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.

# 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.

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:

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.

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.

P.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.

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:

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.

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.

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.)

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

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

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

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

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.

# My Mathematical Magic Show: Part 7

This mathematical trick, which may well be the best mathematical magic trick ever devised, was not part of my Pi Day magic show. However, it should have been. Here’s a description of the trick, modified from the description at http://mathoverflow.net/questions/20667/generalization-of-finch-cheneys-5-card-trick:

The magician walks out of the room. A volunteer from the crowd chooses any five cards at random from a deck, and hands them to your assistant so that nobody else can see them. The assistant glances at them briefly and hands one card back, which the volunteer then places face down on the table to one side. The assistant quickly place the remaining four cards face up on the table, in a row from left to right. After all of this is completed, the magician re-enters the room, inspects the faces of the four cards, and promptly names the hidden fifth card.

In turns out that the trick is a clever application of permutations (there are $3! = 6$ possible ways of ordering 3 objects) and the pigeon-hole principle (if each object belongs to one of four categories and there are five objects, then at least two objects must belong to the same category). These principles from discrete mathematics (specifically, combinatorics) make possible the Fitch-Cheney 5-Card Trick.

Unlike the other tricks in this series, the Fitch-Cheney 5-Card Trick requires a well-trained assistant (or a smartphone app that plays the role of the assistant).

A great description of how this trick works can be found at Math With Bad Drawings. For a deeper look at some of the mathematics behind this trick, I give the following references:

# My Mathematical Magic Show: Part 6

Last March, on Pi Day (March 14, 2015), I put together a mathematical magic show for the Pi Day festivities at our local library, compiling various tricks that I teach to our future secondary teachers. I was expecting an audience of junior-high and high school students but ended up with an audience of elementary school students (and their parents). Still, I thought that this might be of general interest, and so I’ll present these tricks as well as the explanations for these tricks in this series. From start to finish, this mathematical magic show took me about 50-55 minutes to complete. None of the tricks in this routine are original to me; I learned each of these tricks from somebody else.

After presenting four different but thoroughly impressive mathematical magic tricks (including the explanations for each trick as well as a chance for a child in the audience to present the trick for themselves) over the past 50-55 minutes, I have now reached the climatic end of my routine.

Here’s the patter for my grand finale. I got this trick from a book of card tricks that my parents bought me when I was a boy. (The book remains one of my prized possessions from my childhood.) This trick requires an ordinary deck of playing cards — preferably a newly purchased, sealed, and unused deck of cards.

It’s now time for the final magic trick of the show. And every magic act has to include a magic trick involving… a deck of cards.

Now, when most magicians perform a magic trick, they have a deck of cards that are pre-arranged in a certain order. But I am not like most magicians. (I hand the deck to someone.) Here, please take the deck of cards and shuffle it a few times. (He shuffles the deck and gives it back to me.)

Now, when most magicians perform a magic trick, they have a confederate in the audience who helps me cheat by shuffling the deck in a certain way. (Laughter.) But I am not like most magicians. (I hand the deck to someone else.) Here, please take the deck and shuffle it a few more times. (She shuffles the deck some more and gives it back to me.)

Now, when most magicians perform a magic trick, they ask someone in the audience to take a card from a certain spot in the deck. But I am not like most magicians. (I hand the deck to a third person.) Here, please choose a card from anywhere in the deck, and show it to everyone. (The third person picks a card and shows it to everyone except me.)

Now, when most magicians perform a magic trick, they have the card returned to a certain spot in the deck. But…

(And the audience invariably says, “You are not like most magicians!”)

Oh, you’ve seen this trick before?

That’s right, I’m not like most magicians. So don’t return that card to a certain spot in the deck. Instead, place it anywhere in the middle you want. (The third person places the card back in the deck.)

Now, when most magicians perform a magic trick, they’ll do something special to the deck so that the card pops out. But I am not like most magicians. Take the deck, and shuffle it again, and then give me back the deck. (The third person shuffles the deck and returns it to me.)

Now, when most magicians perform a magic trick, they search through the deck to find the selected card. But I am not like most magicians. So I will place the deck behind my back and select your card.

(I place the deck behind my back, wait about 10 seconds as if I’m trying to find the card, select a card, and then show it to the audience with complete and utter confidence that I’ve found the right card.)

At this point in the routine, there is one chance in 52 that I drew the correct card. If that happens to happen, then I would take a deep bow and end the show. If someone asks how I did it, I would explain that magicians have to keep some tricks a secret.

However, I’ve performed this trick dozens of times over the last 30 years, and I have yet to select the correct card even once. So, in the highly likely event that I pull the wrong card, the audience will say something like, “No, that’s not it.” I turn to the audience with a straight face, shrug my shoulders, and say,

And that’s the end of the show as the audience howls in laughter.

It’s really important to perform this “trick” after performing several real magic tricks. Indeed, after seeing a few highly impressive mathematical magic tricks, the audience is expecting me to pull out the right card, and the deliberately repetitive patter above builds the tension in the room as the audience tries to figure out how on earth I’m going to pull out the correct card from a thoroughly shuffled deck.

It’s also important to get in touch with my inner Bud Abbott or Super Dave Osborne or any of the legendary straight men of comedy, as I can’t so much as smile during the routine lest I give away the joke.

If anyone complains, I explain that this was a mathematical magic trick… after all, the probability of me pulling the correct card is $\displaystyle \frac{1}{52}$.

# My Mathematical Magic Show: Part 5d

Last March, on Pi Day (March 14, 2015), I put together a mathematical magic show for the Pi Day festivities at our local library, compiling various tricks that I teach to our future secondary teachers. I was expecting an audience of junior-high and high school students but ended up with an audience of elementary school students (and their parents). Still, I thought that this might be of general interest, and so I’ll present these tricks as well as the explanations for these tricks in this series. From start to finish, this mathematical magic show took me about 50-55 minutes to complete. None of the tricks in this routine are original to me; I learned each of these tricks from somebody else.

Though this wasn’t part of my Pi Day magic show, I recently read an interesting variant on my fourth trick. The next time I do a mathematical show, I’ll do this trick next — not to amaze and stun my audience, but to see if my audience can figure out why it works. Each member of the audience will need to have a calculator (a basic four-function calculator will suffice). Here’s the patter:

I want you to take out your calculator. Using only the digits 1 through 9, there are three rows, three columns, and two diagonals. I want you to pick either a row, a column, or a diagonal. Then I want you to enter a three digit number using those numbers. For example, if you chose the first row, you can enter 123 or 312 or 231 or any three-digit number using each digit once.

Now, I want you to multiply this number by another three-digit number. So hit the times button.

(pause)

Now, choose another row, column, or diagonal and type in another three-digit number, using each of the three digits once.

(pause)

Now hit the equals button to multiply those two numbers together.

(pause)

Is everyone done? The product you just computed should have either five or six digits. I want you to concentrate on one of those digits. Just make sure that you concentrate on a digit other than zero, because zero is boring. So concentrate on a nonzero digit.

(pause)

(I point to someone.) Without telling me the digit you chose, please tell me the other digits in your product.

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

Then I’ll turn to someone else and ask which numbers were not scratched out. She’ll say something like, “1, 1, 9, 7, and 2.” I’ll answer, “The number you chose was 7.”

And then I’ll repeat this a few times, and everyone’s amazed that I knew the different numbers that were chosen.

Clearly this works using the same logic as my fourth magic trick: the product is always a multiple of 9, and so I can add the digits to figure out the missing digit. The more interesting question is: Why is the product always a multiple of 9?

This works because each of the factors of the product is a multiple of 3. Let’s take another look at the calculator.

If the first row is chosen, the sum of the digits is 1+2+3 = 6, a multiple of 3. And it doesn’t matter if the number is 123 or 312 or 231… the order of the digits is unimportant.

If the second row is chosen, the sum of the digits is 4+5+6 = 15, a multiple of 3.

If the third row is chosen, the sum of the digits is 7+8+9 = 24, a multiple of 3.

If the first column is chosen the sum of the digits is 1+4+7=12, a multiple of 3.

If the second column is chosen, the sum of the digits is 2+5+8 = 15, a multiple of 3.

If the third column is chosen, the sum of the digits is 3+6+9 = 18, a multiple of 3.

If one diagonal is chosen, the sum of the digits is 1+5+9 = 15, a multiple of 3.

If the other diagonal is chosen, the sum of the digits is 3+5+7 = 15, a multiple of 3.

This can be stated more succinctly using algebra. The digits in each row, column, and diagonal form an arithmetic sequence. For each row, the common difference is 1. For each column, the common difference is 3. And for a diagonal, the common difference is either 2 or 4. If I let $a$ be the first term in the sequence and let $d$ be the common difference, then the three digits are $a$, $a + d$, and $a + 2d$, and their sum is

$a + (a+d) + (a+ 2d) = 3a + 3d = 3(a+d)$,

which is a multiple of 3. (Indeed, the sum is 3 times the middle number.)

So each factor is a multiple of 3. That means the product has to be a multiple of $9$. In other words, if the first factor is $3m$ and the second factor is $3n$, where $m$ and $n$ are integers, their product is equal to

$(3m)(3n) = 9(mn)$,

which is clearly a multiple of 9. Therefore, I can use the same adding-the-digits trick to identify the missing digit.

# My Mathematical Magic Show: Part 5c

Last March, on Pi Day (March 14, 2015), I put together a mathematical magic show for the Pi Day festivities at our local library, compiling various tricks that I teach to our future secondary teachers. I was expecting an audience of junior-high and high school students but ended up with an audience of elementary school students (and their parents). Still, I thought that this might be of general interest, and so I’ll present these tricks as well as the explanations for these tricks in this series. From start to finish, this mathematical magic show took me about 50-55 minutes to complete. None of the tricks in this routine are original to me; I learned each of these tricks from somebody else.

Though this wasn’t part of my Pi Day magic show, I recently read an interesting variant on my fourth trick. The next time I do a mathematical show, I’ll do this trick next — not to amaze and stun my audience, but to see if my audience can figure out why it works. Each member of the audience will need to have a calculator (a basic four-function calculator will suffice). Here’s the patter:

I want you to take out your calculator. Using only the digits 1 through 9, there are three rows, three columns, and two diagonals. I want you to pick either a row, a column, or a diagonal. Then I want you to enter a three digit number using those numbers. For example, if you chose the first row, you can enter 123 or 312 or 231 or any three-digit number using each digit once.

Now, I want you to multiply this number by another three-digit number. So hit the times button.

(pause)

Now, choose another row, column, or diagonal and type in another three-digit number, using each of the three digits once.

(pause)

Now hit the equals button to multiply those two numbers together.

(pause)

Is everyone done? The product you just computed should have either five or six digits. I want you to concentrate on one of those digits. Just make sure that you concentrate on a digit other than zero, because zero is boring. So concentrate on a nonzero digit.

(pause)

(I point to someone.) Without telling me the digit you chose, please tell me the other digits in your product.

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

Then I’ll turn to someone else and ask which numbers were not scratched out. She’ll say something like, “1, 1, 9, 7, and 2.” I’ll answer, “The number you chose was 7.”

And then I’ll repeat this a few times, and everyone’s amazed that I knew the different numbers that were chosen.

Clearly this works using the same logic as yesterday’s post: the product is always a multiple of 9, and so I can add the digits to figure out the missing digit. The more interesting question is: Why is the product always a multiple of 9? I’ll address this in tomorrow’s post.