TM variants and the Church-Turing thesis
Variants of the Turing machine that do not add power (several tapes, a tape infinite in one or two directions, stay moves, nondeterminism, enumerators) and what they cost in time (a quadratic slowdown for several tapes, an exponential one for nondeterminism), encodings of machines and the universal Turing machine, and the Church-Turing thesis as a statement about the informal notion of algorithm rather than a theorem.
Why it exists
The Turing machine of the previous page is one specific model. Many natural changes (more tapes, a head that may stay, guessing) look as if they should make it stronger. The theorems on this page say they do not change what can be computed, only how fast. That robustness is the reason the Turing machine is accepted as the definition of "computable", which is the content of the Church–Turing thesis. GATE asks which variants are equivalent in power, what the cost of a simulation is, and what the thesis states.
Prerequisites
You need the definition of a Turing machine, its configurations and the difference between recognising and deciding (Turing machines).
Precise definitions
Two models are equivalent if they accept (or decide, or compute) exactly the same languages (functions). The equivalences below are proved by simulation: a machine of the first kind is turned into one of the second kind that does the same job.
| variant | equivalent to the basic machine? | cost of the simulation (quoted) |
|---|---|---|
| tape infinite in one direction only | yes | constant factor |
| head may stay in place () as well as move or | yes | constant factor |
| larger tape alphabet, several "tracks" on one tape | yes | constant factor |
| several tapes ( heads) | yes | time becomes |
| a two-dimensional tape | yes | polynomial |
| nondeterministic machine | yes | time becomes |
| enumerator (a machine that prints the strings of a language) | yes (for recognisers) | see dovetailing below |
| a pushdown automaton with two stacks | yes | polynomial |
| random-access machine, -calculus, -recursive functions | yes | polynomial for random-access machines |
How it works
Several tapes
A -tape machine has tapes with a head on each; one move reads the symbols under the heads, writes symbols, moves each head (, or ) and changes state. The input is on tape 1. Example: a two-tape machine for copies the 's onto tape 2, then, for every on tape 1, erases one copied symbol on tape 2; it accepts when both tapes reach their blanks together. It makes moves on , whereas the one-tape machine of the previous page, which walks back and forth, makes :
One tape against two tapes for a^n b^n: start
Computed by a script, not typed| n | one-tape machine (moves) | two-tape machine (moves) |
|---|---|---|
| n = 0 | ||
| n = 1 | ||
| n = 2 | ||
| n = 3 | ||
| n = 4 | ||
| n = 5 | ||
| n = 6 | ||
| n = 7 | ||
| n = 8 | ||
| n = 9 | ||
| n = 10 |
Step 0
Moves made on the input a^n b^n. One tape: 2n² + 2n + 1 (quadratic). Two tapes: 2n + 2 for n ≥ 1 (linear). Both machines decide the same language, checked on all strings up to length 10.
Both machines decide the same language (checked on all strings up to length ). Simulation of tapes by one tape: write the contents of the tapes one after another separated by a marker , and mark the cell under each head with a dotted symbol (the alphabet is extended). One move of the -tape machine becomes a sweep over the whole tape to read the marked symbols and a second sweep to update them; each sweep takes steps if moves have been made, so moves cost (quoted).
Nondeterminism
A nondeterministic Turing machine (NTM) has : several moves may apply, and the machine accepts if some sequence of choices reaches the accepting state. Its computations form a tree. Example: the NTM that accepts the strings over whose third symbol from the end is : on each it may guess "this is the symbol", then read two more symbols and look for the blank. The table follows all computations at once on an accepted and a rejected input:
Following all computations of a nondeterministic Turing machine: start
Computed by a script, not typed| time | abaab: configurations alive | abaab: states | abbbb: configurations alive | abbbb: states |
|---|---|---|---|---|
| after 0 moves | ||||
| after 1 moves | ||||
| after 2 moves | ||||
| after 3 moves | ||||
| after 4 moves | ||||
| after 5 moves | ||||
| after 6 moves |
Step 0
The machine accepts strings whose third symbol from the end is a: on each a it may guess that this is the symbol. abaab is accepted (True), abbbb is not (False). A deterministic machine simulates it by breadth-first search over these lists.
Simulation by a deterministic machine: search the computation tree breadth first, keeping the list of all configurations after moves, exactly as in the table; accept as soon as one of them is accepting. (Depth-first search would be wrong: an infinite branch could make it miss an accepting one.) If every configuration has at most successors, after moves there are at most configurations, which is the exponential cost; whether this exponential cost can be avoided is the P versus NP question. The two machines accept the same language: the simulation was checked against an explicit enumeration of all computation paths. A nondeterministic machine decides a language if all its computations halt; the simulation then halts on every input too.
Enumerators and dovetailing
An enumerator is a machine with a printer that, started on a blank tape, prints strings (possibly for ever); its language is the set of strings it prints. Enumerators and recognisers are equivalent. Given a recogniser , build the enumerator by dovetailing: in stage run for moves on the -th string (counting from ) of the list for every , and print a string the first time accepts it. A string on which loops never blocks the others, and every string accepted after moves is printed in stage :
Turning a recogniser into an enumerator (dovetailing): start
Computed by a script, not typed| output | string printed | stage | its number in the list | move budget in that stage | moves the machine needs |
|---|---|---|---|---|---|
| output 1 | |||||
| output 2 | |||||
| output 3 | |||||
| output 4 | |||||
| output 5 | |||||
| output 6 | |||||
| output 7 | |||||
| output 8 | |||||
| output 9 | |||||
| output 10 | |||||
| output 11 | |||||
| output 12 | |||||
| output 13 | |||||
| output 14 |
Step 0
In stage s the recogniser for 'contains b' is run for s − i moves on the i-th string for every i < s, and a string is printed the first time it is accepted. A machine that loops on some string never blocks the others, and every string of the language is printed in some stage.
Conversely, from an enumerator build a recogniser: run and accept if prints .
Encoding machines and the universal machine
A machine can be written as a string over a fixed alphabet: list the start and accepting states and all transitions. For the machine of the previous page that decides the description begins start=q0;accept=qa;q0,Y>q3,Y,R;q0,_>qa,_,R;q0,a>q1,X,R;.... Decoding this string recovers the machine exactly (checked for six machines). A universal Turing machine takes and , and simulates on : it accepts iff accepts , loops iff loops. A program that decodes and simulates agrees with direct simulation on all strings up to length for four machines. is the model of a general-purpose computer; it is also the machine that recognises , the language of pairs with accepting , a language that is recognisable but not decidable (next pages).
The Church–Turing thesis
Everything that can be computed by an algorithm, in the intuitive sense, can be computed by a Turing machine.
It is a thesis, not a theorem, because "algorithm in the intuitive sense" is not a mathematical notion: it cannot be proved, only supported. The evidence: every proposed formal model of computation (the -calculus of Church, Turing machines, -recursive functions of Gödel and Kleene, random-access machines, programming languages, two-stack machines) has turned out to compute the same functions, and no one has found an algorithm that a Turing machine cannot carry out. The strong (or extended) version claims that a Turing machine simulates every reasonable model with only a polynomial slowdown; it is more debatable (it is where quantum computers raise questions). Practical consequences: to show that a language is decidable one may describe an algorithm in plain language; to show it is undecidable one must show that no Turing machine, and by the thesis no algorithm, decides it.
Worked examples
EX 1Which variants add power
EasyA multitape Turing machine, a nondeterministic Turing machine, a machine whose head may stay in place, a machine with a one-way infinite tape: none recognises a language that a basic Turing machine cannot. A pushdown automaton with one stack does recognise fewer languages (not ); with two stacks it recognises all recursively enumerable languages.
EX 2Cost of the simulations
EasyA 3-tape machine that runs in moves is simulated by a one-tape machine in moves. A nondeterministic machine with branching degree that runs moves is simulated by breadth-first search over at most configurations after moves, hence in time exponential in .
EX 3Why breadth-first, not depth-first
MediumAn NTM may have a computation branch that never halts next to a short accepting branch. Depth-first search could follow the infinite branch for ever and never see the accepting one. Breadth-first search examines all configurations of depth in turn, so it finds the accepting configuration at its depth.
EX 4Enumerating a language by dovetailing
MediumThe recogniser for "contains " accepts after move, after moves, after . The strings are the 3rd, 5th and 9th in the list . The enumerator prints in stage , in stage and in stage (the table lists these and the later outputs). The strings , on which the recogniser loops, are never printed and never block anything.
EX 5Typical questions
GATE level(a) "A nondeterministic TM is more powerful than a deterministic TM." False (same languages); it may be faster. (b) "Every multitape TM has an equivalent single-tape TM." True. (c) "The Church–Turing thesis is a theorem." False; it is an unprovable thesis. (d) "A language is recursively enumerable iff some enumerator prints it." True. (e) "A PDA with two stacks is as powerful as a TM." True (quoted). (f) "A universal TM simulates any TM given its description." True.
Cheat box
Cheat box
- Same power as the basic TM: more tapes, two-way or one-way tape, stay moves, bigger alphabet, nondeterminism, enumerators, two stacks, RAM, -calculus.
- Costs: tapes one tape squares the time; NTM DTM exponential (search the tree breadth first).
- Enumerator from recogniser: dovetailing (stage runs the -th string for moves).
- Universal TM: input and ; recognises .
- Church–Turing thesis: intuitive algorithm = Turing machine; a thesis, not a theorem.
Traps and GATE patterns
Connections
Builds on
Across subjects
No cross-subject links yet.
Recognising versus deciding becomes the central distinction of the next page (decidable and recognisable languages); the universal machine is the engine of the halting problem (undecidability); the strict gap between the first and second stack leads back to the Chomsky hierarchy (hierarchy).
PYQs
2 previous year questions from your book. I re-solved each one myself (0 by running or simulating, 2 by reasoning only); the book's key is shown next to my answer. All PYQs
Which of the following pairs have DIFFERENT expressive power?
- (a)Deterministic finite automata (DFA) and Non- deterministic finite automata (NFA)
- (b). Deterministic push down automata (DPDA) and Non-deterministic push down automata (NPDA)
- (c). Deterministic single-tape Turning machine and Non-deterministic single tape Turning machine
- (d). Single-tape Turning machine and multi-tape Turning machine
Let A and B be finite alphabets and let # be a symbol
outside both A and B. Let f be a total function from A*
to B*. We say f is computable if there exists a Turing
machine M which given an input x ∈ A*, always halts
with f(x) on its tape. Let Lf denote the language {x #
f(x)│x ∈ A* }. Which of the following statements is
true:- (a)f is computable if and only if Lf is recursive.
- (b)f is computable if and only if Lf is recursively enumerable.
- (c)If f is computable then Lf is recursive, but not conversely.
- (d)If f is computable then Lf is recursively enumerable, but not conversely.
Self-check
Question 1
How much slower is the one-tape simulation of a -tape machine that runs in moves?
Show answerHide
It runs in moves.
Question 2
Why does the simulation of an NTM use breadth-first search?
Show answerHide
A depth-first search could get stuck in an infinite branch and never reach an accepting branch.
Question 3
Is the Church–Turing thesis a theorem?
Show answerHide
No: it relates an informal notion (algorithm) to a formal one and cannot be proved.
Question 4
How does dovetailing turn a recogniser into an enumerator?
Show answerHide
In stage it runs the recogniser for moves on the -th string for each and prints every string the first time it is accepted.
Revision card
One-screen revision
- Same languages: multitape, nondeterminism, stay moves, one-way tape, bigger alphabet, enumerators, two stacks.
- Time: (multitape), (NTM, breadth first).
- Dovetailing; universal machine ; encoding .
- Church–Turing thesis: a thesis about algorithms.
References
- ·Sipser, Introduction to the Theory of Computation (3rd edition), Section 3.2 (variants of Turing machines) and Section 3.3 (the definition of algorithm, the Church-Turing thesis)
- ·Hopcroft, Motwani, Ullman, Introduction to Automata Theory, Languages, and Computation (3rd edition), Section 8.4 (extensions to the basic Turing machine) and Section 8.6 (Turing machines and computers)
Verification
scripts/enum-checks/toc_compute.py: a two-tape machine and a one-tape machine for a^n b^n decide the same language on all strings up to length 10, with 2n + 2 and 2n^2 + 2n + 1 moves (n up to 40); a nondeterministic machine for 'the third symbol from the end is a' equals its predicate on all strings up to length 9, and the breadth-first simulation (the list of configurations after each move) equals an explicit enumeration of all computation paths, with at most 2^t paths after t moves; the encoding of machines as strings decodes back to the same machine and a universal program that decodes and simulates agrees with direct simulation on four machines and all strings up to length 8; the dovetailing enumerator built from a recogniser prints exactly the strings of the language, each once, in stage i + max(1, moves). The general simulation theorems (every multitape or nondeterministic machine has an equivalent single-tape deterministic machine, with the quoted slowdowns), the equivalence of enumerators with recognisers, the equivalence of the other models of computation and the Church-Turing thesis itself are textbook statements, QUOTED and not machine-proved (the thesis cannot be proved). Textbook chapter references are from memory. SECOND PASS (2026-11-02, done by the assistant, not a human check): every Self-check question was solved before the printed answer was read and all agreed; the definitions, worked examples, cheat box and traps were read claim by claim and the numbers re-derived by hand or by a small script (state counts, derivations, parse-tree and move counts, decomposition counts); tables and animations are machine output and were read, not re-run; No other defect found. Status raised to self-checked; verified needs a textbook or human check.
last verified: never
My notes (saved in this browser)