# Magic trick based on deep mathematics

I am interested in magic tricks whose explanation requires deep mathematics. The trick should be one that would actually appeal to a layman. An example is the following: the magician asks Alice to choose two integers between 1 and 50 and add them. Then add the largest two of the three integers at hand. Then add the largest two again. Repeat this around ten times. Alice tells the magician her final number $n$. The magician then tells Alice the next number. This is done by computing $(1.61803398\cdots) n$ and rounding to the nearest integer. The explanation is beyond the comprehension of a random mathematical layperson, but for a mathematician it is not very deep. Can anyone do better?

• I am informed that Persi Diaconis is the correct person to answer this question. Dec 26, 2009 at 0:09
• I have discussed this question with Persi. He could not come up with anything significant (though he did not think about it very long). Dec 26, 2009 at 16:30
• I've also heard Persi talk about this subject, and my guess is that he would say that the requirements of "deep mathematics" and "would actually appeal to a layman" are nearly incompatible in practice. Dec 27, 2009 at 13:54
• Whenever I see this question's title, I can hardly resist opening a complementary "Deep mathematics based on magic tricks" community wiki. May 16, 2013 at 7:51
• Isn't it risky to do magic tricks that require a member of the audience to carry out a computation? What do you do if Alice botches the computation?
– bof
Dec 8, 2014 at 7:04

