# Mind Reading with Math

**Mind reading** is a puzzle or a game in which the "mathe-magician" is able to figure out the correct answer, either based on a small set of information that the audience provides or sometimes based on no information at all.

Here is a "mind reading" puzzle:

- Pick any positive integer 10 or greater.
- Find the repeated sum of digits.$^*$
- Subtract this from your original number.
- Find the repeated sum of digits$^*$ on this result.
- Now think very hard about what number you have now. I must concentrate to be able to pull this number out of your mind from across the internet.
- Aha! I have it now! It is 9!
$^*$ The repeated sum of digits is obtained by repeatedly summing the digits until a one-digit number is obtained. In some cases, this happens on the first try, but a number like 99 would sum to 18 and then be summed again to 9. No two-digit number should be summed more than twice.

Here's another mind reading:

- Pick any positive integer.
- Double it.
- Add 10.
- Divide by two.
- Subtract the number you started with in Step 1.
- The answer is 5!
The answer will always be half the number that you added in Step 3. In algebra, the steps are as follows:

- $n$
- $2n$
- $2n+10$
- $n+5$
- $5.$

Mind reading games are often based on some mathematical process that always produces a predictable result. The magician uses his or her showmanship to keep the audience engaged in the trick and misdirection to keep the audience from figuring out how the trick works. However, by tracing out the mathematical and logical steps involved in the trick, one can figure out what makes it work.

## Definition

Magicians read minds in the following ways:

- clever mathematics (like very long math operations that return a predictable result)
- common psychological patterns (like using most common associations and trends when guessing what you think)
- reading body language (most people react slightly seeing familiar things, hearing emotionally loaded words or things they want to hear)
- faking or guessing.

But, in this section, we will be dealing with the first way, which is used in famous card tricks and many more. "Mathe-maticians," as the name suggests, rely on the utter immutability and predictability, i.e. mathematics. Unlike other methods, this method gives a $100$% guarantee in its outcome.

Most types of tricks can be done with a little knowledge of high school algebra and a quick manipulation of basic arithmetic. In designing a problem like the one below, no matter what the original number is, you can make it return to some unchanging number. Consider the following example:

- Think of a number, any positive integer.
- Square it.
- Add the result to your original number.
- Divide by your original number.
- Add, oh, how about $17$.
- Subtract your original number.
- Divide by $6$.

The number you are thinking of now is $3,$ right? Whoooah!!!

To understand how this trick really works, let the number you pick first be $x$ and make it go through the above procedure:

$\begin{array}{c}&x &\implies & { x }^{ 2 }&\implies & x+{ x }^{ 2 }&\implies & \dfrac { x+{ x }^{ 2 } }{ x } =1+x&\implies & 18+x&\implies & 18&\implies & \dfrac { 18 }{ 6 } =3.\end{array}$

Now we can clearly see what is happening. The trick is to obscure the variable $x$ with a series of arithmetic so that the variable $x$ vanishes. The same goes for card tricks, where the variable is the card you choose and the shuffle is equivalent to the binary operation we performed.

Also, don't forget to sell it, but do it as any magician would do!

## Examples of Tricks

In Las Vegas, a street artist said that he could read your mind. He asked you to think of a certain two-digit number, multiply it by $25,$ add $17$ to it, and then multiply it by $4.$ You then give him the final answer and he is able to confidently state the number that you were originally thinking of. How did he do this?

Suppose the number you chose was $\overline{ab}$ with $a\neq 0$ and $a,b\in\{0,1,2,\ldots,9\}$. Now, proceed step-by-step to demonstrate how he guessed your number. First of all, the number you chose can be written as

$\textbf{Your number}=\overline{ab}=10a+b.$

Let $s$ be the number that you rattle off as your result to the mathe-magician. Then you can see how $s$ is related to your number as follows:

