Which of the given languages are regular?

Which of the given languages are regular?

L1 : The set of all strings over {a,b} containing more a’s than b’s

L2 : The set of strings over {0,1} that have an equal number of 0’s and 1’s; and having an alternating pattern of 0’s and 1’s.

L3 : The set of strings over {0,1} than have an equal number of 0’s and 1’s in any pattern.

L4 : The set of all strings over {0,1}

 

(A) L4

(B)  L2, L4

(C) L1, L3, L4

(D) L2, L3, L4

Answer: B
L2:   (01)* U (10)*
L4:  (0+1)*

0Comment