GATE 2017 CS (CS2) – Question 14
L₁,L₂ are context-free and R is regular. Which are correct? I: L₁∪L₂ is context-free. II: $\overline{L_1}$ is context-free. III: L₁−R is context-free. IV: L₁∩L₂ is context-free.
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (B) I and III only
Explanation
CFLs are closed under union, proving I. Also $L_1-R=L_1\cap\overline R$; regular languages are complement-closed and intersecting a CFL with a regular language preserves context-freeness, proving III. CFLs are not generally closed under complement or intersection, so II and IV fail. Thus B.
More Regular and Context-Free Languages, Pumping Lemma questions
- GATE 2017 CS (CS2) Q50
- GATE 2013 CS (CS1) Q42
- GATE 2011 CS (CS1) Q34
- GATE 2011 CS (CS1) Q36
- GATE 2015 CS (CS2) Q46
- GATE 2025 CS (CS1) Q44
All Regular and Context-Free Languages, Pumping Lemma questions →