$\begin{aligned} 25\times \overline{ab} =&25(10a+b) &&(\text{multiply by }25)\\ =&250a+25b\\ \\ \Rightarrow \quad &250a+25b+17 &&(\text{add }17)\\ \\ \Rightarrow \quad &\big(25\times \overline{ab}+17\big)\times 4 &&(\text{multiply by }4)\\ =&(250a+25b+17)\times 4\\ =&1000a+100b+68\\ =&1000a+100b+60+8\\ =&\overline{ab68}. &&(\text{your final result}) \end{aligned}$

So, if you had thought of $69$, your result would be $6968$. If you had thought of $34$, your result would be $3468$. See the pattern?

The first two digits from the left of the result you rattle off to the mathe-magician is the number you initially thought of! So, he isn't reading your mind. You're telling him what you thought of indirectly. Hence, he has "read" your mind. $_\square$

$\textbf{"MIND=BLOWN"}$

27 cards trick:

- You pick a card from a deck of 52 cards, remember it, and put it back into the deck.
- The mathemagicain deals out 3 even stacks, one at a time. You say which pile the card appears in. The piles are stacked up.
- The stack is again split, one-by-one, into 3 even piles, and you say which pile the card appears in. The piles are stacked up.
- The stack is again split into 3 piles, and you say which pile the card appears in. The piles are stacked up.
- The stack is for a fourth time split into 3 piles, and you say which pile the card appears in. The piles are stacked up.
## Then, your card magically appears at the top of the stack. How is this done?

After you pick your card, remember it, and put it back in the deck of 52 cards; the deck is shuffled. For the rest of the trick, the magician simply must stack the piles in the correct order each time to move your card to the top.

The magician deals the 52 cards, one by one, face down into 3 piles just as a casino dealer would deal to 3 players. Since $52\div 3=17\text{ R }1,$ two piles will contain 17 cards, and the remaining pile will contain 18 cards. After you search the piles and point out which pile contains your card, the magician stacks the piles face down with your pile on the

bottom.Just as before, the magician deals out the 52 cards one by one face down into 3 piles. Since your pile was on the bottom, the cards that were previously in that pile will be dealt

last. Thus, your card will be one of the top 6 cards in one of the piles. After you point out which pile contains your card, the magician stacks the piles face down with your pile ontop.For the third time, the magician deals the cards into 3 piles. Since your card was previously in the top 6 cards of the deck, it will now be among the bottom 2 cards of one of the piles. After you point out which pile contains your card, the magician stacks the piles with your pile on the

bottom.For the final time, the magician deals the cards into 3 piles. Since your card was among the bottom 2 cards of the deck, it will now be the top card of one of the piles. After you point out which pile contains your card, the magician knows that the card is on top of that pile. $_\square$

Birthday Card Trick:The five cards below (red, yellow, green, blue, purple), each with 16 numbers on it, can be used to find the birthday (day of the month) of a friend.

- Give the five cards to your friend, and ask him or her to tell you every card that contains his or her birthday.
- Summing the numbers on the top left corner of each card that contains the birthday will give the birthday.
For instance, if their birthday was on the 11th day of a month, they would hand you the red, yellow, and blue cards.

It is also known as

binary magic card trick. It works based on the binary number to decimal number conversion.Each card corresponds to a place value in binary:

- red = 1, which is equal to ${2}^{0}$
- yellow = 2, which is equal to ${2}^{1}$
- green = 4, which is equal to ${2}^{2}$
- blue = 8, which is equal to ${2}^{3}$
- purple = 16, which is equal to ${2}^{4}$.
We need to read the presence of the color in the following order:

$\text{purple} \to \text{blue} \to \text{green} \to \text{yellow} \to \text{red}.$

if the number exists, place $1,$ and, if not, place $0.$ Then we get the 5-bit binary representation. For example, if the birthday exists in purple, blue and red cards it can be represented as ${11001}_{2}$. Now convert the binary number to its equivalent decimal as follows:

$\begin{aligned} {11001}_{2} &= \big(1 \times {2}^{4}\big) + (1 \times {2}^{3}) + (0 \times {2}^{2}) + (0 \times {2}^{1}) + (1 \times {2}^{0}) \\ &= 16 + 8 + 0 + 0 + 1 \\ &= 16 + 8 + 1 \\ &= \text{(purple top left) + (blue top left) + (red top left)} \\ &= {25}_{10} \\ &= 25. \ _\square \end{aligned}$

