Magic, maths and computer science


Pulling a rabbit out of a hat or making the Statue of Liberty vanish are impressive feats of magic. Magicians are in many ways like computer scientists: a magician must find a method to solve a problem, that problem being, say, making the rabbit appear or the Statue vanish, but without the audience realising how it's done. A good magic trick is a combination of method and presentation, in some ways like a computer program: the computer software must have a method to solve the problem (in computer science we call this method, or series of steps, an algorithm), but, unlike magic, software must present the results to the user so they can understand them.

Magic and computer software

It's not surprising that many mathematicians and computer scientists are interested in magic tricks. Working out ways to solve problems, whether predicting a chosen card in a trick or how to reduce the amount of digital data in an MP3 music file without the listener noticing are very similar. A magician wants to be sure that the trick will always work (who wants to look a prat in front of an audience). Computer Scientists want to be sure their programs always work. The difference is that computer scientists want to tell other people how it's done. Magicians must keep the method a secret, never revealing it to the audience.

The Maze

The maze

Down the corridor, a series of famous people are having their portrait drawn

The maze

A window through to the next room makes everything look wierdly block-like.