Decidability & Computability



Shared context
X asks whether a Turing machine M loops forever on input w. The halting problem H is assumed undecidable but partially decidable.
Answer & solution
Answer: X is undecidable. (no official key was published)
1. For a fixed valid encoding ⟨M,w⟩, exactly one possibility holds: M halts on w, or it runs forever. Thus X is the complement of H on valid encodings.
2. Assume a decider D for X exists. A decider always terminates and correctly answers both yes and no instances.
3. Construct a halting decider by running D on ⟨M,w⟩ and reversing its answer. If D says loops forever, answer does not halt; if D says does not loop forever, answer halts.
4. This new algorithm terminates on every input because D does, contradicting the assumed undecidability of H. Therefore no such D exists. Mere simulation does not refute this result: observing a halt is possible, but waiting forever is not a terminating negative test.