The below table shows how the number from 1 to 31 are derived using the presence of the respective color codes.

Color Code and Birthday:

A magician selects five spectators from a crowd. He then gives the first spectator a deck of cards and asks him/her to cut the deck and take a card from the top. Then, each of the remaining four spectators takes a card from the top of the deck. The five spectators are allowed to look at their cards, but they do not show them to the magician. The magician waves his hands a bit and then asks which of them is holding a red card. He again waves his hands a bit, closes his eyes, and then correctly declares every single card that the spectators are holding. How does he do this?

Clearly, the key to the trick lies in the order of the cards drawn, and which of the spectators has red cards. It is also important that the deck was merely cut, not shuffled.

Each card drawn represents a bit of information, either "Red"(1), or "Black"(0). The magician notes the order that the spectators drew the cards and which of the cards were red. From this, the magician creates a 5-bit sequence. For example, if the $1^\text{st}, 3^\text{rd},$ and $4^\text{th}$ spectators had red cards, then the magician would form the sequence $10110$ in his head.

The magician knows that there are ${ 2 }^{ 5 }=32$ such possible sequences, and knowing the sequence is sufficient to know what the cards are. The magician is taking advantage of what is known as a De Bruijn sequence. A De Bruijn sequence is a cyclic sequence of characters such that each sub-sequence of a certain length is distinct. The deck that the magician uses has 32 cards, and the magician has ordered the deck so that it forms a De Bruijn sequence:

