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

ETM is undecidable

Reduce ATM to ¬ETM: build M' whose language is Σ* iff M accepts w.

CLO-2R1·30 ptsL6
🔊 Listen

"Is this program's language empty?" is one of the most basic questions you can ask about a TM — and it is undecidable. This means: there is no algorithm that, given an arbitrary program, can tell you whether it ever produces any output on any input. Practical examples: "does this regex with backreferences match any string?" "does this program have any reachable accepting path?" — undecidable in general.

What we prove

ETM = {⟨M⟩ : L(M) = ∅} is not decidable. We give a mapping reduction ATMm ¬ETM, showing ETM is at least as hard as ATM.

🔊 Listen

We turn a question about M accepting one specific input w into a question about a new machine M' accepting anything at all. The trick: hard-code w inside M', and have M' ignore its input.

Construction of M' (from ⟨M, w⟩)

M' = "on input x:
  1. ignore x;
  2. simulate M on w;
  3. if M accepts: accept x."

Note ⟨M, w⟩ is finite, so writing M' down is computable. The map ⟨M, w⟩ ↦ ⟨M'⟩ is the reduction.

🔊 Listen

Two cases:

So ⟨M, w⟩ ∈ ATM ⇔ ⟨M'⟩ ∉ ETM. If we had a decider for ETM, we could build a decider for ATM (run the ETM-decider, flip the answer). Impossible ⇒ ETM is undecidable.

🔊 Listen
Construct M' stage by stage Auto-plays
🔊 Listen

Take M = "accept iff input length is a multiple of 3", w = "aaaaaa" (length 6).

Now change w to "aaaaa" (length 5).

The "membership in ATM" question (does M accept w?) became "is L(M') empty?" — a question about ETM.

🔊 Listen
🔊 Listen
  1. "M' runs M on x, not on w." No! M' runs M on the fixed w that's hard-coded inside M'. Otherwise the trick fails.
  2. Reducing the wrong direction. We need ATM ≤ ETM, not the other way. The known-undecidable problem must be the source.
  3. Confusing ¬ETM with ETM. The reduction gives M accepts w ⇔ L(M') = Σ*, which is ⟨M'⟩ ∉ ETM. So we reduce to the complement; that still shows ETM undecidable.
  4. "M' must halt to be a valid TM." No — a TM is valid even if it loops on every input. L(M') = ∅ is perfectly legal.
  5. Trying to make L(M') = {w}. Tempting but wrong. The trick is L(M') = Σ* vs ∅, because that's the question ETM asks about.
🔊 Listen
🔊 Listen

Total time: 10 minutes.