GATE / CS ARCHIVE

GATE CSE 2003 / QUESTION 54

Tagged halting and nonhalting languages

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

GATE 2003, Q54 2 marks · MCQ
Report issue

Decidability & Computability

Question 54, GATE 2003: Define L0={⟨M,w,0⟩: M halts on w} and L1={⟨M,w,1⟩: M does not halt on w}, where M is a Turing-machine encoding, w a string and the last component a bit. Let L=L0∪L1. Which is true?
A. L is recursively enumerable but its complement is not.
B. Its complement is recursively enumerable but L is not.
C. Both L and its complement are recursive.
D. Neither L nor its complement is recursively enumerable.
Question 54, GATE 2003: Define L0={⟨M,w,0⟩: M halts on w} and L1={⟨M,w,1⟩: M does not halt on w}, where M is a Turing-machine encoding, w a string and the last component a bit. Let L=L0∪L1. Which is true?
A. L is recursively enumerable but its complement is not.
B. Its complement is recursively enumerable but L is not.
C. Both L and its complement are recursive.
D. Neither L nor its complement is recursively enumerable.
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

1. The halting language H is recognizable, but its complement is not recognizable: recognizers for both would yield a decider by dovetailing them.
2. Map each halting-instance pair (M,w) to ⟨M,w,1⟩. It belongs to L exactly when M does not halt. Therefore a recognizer for L would recognize the complement of H, impossible.
3. Map the same pair to ⟨M,w,0⟩. It belongs to the complement of L exactly when M does not halt. A recognizer for that complement would give the same contradiction.
4. Neither tagged language is recognizable, so D. The different tags are essential; halting and nonhalting cases are not simply being unioned without a tag.

Solution: Let H be the halting language. If L were recursively enumerable, mapping (M,w) to ⟨M,w,1⟩ would make the complement of H recursively enumerable, a contradiction. If the complement of L were recursively enumerable, mapping (M,w) to ⟨M,w,0⟩ would again recognize the complement of H. Therefore neither L nor its complement is recursively enumerable, option D. The tag prevents the union from simply being the universal set.

Original paper, page 7