sciencebriefs
13:00in productionCh. 1 · A question from Hilbert/ 13:00 · ceiling 15 min
Computing & AI

Halting problem

Turing's 1936 proof that no algorithm can tell, for every program and input, whether that program will ever stop running set a permanent boundary on what computation can decide.

In a 1936 paper written to answer a question posed by David Hilbert, Alan Turing described an abstract computing device and used it to show that no single procedure can look at an arbitrary program and its input and always correctly say whether the program will finish or run forever. The argument works by contradiction: assume such a checker exists, then build a program that does the opposite of whatever the checker predicts about itself, which the checker cannot get right either way. Alonzo Church reached an equivalent result at almost the same time using a different mathematical language. The finding still governs what software tools can and cannot promise about a program's behaviour.

Chapters & takeaways6
  1. 0:08
    A question from Hilbert

    The problem grew out of David Hilbert's request for a general method to settle mathematical statements mechanically.

  2. 2:10
    Turing's machine

    Turing invented an abstract device, later called the Turing machine, to give 'algorithm' a precise meaning before he could prove anything undecidable.

  3. 4:20
    The self-referring trap

    The proof builds a program that asks a hypothetical halting-checker about itself and then contradicts whatever answer comes back.

  4. 6:30
    Church's parallel route

    Alonzo Church proved the same limit independently using lambda calculus, and the two results converged into one thesis about what counts as computable.

  5. 8:40
    A life beyond the proof

    Turing went on to codebreaking work during the war, early stored-program computer design, and a proposal for testing machine intelligence.

  6. 10:50
    What the limit still does

    The undecidability result underlies why no tool can universally guarantee a program terminates, and it generalises to other properties of programs.

Worth your time?

Yes. Study the whole thing.

4.5/ 5
What works
  • the contradiction at the heart of the proof is genuinely followable without a maths degree
  • it connects a 1930s puzzle to problems every programmer still runs into
  • it gives Turing's other work the context his wartime fame usually crowds out
What does not
  • it does not walk through Church's lambda-calculus version in comparable depth
  • the practical consequences for everyday software testing are easy to skate past
Study it if
  • anyone curious why software verification has hard limits
  • readers interested in the foundations of computer science
  • people who know Turing only from the war film version
Skip it if
  • readers wanting a step-by-step formal proof
  • anyone after a biography rather than the mathematics
The written brief4 min read

A question from Hilbert

The claim is narrow and precise: there is no general algorithm that, given any program and any input, always correctly decides whether running that program on that input will eventually stop or carry on forever. This is not a claim that halting is unknowable in specific cases, which is often easy to determine, but that no single procedure works for every case. Turing set out the result in a 1936 paper answering a decision problem posed by the mathematician David Hilbert, who had asked whether a finite mechanical method could settle the truth of any mathematical statement. Turing’s answer, reached independently at almost the same time by Alonzo Church working with a different formal system, was that no such universal method exists, and the halting question became the clearest illustration of why.

Turing’s machine

To make the claim precise, Turing first had to define what an algorithm was, since no such definition existed. He described an abstract machine, since called the Turing machine, that reads and writes symbols on an endless tape according to a fixed set of rules, and argued that this simple device could carry out any calculation a human following instructions could. With that definition fixed, the proof proceeds by contradiction. Suppose a program existed that could always correctly say whether any other program halts on a given input. Turing showed how to build, from that supposed checker, a further program that asks the checker about its own behaviour and then deliberately does the opposite of what the checker predicts, leaving no consistent answer the checker could have given.

The self-referring trap

The structure of the argument, sometimes compared to Cantor’s diagonal method for showing some infinities are larger than others, holds up as a piece of mathematics regardless of what hardware or programming language one imagines running the machine on. It does not depend on speed, memory size, or any feature of a particular computer, only on the assumption that a checker exists that always answers correctly for every program and input pair. Because the contradiction follows purely from that assumption, the conclusion applies to any computational system capable of the same range of behaviour as a Turing machine, which by the Church-Turing thesis includes essentially every general-purpose computer built since. Church’s independent proof, using recursive functions and lambda calculus rather than an abstract machine, reached the identical limit by a different formal road.

Church’s parallel route

The result is a statement about what a fully general method can achieve, not about every individual case. For a specific, ordinary program, it is very often possible to say with confidence whether it halts, and much of software engineering rests on being able to do exactly that for the programs people actually write. Tools exist that can verify termination for large classes of realistic code, including work cited on Windows device drivers. What the theorem rules out is a single procedure that succeeds on every conceivable program without exception, including deliberately constructed pathological ones. It also does not address how long a halting program takes to finish, only whether it finishes at all, and it says nothing about programs running on machines with finite, bounded memory, where the question becomes decidable in principle.

A life beyond the proof

The halting problem’s real reach is as a template. Rice’s theorem, building on the same argument, shows that almost any non-trivial question about what a program’s behaviour will be, not just whether it halts, is equally undecidable in general. That result quietly limits what any static analysis tool, compiler warning, or automated bug-checker can promise: none of them can be complete for every program, only reliable for the ordinary ones people write. The same undecidability argument also underwrites a weaker version of Gödel’s incompleteness theorems, linking a practical question about running code to a foundational question about what mathematics itself can prove. It is one of those results that started as an answer to a fairly abstract decision problem and ended up describing a boundary that every piece of software, then and now, quietly lives inside.

What the limit still does

This is worth an hour for the proof alone, which is short, self-contained, and does not require prior computer science to follow: the trick of building a program that contradicts a prediction about itself is one of those ideas that, once seen, changes how you read claims about what software can guarantee. It rewards patience more than speed reading, since the payoff is in sitting with the contradiction until it clicks rather than skimming past it. Readers who want Turing the wartime codebreaker or the persecuted mathematician will find that material better served elsewhere; this is squarely about the argument and its consequences. For anyone who writes software, debugs it, or simply wants to understand why no tool can promise to catch every infinite loop, it is time well spent.

Same field · Computing & AI4 of 46
13:00
Cellular automatonWorking at Los Alamos with Stanislaw Ulam, John von Neumann designed a cellular automaton, a grid of cells each following the same simple rule based on its neighbours, as a way to ask whether a machine could construct a working copy of itself without outside help. His design used 29 possible states per cell and produced a genuine universal constructor, a theoretical proof that self-reproduction did not require anything mysterious, years before the structure of DNA was known. The idea of a grid governed by local rules later took on a life of its own, most famously in John Conway's Game of Life and in Stephen Wolfram's later classification of how such simple systems can behave, from settling down to running forever without repeating.
13:00
Lambda calculusAlonzo Church proposed that computation could be fully captured by variables, function abstraction and application, plus a single substitution rule. After an inconsistency in his first version was found and fixed, the resulting untyped lambda calculus was shown equivalent to Turing machines, encoded arithmetic and recursion purely as functions, and became the direct template for functional programming, while also producing the first problem ever proved formally undecidable.
13:00
Turing machine1936Alan Turing's 1936 paper introduced an abstract device, now called a Turing machine, consisting of an infinite tape of symbols and a finite table of rules for reading, writing and moving along it, built to answer David Hilbert's question of whether mathematics is fully decidable. Turing proved it is not, by showing that no machine can determine in general whether another arbitrary machine will ever halt, the halting problem. The same model, alongside Alonzo Church's independent and near-simultaneous proof using different mathematics, became the basis of the Church-Turing thesis, the working definition of what 'computable' means, while remaining a poor description of how real, fast computers are actually built.
10:54
Évariste Galois1811–1832Galois defined solvability by radicals in terms of group structure — not calculation. He introduced normal subgroups, solvable groups, and finite fields. His results are exact, general, and still operative. They do not extend to algorithms, numerics, or physics. His work matters because it draws a permanent line between what is algebraically decidable and what is not.
Up next in Science

Hayflick limit

Hayflick · 12:05

Cells don’t die from bad conditions — they count their divisions and stop.

12:05