Home › GATE CSE › computerscience › Theory 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$)._
Related questions
Which class of grammars generates ALL recursively enumerable languages?What is a LEFTMOST DERIVATION?Which of the following languages is CONTEXT-FREE?Consider the grammar $S \to (S) \mid SS \mid \varepsilon$. The language generated isEvery regular language is also context-free. The PROOF construction isThe CYK algorithm parses a CFG in CNF. Its time complexity for a string of length $n$ isA LEFT-RECURSIVE rule in a CFG has the form $A \to A\alpha$ for some non-empty $\alpha$. WContext-free languages are CLOSED under which of the following operations?