This is a trick that I designed years ago and I have used it in many different occasions for amusement only or educational purpose or both. It is indeed the finial difference method to find a polynomial. Ask the person to write down a polynomial without you knowing the polynomial and even the degree of the polynomial. To keep your life easy, it would be better to keep the degree less than or equal 3. (It wouldn't be hard to let a layman know what a polynomial is just by giving two or three examples). Then you ask for some information that is essentially the value of the polynomial for 0, 1, 2, 3. As soon as you take one of the value you should calculate the difference. And in a few seconds after taking the last information, you announce not only the degree of the polynomial but also the exact polynomial.

Note 1: Finding the degree is a very important part of this trick since it convinces more knowlegable persons that you are not just solving a simultaneous equation quickly.

Note 2: I used this trick in my Calculus classes to give this seemingly paradoxical idea that "if you don't know what the function is, try to figure out how it changes."

Note 3: Of course, one can use it in many different classes for different purposes.

Note 4: I've just search the internet to see if Martin Gardner ever introduced this trick. Damn it! The answer was yes, here: "The calculus of finite differences". However, I still love to keep the credit of telling the degree for my self :)

• It is similar to Shamir's secret sharing: en.wikipedia.org/wiki/Shamir%27s_Secret_Sharing May 15, 2013 at 20:50
• If you instruct the person writing down the polynomial to only use nonnegative coefficients, then in fact two evaluations (at integral points) suffice for you to uniquely infer the polynomial, irrespective of its degree. Aug 12, 2016 at 20:02

My favourite example, the rope and two carabiner trick http://blogs.scientificamerican.com/guest-blog/amazing-rope-trick/

I also offer up my variation of the Dirac belt trick https://m.youtube.com/watch?v=UtdljdoFAwg

Here is a trick much in the spirit of the original number-adding example; moreover I'm sure Richard will appreciate the type of "deep mathematics" involved.

On a rectangular board of a given size $m\times n$, Alice places (in absence of the magician) the numbers $1$ to $mn$ (written on cards) in such a way that rows and columns are increasing but otherwise at random (in math term she chooses a random rectangular standard Young tableau). She also chooses one of the numbers say $k$ and records its place on the board. Now the she removes the number $1$ at the top left and fills the empty square by a "jeu de taquin" sequence of moves (each time the empty square is filled from the right or from below, choosing the smaller candidate to keep rows and columns increasing, and until no candidates are left). This is repeated for the number $2$ (now at the top left) and so forth until $k-1$ is gone and $k$ is at the top left. Now enters the magician, looks at the board briefly, and then points out the original position of $k$ that Alice had recorded. For maximum surprise $k$ should be chosen away from the extremities of the range, and certainly not $1$ or $mn$ whose original positions are obvious.

All the magician needs to do is mentally determine the path the next slide (removing $k$) would take, and apply a central symmetry with respect to the center of the rectangle to the final square of that path.

In fact, the magician could in principle locate the original squares of all remaining numbers (but probably not mentally), simply by continuing to apply jeu de taquin slides. The fact that the tableau shown to the magician determines the original positions of all remaining numbers can be understood from the relatively well known properties of invertibility and confluence of jeu de taquin: one could slide back all remaining numbers to the bottom right corner, choosing the slides in an arbitrary order. However that would be virtually impossible to do mentally. The fact that the described simple method works is based on the less known fact that the Schútzenberger dual of any rectangular tableau can be obtained by negating the entries and applying central symmetry (see the final page of my contribution to the Foata Festschrift).

You may ask the person to encode something by RSA, then you decode it (you have the private key)

OR

To divide two 40-digit integers and give you the decimal result to 100 digits, you then use continued fractions to find the original fraction (reduced)

OR

To compute pq and pr where p,q,r are prime, you then find p,q,r by the Euclidean algorithm (no very deep, but it's the best i've got)

Here's a couple of well-known simple topology tricks:

Tie ends of a long enough piece of rope to your wrists, while wearing a loosely fitting jacket or sweatshirt. With your arms tied like that, take the jacket off your back and put it back on inside out. It's easier to figure out how to do it than to explain it in words, so I'll skip the explanation. The more risque version is to tie the ankles and do the trick with pants.

The other one I haven't tried, but maybe it can be done at a party if you have a stick and some plasticine around.

• The one with the plasticine is more of an exercise for mathematicians to figure out what is wrong with the method. Jul 13, 2010 at 6:37

A variant on Anton Geraschenko answer above- say you are in a fourth grade school that for some reason let these poor kids use calculators. you ask them to pick for themselves a 3 digit number say abc. Tell them to write it twice in their calculator ,i.e., abcabc and then divide by 77. Then by 13. What did you get? do it again with 143 and then by 7? What did you get. again with...

I learnt it from Avraham Arcavi.

• The title is, "Magic trick based on deep mathematics." I don't think that was meant to be taken as "deep to 4th graders." Nov 17, 2010 at 0:05

Destination Unknown is a magic trick that makes use of Combinatorics. It really fools people.

Although one of the answers mentions Kruskal count, I would like to add more about it. Kruskal count not just works in the case of a paragraph as well. If you start from one of the first ten words of a paragraph, go to the word which is away from the previous word by number of words exactly equal to the letters of the previous word, you'll land up on the same word in the end! For more discussion, you can refer this link

• Link seems to have rotted. Nov 27, 2017 at 22:15

Apart from tricks based on numbers, there are topological objects whose properties can seem quite magical, like the Möbius strip or the unknot.

E.g. take a standard page of paper, show that it has two sides (number them with a pen, show that any straight pen path meets a boundary). Next, cut out a long strip from it (not needed of course, but adds to the drama), and ask the audience "and how many sides does this have?". They reply "two". Then you put the the two small ends of the strip together to form a ring and you ask "and now, how many sides?", they still reply "two!". At this point do a little diversion, like putting a pair of scissors on the table saying out loud "I'll use this in a minute". Now do a half-twist with the strip before putting the small ends together and ask again "for the last time people, how many sides?". They answer "twoo!!", and you say "the magic has worked people, there's only one side!" (you show that now the pen paths along the long direction never meet a boundary and come back). Most laymen are quite bemused. Now do two half-twists and ask again, some won't dare an answer...

• I agree that the Mobius strip is magic. But it is not a trick! Dec 28, 2009 at 14:21
• Someone posted something similar earlier, but I guess they deleted it. My complaint was that, while it is perhaps counter-intuitive at first sight, it isn't very deep mathematically. Dec 29, 2009 at 16:10
• Have an assistant cut a cylinder in half along its median circle. Then cut a Mobius strip along its median. Jan 17, 2010 at 23:08
• How is orientability not a deep mathematical concept? Jun 22, 2012 at 11:31

If you are not mathematically inclined, this game can drive you crazy. http://www.transience.com.au/pearl.html

The "casting out nines" sanity check of calculations is dead simple to use (a small child can do it), but the proof requires a deeper knowledge of mathematics (more precisely of arithmetic ; my own students don't have access to it even though they know what series are and can diagonalize matrices!).

• I wouldn't consider "casting out nines" deep mathematics, and it should be relatively easy giving your students access to it, if you wanted. Certainly it would fit well into a first abstract algebra course. Sep 15, 2012 at 12:18
• First, notice I didn't write it was deep mathematics -- I wrote "deepER" ; I explained that it can be used by children, but understanding why it works is more difficult. So I stand by my statement as I wrote it :-) Second, I definitely can't do arithmetic with my students : I'm teaching in a scientific CPGE, so the quotient (syllabus content)/(time to cover it) is already very high [see: en.wikipedia.org/wiki/… -- where they mention the years as "intensive" which is quite an understatement]. Sep 15, 2012 at 18:43
• Don't worry; I noticed. :-) As for the rest, that's too bad. I was thinking that it's something that could be easily explained in a few minutes to a bright and curious youngster during office hours, but maybe those opportunities don't exist for your situation? Sep 16, 2012 at 15:30
• Those opportunities are rare enough that I would like to move on and get back to university... :-/ Sep 16, 2012 at 19:34

Matt Baker's book The Buena Vista Shuffle Club might tick the boxes. He is a math professor and card magician and the book uses a lot of math principles. It's published by Vanishing Inc.

Lay out 21 cards face up in three vertical lines. Have a friend pick out any card without telling you which card he/she has chosen. Have your friend tell you which line of cards the selected card is in, and make three stacks of cards, each stack being made from each line of cards. stack the three stacks on top of each other, placing the stack with the selected card between the other two stacks (IMPORTANT!). lay out the cards again in the exact same set up (3 lines of 7 all face up) but here is the trick: when laying out the cards, flip them face up in a line every time. In other words, don't make one line at a time, but put a card in every line one at a time. Have your friend again tell you which line has the selected card. Stack the cards again, the exact same way you did the first time. One more time, lay out the cards the exact same way as the last time, one card per line, and again have your friend tell you which line has the selected card. Stack all the cards again one last time, again placing the line with the selected card between the other stacked cards. now lay out all the cards face down, one at a time. while you're doing this, remember to count, because the 11th card you place down is the selected card. from this point you can do whatever you can think of to make the trick "magical" and shock your friend by suddenly coming up with his/her card.

Start with a deck of 32 cards. Then the player should take a card and tell a number $n$ between 1 and 32 then you divide the stack in 2 smaller stacks and the player has to tell which of the stacks contains his chosen card. according to a rule dependend on that number you put that stack above or below the other stack. After repeating this 5 times the chosen card should be exactly at position $n$. The rule has to depend on the way you want to deal cards (whether you turn around the deck and start dealing from the bottom, or you deal from the top and turn each single card around or you deal at first and then turn bost stacks around). In one of the cases the rule was take $N-11$, find the representation in the system with base $-2$ and revert that presentation. ($0$ tells you to put the stack containing the chosen card on top, etc.). I dont remeber this trick properly, it should not be too difficult to express the final position depending on the choices in some formula; but it is the only situation I know, in which the $-2$-system is useful.

i was about the to post another trick based on binary encoding in radices (or hamming codes) which has already been posted (see comment as well)

So i will post another one based on cyclic orderings (known also as "The Fitch Cheney Five-Card Trick")

excerpt (from here):

You hand a deck of cards to an audience and tell them to choose any five cards they wish. You collect the ve cards, look at them quickly, and then ask a volunteer to hide one of the cards after showing it to the audience. You place the remaining four cards face up in a line. You then tell someone in the room to go to the door and fetch your partner, who has been waiting outside. You take a seat in the back of the room somewhere out of sight. Your partner enters, takes a look at the four cards displayed, and correctly calls out the hidden card! Applause follows.

• Already here, mathoverflow.net/questions/9754/… Mar 1, 2015 at 4:54
• @GerryMyerson, oops seems i missed it Mar 1, 2015 at 11:55

Requirements for audience: pen, paper, and calculator. You have nothing. Offer the following instructions:

1. Write down a whole number of any size without showing you.
2. Just below it, write the same digits in a mixed up order.
3. Subtract the smaller from the larger, and write down the result.
4. In the resulting number, circle any digit which is not a 0.
5. Ask them to tell you the other digits in the number which are not circled.
6. You tell them the circled digit.

The key of course is that the resulting number in step 3 must be a multiple of 9 (obvious to readers here.) As the audience is reciting the digits in step 5, just keep track of the sum modulo 9. Take the result and subtract from 9 and that is the circled digit (except when the result is 0 then the circled digit is 9.)

• Are you sure that this mathematics is deep? Apr 12, 2019 at 0:56
• Perhaps not by your standards, but in the context of the OP I think it's at least appropriate to mention. "The explanation is beyond the comprehension of a random mathematical layperson, but for a mathematician it is not very deep. Can anyone do better?"
– Matt
Apr 12, 2019 at 13:31