GATE 2011 CS (CS1) – Question 34
P is regular and Q is context-free with Q⊆P, e.g. P=p*q* and Q={pⁿqⁿ:n∈N}. Which is always regular?
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (C) $\Sigma^*-P$
Explanation
Regular languages are closed under complement, so Σ*−P is always regular, C. P∩Q equals Q under the subset premise and can be nonregular. Removing a nonregular CFL from P, or complementing that CFL, does not guarantee regularity.
More Regular and Context-Free Languages, Pumping Lemma questions
- GATE 2011 CS (CS1) Q36
- GATE 2015 CS (CS2) Q46
- GATE 2025 CS (CS1) Q44
- GATE 2025 CS (CS1) Q45
- GATE 2025 CS (CS2) Q24
- GATE 2025 CS (CS2) Q30
All Regular and Context-Free Languages, Pumping Lemma questions →