Pumping lemma: practice problems with answers
The pumping lemma shows that a language is not regular: every long word would have to be pumpable without leaving the language.
Rules
- Pick w with |w| ≥ p
- Split w = xyz with |xy| ≤ p and |y| ≥ 1
- For every split find an i with xyⁱz ∉ L
Your turn
Three problems on this topic. The software checks your answer exactly.
- 1 · Pumping lemma
- 2
- 3
Pumping lemma for L = { aⁿbⁿ | n ≥ 0 } with p = 6. Take w = a⁶b⁶. The split is x = ε, y = a⁶, z = the rest. Pump with i = 2.
Number of a in xyⁱz
Number of b in xyⁱz
Is xyⁱz in L?
Worked example
Pumping lemma for L = { aⁿb²ⁿ | n ≥ 0 } with p = 5. Take w = a⁵b¹⁰. The split is x = a², y = a³, z = the rest. Pump with i = 0.
Worked solution
- 1Since |xy| ≤ p, y consists of a only. Number of a: 5 + (0 − 1) · 3 = 2
- 2The number of b stays 10.
- 3The ratio no longer holds, so the word is not in L.
Typical mistake: For the proof you have to cover every admissible split, not just one.
Common questions
Does the lemma prove that a language is regular?
No, it can only show non-regularity.
