GATE / CS ARCHIVE

GATE CSE 2016 SET 2 / QUESTION 18

GATE CSE 2016 Set 2 Q18

Theory of Computation · Closure Properties & Language Hierarchy · Full GATE CSE 2016 Set 2 paper

GATE 2016 Set 2, Q18 1 mark · MCQ
Report issue

Closure Properties & Language Hierarchy

Question 18, GATE 2016: L1 is regular, L2 context-free, L3 recursive and L4 recursively enumerable. Which are always true? I ¬L3∪L4 is RE; II ¬L2∪L3 is recursive; III L1*∩L2 is context-free; IV L1∪¬L2 is context-free. Complements use the common alphabet-star. A I only; B I,III; C I,IV; D I,II,III.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

The source complement bars matter. I: complement(L3) is recursive and its union with RE L4 is RE. II: every CFL is recursive, so complement(L2) and its union with recursive L3 are recursive. III: L1* is regular and its intersection with a CFL is CFL. IV is not guaranteed because taking L1 empty leaves complement(L2), and CFLs are not closed under complement. Thus I, II, III, D.

Do not confuse “not context-free” with “undecidable.” Every CFL has a terminating membership algorithm, so its complement is decidable even though it may cease to be context-free. For III, run a finite automaton for L1* alongside a pushdown automaton for L2. The finite control adds no second stack, preserving context-freeness.

Original paper, page 30 · Answer key