Tooltip
These resources have been reviewed and selected by STEM Learning’s team of education specialists for factual accuracy and relevance to teaching STEM subjects in UK schools.

The Magic of Computer Science III

The third collection of magic tricks, from Paul Curzon and Peter McOwan, is entitled ‘magic meets mistakes, machines and medicine. The five card tricks contained make use of maths and computer science theory, and are used by real magicians.

Each trick includes magician’s instructions. The theory behind each trick is then fully explained, with links to key computational thinking ideas. The theory is then linked to practice, with real world examples.

• Invisible palming works because a carefully crafted algorithm is followed – it is known as a self-working trick.

• The Ninja Countdown shows that confusion can arise when counting up and also counting down. Measures taken to minimise this confusion are explained – these are critical in some environments, such as hospitals.

• The magical friendship test uses slight-of-hand and an algorithm to surprise and amuse. The article includes a pseudocode walk-through of the trick. A full explanation is given which includes some examples of human error-catching measures in hospitals and how they are tested.

• The acrobatic eights trick includes a little misdirection and some classic magician moves. The psychology of misdirection is explained, together with the mistakes that can happen when attention is directed at the wrong moments.

• Between the two red queens uses another ‘self-working trick’ algorithm, and a little more misdirection, to make ‘detectives’ out of the playing cards.

Finally, some advice for both aspiring magicians and software developers is offered.

Show health and safety information

Please be aware that resources have been published on the website in the form that they were originally supplied. This means that procedures reflect general practice and standards applicable at the time resources were produced and cannot be assumed to be acceptable today. Website users are fully responsible for ensuring that any activity, including practical work, which they carry out is in accordance with current regulations related to health and safety and that an appropriate risk assessment has been carried out.

Information on the permitted use of this resource is covered by the Category Three Content section in STEM Learning’s Terms and conditions.