YOUNG mathematicians entered the world of spies, secrets and espionage as they became code-breakers — inspired by an original Enigma machine.

Year Seven girls at Bolton School had a chance to see the 81-year-old German machine in use, which sent encrypted messages during the Second World War.

The story of how the code was cracked was told in the Oscar-winning film The Imitation Game, about the brilliant mathematician Alan Turing, played by actor Benedict Cumberbatch.

The pupils found out how the machine — the only surviving travelling Enigma machine —was used to send the coded messages — and how they were cracked at Bletchley Park in Buckinghamshire.

It was brought into school by Dr James Grime, a mathematician and lecturer. The machine belongs to his friend and author Simon Singh, who bought it from an American who picked it up in a French field when the war ended — and took it away with him as a souvenir.

Dr Grime said: “As someone fascinated by mathematics and codes, it is such fun and a privilege to exhibit this Enigma machine.

“Codebreaking always fascinates young people and they are always very impressed that this is an actual piece of living history from World War II.

“Not very many Enigma machines exist any more, and this is the only one that travels and gets demonstrated in schools.”

Children learned about the history of code-breaking — including the ancient Spartans tattooing messages on slaves’ heads and sending them out once their hair had grown.

And pupils had a chance to create their own codes while cracking others.

Stephen Wrigley, maths teacher, said: “My hope is to show students how maths can be applied to different situations, in this case, code-breaking.

“Dr Grime’s talk also shows how code-breaking has its place in history, exemplified by the foiling of the Babington Plot of 1586 which aimed to assassinate Queen Elizabeth I, and the breaking of the enigma code in the Second World War, both of which had huge implications.”

Harriet Dickens, aged 12, said: “I gained confidence in code-breaking and learned how I could be a code-breaker for MI5 or MI6 when I grow up.”

Tanya Thakrar, aged 11, added: “I really enjoyed the morning and learned all about the Germans’ Enigma machine and how the Poles and then us cracked the code.

“You obviously had to be good at maths to work out these codes.

“The workshop was fun too, as we got to do our own codes. We gave out clues and others had to guess. The different words put together spelled out a sentence in the end.”

n To see how the Enigma machine works visit theboltonnews.co.uk