Open In App

GATE | GATE 2017 MOCK II | Question 40

Which of the following languages are regular over ∑ = {a, b} ?

L1 = { anbn | 0 L2 = { a2n | n ≥ 1}
L3 = { an! | n > 0}



(A) L2 only.
(B) L1 only.
(C) L1 and L2.
(D) None of L1, L2 and L3.

Answer: (C)
Explanation: Any language for which we have a finite set or we can possibly have a DFA drawn for it is regular.
L1: It gives a finite set generating string with equal number of a’s and equal number of b’s for range 0

Hence L2 is also regular.



L3: It gives all possible strings with a’s such that number of a’s are in factorial values of 1,2,3,4 ……. i.e. {a1, a2, a6, a24 ……………}. The set is neither finite nor a DFA is possible for such set. Hence L3 is not regular.

Quiz of this Question

Article Tags :