Track progress, take quizzes and save notes on this lesson.

Free forever · no card needed

Start free
Advanced

Turing Machines

4.4.5.1 Turing machine

Aligned to the AQA 7517 specification

Level
Advanced
Reading time
6 min
Published
13 June 2026
Updated
1 July 2026
On this page
  1. 1.What Is a Turing Machine?
  2. 2.The Transition Function
  3. 3.A Transition Table and Diagram
  4. 4.Hand-Tracing a Turing Machine
  5. 5.The Universal Turing Machine
  6. 6.Common Exam Mistakes

Key takeaways

  • A Turing machine is a theoretical model of computation made of a tape, a read-write head, a finite set of states Q, an alphabet Σ (including a blank symbol), and a transition function δ.
  • The transition function δ(q, s) → (q′, s′, D) has five components: current state, current symbol, new state, symbol to write, and move direction D ∈ {L, R}.
  • Halting states have no outgoing transitions, so the machine stops on entering one; there may be a separate accept state and reject state.
  • A Universal Turing Machine can simulate any other Turing machine by taking an encoding of that machine plus its input, making it the theoretical model for the stored-program computer.
  • Turing machines compute exactly the computable functions; the halting problem is non-computable, so a Turing machine cannot solve it for all inputs.

What Is a Turing Machine?

A Turing machine is a theoretical model of computation proposed by Alan Turing in 1936. It is not a real device — it is a mathematical model that defines what it means for a function to be computable.

A Turing machine consists of:

ComponentDescription
TapeAn infinite sequence of cells, each holding one symbol; extends infinitely in one direction
Read-write headReads the current cell; can write a new symbol to it; moves left or right one cell
Finite set of states ()The machine is always in exactly one state; includes a start state and halting states
Alphabet ()Finite set of symbols the tape can contain; includes a special blank symbol ( or )
Transition function ()Defines what the machine does in each (state, symbol) situation

Start state: the machine begins in a designated start state with the input written on the tape.

Halting states: states with no outgoing transitions. When the machine enters a halting state, it stops. There may be an accept state and a reject state.

The Transition Function

The transition function is the heart of a Turing machine. For each combination of current state and current symbol, it specifies:

  1. The new state to transition to
  2. The symbol to write on the current cell (may be the same as the current symbol)
  3. The direction to move the head: Left (L) or Right (R)

where = current state, = current symbol, = new state, = symbol to write, .

Example entry:

Meaning: in state , reading symbol 0 → write 1, move right, enter state .

The transition function can be represented as:

  • A transition table (rows = states, columns = input symbols)
  • A state transition diagram (circles = states, labelled arrows = transitions)

A Transition Table and Diagram

Machine: flip all 0s to 1s and all 1s to 0s on a tape, then halt

Alphabet: where = blank

StateSymbol readWriteMoveNew state
01R
10R
R (halt)

State transition diagram:

Trace — input tape: 0 1 1 0 B …

StepStateHead posTapeAction
110 1 1 0 Bread 0 → write 1, R
221 1 1 0 Bread 1 → write 0, R
331 0 1 0 Bread 1 → write 0, R
441 0 0 0 Bread 0 → write 1, R
551 0 0 1 Bread B → write B, R
661 0 0 1 Bhalt

Output: 1 0 0 1 (all bits flipped) ✓

Hand-Tracing a Turing Machine

When tracing a Turing machine step by step:

  1. Look up the current state and the symbol under the head in the transition table
  2. Write the new symbol to the current cell
  3. Move the head left or right as specified
  4. Transition to the new state
  5. Repeat until a halting state is reached (or it becomes clear the machine will not halt)

Machine: add 1 to a binary number

Alphabet: . The tape holds the binary number. The head starts at the rightmost digit.

StateReadWriteMoveNew state
10L (carry: keep flipping 1s to 0s)
01R (no carry: write 1, done)
1R (overflow: write leading 1)

Trace — adding 1 to 1 0 1 (head starts at rightmost digit, position 3):

StepStateHeadTapeAction
131 0 1read 1 → write 0, L
221 0 0read 0 → write 1, R
331 1 0halt

