GATE / CS ARCHIVE

GATE CSE 2001 / QUESTION 7(a)

Undecidability of nonhalting

Theory of Computation · Decidability & Computability · Full GATE CSE 2001 paper

GATE 2001, Q7(a) Descriptive
Report issue

Decidability & Computability

Question 7(a), GATE 2001: X asks whether a Turing machine M loops forever on input w. The halting problem H is assumed undecidable but partially decidable.

Task: Prove that X is undecidable.
Question 7(a), GATE 2001: X asks whether a Turing machine M loops forever on input w. The halting problem H is assumed undecidable but partially decidable.

Task: Prove that X is undecidable.
Question 7(a), GATE 2001: X asks whether a Turing machine M loops forever on input w. The halting problem H is assumed undecidable but partially decidable.

Task: Prove that X is undecidable.
Tap to enlarge
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.

Original paper, page 7