The GATE Grind

GATE 2013 CS (CS1) – Question 42

Theory of Computation · Regular and Context-Free Languages, Pumping Lemma · 2 marks · Multiple choice

$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?

  1. L₂ is context-free
  2. L₁∩L₂ is context-free
  3. The complement of L₂ is recursive
  4. The complement of L₁ is context-free but not regular

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

All Regular and Context-Free Languages, Pumping Lemma questions →