GATE | Gate IT 2008 | Question 33

Which of the following languages is (are) non-regular?

L1 = {0m1n | 0 ≤ m ≤ n ≤ 10000}
L2 = {w | w reads the same forward and backward}
L3 = {w ∊ {0, 1} * | w contains an even number of 0’s and an even number of 1’s}
(A) L2 and L3 only
(B) L1 and L2 only
(C) L3 only
(D) L2 only


Answer: (D)

Explanation:  

1. L 1 is a regular language, as it can be derived by a trivial DFA with 10000 states for each alphabet in the grammar to limit on the number of 0s and 1s to 10000.
2. L 2 is a set of all palindromic strings, which isn’t a regular language because there is no way for a finite automaton to remember which alphabets have occurred.
3. L 3 is a standard regular language as there exists a DFA which can derive this language. You can read more in the references about it.

Reference :
http://stackoverflow.com/questions/17420332/need-regular-expression-for-finite-automata-eve 17434694#17434694

This solution is contributed by vineet purswani.

Quiz of this Question

My Personal Notes arrow_drop_up
Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.