GATE 2013 CS (CS1) – Question 42
$L_1=\{0^p1^q0^r:p,q,r\ge0\}$ and $L_2=\{0^p1^q0^r:p,q,r\ge0,p\ne r\}$. Which statement is false?
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (D) The complement of L₁ is context-free but not regular
Explanation
L₁=0*1*0* is regular, so its complement is also regular. Thus D’s claim “not regular” is false. L₂ is a union of the p<r and p>r languages, each handled by stack comparison, so it is context-free. L₂⊆L₁ makes their intersection L₂; its complement is decidable by block checking and counting.
More Regular and Context-Free Languages, Pumping Lemma questions
- GATE 2011 CS (CS1) Q34
- 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
All Regular and Context-Free Languages, Pumping Lemma questions →