When magic fails in mathematics

The dark side of memorisation

I recently learned a magic trick. It goes like this: think of a number from 1 to 31. Tell me which of the boxes below it is in. Almost instantly, I can identify your number. For example, if your number happens to reside in boxes A, C and E then I know right away that it is 21.

The trick, while hardly spellbinding, has enough wow factor to impress my primary students. My reason for wheeling out this trick was not to lay claim to supernatural powers. It was to set up the perfect maths problem: figure out how and why the trick works.

I encouraged my students to sniff out patterns and to probe the contents of each box. A cursory inspection shows that Box E only contains the odd numbers. Box A contains all the numbers from 16–31. The other boxes contain sequences of successive integers: eight straight integers at a time in Box B, four at a time in Box C, and two at a time in Box D. Is there meaning to these patterns, or are they just arbitrary observations? Why not simulate the trick by trying out a few numbers and record the boxes in which they appear?

My great hope for this problem was for the students to wander off and explore this trick for themselves. You can imagine my delight when one student returned the following week to declare, glint in her eye, that she can perform the trick. Indeed she could, several times over with different numbers, each time without hesitation.

How had this seven-year-old mastered the trick?

Prepare to be underwhelmed: she memorised every one of the 31 combinations.

This isn’t quite what I had bargained for. I had selected the problem for its elements of reasoning and understanding, but instead provoked brute memorisation. This student happens to be one of the most skilled memorisers I have ever met. The ability to absorb and recall information will undoubtedly serve her intellectual development. But an overreliance on memory could also damage it. There is nothing illuminating about her approach. It does not scale well to other cases — extending the method would require significantly more effort (not only will the number of combinations increase, but the combinations themselves will grow in length).

My student was at a loss to explain the structure of the boxes. She would be unable to reconstruct the trick from scratch. It is easy to forget that someone, somewhere conjured up with this trick, and had to think about which numbers to place in each box. The mathematical endeavour of this problem is to recreate the trick from the ground up.

Mathematical thinking is a mixture of novelty and scale. Novelty is what gives us the insight to break down seemingly complicated tasks — like memorising 31 box combinations — into much simpler ones. Scale allows us to extend our thinking to other, often more involved cases. Only by rediscovering the method and reason behind the trick can we achieve both.

I nudged my student towards a reasoning mindset (which I know that she has in abundance), resisting her reflexive tendency to memorise cases and focusing her instead on the number patterns in each box. It helps to write a list of all box combinations — the purpose is not to memorise them, but to unearth subtle insights that might otherwise remain buried.

Box combinations for the numbers 1–10. What do you notice?

You will soon find that a handful of numbers only appear in one box — namely 1, 2 , 4 , 8 and 16. Notice anything curious? My student did: this is among her favourite sequences. She has a glorious way of describing it (“1+1 is 2, then 2+2 is 4, 4+4 is 8 and 8+8 is 16” — with lyrics like these, who needs words like doubling?)

The powers of 2 appear to be governing this trick, but how? Take the number 23, which appears in boxes A, C, D and E. These boxes contain the numbers 16, 4, 2 and 1, respectively. What do you notice? Is it a coincidence that 23 = 16 + 4 + 2 + 1? Try another example: 13 is in boxes B, C and E, which correspond to 8, 4 and 1. And behold, 13 = 8 + 4 + 1.

We can now see how the trick works: once you tell me your boxes, I just take the numbers in the top left corner (the powers of two) and add them up. If you like, each box has a value that corresponds to the power of two it contains, and we just add those values for each of the boxes that the mysterious number appears in. No need for memorisation when basic addition will do.

We still haven’t uncovered the full extent of why this trick works, although we’re pretty close. The trick is a soft introduction to binary representations of numbers. It works because every number can be expressed as a sum of distinct powers of two (consider why the trick would fail with powers of three). This means that every box combination corresponds to one of the numbers from 1 to 31. When you tell me your number is in boxes B, D and E, I know the only possibility is 8 + 2 + 1 = 11. In fact, this is how the creator of this trick knew to place 11 in those boxes. You can apply the same thinking to every number from 1–31, and thus reconstruct the trick for yourself.

You can also extend the trick to any collection of numbers — for numbers between 32 and 63, you will just need an additional box that corresponds to the next power of two, 32. Binary representations scale very neatly, and they depend little on your memory skills.

A good maths problem should be illuminating. The real magic of maths is in understanding why its truths hold. This trick has proven to be a double-edged sword because its depths are easily concealed by the turgid effort of memorisation. Smarter questions around how the boxes are constructed, and how the trick might be extended, expose us to the richness of binary representations.

My student prides herself on her memory skills — and why not? But memorisation will only remain a strength if she learns to tame it, and to give space to those crucial elements of mathematical thinking: reasoning and understanding.


I am a research mathematician turned educator working at the nexus of mathematics, education and innovation.

Come say hello on Twitter or LinkedIn.

If you liked this article you might want to check out my following pieces:

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.