## A magazine where the digital world meets the real world.

# On the web

- Home
- Browse by date
- Browse by topic
- Enter the maze
- Get our RSS feed
- Follow us on Twitter
- Resources for teachers

# In print

# What is cs4fn?

- About us
- Contact us
- Partners
- Privacy and cookies
- Copyright and contributions
- Links to other fun sites
- Complete our questionnaire and get a free magic download

# Search:

# Cheap Magic

# by Peter W McOwan, Queen Mary University of London

*
Many stage magic tricks need fantastically expensive equipment to do. Tanks of water
to escape from, levitating tables, elephants to make disappear...
To perform this amazing feat of mind magic you will need, nothing. Yes
it's that cheap. But you will need a friend who has a calculator or phone that includes one.
*

## The roots of the magic effect

Get the first friend to think of a long number with how ever many digits they fancy. Have them call that number out digit by digit to the friend with the calculator who enters it into their device. They then press multiply. A third friend does the same, choosing a long number and calling it out digit by digit to the calculator owner. They then multiply these two large random numbers together, giving an even longer random number.

Now the mind magic begins. The friend with the calculator now calls out, digit by digit the number on the screen. They can chose to do this backwards or forwards, but more importantly they can decide if they want to tell the truth or lie about just one of the digits. You listen intently and then, after a dramatic pause, correctly tell them whether they were telling the truth of lying about changing a digit, so proving your superior mental agility.

## Getting to the root of the trick

This effect works using a mathematical idea called a digital root. The digital root of any number is the single digit you get by adding together the numbers in the original, and doing the same thing with the result until you get to a single digit answer. So, for example, the digital root of number 65,537 is 8, because 6 + 5 + 5 + 3 + 7 = 26 and 2 + 6 = 8.

You calculate the digital root of the first number and remember it. As your friend is saying it out loud digit by digit, it's quite easy to keep the running total, as long as you are good with numbers. (If not then practice and you will be!) Then, while the multiplication button is being pressed you tidy up the last bit of mental addition to work out the single root number. You do the same with the second number, calculating its digital root as it's spoken too. You now have the digital root of the first two numbers. It turns out that the maths means you also have the digital root of the number they make when multiplied together. How? You simply multiply the digital roots of the two initial numbers and work out its root. The answer is also the root of the larger multiplied number. That means, if you work out the digital root of the 'answer' as it is read out, you can tell if a digit was changed. How? Because if it was changed then, the two digital roots you have calculated for it will be different. If they are you know that you have been told a fib!

## The root of all numbers

Let's look at a quick example with two random numbers 4,728 and 917,369

The digital root for 4728 is 4+7+2+8 = 21 and 2+1= 3

The digital root for 917369 is 9+1+7+3+6+9= 35 and 3+5=8

Multiplying these two resulting digital roots, 3 and 8, together gives 3x8=24. It has digital root 2+4=6

Now if we multiply 4728 x 917369 = 4337320632

Calculating this number's digital root we get 4+3+3+7+3+2+0+6+3+2 = 33, and so the digital root of this number is 3+3 = 6

The two digital roots are the same with matching value 6. The answer was not tampered with!

## The code of errors

This digital root, as used here, is a simple example of an error-detecting code. It can detect when a number has been tampered with. In the digital world everything is represented as numbers: messages, images, music, video, they are all numbers. If you are transmitting information as numbers and you also include products and digital roots in the message, then they could be used to check if any of the data had been corrupted in transmission.

Computer scientists have developed many more sophisticated mathematical error-detecting codes that can tell if more than one change has been made. Our version only tells you that a number has been changed not what the number should be, but there are also so-called 'error-correcting codes' that allow you to reconstruct any changed data too. Look at the barcodes on supermarket products. The set of stripes that make up the barcode pattern stand for the product number. That number is printed with the barcode. The barcode actually contains both the code to identify the product but also include an error-detecting code. That means that if the numbers are misread by the laser scanner at the checkout, the scanner knows something has gone wrong and can tell the cashier to try again. That's far better rather than silently charging you for the wrong item!

In any situation where numbers have to be entered into a computer or transmitted from one to another, and the numbers matter, then an error-detecting or error-correcting code is a good idea. For example, in hospitals patients are identified by their patient number. You don't want a nurse to mistype the number and, as a result, the wrong patient have their leg amputated (say). By including error-correcting codes with the number, a computer can check a mistake hasn't been made before that leg is tampered with!

It may be a cheap trick, but an error-detecting code adds a useful extra check against mistakes, so saving a great deal of money (not to mention avoiding a mistake costing an arm or a leg).