Practice free →
HomeGATE CSEcomputerscienceTheory of Computation › Which of these is an example of an IRREGULAR (no…

Which of these is an example of an IRREGULAR (non-regular) language?

AStrings over $\{0,1\}$ with at least three 0's
BBinary representations of multiples of 3
CStrings $w$ such that $|w| \bmod 5 = 2$
D$L = \{a^n b^n \mid n \geq 0\}$
Answer & Solution
Correct answer: D. $L = \{a^n b^n \mid n \geq 0\}$
1. To prove $L = \{a^n b^n \mid n \geq 0\}$ is non-regular, apply the Pumping Lemma. 2. Suppose $L$ is regular with pumping length $p$. Consider $s = a^p b^p \in L$ with $|s| = 2p \geq p$. 3. By the lemma, $s = xyz$ with $|xy| \leq p$ and $|y| \geq 1$. 4. Since $|xy| \leq p$ and $s$ starts with $p$ a's, both $x$ and $y$ lie within the $a$-prefix. So $y$ consists of only $a$'s. 5. Pump up: $xy^2z$ has MORE a's than b's — not in $L$. Contradiction. 6. So $L$ is NOT regular. ✓ Option D. 7. Options A, B, C are all regular (constructible DFAs): - At least three 0's: 4-state DFA tracking count up to 3. - Multiples of 3: 3-state DFA tracking remainder. - $|w| \bmod 5 = 2$: 5-state DFA tracking length mod 5. _Source: Jeff Erickson, "Models of Computation", §2.10 (Pumping Lemma application to $a^n b^n$)._
Solve this in the app — GATE CSE practice & 24k+ MCQs →
Related questions