I’ve just heard that our maths theme for this year’s Edinburgh Science Festival is going to be ‘Maths is Magic’. That got me thinking about magic tricks that involve mathematics, and I found out about a really great card trick
.
You will need:
- A normal deck of playing cards
- A lovely assistant
- The ability to memorise 6 things
The trick goes like this. Ask a random member of the public (let’s call him Bob) to choose 5 cards from the deck. Bob can shuffle the deck first if he wishes, and he can pick the cards at random or make a deliberate choice. When he has his 5 cards, ask him to hand them to your lovely assistant. Your assistant will then hand you 4 of the cards, and your job is to correctly predict the 5th.
How is this possible without some sort of secret hint from your assistant? Well, there is going to be a secret hint, and the secret hint is going to be the order in which they hand you the first 4 cards.
If you choose any 5 playing cards, it is inevitable that two of them will have the same suit. One of these will be the card that you will predict, and the other will be the first card that your assistant gives you. So, after the very first card you receive, you already know the suit of the mystery card. This narrows down your prediction to 12 possible cards.
Imagine a clock with 13 numbers on it instead of 12. If I give you any two distinct numbers on the clock, you will be able to get from one to the other in 6 steps or less by travelling clockwise. For example, if I give you the numbers 2 and 7, you can get from 2 to 7 in five steps (obvious). If I give you 2 and 10, you can get from 10 to 2 in five steps too: 10-11-12-13-1-2.
This scenario applies to the two cards of the same suit that Bob chose. Make your assistant choose the ’smaller’ of the two cards to give to you first, i.e. the one from which you can travel around clockwise to get to the other one in 6 steps or less. Now your assistant has 3 cards left in which to convey to you a number between 1 and 6. You will add this number to the first card you were given, calculate the new number using the clock method, and hey presto you will correctly predict the mystery card!
How do we get a number between 1 and 6 using the remaining three cards? Well, if you are given three objects there are 6 different ways of arranging them in a straight line. Order your three cards from smallest to largest by number; if two cards have the same number then we’ll say that the smallest is clubs, followed by diamonds, hearts and then spades (alphabetically). For example, 4♦,8♣,8♥ or J♣,J♦,J♠. So we have a smallest (S), middle (M) and largest (L) card. You’ll need to memorise the following set of combinations:
- S-M-L
- S-L-M
- M-S-L
- M-L-S
- L-S-M
- L-M-S
Thus the order in which your assistant hands you the three cards gives you a number between 1 and 6.
Worked example (from the point of view of the assistant): Suppose Bob chooses the cards 4♥, A♦, K♣, 2♥ and 10♥. First step: identify a suit that occurs twice. In this case it’s hearts. You actually have a choice since there are three cards which are hearts! Pick the smallest two, the 2 and 4. Give the 2♥ to the magician and keep the 4♥ as the mystery card. The magician now knows that the mystery card is a heart and that it is at most six numbers away from the 2. Your job is to communicate that the mystery card is two numbers away from the 2♥. The three remaining cards are A♦ (S), 10♥ (M) ,K♣ (L) . Remembering the code you learnt earlier, you hand the cards to the magician in the order A♦ (S), ,K♣ (L), 10♥ (M). If the magician has learnt the code correctly, he can now confidently say that the last card in the hand is the 4 of hearts.
Bob is flabbergasted by the amazing magical feat you have performed, while you can smile inwardly at the amazing feat of mathematics you have demonstrated.










Now, whenever you have a square matrix you can compute a set of numbers called eigenvalues. These are numbers λ that satisfy the equation Mv=λv, where M is our matrix and v is some vector. (If you would like to learn more about eigenvalues, take a look at the 








