Part 03 / 06 1936 → 1945

Universal Machines and Secret Codes

Alan Turing imagined one machine that could do any job if it was given the right instructions, then helped build real machines to break the codes of a world war.

3 sections 1 interactive
§ 3.1

Turing and the Universal Computer

In 1936, British mathematician Alan Turing proposed a remarkable idea. Instead of building a different machine for every task, he imagined a single machine that could solve many different problems by following a set of instructions.

This theoretical device, now known as the , could read, store, and process information according to a program. Although it existed only on paper, the concept introduced the fundamental principle behind modern computers: a machine whose behavior can be changed simply by changing the instructions it receives.

The machine itself is surprisingly simple. It has a long tape divided into cells, each holding one symbol. A head looks at one cell at a time; it can write a new symbol there, then move one cell left or right. And the machine is always in some state, a note of what it is doing right now. A short table of rules says what to do for every state and every symbol. That table is the program.

§ 3.2 · interactive

Try it: run a Turing machine

The tape below holds a number in , where each place is worth twice the one to its right: 1011 means 8 + 0 + 2 + 1, which is 11.

Try it

Run a Turing machine

Press Step to watch one move at a time, or Run to let the machine work. Then choose another table of rules: the machine stays exactly the same, only its instructions change. While it is stopped, tap a cell to change the starting number.

Tape Tap a cell to change it
State register q1
Table of rules
StateReadWriteMoveNext
q110Lq1
q101LqH halt
q1□1LqH halt
  1. 1 Read
  2. 2 Look up
  3. 3 Write
  4. 4 Move
  5. Halt
1011= 11 at the start
1011= 11 on the tape now

Press Step to watch one move at a time, or Run to let the machine work.

After A. M. Turing, “On Computable Numbers”, 1936. In the rule tables, q1 is the working state and qH means halt; □ is a blank cell.

Turing went one step further. He showed that a single machine, given another machine’s rule table written on its tape, could imitate that machine exactly. One universal machine could do the work of all the others. Your phone does the same thing every time you open a different app.

Turing’s idea laid the foundation for computer science and helped shape the design of the programmable computers that would soon emerge.

§ 3.3

Computing During World War II

During World War II, Alan Turing worked at Bletchley Park, Britain’s secret codebreaking centre, where he helped design the “Bombe,” a machine used to break the German Enigma code. It built on the work of Polish mathematicians, who had first broken Enigma in the 1930s and shared their methods with Britain and France just before the war.

Enigma scrambled every letter by passing it through spinning wheels called rotors, and every key press turned them, so the same letter came out differently each time. To break a day’s messages, codebreakers guessed a word that was probably in one of them, which they called a crib. Then they had to find the setting that turned the scrambled letters back into that word. That search was the Bombe’s job: it tested the settings electrically, far faster than anyone could by hand.

At the same time, engineer Tommy Flowers and his team built Colossus, an electronic machine designed to crack another, even tougher German . It was the first programmable electronic digital computer, though it was kept secret for decades after the war. These wartime projects demonstrated the power of automated computation and accelerated the development of electronic computers. Soon, machines that once existed only in theory would become a reality.

When the war ended, Colossus stayed a secret. In America, a much bigger electronic machine was about to be shown to the world.

Sources for this part

Alan Turing

Enigma

Colossus and wartime computing

Series The Machine That Changed Everything
Menu

Gears & Signals · Static site · No trackers