Computability Theory and Turing Machines

⚡ Key Takeaways

Computability theory studies which problems can in principle be solved by mechanical procedures. The central model is the Turing machine, an idealized computer with unlimited memory; the Church–Turing thesis asserts it captures every notion of "effective computation." Key result in words: there exist precisely defined problems (like the halting problem) that NO algorithm can solve. Applies across logic, computer science, and the foundations of mathematics. Pioneered by Alan Turing, Alonzo Church, Kurt Gödel, and Emil Post in 1936.

💡 The Core Insight

A computation is a finite, mechanical, rule-following process. Once you fix any reasonable formalization of this idea, you get the same class of computable functions. This robustness is what gives the concept its weight: "computable" is not an artifact of one machine design but a fundamental mathematical category. And because programs are finite strings, they can be counted and encoded as numbers — which lets a machine take other machines as input, and lets us run diagonalization to manufacture problems no machine can decide.

Formal Statement

DefinitionTuring Machine

A (deterministic, one-tape) Turing machine is a 7-tuple

1
M=(Q, Σ, Γ, δ, q0, qaccept, qreject)\quad M = (Q,\ \Sigma,\ \Gamma,\ \delta,\ q_0,\ q_{\text{accept}},\ q_{\text{reject}})

Derivation hint: this is a definition, not derived — each component names one physical part of the abstract device. where the symbols mean:

  • QQ — a finite set of states (the controller's internal configurations).
  • Σ\Sigma — the input alphabet, not containing the blank symbol.
  • Γ\Gamma — the tape alphabet, with Σ⊆Γ\Sigma \subseteq \Gamma and blank ⊔∈Γ\sqcup \in \Gamma.
  • δ:Q×Γ→Q×Γ×{L,R}\delta : Q \times \Gamma \to Q \times \Gamma \times \{L, R\} — the transition function.
  • q0∈Qq_0 \in Q — the start state.
  • qaccept,qreject∈Qq_{\text{accept}}, q_{\text{reject}} \in Q — the halting states (qaccept≠qrejectq_{\text{accept}} \neq q_{\text{reject}}).

The transition function reads

2
δ(q,a)=(q′, b, D),D∈{L,R}\quad \delta(q, a) = (q',\ b,\ D),\qquad D \in \{L, R\}

Derivation hint: from current state qq reading symbol aa, the machine moves to state q′q', overwrites aa with bb, and shifts the head one cell in direction DD. A configuration is a snapshot (q,w,i)(q, w, i) giving the current state, full tape contents, and head position. The machine halts if it ever enters qacceptq_{\text{accept}} or qrejectq_{\text{reject}}; otherwise it runs forever.

DefinitionDecidable and Recognizable Languages

Let L⊆Σ∗L \subseteq \Sigma^* be a language (set of strings).

  • LL is Turing-recognizable (recursively enumerable, r.e.) if some TM MM accepts exactly the strings in LL, and on strings not in LL either rejects or loops.
  • LL is decidable (recursive) if some TM accepts every string in LL and rejects every string not in LL — i.e. it always halts.

A function f:N→Nf : \mathbb{N} \to \mathbb{N} is computable if some TM, started with nn encoded on its tape, halts with f(n)f(n) encoded on its tape.

TheoremChurch–Turing Thesis

Every function that is "effectively calculable" by any mechanical procedure is computable by a Turing machine. Formally, the following classes coincide:

3
TM-computable=λ-definable=μ-recursive=register-machine-computable\quad \text{TM-computable} = \lambda\text{-definable} = \mu\text{-recursive} = \text{register-machine-computable}

Derivation hint: each equality is a separate constructive theorem (e.g. Kleene's proof that λ\lambda-definable == μ\mu-recursive); the thesis itself is the empirical claim that this common class equals the informal notion of "algorithm." The thesis is not a theorem — "effectively calculable" is informal — but it is supported by the convergence of every independent formalization onto the same class.

TheoremUndecidability of the Halting Problem

Let

4
HALT={ ⟨M,w⟩:M is a TM that halts on input w }.\quad \mathrm{HALT} = \{\,\langle M, w\rangle : M \text{ is a TM that halts on input } w\,\}.

Derivation hint: ⟨M,w⟩\langle M, w\rangle is a single string encoding both the machine's description and its input via a fixed Gödel encoding. Then HALT\mathrm{HALT} is Turing-recognizable but not decidable: no Turing machine decides, for all ⟨M,w⟩\langle M, w\rangle, whether MM halts on ww.

Why It Holds / Derivation

ProofHalting Problem is Undecidable — Diagonalization

1. Assume for contradiction a decider HH exists with

5
H(⟨M,w⟩)={acceptif M halts on w,rejectif M loops on w.\quad H(\langle M, w\rangle) = \begin{cases} \text{accept} & \text{if } M \text{ halts on } w,\\ \text{reject} & \text{if } M \text{ loops on } w.\end{cases}

Derivation hint: this is exactly the negation of "HALT\mathrm{HALT} is undecidable"; HH always halts by assumption. 2. Build a new machine DD that takes a single machine description ⟨M⟩\langle M\rangle as input and runs HH on ⟨M,⟨M⟩⟩\langle M, \langle M\rangle\rangle — i.e. asks "does MM halt when fed its own description?" 3. Invert the answer: DD is defined so that

6
D(⟨M⟩)={loop foreverif H(⟨M,⟨M⟩⟩)=accept,haltif H(⟨M,⟨M⟩⟩)=reject.\quad D(\langle M\rangle) = \begin{cases} \text{loop forever} & \text{if } H(\langle M,\langle M\rangle\rangle)=\text{accept},\\ \text{halt} & \text{if } H(\langle M,\langle M\rangle\rangle)=\text{reject}.\end{cases}

Derivation hint: DD does the opposite of what MM does on its own code — this is the diagonal flip. 4. Feed DD its own description. Consider D(⟨D⟩)D(\langle D\rangle). By the definition of DD:

  • If DD halts on ⟨D⟩\langle D\rangle, then HH said "halt," so by step 3 DD loops — contradiction.
  • If DD loops on ⟨D⟩\langle D\rangle, then HH said "loop," so by step 3 DD halts — contradiction.

5. Conclusion: both cases are impossible, so HH cannot exist. Hence HALT\mathrm{HALT} is undecidable. ■\blacksquare (That HALT\mathrm{HALT} is recognizable: simply simulate MM on ww; accept if it halts. This may loop, but it never wrongly rejects.)

∎
ProofMost Functions Are Uncomputable — Counting

1. Every Turing machine has a finite description, encodable as a finite binary string. So the set of TMs is at most countable:

7
∣{Turing machines}∣≤∣Σ∗∣=ℵ0.\quad |\{\text{Turing machines}\}| \le |\Sigma^*| = \aleph_0.

Derivation hint: finite strings over a finite alphabet form a countable union of finite sets. 2. The set of all functions N→{0,1}\mathbb{N} \to \{0,1\} has cardinality

8
∣{0,1}N∣=2ℵ0=c.\quad |\{0,1\}^{\mathbb{N}}| = 2^{\aleph_0} = \mathfrak{c}.

Derivation hint: Cantor's theorem — the power set of N\mathbb{N} is strictly larger than N\mathbb{N}. 3. Since there are only countably many machines but uncountably many functions, almost all functions are uncomputable. ■\blacksquare

∎
mathematician · Alan Turing | 1912–1954

British mathematician who, at age 23, defined the abstract machine now bearing his name in the 1936 paper "On Computable Numbers, with an Application to the Entscheidungsproblem." He introduced the universal machine, the halting argument, and the very idea of a stored-program computer years before electronic hardware existed. During WWII he led codebreaking at Bletchley Park against the German Enigma, work credited with shortening the war. His later interests included morphogenesis and machine intelligence (the "Turing test"). Persecuted for his homosexuality, he died in 1954; he received a posthumous royal pardon in 2013.

Building Intuition

🧠 Intuition

Picture a clerk with an infinitely long roll of squared paper, a pencil, and an eraser. The clerk follows a small fixed rulebook (the transition function): "in mood qq seeing symbol aa, write bb, change to mood q′q', step left/right." That's all a computer ever does — there is no hidden magic. The astonishing claim of computability theory is that this clerk can do anything any computer can do, just more slowly. The limits then become visceral. A program is itself just symbols on paper, so the clerk can read another clerk's rulebook and simulate it — this is the universal Turing machine, the mathematical ancestor of the general-purpose computer. But self-reference creates a trap: ask the clerk to predict whether an arbitrary clerk (possibly itself) will ever stop, and you can always construct a contrarian clerk that does the opposite of the prediction. The prediction task is therefore impossible in general, not merely hard.

Figure
A Turing machine: finite controller scanning an infinite tape
⊔ 1 0 1 1 0 ⊔ ⊔ ⊔ … … read/write head finite controller state q ∈ Q δ(q,a)=(q′,b,D)

Worked Examples

ExampleTracing a TM that increments a unary number

Given: A TM MM over Γ={1,⊔}\Gamma=\{1,\sqcup\} that appends a single `1` to a block of `1`s (computes n↦n+1n \mapsto n+1 in unary). Rule: in q0q_0, move right over `1`s; on hitting ⊔\sqcup, write `1`, then accept. Start tape: `111` (so n=3n=3), head on the leftmost `1`.

Steps (configuration = state · tape with head position underlined): 1. q0:q_0: `111⊔` → read `1`, move R → q0:q_0: `111⊔` 2. q0:q_0: `111⊔` → read `1`, move R → q0:q_0: `111⊔` 3. q0:q_0: `111⊔` → read `1`, move R → q0:q_0: `111⊔` 4. q0:q_0: `111⊔` → read `⊔`, write `1`, enter qacceptq_{\text{accept}} → tape `1111`

Boxed answer: f(3)=4\boxed{f(3) = 4} — the tape now holds four `1`s, the unary encoding of 44. Total steps: 44 transitions for input length 33, i.e. n+1n+1 steps.

ExampleCounting machines vs. functions concretely

Given: Restrict to TMs whose total description fits in k=1000k = 1000 bits, and ask how many distinct boolean functions on a single byte (88-bit inputs) exist.

Steps: 1. Number of TM descriptions ≤21000≈1.07×10301\le 2^{1000} \approx 1.07 \times 10^{301} machines (an upper bound on how many functions this finite family can compute). 2. Number of functions {0,1}8→{0,1}\{0,1\}^8 \to \{0,1\}: domain has 28=2562^8 = 256 inputs, so the count is

9
228=2256≈1.16×1077.\quad 2^{2^8} = 2^{256} \approx 1.16 \times 10^{77}.

Derivation hint: each of the 256256 inputs is independently mapped to 00 or 11, giving 22562^{256} truth tables. 3. Here 21000≫22562^{1000} \gg 2^{256}, so all 22562^{256} functions are describable within 1000 bits. But let the input width grow: functions on ww-bit inputs number 22w2^{2^w}, which for w=10w = 10 already gives 21024>210002^{1024} > 2^{1000}.

Boxed answer: 22w>21000 for w≥10\boxed{2^{2^w} > 2^{1000} \text{ for } w \ge 10} — already at 10-bit inputs there are more functions than 1000-bit programs, so some are not computable by any such program. Taking w→∞w \to \infty gives the uncountability gap of [8][8].

Common Misconceptions

⚠️ Common mistake

"Undecidable" ≠ "hard" ≠ "unknown." The halting problem is not merely intractable like NP-complete problems; it is provably impossible for any algorithm, regardless of time or memory. Also, undecidability is about deciding all instances uniformly — for any specific program you may well be able to determine whether it halts. The theorem only forbids a single general method that works for every input.

⚠️ Common mistake

The Church–Turing thesis is not provable. Because "effectively calculable" is an informal notion, the thesis cannot be a theorem; it could in principle be refuted by exhibiting a physically realizable procedure computing a non-Turing-computable function. No such device is known, and quantum computers do not violate it (they compute the same class of functions, only — for some problems — faster).

CounterexampleRecognizable but not decidable, and the gap between them

The complement of the halting problem, HALT‾\overline{\mathrm{HALT}} (machines that loop), is not even recognizable. If both HALT\mathrm{HALT} and HALT‾\overline{\mathrm{HALT}} were recognizable, run both recognizers in parallel; one must accept, giving a decider — contradicting undecidability. This shows recognizability is not closed under complement, unlike decidability. Concretely:

10
HALT∈RE,HALT‾∉RE,HALT∉R.\quad \mathrm{HALT} \in \mathrm{RE},\qquad \overline{\mathrm{HALT}} \notin \mathrm{RE},\qquad \mathrm{HALT} \notin \mathrm{R}.

Derivation hint: L∈RL \in \mathrm{R} iff both LL and L‾\overline{L} are in RE\mathrm{RE} (Post's theorem); HALT\mathrm{HALT} fails this.

Connections

connection

Computability theory underpins much of theoretical computer science and logic. It feeds directly into Complexity Theory, which refines "computable" into "computable within bounded resources" (P, NP, PSPACE). Its diagonalization technique is the same engine behind Gödel's Incompleteness Theorems — Turing's halting argument can be rephrased to prove that any consistent, sufficiently strong formal system has true-but-unprovable statements. The encoding of machines as numbers connects to Recursive Function Theory and to Formal Languages and Automata, where Turing machines sit atop the Chomsky hierarchy above pushdown and finite automata. The notion of one problem reducing to another links to Many-One Reducibility and the structure of Turing Degrees.

Real-World Applications

🔬 Where this appears

Historical Development

⏳ History
- 1900 — David Hilbert poses, among 23 problems, the Entscheidungsproblem: find an algorithm deciding the truth of any first-order statement.
- 1931 — Kurt Gödel proves his incompleteness theorems, showing arithmetic cannot be both complete and consistent — foreshadowing computational limits.
- 1933–34 — Gödel and Jacques Herbrand define general recursive functions.
- 1936 — Alonzo Church introduces the λ-calculus and proves the Entscheidungsproblem unsolvable; states "Church's thesis."
- 1936 — Alan Turing independently defines the Turing machine, the universal machine, and proves the halting problem undecidable, settling the Entscheidungsproblem.
- 1936 — Emil Post publishes a closely related "worker on a tape" model.
- 1937 — Turing proves λ-definability, μ-recursion, and TM-computability all coincide, unifying the field.
- 1943–53 — Stephen Kleene systematizes recursion theory; states the Church–Turing thesis in its standard form and proves the recursion (fixed-point) theorem.
- 1953 — Henry Gordon Rice proves Rice's theorem: every non-trivial semantic property of programs is undecidable.
- 1970 — Yuri Matiyasevich completes the proof (with Davis, Putnam, Robinson) that Hilbert's Tenth Problem is undecidable.

Subtleties & Limits

open-problem

Computability theory has a rich landscape of unresolved and subtle questions. The Busy Beaver function Σ(n)\Sigma(n) — the maximum number of `1`s a halting nn-state TM can print — grows faster than any computable function and is itself uncomputable; the exact value of Σ(5)\Sigma(5) was only confirmed (47,176,870) in 2024, and Σ(6)\Sigma(6) is astronomically beyond reach, recently shown to exceed 10↑↑1510\uparrow\uparrow15. Post's problem — whether there exist r.e. sets strictly between decidable and HALT\mathrm{HALT} in Turing degree — was solved (yes) by Friedberg and Muchnik in 1956 via the priority method, but the fine structure of the Turing degrees D\mathcal{D} remains an active research area with many open questions about its order-theoretic and automorphism properties. At the philosophical frontier, hypercomputation asks whether any physical process could compute beyond Turing limits — currently no, but the question intertwines with open problems in physics about the computability of physical law.

See Also

Church–Turing Thesis · Halting Problem · Rice's Theorem · Universal Turing Machine · Lambda Calculus · Recursive Function Theory · Complexity Theory · Gödel's Incompleteness Theorems · Busy Beaver Function · Turing Degrees