$\begin{array}{cccccccccccccccccccccccccccccccc} \text{A}\spadesuit & 5\clubsuit & 10\clubsuit & 6\spadesuit & 2\spadesuit & {\color{#D61F06}\text{Q}\heartsuit} & 2\clubsuit & \text{J}\clubsuit & 7\spadesuit & {\color{#D61F06}7\heartsuit} & {\color{#D61F06}\text{A}\heartsuit} & \text{Q}\clubsuit & 3\clubsuit & {\color{#D61F06}6\diamondsuit} & \text{K}\spadesuit & {\color{#D61F06}8\heartsuit} & \text{J}\spadesuit & 4\clubsuit & {\color{#D61F06}2\diamondsuit} & {\color{#D61F06}\text{J}\heartsuit} & {\color{#D61F06}7\diamondsuit} & 5\spadesuit & {\color{#D61F06}\text{K}\diamondsuit} & \text{Q}\spadesuit & {\color{#D61F06}\text{A}\diamondsuit} & {\color{#D61F06}6\heartsuit} & 3\spadesuit & {\color{#D61F06}3\heartsuit} & {\color{#D61F06}9\diamondsuit} & {\color{#D61F06}4\diamondsuit} & {\color{#D61F06}5\heartsuit} & {\color{#D61F06}\text{K}\heartsuit} \\ 0 & 0 & 0 & 0 & 0 & {\color{#D61F06}1} & 0 & 0 & 0 & {\color{#D61F06}1} & {\color{#D61F06}1} & 0 & 0 & {\color{#D61F06}1} & 0 & {\color{#D61F06}1} & 0 & 0 & {\color{#D61F06}1} & {\color{#D61F06}1} & {\color{#D61F06}1} & 0 & {\color{#D61F06}1} & 0 & {\color{#D61F06}1} & {\color{#D61F06}1} & 0 & {\color{#D61F06}1} & {\color{#D61F06}1} & {\color{#D61F06}1} & {\color{#D61F06}1} & {\color{#D61F06}1} \end{array}$

This is a possible arrangement of the deck into distinct black (0) and red (1) cards. Due to the way it is ordered, any sub-sequence of 5 cards can be uniquely identified by the sequence of bits. In addition, the sequence is cyclic, so the fact that the deck was cut does not matter. Thus, if the $1^\text{st}, 3^\text{rd},$ and $4^\text{th}$ people had red cards (a sequence of $10110$), then the magician would be able to identify the cards as $({\color{#D61F06}\text{K}\diamondsuit}, \text{Q}\spadesuit, {\color{#D61F06}\text{A}\diamondsuit}, {\color{#D61F06}6\heartsuit}, 3\spadesuit).$ This sub-sequence of bits does not show up anywhere else in the deck of cards.

This trick is very challenging to perform, as it requires the magician to memorize $32$ sequences of bits and their corresponding cards. However, it is astounding to know the cards with such a small amount of information. An especially impressive thing about this trick is that the magician could repeat it any number of times, as long as the deck is only ever cut and never shuffled. $_\square$

Martin the mathemagician says he can read your mind. He tells you to think of any two-digit number.

Add 10 to this number.

Multiply the result by 6.

Subtract 6 from the result.

Divide the number by 3.

Subtract the original number that you thought of.

Add 9 to the result.

Subtract the original number that you thought of.

Martin claims to know your final result. What is this number?

Which of the following methods cannot be used as a trick by a mathemagician to find your final answer?

A. Think of a single-digit positive integer. Multiply by 37 and add 74. Multiply by 3 and then subtract 222. Divide by your initial number. I can tell you what the answer is!

B. Think of a positive integer. Multiply by 10. Add 9 and subtract the original number. Now find the repeated sum of digits. I can tell you what the answer is!

C. Think of a positive integer. Multiply the number by 10. Find the repeated sum of digits. Subtract this from your original number. I can tell you what the answer is!

**Note:** Repeated sum of digits means that you take the digit sum of the number repeatedly until you end up with a single-digit number.

## Designing your own Tricks

When designing mind game tricks of your own, perhaps the most important part is your own showmanship. Being entertaining is what keeps your audience engaged and willing to do the required steps of the trick. Beyond that, misdirection is also important. The underlying math behind these tricks is often very simple and easy to figure out. Putting in extra flourishes that distract your audience from the underlying math can keep your audience impressed. Below are a few examples of how you can design your own mind game tricks. Once you understand how these tricks are designed, you can begin to come up with some tricks of your own.

Guess-the-result TricksThe goal of this kind of trick is to have your friend think of a number, then do a bunch of operations on it, and then you will guess the result. The key to this trick is that the result is always the

samenumber.The simplest versions of these tricks are easy to figure out:

Think of a number, then add 7 to it, and then subtract your original number. I know what number is left. It is 7!

You wouldn't impress too many friends with this trick, but the structure here gives some insight into how the more complicated tricks work. By subtracting the original number, you're left with whatever number you added earlier.

The key to making the trick believable is to insert enough operations to misdirect your audience so that they don't become suspicious. As you design steps, write out the algebra with the given number, $n.$ The goal is to do operations that eventually eliminate the variable and leave you with a constant.

Think of any number other than 0. $\implies n$

Note: You might want to give your friend a calculator to help with the operations. The reason for not picking 0 will become clear later.Now add 3 to that number. $\implies n+3$

Multiply that result by 4. $\implies 4(n+3) \implies 4n+12$

Now multiply that result by the original number. $\implies n(4n+12) \implies 4n^2+12n$

Add 9 to this result. $\implies 4n^2+12n+9$

Now take the square root. $\implies \sqrt{4n^2+12n+9} \implies 2n+3$

Subtract 3 from this number. $\implies 2n+3-3 \implies 2n$

Divide by your original number. $\implies 2n \div n \implies 2$

Ah, the spirits are whispering to me the number that is in your mind! It is 2!

Note: If your friend disobeyed your directions and picked 0, then you might notice some hesitation at the final step. You can impress him or her by immediately declaring, "You have picked the forbidden number, haven't you? The number of nothingness... This will surely be bad luck for you!" Of course, a little showmanship helps!As you can see, the kinds of operations you can use to design these tricks are limitless. The only requirement is that the end result is a constant.

Another possible version of this trick would be to give your friend operations that lead your friend to the number that he or she started with. At the final step of the above example, you could tell your friend to divide by 2 (instead of dividing by the original number). Then he/she would be left with the number he/she started with.

Guess the Number with DigitsBecause of how the decimal system works, doing certain operations on a number will often cause the digits to follow a predictable form. You can use this to your advantage to impress your friends.

As with the "guess-the-result" tricks, the simplest version of this trick is pretty easy to figure out:

Think of any positive two-digit number. Multiply it by 100 and tell me the result. Now I know exactly what number you thought of!

The key to these kinds of tricks is that the original number is hidden somewhere in the digits. Of course, this example hides the original number in plain sight. To make the trick believable, the goal will be to add some steps for misdirection and to make the number less obvious within the digits.

In the following example, the digits of the original number will be represented with $\overline{ab},$ where $a$ and $b$ are the digits of the number.

Think of any positive two-digit number. $\implies \overline{ab} \implies 10a+b$

Note: You might want to give your friend a calculator to help with the operations.Add 3 to that number. $\implies 10a+b+3$

Now multiply it by 4. $\implies 4(10a+b+3) \implies 40a+4b+12$

Add 6 to this number. $\implies 40a+4b+12+6 \implies 40a+4b+18$

Multiply the result by 5. $\implies 5(40a+4b+18) \implies 200a+20b+90$

Now add 1. $\implies 200a+20b+25+1 \implies 200a+20b+91$

Multiply by 5 again. $\implies 5(200a+20b+91) \implies 1000a+100(b+4)+55$

Ask your friend to give you his or her result. These steps will put the original number into the thousands and hundreds place, with an additional 4. For example, if your friend's original number was 89, then the result he or she gives you should be 9355. All you have to do is take away 4 from those digits, and you can guess your friend's number.

The trick works by multiplying by 100 in "stages": first by 4, then by 5, and then by 5 again, with other operations between these multiplications as misdirection.

Another possible way to make this trick more believable is to personalize the numbers that are added or subtracted. Here is an example:

What day of the month was your birthday? Add that number.

This requires you to do some math in your head so that you can know what number to add or subtract at the end. It is a challenge, but it makes the result less predictable for your friends to figure out if you do the trick multiple times.

Guess the number with Chinese remainder theoremThe Chinese remainder theorem makes it possible to guess a friend's number just by the remainders after your friend divides by certain numbers. For example:

Pick any integer between 1 and 250.

Give me the remainder when you divide by 11.

Give me the remainder when you divide by 23.

This is exactly enough information to determine what the number is. Let $x$ be the number, let $a$ be the remainder when the number is divided by 11, and let $b$ be the remainder when the number is divided by 23:

$\begin{array}{cccl} \text{If} & a \ge b, & \text{then} & x=23(a-b)+b. \\ \text{If} & a<b, & \text{then} & x=23(a-b+11)+b. \end{array}$

The trick works because each possible ordered pair $(a,b)$ corresponds to a distinct integer between 1 and 253. The fact that $23 \equiv 1 \pmod{11}$ (when 23 is divided by 11, the remainder is 1) makes the number easier to compute in your head. You can design your own tricks around this concept by carefully picking numbers that are related in the same way.

Before doing the trick, pick positive integers $m$ and $n$ such that $m<n$ and $n \equiv 1 \pmod{m}$ (when $n$ is divided by $m,$ the remainder is 1).

Ask your friend to pick any integer between 1 and some number less than or equal to $mn.$

Ask your friend to give you the remainder when the number is divided by $m.$ Let this remainder be $a.$

Ask your friend to give you the remainder when the number is divided by $n.$ Let this remainder be $b.$

You will know exactly what the number is by the following:

$\begin{array}{cccl} \text{If} & a \ge b, & \text{then} & x=n(a-b)+b.\\ \text{If} & a<b, & \text{then} & x=n(a-b+m)+b. \end{array}$

**Cite as:**Mind Reading with Math.

*Brilliant.org*. Retrieved from https://brilliant.org/wiki/mind-reading/