Bletchley Park – A code breaking masterclass

This weekend I was invited to Bletchley Park to run a code breaking workshop with a group of year 9 students, as part of our Open University and Royal Institution mathematics masterclass series.

It also happened to be the Park’s 1940’s vintage weekend so, as I arrived I was greeted by soldiers in world war two uniforms, guarding the front entrance.

Inside the world heritage site, staff and visitors alike were dressed to impress in 1940’s attire. Vintage vehicles, including an army jeep, Spitfire and tank, were proudly displayed around the grounds, guests played lawn games and swing music blasted out of a wireless radio, creating a nostalgic atmosphere.

Staff and visitors dressed in 1940s clothing for the vintage weekend

Of course, in the 1940’s, when Bletchley Park was in full operation, it was not all fun and games.

During the Second World War, Bletchley Park was home to the Government Code and Cypher School and it was the job of mathematicians working there, including Alan Turing, Joan Clarke and Bill Tutte, to decipher intercepted military communications sent by the Axis nations. These included messages encoded with the German Enigma and Lorenz ciphers, which cryptanalysts had thought unbreakable.

Building on a breakthrough made by Polish codebreakers in Warsaw, Alan Turing and Gordon Welchman designed an electro-mechanical machine, known as the Bombe, to rapidly decode and transcribe Enigma encoded messages. Colossus, the world’s first programmable digital computer, was also used at Bletchley Park to decipher high level messages sent using the Lorenz cipher.

This work provided vital intelligence in support of Allied military operations and is credited with shortening the war by two years.

Working at the Open University, just a few miles down the road from Bletchley Park, it is hard not to feel inspired by the men and women who worked there. So when I was asked to run a workshop within these historic grounds, I jumped at the opportunity and a cryptography challenge seemed the obvious choice for my session.

A code breaking masterclass – the cipher challenge competition

After successfully getting past the military police at the identity card check point, I headed over to Block B, home to ‘The Life and Works of Alan Turing’ gallery and the coding centre’s Education Department, where our masterclass series takes place. I was joined by Sue Pawley from the Open University, who organised the series, and Tom Briggs, Bletchley Park’s Education manager.

The Education Department in Block B

This particular masterclass was set up as a competition, with twelve quick fire rounds, designed to create a sense of urgency, build tension and encourage strategic team work. In this way the students could begin to empathise with the code breakers of Bletchley Park and understand the immense pressure they were under during the war.

Students worked in small groups to decipher secret messages, working against the clock to crack the codes and get the decoded messages back to the base, before the other teams. They learned how to encode and decode messages using a range of classic codes and ciphers, including substitution ciphers such as the Pigpen (or Freemasons), Caesar and Hebrew “Atbash” cipher, and transposition ciphers like the Scytale and Rail-fence. There was also a bonus round, which involved deciphering numbers sentences, for example: 64 S on a C B and 32 is the T in D F at which W F (answer at the end*), for students to work on between rounds.

Working on the Bonus round, with a little help from Bletchley Park’s Tom Briggs

One of the oldest ciphers the students worked with, was the “Scytale” transposition cipher, used by the Spartans in Ancient Greece. In the 3rd century BC, a parchment would be wound around a cylinder, before a message was written and the unravelled parchment was sent to the intended recipient. For the students, this meant wrapping the cipher-text around a pencil to unscramble the letters and reveal the original plaintext.

The “decoders” working on the Scytale cipher using a pencil

One team of students worked out that they could solve this cipher without using a pencil, by simply ‘jumping’ along every six letters, deciding that this method was more mathematical. Unfortunately it was also a much slower method, but I was pleased that they had spotted this pattern and if they were decoding a longer message, this generalisation would have been helpful.

A Spartan “Scytale cipher”

The most famous mono-alphabetic substitution cipher, the Caesar cipher, was required for the next quick-fire round. Students solved this challenge by setting their Caesar wheels to a shift of 3, since this was the way historians believe Julius Caesar used this cipher when sending messages of military importance.

Team “cheese crackers” deciphering a message using a Caesar wheel

As the Caesar cipher is very simple, swapping one letter for another, it is a weak code that is easy to crack. As a group, the students discussed how to make this cipher stronger. This included a suggestion to “jumble up” the letters in the cipher-text strip so they were not in alphabetic order. This lead to a bonus challenge question: in how many different ways can the letters of the English alphabet be rearranged? The students produced a range of answers, including a sensible but incorrect suggestions of 26×26, but two teams were able to identify the solution: 26! (or 403 291 461 126 605 635 584 000 000). One team was able to correctly name an approximation of this number as four hundred septillion.

Trying different shifts using a Caesar cipher wheel

Modern cryptography is most often used to provide confidentiality and security when sending sensitive information, including bank details, via computers, so it was important to look at binary encryption. Some of the students had met the binary number system before, but for most the name was a familiar but scary and unknown concept. One student was able to explain the use of ones and zeroes to mean ‘on’ and ‘off’ functions within computers. Another student was able to explain that the ones and zeroes represented powers of 2, starting with 2o, i.e. 1, and that the equivalent decimal (or denary) number was equal to the sum of these values.

