Study resource
A model of computation revision notes
Study A model of computation with curriculum-aligned Revision Notes resources, practice links, and exam-focused support.
At a glance
revision notes
Resource type
Topic
A model of computation
Revision notes
Turing Machines: A Formal Model of Computation
Structure of a Turing machine
A Turing machine can be viewed as a computer with one fixed program. The program is represented by a finite set of states and the transitions between them. The machine also has a finite alphabet of symbols, an infinite tape divided into marked-off squares, and a sensing read-write head. The head examines one square at a time, can replace the symbol in that square, and travels along the tape one square at a time. In the A-level questions described here, the tape is infinite in one direction.
One state is designated as the start state. A state with no outgoing transitions is a halting state. When the machine reaches a halting state, no further transition is available.
Transition rules
A transition rule specifies what happens for a particular current state and scanned symbol. It identifies the next state, the symbol to write, and the direction in which the head moves. A rule can be written in a transition-function form such as:
δ(q0, 1) = (q0, 1, R)This means: if the machine is in state
q0and reads1, it remains inq0, writes1, and moves the head one square to the right. A state transition diagram represents the same information graphically: an arrow leaves the current state and points to the next state, with a label showing the symbol read, the symbol written and the movement.The transition function and the diagram are two representations of the same transition rules. When tracing a machine, use the current state and the symbol under the head to select exactly one applicable rule.
Worked trace
Consider a machine with start state
q0and halting statehalt. Suppose its relevant rules are:δ(q0, 1) = (q0, 1, R)δ(q0, blank) = (halt, blank, R)
If the tape initially contains
111followed by blank squares, the head starts on the first1in stateq0. It reads the first1, leaves it unchanged, moves right and stays inq0. The same happens for the second and third1. On the next square it readsblank, changes tohalt, and stops. The machine has therefore scanned the consecutive1symbols and halted when it reached the first blank.Why Turing machines matter
Turing machines provide a general, formal model of computation. They give a precise way to describe a computation as a sequence of state changes, tape operations and head movements. They also provide a definition of what is computable. A Universal Turing machine is important because it provides a general computational model that can represent and carry out the behaviour of other Turing machines, rather than being restricted to one particular fixed computation.
Common errors
- Confusing the current state with the symbol currently under the head.
- Forgetting that the head writes before moving according to the transition rule.
- Treating a halting state as if it must have an outgoing transition.
- Moving the head more than one square for a single transition.
- Assuming that a state diagram and a transition function describe different programs; they are alternative representations of the same rules.
- Continuing a trace after the machine has entered a halting state.
Related topics
