Question:

Which among the following cannot be accepted by a regular grammar?

Show Hint

The language \[ \{a^n b^n\} \] is the most famous example of a non-regular language.
Updated On: Jun 25, 2026
  • L is a set of numbers divisible by 2
  • L is a set of binary complement
  • L is a set of string with odd number of 0
  • L is a set of \(0^n1^n\)
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is D

Solution and Explanation

Concept: Regular grammars generate exactly the regular languages. A language is regular if it can be accepted by a finite automaton.

Step 1:
Analyze each language.
Numbers divisible by 2, binary complement patterns, and strings containing odd numbers of \(0\)'s can all be recognized using finite automata. Hence they are regular languages.

Step 2:
Consider \(0^n1^n\).
\[ L=\{0^n1^n\mid n\ge0\} \] requires matching equal numbers of \(0\)'s and \(1\)'s. A finite automaton has no memory to count arbitrarily large values of \(n\). Hence this language is not regular.

Step 3:
Write the answer.
Therefore, \[ \boxed{0^n1^n} \] cannot be generated by a regular grammar.
Was this answer helpful?
0
0