GATE 2015 CS (CS2) – Question 46
Which languages are regular? $L_1=\{wxw^R:w,x\in\{a,b\}^*,\ |w|,|x|>0\}$; $L_2=\{a^nb^m:m\ne n,\ m,n\ge0\}$; $L_3=\{a^pb^qc^r:p,q,r\ge0\}$.
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (A) L₁ and L₃ only
Explanation
For L₁, any valid word begins and ends in the same symbol and has at least three symbols; conversely choose w as its first symbol and x as the nonempty middle. Hence L₁=a(a+b)+a ∪ b(a+b)+b, regular. L₃=a*b*c* is regular. If L₂ were regular, its complement within a*b* would give the nonregular equal-count language. Thus A.
More Regular and Context-Free Languages, Pumping Lemma questions
- GATE 2025 CS (CS1) Q44
- GATE 2025 CS (CS1) Q45
- GATE 2025 CS (CS2) Q24
- GATE 2025 CS (CS2) Q30
- GATE 2025 CS (CS2) Q52
- GATE 2024 CS (CS1) Q23
All Regular and Context-Free Languages, Pumping Lemma questions →