GATE 2016 CS (CS2) – Question 27
$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?
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
- GATE 2016 CS (CS2) Q28
- GATE 2016 CS (CS2) Q53
- GATE 2017 CS (CS2) Q14
- GATE 2017 CS (CS2) Q50
- GATE 2013 CS (CS1) Q42
- GATE 2011 CS (CS1) Q34
All Regular and Context-Free Languages, Pumping Lemma questions →