- Asked 3/7
- 2070 Chaitra
- 2073 Shrawan
Pumping lemma: aⁿb²ⁿ not regular
Short answer
The pumping lemma states that for any regular language there is a pumping length p such that every long enough string can be split into xyz with |xy|≤p, |y|≥1, and xy^iz in the language for all i. For L={aⁿb²ⁿ}, choosing a^p b^{2p} forces y to be only a's; pumping yields a mismatch in the 1:2 ratio, so L is not regular.
State the pumping lemma for regular languages and use it to prove that L = {aⁿb²ⁿ : n ≥ 1} is not regular.
Pumping lemma for regular languages
If L is a regular language, there is a constant p ≥ 1 (the pumping length) such that every string w ∈ L with |w| ≥ p can be written as w = xyz with
- |xy| ≤ p,
- |y| ≥ 1 (y ≠ ε),
- xyⁱz ∈ L for every i ≥ 0.
(p can be taken as the number of states of a DFA for L.)
Proof that L = {aⁿb²ⁿ : n ≥ 1} is not regular
Use proof by contradiction. Assume L is regular, and let p be its pumping length.
- Choose w = aᵖb²ᵖ. Then w ∈ L (n = p) and |w| = 3p ≥ p.
- Let w = xyz with |xy| ≤ p and |y| ≥ 1. Since the first p symbols of w are all a, both x and y consist only of a's. So y = aᵏ for some k with 1 ≤ k ≤ p.
- Pump with i = 2: the string xy²z = a^(p+k) b^(2p).
- For this to be in L, the number of b's must be twice the number of a's: 2p = 2(p + k), which gives k = 0. But k ≥ 1, so xy²z ∉ L.
This contradicts condition 3 of the lemma. Hence the assumption was false, and L = {aⁿb²ⁿ} is not regular. ∎
(Pumping with i = 0 also works: a^(p−k)b^(2p) has too many b's.)
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Pumping lemma: a^(n²) not regular · Theory of Computation, chapter 2 · asked 5×
- Pumping lemma: aⁿbaⁿ not regular · Theory of Computation, chapter 2
- Pumping lemma (CFL): ww not CF · Theory of Computation, chapter 3
- Pumping lemma: equal 0s and 1s · Theory of Computation, chapter 2 · asked 2×
- Pumping lemma (CFL): aⁿbⁿcⁿ not CF · Theory of Computation, chapter 3
- Pumping lemma: a^p, p prime · Theory of Computation, chapter 2 · asked 2×
- Closure properties of regular languages · Theory of Computation, chapter 2 · asked 2×
- Regular expressions and regular languages · Discrete Structure, chapter 2
- Closure properties of regular languages · Discrete Structure, chapter 2 · asked 2×