The GATE Grind

GATE 2016 CS (CS2) – Question 27

Theory of Computation · Regular and Context-Free Languages, Pumping Lemma · 1 mark · Multiple choice

$S_1\to aS_1b\mid\epsilon$ generates L₁ and $S_2\to abS_2\mid\epsilon$ generates L₂. P says L₁ is regular; Q says L₂ is regular. Which is true?

  1. Both P and Q
  2. P true, Q false
  3. P false, Q true
  4. Both false

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (C) P false, Q true

Explanation

L₁ is {aⁿbⁿ:n≥0}, nonregular by the pumping lemma because arbitrarily many a’s must be matched by b’s. L₂ is $(ab)^*$, directly regular. Thus P is false and Q true, C.

More Regular and Context-Free Languages, Pumping Lemma questions

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