Did you know that codes are all around us, all the time? They're used to send telephone calls from mobile phones, images to your digital television, and computers use encrypted codes to send and receive sensitive information. As Marcus shows in this lecture, codes can also be used in card tricks to impress your friends! For centuries mathematicians have been thinking up new codes to send messages - including Morse, Braille and ASCII - and cracking the codes that already exist. Semaphore and Baudot codes, for example, were used to communicate across countries and continents. Marcus demonstrates how, nowadays, your mobile phone and computers can spot a mistake in a message and use error correcting codes to put the mistake right. Finally, you can find out how you can win a genuine Enigma machine - used to send coded messages during the Second World War.
Confound your audience with this cunning magic trick based on error correcting codes.
Not all codes are used to disguise information, some are there to detect and even correct mistakes. Download these two PDFs to find out more.
The Enigma machine shown in the Christmas Lectures is genuine - it was used during the second world war. The machine is worth over 30,000, and it could be yours thanks to a competition held by Orion Publishing!
Use this site to encipher your own text, crack some coded messages, and learn about the history and development of codes over the centuries.
Use this link to create Baudot codes in the style of the Coldplay album X&Y
Marcus explains the Baudot code and finds a CD cover that hides a mistake.
(Press play to start the video.)
In the 1870s a Frenchman, named Emile Baudot came up with a new code, which was much better and solved this sort of problem. And here is the code. So, this is Emile Baudot's code. Now what you're going to see here he's replaced ever letter by some dots and spaces. He's given every letter the same number of dots and spaces: there are five dots and spaces to represent every letter. So, for example, if I look down here, X is a dot-space-dot-dot-dot. And Y for example, is dot-space-dot-space-dot. Now this is much easier for a computer to read. So, for example, I found some tickertape here, so you can actually print this out on a piece of tape and all the holes then, the dots become holes in the tape and the spaces are left blank. Now I found this lying around on Andy's desk a little bit earlier on, and I am actually hoping, maybe, these are the secret numbers for the combination locks. So, I wonder whether anybody could help me to try and decode the Baudot code that I've got on this tickertape. OK, do you want to come out? Maybe we'll get the secret numbers and we won't need Bletchley Park after all. OK, so, what's your name?
Nick. What we need to do is to feed this inside here - this is a machine that can read all the holes and the spaces and tell us what the message is. I think we put it here and now we need to switch it on. OK, so if you'd like to press that one there, Nick, I think it will start telling us. Here comes the message. Read it up here. OK, can you read? Let's switch this off. What does the message say, is it numbers? No, it's not numbers, can you read that out?
It says, you won't get the chocolates this way, signed Evil Andy.
Evil Andy, my God he's messing with us, oh well, there we go. It's not the numbers, but Evil Andy messing with us. OK, let's give Nick a big round of applause, for trying to decode. I think we are going to have to rely on Bletchley Park; Evil Andy is just messing with our minds. Well, this idea of using the language of mathematics is actually a major breakthrough in the history of codes. The dots and spaces, or ones and zeros, are easily converted into electrical signals and then these can be sent across the electricity lines and telegraph lines. And it's used in nearly every form of communication devices today. For example, your mobile phone, or when you're watching digital TV or anything like that, iPods and things like that, all the music, the pictures are translated into loads of zeros and ones. So that's how these codes can encode the world around us.
Now you may even be able to spot the code in this. If I show you this, this is Coldplay's recent album. In fact the title of the album is written in Baudot code, this sort of zeros and ones codes. I've got a large version of it over here, which I'm going to try and decode for you. So this is the name of Coldplay's album. They wrote it in Baudot code. So, if I could squeeze in here. OK, so the colours are kind of irrelevant here. Just, if there is a colour, that means we've got a black dot. So, for example, there's colour here that means we've got a black dot. We've got a space here that means there's a space in the Baudot code. So, for example, this first column here represents a letter and here I've got colour-colour-colour, so that's spot-spot-spot. If we look here, this is the first letter in the title is in fact X. If I go to the end here, we have colour-space-colour-space-colour. And if I turn that round, so that's dot-space-dot-space-dot. Remember, that was the Y that I read out earlier. Now I want a volunteer to try and help me to decode the last two, the middle two, columns here. Yes, would you like to come up, sir? And you'd like to go this side of our Baudot code, and yes, let's stand you here. What's your name, sir?
Josh, let me give you a hint for the first column here. This is actually a bit like the shift key on a typewriter. If you press the shift key, you get all the interesting characters. So in Baudot if you see dot-dot-space-dot-dot, you know you've pressed the shift key. And if you look on our Baudot code all the things at the top are the interesting letters. So we're going to be looking at those, OK? Now the next one, what you've got to find on our Baudot is, what's this? This is space-space-space-dot-dot. So let's translate that one, so can you find space-space-space-dot-dot on our Baudot code?
Right, it's O, but you have to shift up, so shift it up to 9. OK, so we managed to decode Coldplay's album. Coldplay's album is actually called X9Y. OK, we'll let's give Josh a big round of applause. Now, that's kind of intriguing because I guess you were all expecting it to be called X&Y. That's certainly what Coldplay hoped to call their album, but they made a bit of a mistake. They actually called the album X9Y, because if you look at what & was meant to be, it was space-dot-space-dot-dot. In fact, they made a little mistake, they should have had a dot here and they didn't. So something got a little bit of mistake here and they ended up calling their album X9Y, of all things.