← Student tools · Problem 5 · Lecture 6 · Round 1 (30 pts)

HALTTM is undecidable

Reduce ATM to HALTTM. The first reduction proof in the course.

CLO-2 · Reductions Round 1 · 30 pts Lecture 6
🔊 Listen

The halting problem is the most famous undecidable problem in computer science. Every introductory book mentions it. Here is the precise statement: no program can examine an arbitrary program + input and reliably tell you whether that program will eventually halt or run forever.

Practically, this means:

What we are about to prove

HALTTM = {⟨M, w⟩ : M halts on w} is not Turing-decidable. Strategy: assume a decider R for HALTTM exists, then build a decider S for ATM using R as a subroutine. We already know ATM has no decider — contradiction.

🔊 Listen

A reduction is the workhorse of complexity theory. We say "problem A reduces to problem B" if a solver for B gives us a solver for A. Notation: A ≤ B.

The contrapositive is what we exploit: if A is unsolvable, then B is unsolvable too (because solving B would solve A — but A cannot be solved).

Two flavors of reduction
  • Turing reduction (≤T) · A's decider is allowed to call B's decider as a subroutine any number of times and do additional computation around the calls.
  • Mapping (many-one) reduction (≤m) · A's decider produces one input for B; that one yes/no answer is exactly A's answer. Stricter, cleaner, preserves recognizability.

For HALTTM we present the Turing reduction first (intuitive), then the mapping reduction (in Q4 below) for completeness.

🔊 Listen

Assume R is a decider for HALTTM. Define:

Decider S for ATM

S = "on input ⟨M, w⟩:
  1. run R(⟨M, w⟩) — does M halt on w?
  2. if R rejects: reject (M loops, so M does not accept).
  3. if R accepts: simulate M on w directly (guaranteed to halt).
  4. accept iff the simulation accepts."

S decides ATM: it always halts (step 3 is safe because R confirmed M halts), and it outputs the correct answer. But Problem 3 told us no decider for ATM exists. Contradiction ⇒ R does not exist ⇒ HALTTM is undecidable.

🔊 Listen
The reduction ATM ≤ HALTTM · stage by stage Auto-plays
🔊 Listen

Suppose we have these two specific inputs:

⟨M, w⟩ M's actual behavior on w R's answer (step 1) S's answer (final)
M1 = "always loop", w = ε loops forever reject reject (step 2)
M2 = "check parity", w = 0000 halts, accepts (even length) accept accept (sim accepts)
M3 = "check parity", w = 000 halts, rejects (odd length) accept reject (sim rejects)

Every row terminates with a definite yes or no. Look closely at row 1: S never tried to simulate M1. R told us up front it would loop, so we shortcut to reject without ever running M1. That shortcut is what makes S a decider rather than just a recognizer.

🔊 Listen

All of these proofs share the structure: "If you could solve me, you could solve ATM — which you can't."

🔊 Listen
  1. Reducing in the wrong direction. To prove B undecidable, reduce a known undecidable problem to B (not the other way around). "A ≤ B" means B is at least as hard as A.
  2. Forgetting why simulation is now safe. Direct simulation of M(w) only terminates because R already confirmed M halts. Without R, step 3 could loop.
  3. Believing HALT is even harder than ATM. Both have the same degree of unsolvability; reductions go both ways.
  4. "R rejected, so M halts but rejects." No — R rejecting means M does not halt at all. R is a decider for HALT, not for accept.
  5. Mixing up Turing and mapping reductions. Turing reductions can do extra work after the call; mapping reductions cannot. For undecidability, either kind suffices.
🔊 Listen
🔊 Listen

Total time: 10 minutes.