Enter the maze

Time travel to 1089: why does this trick work?

The year 1089 in the crystal ball

To understand why the trick works we need to do some algebra. Let's represent the chosen number as letters ABC (that's A 100s, B 10s and C 1s. So for example if the chosen number is 257 that's A=2, B=5 and C=7) Now, following the instructions, your spectator has to reverse this number. That leaves them with CBA. Next we ask them to subtract CBA from ABC, which we can write like this:

Hundreds  Tens    Units  
   A        B        C   
-  C        B        A

Now watch carefully. This is a tricky bit. If we both add 100 and subtract 100 (made up from 9 10s + 10 1s) to the number ABC we wont make any difference (as we are adding 100 and taking 100 away). What that lets us do is rather sneaky. It means we can write the sum as the following (actually it is just doing the carry that must be done because we specified C had to be bigger than A):

Hundreds  Tens    Units  
   A        B        C   
-  C        B        A
-  1
+           9       10

Do the subtraction and we get:

(A-1-C)  9  (10+C-A)

That was the first bit of magical prediction: the centre number always, always will be a 9!

You can also probably see why it's important to have all the digits different with the largest digit first. It's not to make it harder, that's just presentation, it's to make the maths work.

There is still more mathematical mystery to follow, though. When you get them to write this number backwards and add, what you're really doing is adding:

    A-1-C     9    10+C-A  
+     
    10+C-A    9     A-1-C  
 ---------------------------
      9      18       9  

Notice how all the A's and C's cancel as we added them together earlier to subtract again now. We can simplify this further though. That 18 in the middle means 180 (remember it's in the tens column) so we can take the 100 from 180 and shift it to the 100’s column, leaving only 8 in the middle and a final sum of

  10  8  9  

This of course is 10 hundreds, 8 tens and 9 ones, or 1089: the number we predicted all along!

Behave yourself

The maths shows that if the spectator does what's expected of them, and follows the rules, the trick will always work.

Mathematically we call the things the spectator must do, like chose different digits and put them in the right order, constraints. In this trick it's the presentation (where we say "let's make it harder", and so on) that makes sure these constraints are followed. If we let things go astray and, for example, let the spectator chose digits that were the same we call this a constraint violation, and it would upset the maths.

When developing software for computers there are also often constraints, which if the user disregards (perhaps because they don't know about them) can cause problems, For example trying to divide by zero is never a good idea, there isn't a correct mathematical answer. Users entering 0 when a division is going to happen has caused lost of problems in the past when software didn't check that people were following the rules. It's always a better idea to design software, like magic trick presentations, around people, so that people are naturally led into doing the right things. Understanding how humans behave and how and why they are likely to make mistakes is as important for computer scientists as it if for magicians.