Result: 1 1 0 = 6 in binary. Input was 1 0 1 = 5. Correct: 5 + 1 = 6. ✓

Something not quite clicking?

Ask Aica to explain any part of this differently. Free, takes 30 seconds.

Ask Aica

The Universal Turing Machine

A Universal Turing Machine (UTM) is a Turing machine that can simulate any other Turing machine.

A UTM takes two inputs on its tape:

  • An encoding of the Turing machine to simulate (its states, alphabet, and transition function)
  • The input to be processed by

The UTM then simulates step by step on that input, producing the same output as if had run directly.

Why the UTM matters:

  1. It defines computability — a function is computable if and only if a Turing machine (and therefore a UTM) can compute it
  2. It is the theoretical model for the stored-program computer — a real computer executes a program (the encoding of the machine) stored alongside data (the input), just as a UTM simulates with 's description on the same tape
  3. It underpins the halting problem — Turing used the UTM to prove the halting problem is unsolvable

The Church-Turing thesis states that any function computable by any algorithm can be computed by a Turing machine. This means Turing machines define the absolute boundary of what is computable.

Common Exam Mistakes

1. Forgetting that halting states have no outgoing transitions

A halting state is defined by having no transitions — the machine simply stops. A state that has some transitions is not a halting state even if it could eventually be reached from itself.

2. Confusing the Turing machine with the UTM

An ordinary Turing machine solves one specific problem. A Universal Turing Machine can simulate any other Turing machine. They are different machines.

3. Getting the transition notation wrong

has five components: current state, current symbol, new state, symbol to write, direction. Missing the direction or confusing write-symbol with move-direction loses marks in transition table questions.

4. Stating that a Turing machine can compute anything

Turing machines can compute exactly the computable functions. The halting problem is an example of a non-computable function — no Turing machine can solve it for all inputs.

Key terms

Turing machine
A theoretical mathematical model of computation, proposed by Alan Turing in 1936, that defines what it means for a function to be computable.
Tape
An infinite sequence of cells, each holding one symbol, that extends infinitely in one direction and holds the machine's input and working data.
Read-write head
The component that reads the current cell, can write a new symbol to it, and moves one cell left or right.
Transition function (δ)
The function that, for each combination of current state and current symbol, defines the new state, the symbol to write, and the direction to move.
Alphabet (Σ)
The finite set of symbols the tape can contain, including a special blank symbol (B or ␣).
Halting state
A state with no outgoing transitions; when the machine enters one it stops. There may be an accept state and a reject state.
Universal Turing Machine (UTM)
A Turing machine that can simulate any other Turing machine, given an encoding of that machine and its input.
Computable function
A function that a Turing machine can compute; a function is computable if and only if a Turing machine can compute it.
Halting problem
The non-computable problem of deciding whether an arbitrary machine halts; Turing used the UTM to prove it is unsolvable.
Church-Turing thesis
The statement that any function computable by any algorithm can be computed by a Turing machine, setting the boundary of what is computable.

Frequently asked questions

An ordinary Turing machine solves one specific problem. A Universal Turing Machine (UTM) can simulate any other Turing machine by taking an encoding of that machine and its input on its tape, then simulating it step by step to produce the same output.

For each current state and current symbol, the transition function δ(q, s) → (q′, s′, D) specifies the new state to enter, the symbol to write on the current cell, and the direction to move the head, Left (L) or Right (R).

No. Turing machines can compute exactly the computable functions. The halting problem is an example of a non-computable function: no Turing machine can solve it for all inputs. The Church-Turing thesis sets Turing machines as the boundary of what is computable.

Generate revision on any topic you study

Type any topic you're studying and Aicademy generates a complete lesson, quiz, and flashcard set, personalised to your level.

Lessons on anything

Structured, level-matched lessons on any topic you study

Practice quizzes

Find out what you actually know before the exam does

Flashcard sets

Lock in key concepts with instant revision cards

Ask Aica

Stuck on something? Get a clear explanation, any time

Prev

Limits of Computation and Tractability

Next

Number Systems and Bases

Related lessons

Top students don’t revise more. They revise what counts.

Start revising free

Free to start. No card needed.