Which of the following languages is (are) non-regular? L1= {0m1n| 0 ≤ m ≤ n ≤…

2008

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}

  1. A.

    L2 and L3 only

  2. B.

    L1 and L2 only

  3. C.

    L3 only

  4. D.

    L2 only

Attempted by 47 students.

Show answer & explanation

Correct answer: D

Answer: Only L2 is non-regular.

  • L1 is regular. Reason: n is bounded by 10000, so there are only finitely many strings of the form 0^m 1^n with 0 ≤ m ≤ n ≤ 10000; every finite language is regular.

  • L2 (palindromes) is non-regular. Sketch of proof by the pumping lemma: assume L2 is regular with pumping length p. Consider the palindrome s = 0^p 1 0^p. Any decomposition s = xyz with |xy| ≤ p and |y| ≥ 1 forces y to consist only of 0's from the left block. Pumping y out (taking i = 0) yields fewer 0's on the left than on the right, so the resulting string is not a palindrome, contradicting the pumping lemma. Therefore L2 is not regular.

  • L3 is regular. Reason: a deterministic finite automaton with four states can track the parity (even/odd) of the number of 0's and the parity of the number of 1's; accept the state where both counts are even.

Conclusion: Only the palindrome language is non-regular; therefore the correct classification is that only L2 is non-regular.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Gate Guidance By Sanchit Sir