Enter the maze

Who invented Morse code?

by Paul Curzon, Queen Mary University of London

Morse code tapper: www.istock.com 877875

Who invented Morse code? Silly question, surely! Samuel Morse, of course. He is one of the most celebrated inventors on the planet as a result. Morse code helped revolutionise global communications. It was part of the reason the telegraph made fast, city to city communication a practical reality. Morse did invent a code to use for the telegraph, but not Morse code. His code was, by comparison, a poor, inflexible solution. He was a great businessman, focussed on making his dream a reality, but perhaps not so good at computational thinking! The code that bears his name was largely invented by his partner Alfred Vail.

Samuel Morse was originally a painter. However, his life changed when his wife died suddenly. He was away doing a portrait commission at the time. On hearing of his wife's illness he rushed home, but the message, delivered by a horse rider had taken too long to reach him and she died and was buried before he got there. He dedicated his life to giving the world a better way of communicating as a result. Several different people were working on the idea of a way to send messages by electricity over wires, but no one had really come up with a usable, practical system. The physics had largely been sorted, but the engineering was still lacking.

Morse came up with a basic version of an electrical telegraph system and he demonstrated it. Alfred Vail saw the demonstration and persuaded Morse to take him on as a partner. His father built a famous ironworks, and so he had worked as a machinist. He improved Morse's system enormously including making the tapping machine used to send messages.

He wasn't just good at engineering though. He was good at computational thinking, so he also worked on the code used for sending messages. Having a machine that can send taps down a wire is no use unless you can also invent a simple, easy to use algorithm that turns words into those taps, and back again once it arrives. Morse came up with a code based on words not letters. It was a variation of the system already used by semaphore operators. It involved a code book: essentially a list of words. Each word in the book was given a number. A second code turned numbers in to taps - in to dots and dashes. The trouble with this system is it is not very general. If the word you want to send isn't in the code book you are stuffed! To cover every possibility it has to be the size of a dictionary, with every word numbered. But that would make it very slow to use. Vail came up with a version where the dots and dashes represented letters instead of numbers, allowing any message to be sent letter by letter.

Alfred Vail was great at computational thinking

He also realised that some letters are more common than others. He therefore included the results of what we now call "frequency analysis" to make the system faster, working out the order of letters based on how common they are. He found a simple way to do it. He went to his local newspaper offices! To print a page of text, printing presses used metal letters called movable type. Each page was built up out of the individual metal letters slotted in to place. Vail realised that the more common a letter was, the more often it appeared on any page, and the more metal versions the newspaper office would therefore need if they wasn't to keep running out of the right letters before the page was done. He therefore counted how many of each "movable type" letter the newspaper printers had in their trays. He gave the letters that were most common the shortest codes. So E, for example, is just a single dot as it is the most common letter in American English. T which is also common is a single dash. It is this kind of attention to detail that made Morse code so successful. Vail was really good at computational thinking!

Morse and Vail worked really well as a team, though Morse then took all the credit because the original idea to solve the problem had been his, and their agreement meant the main rights were with Morse. They almost certainly worked together to some extent on everything to do with the telegraph. It is the small details that meant their version of the telegraph was the one that took over the world though and that was largely down to Vail. Morse maybe the famous one but the invention of the telegraph needed them both working together.