GATE / CS ARCHIVE

GATE CSE 2005 / QUESTION 56

Complements of recursive and enumerable languages

Theory of Computation · Closure Properties & Language Hierarchy · Full GATE CSE 2005 paper

GATE 2005, Q56 2 marks · MCQ
Report issue

Closure Properties & Language Hierarchy

Question 56, GATE 2005: L1 is recursive; L2 is recursively enumerable but not recursive. Which is true of their complements? A complement L1 recursive and complement L2 RE; B complement L1 recursive and complement L2 not RE; C both complements RE; D complement L1 RE and complement L2 recursive.
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

A recursive language has a halting decider, whose accept/reject outputs can be swapped to decide its complement. If both L2 and its complement were recursively enumerable, dovetailing their recognizers would decide L2, contradicting its nonrecursive premise. Thus complement(L1) is recursive and complement(L2) is not recursively enumerable, B.

A decider always halts, so swapping its accept/reject outcomes gives a complement decider. A recognizer need not halt on nonmembers, so that swap does not work for an arbitrary RE language. If both L2 and its complement had recognizers, run them in alternating steps on any input. Exactly one must eventually accept, deciding which side the input belongs to. That would contradict the given nonrecursive status. Thus B, with the nonhalting possibility explaining the distinction.

Original paper, page 7