The “codebreakers” converting numbers from binary to denary to decode a message

When computers send information, usually in binary form, elements of the message can sometimes get changed in error during transmission. For this reason, data needs to be checked for corruption. In the next part of the session the students looked at how data can be “error checked” using a two-dimensional parity check.

This particular method works by adding an extra row and column of values to the original data which each act as a label. In the example below, 1 is added to the end of a row or column if there is an odd number of 1’s and a 0 is added for an even number of 1’s. In other words, the final value in each row or column contains the sum of that row or column, modulo 2.

Example of how to find an error using the two-dimensional parity check method

This challenge was set as a relay-race so that students had to find the error in each set of data before being given the next. This round required speed but students learnt that accuracy was ultimately more important as those teams who rushed and made mistakes were sent back, losing valuable seconds.

The “error-checking” relay challenge was a close round!

There is a useful video about parity checking here. You can also visit the National Museum of Computing, within the grounds of Bletchley Park, to find out more about binary and error checking.

The final!

During WW2, Alan Turing and the Hut 8 team used a combination of educated guess work and clues, including knowledge about where the message was intercepted, to decipher German military messages. Up to this point in the competition, the students had been told about the cipher used in each round and were given some information about the key, ultimately making the process of deciphering relatively straightforward. Of course, in any real code-breaking situation, where you are not the intended recipient of the message, you are not going to know the cipher key.

In the final and deciding round, the students had to use clues, including a bar chart depicting the frequency analysis of letters in the English alphabet, to decode one last message, getting a sense of the difficulty faced by the Bletchley Park code breakers.

The most common two and three letter words in the English language

This was a challenging task since many students struggled with the ambiguity that this method created. Assumptions had to be made and a trial and improvement approach was required. More than anything, students needed to use logic and their common sense in this round, to place likely words and adapt their solution as it developed.

“Team one” solved the frequency analysis round in record time!

It was a close call between the top three teams, but the final result meant team “JABLE” (named from the initials of the team members) were victorious, leaving Bletchley Park as Code-breaking Champions.

What struck me about this session was that the students naturally engaged with and discussed, problem solving strategies. Teams divided up the challenges and allocated roles in order to collaboratively decipher messages, quickly and accurately. Students used their natural mathematical powers to look for generalities within sequences and conjectured about solutions that made sense within the context. I was particularly impressed by the resilience that the students demonstrated when faced with unknown problems and when they became “stuck”. The history behind this mathematical masterclass seemed to give these students a common goal and a sense of working towards something greater.

Andrew Wiles, the mathematician who famously proved Fermat’s last theorem, recently said that “accepting the state of being stuck” is the essence of being a successful mathematician. Like the Enigma code, which was thought to be impossible to decipher, Fermat’s last theorem was long thought to be impossible to prove. What Turing and Wiles had in common when working on these “impossible” problems, was the resilience and perseverance that prevented them from giving up.

According to Tom Briggs, the Allies strengths, which ultimately lead to cracking the Enigma code, were: luck, inventiveness, bravery, persistence and secrecy. The students certainly showed inventiveness and persistence, and I am sure the winning team would argue that luck that nothing to do with it!

Find out more about Royal Institution mathematics masterclasses

The Open University is responsible for organising four Royal Institution secondary mathematics masterclass series held at: Bletchley Park, the Museum of Science and Industry in Manchester, the University of Bradford and the University of Worcester.

For six weeks, children in year 9 from local schools are invited to participate in exciting mathematical workshops, such as: Games, Goats and Gold and Infinity: Friend or Foe? The aim of the series is to stimulate and encourage young people in the art and practice of mathematics, to develop a sense of enjoyment in the subject.

If you want to send some students along, you can find out more about these series here: http://mcs.open.ac.uk/RI_MasterClasses/.

If you are interested in delivering a workshop or volunteering to support a session for the 2018 series, please get in touch: charlotte.webb@open.ac.uk.

For more information about the Royal Institution Mathematics Masterclasses national programme, which also includes masterclasses for primary-aged children, see: http://www.rigb.org/maths.

Visiting Bletchley Park and The National Museum of Computing

If you have not yet visited Bletchley Park, no longer the world’s best kept secret, it is definitely worth making the trip!

A view of the mansion from across the lake. 

I recommend signing up for a free guided tour of the Park and attending one of the Enigma and Turing Bombe live demonstrations.

If you have time, you should also include a trip to the National Museum of Computing to see the magnificent Colossus rebuild.

More codes and Ciphers

If you are interested in finding more about codes and ciphers or are looking for resources to use with your classes, these websites offer some fantastic ideas:

*Answers

64 squares on a chessboard

32 is the temperature in degrees Fahrenheit at which water freezes

This entry was posted in Uncategorised. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *