Undecidability and the Halting Problem

Context: FIT2014_MOC Ā· names the ring left open by Decidability and Decision Problems — the first explicitly undecidable language, and the seed every later undecidability proof reduces from (Proving Undecidability by Reduction)

Quick Revision

  • šŸŽÆ Objective: is undecidable āž” assume a decider , build that does the opposite of what predicts about , read off the contradiction.
  • šŸ“¦ Core Components: counting āž” some language is undecidable | diagonalisation āž” this language is undecidable | āž” the one-argument version the proof actually kills.
  • āš ļø Key Constraint: undecidable ≠ unanswerable. Every individual has a Yes/No answer; what cannot exist is one machine that halts with the right answer on every instance.

šŸ“ How It Works

1. Undecidable languages exist (the counting argument)

  • Deciders are countable āž” (Encoding Turing Machines (Code Words)), and is countable ⟹ at most countably many decidable languages.
  • Languages are uncountable āž” Cantor diagonalisation on (Countability and Cantor Diagonalisation).
  • Conclusion āž” forces undecidable languages to exist — but this is a pure existence proof: it exhibits none, which is exactly why the Halting Problem is needed.

2. The problem itself

Halting Problem. Input: a Turing machine and an input . Question: if is run on , does it eventually halt?

  • As a language āž” , via the problem ⟷ language bridge of Decidability and Decision Problems.
  • Halting, not accepting āž” the question is whether stops in any state; Accept and Reject both count as halting, only is the No-answer.
  • Historical name āž” Hilbert’s Entscheidungsproblem; killed independently by Church (1936, -calculus) and Turing (1936–37, Turing machines).
  • Diagonal Halting Problem āž” Input: a TM . Question: does halt on input ? The one-argument restriction — and the version the proof below actually refutes, hence the version every reduction starts from.
  • Programs are strings āž” is a word over (Encoding Turing Machines (Code Words)), so it is a perfectly legal input to a machine — the stored-program idea is what makes ā€œrun on ā€ meaningful rather than a category error.
  • Proof ingredients āž” contradiction diagonalisation a machine version of the Liar Paradox (ā€œthis sentence is falseā€).

🧮 Proof Blueprint — the Halting Problem is undecidable

Theorem. The Halting Problem is undecidable. Equivalently, no decider settles .

Strategy āž” assume the decider, use it to build a machine whose behaviour must contradict the decider’s own verdict on that machine.

šŸ“Š Manual Execution Trace — the diagonalisation table

Rows are TMs (by code word), columns are inputs; āœ“ halts, āœ— loops forever. is defined to flip the shaded diagonal.

TM / input
āœ“āœ—āœ—āœ“
āœ—āœ—āœ“āœ“
āœ“āœ“āœ—āœ—
āœ“āœ—āœ“āœ“
āœ—āœ“āœ“āœ—
  • Reading the flip āž” ā€˜s entry in column is the negation of the diagonal entry ⟹ disagrees with machine on input , for every .
  • The kill āž” is itself a machine, so it owns a row; at its own column it must disagree with itself. The table therefore cannot exist, and — which is what made constructible — cannot either.

āš ļø Common Mistakes

  • šŸ’” ā€œUndecidable means we don’t know the answerā€ āž” wrong on both counts. Each instance has a definite answer, and infinitely many are easy; undecidability denies a uniform total algorithm, nothing more.
  • šŸ’” Confusing halting with accepting āž” a machine that halts in Reject is a Yes-instance of the Halting Problem. Only contributes No-instances.
  • šŸ’” ā€œJust simulate on ā€ āž” simulation (Universal Turing Machine) recognises halting but never certifies looping — it gives with , i.e. r.e. but not decidable (Recursively Enumerable Languages). Timeouts do not fix it: no computable bound on running time exists.
  • šŸ’” Objecting that ā€ run on ā€ is nonsense āž” it is not; is just a string, and compilers compiling themselves is the everyday instance.
  • šŸ’” Claiming the counting argument proves the theorem āž” counting yields existence only. Without diagonalisation you cannot name a single undecidable language, and reductions need a named one to start from.

🧠 Active Recall