GATE / CS ARCHIVE

GATE CSE 2015 SET 1 / QUESTION 28

GATE CSE 2015 Set 1 Q28

Theory of Computation · Closure Properties & Language Hierarchy · Full GATE CSE 2015 Set 1 paper

GATE 2015 Set 1, Q28 1 mark · MCQ
Report issue

Closure Properties & Language Hierarchy

Question 28, GATE 2015: L1 is context-free; L2 is recursively enumerable but not recursive. Which must hold? I complement(L1) is recursive; II complement(L2) is recursive; III complement(L1) is context-free; IV complement(L1)∪L2 is recursively enumerable. A I only; B III only; C III and IV; D I and IV.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

A CFL has a terminating membership algorithm, so it and its complement are recursive. If complement(L2) had a decider, exchanging accept/reject would decide L2, a contradiction. CFL closure under complement fails in general, so III is not necessary. For IV, first decide whether the input is outside L1; accept if so, otherwise run the recognizer for L2. That algorithm recognizes the union and may loop only for nonmembers.

Solution: Every CFL is decidable, so complement(L1) is recursive. The complement of nonrecursive L2 cannot be recursive, because recursive languages are closed under complement. CFLs are not closed under complement. Since complement(L1) is recursive and L2 is RE, their union is RE by dovetailing recognizers. Hence I and IV, D.

Original paper, page 11 · Answer key