The Timpson Lyceum · Computation Theory
Lecture 14 (Computation Theory) Church-Turing Thesis and the Definition of an Algorithm
Overview
This lecture pivots from the mechanics of Turing machines to the question they were invented to answer: what is an algorithm? It traces the historical motivation — Hilbert's 1900 list of 23 problems, and especially Hilbert's tenth problem on Diophantine equations — that exposed why a precise definition of "algorithm" was needed. It introduces the Church–Turing thesis: the claim that the informal notion of algorithm is exactly captured by what a Turing machine (equivalently, Church's lambda calculus) can compute. The lecture then practices high-level algorithm descriptions by proving several languages recognizable or decidable, and closes with the real-world consequences of Turing's work: the universal (reprogrammable) machine and the codebreaking that grew out of it.
Key Concepts
Recognizable vs. decidable (review).
- A language is Turing-recognizable if some Turing machine accepts every string in the language (it may loop forever or reject on strings not in the language).
- A language is decidable if some Turing machine accepts every string in the language and rejects every string not in the language — it always halts with a yes/no answer.
- Every decidable language is recognizable; the decidable languages are a proper subset of the recognizable ones.
Why a definition of algorithm was needed.
- Before Turing and Church, "algorithm" was understood only intuitively — e.g. Euclid's algorithm for the greatest common divisor is clearly a finite, mechanical procedure.
- Intuition is enough to recognize an algorithm when you see one, but it cannot prove that no algorithm exists for a given problem. Proving impossibility requires an exact, formal definition of computation.
Hilbert's problems (1900). David Hilbert posed 23 problems to guide the century's mathematics. Several turned out to have no resolution in Hilbert's intended sense:
- Problem 1 (Continuum Hypothesis): whether a set exists with size strictly between and — shown to be independent of the standard axioms (must be taken as an axiom either way).
- Problem 2 (consistency of arithmetic): Gödel's incompleteness theorems show a sufficiently strong system cannot prove its own consistency.
- Problem 10 (Hilbert's tenth problem): find an algorithm that decides whether an arbitrary Diophantine equation has an integer solution.
Diophantine equations. A polynomial in any number of variables with integer coefficients, set equal to zero, where only integer solutions count. For example has the integer solution . An "integer root" of the polynomial means integer values for all variables that make it evaluate to .
The Church–Turing thesis.
- In 1936, Alonzo Church proposed a formal definition of algorithm using lambda calculus; his student Alan Turing independently proposed one using Turing machines (Turing's paper, On Computable Numbers, with an Application to the Entscheidungsproblem).
- The two definitions are logically equivalent: any procedure one calls an algorithm, the other does too. Other later proposals have all proven equivalent as well, suggesting a very robust notion.
- The thesis is a claim, not a theorem: it asserts that the intuitive idea of "algorithm" is precisely what a Turing machine can do. Turing machines are easier to reason about than lambda calculus, which is one reason Turing's formulation became dominant.
- Hilbert's tenth problem was eventually proven to have no algorithm — its language is undecidable — but it required exactly this kind of formal definition to prove the negative.
Encoding inputs as strings. A Turing machine takes only strings. Any object (a polynomial, a graph, even another Turing machine) is first encoded as a string, written . The encoding scheme does not matter, only that one exists.
Universal Turing machine. Turing described a single machine that takes — the encoding of a Turing machine together with an input string — and simulates running on .
- If accepts , then accepts; if rejects , then rejects; if loops on , then loops.
- A program is simply an encoded Turing machine, so is the theoretical model of a reprogrammable computer — one machine that runs any software, configured by code rather than by rewiring hardware.
Historical consequences.
- Enigma: a rotor cipher machine. A single rotor rewires the 26 letters and advances by one position after each keypress; three rotors chained give wheel positions, times rotor orderings. Crucially the wiring is reciprocal (if A maps to Q, then Q maps to A) and no letter ever maps to itself — a weakness Turing exploited.
- The German military version used 5 rotors choose 3 in order ( ways) plus a plugboard swapping pairs of letters, exploding the keyspace into the hundreds of millions and beyond.
- Turing's bombe systematically searched rotor/plugboard configurations. Like early purpose-built machines, it was wired for one task — when the settings changed the hardware became near-worthless, illustrating why the universal (software-driven) machine was such a leap.
- An early universal electronic machine (ca. 1945) solved in ~30 seconds artillery-trajectory calculations that a human "computer" took ~20 hours to do — roughly 2,400× faster, paying back its ~$1M cost within months.
Worked Example
Claim. Let . Then is recognizable.
Recognizing strategy: test integer values of in an order that is guaranteed to reach every integer, and accept if any value drives to . Enumerating would never reach the negatives, so interleave them.
If has an integer root, eventually tests it and accepts; if not, runs forever. Hence recognizes (but does not decide) .
Extending to two variables. For (polynomials over and ), enumerate ordered pairs by dovetailing — sweeping the integer grid in expanding diagonals so every pair is eventually reached — and accept if any pair gives . The same idea generalizes to variables by dovetailing over a -dimensional grid, so the full Diophantine language is recognizable (though not decidable).
A decidable contrast (connected graphs). Let . The machine marks one node, then repeatedly marks any node adjacent to a marked node until no new node gets marked; it accepts if all nodes are marked and rejects otherwise. Because it always halts with an explicit accept-or-reject, is decidable.
Summary
- The Church–Turing thesis identifies the informal notion of "algorithm" with what a Turing machine can compute; lambda calculus and Turing machines are logically equivalent formalizations of it.
- A formal definition of algorithm was needed not to recognize algorithms but to prove none exists for a problem — motivated by Hilbert's tenth problem.
- A Diophantine equation is an integer-coefficient polynomial sought to be zero with integer-only solutions; the language of solvable Diophantine equations is recognizable but not decidable.
- Recognizable = accept every member (may loop otherwise); decidable = always halt and correctly accept or reject. Decidable recognizable.
- High-level algorithm descriptions (search-in-the-right-order, dovetailing, mark-and-spread) suffice once the Turing machine has fixed the precise model of computation; any object is fed in via a string encoding .
- The universal Turing machine simulates any encoded machine on any input — the theoretical basis for the reprogrammable computer, realized physically within a decade of Turing's 1936 paper.