Free tools Windows power users keep installed
One-click scans. No signup required.
To prove a language is not regular with the pumping lemma, assume it is regular, take the pumping length supplied by that assumption, and choose a long string in the language. Then show that every split permitted by the lemma can be pumped to produce a string outside the language. The crucial point is that you must handle every valid split—not just a convenient one.
What the pumping lemma says
If a language L is regular, there is an integer p ≥ 1 such that every string w in L with |w| ≥ p can be written as w = xyz, satisfying:
As an Amazon Associate I earn from qualifying purchases.
- |xy| ≤ p
- |y| > 0
- xyiz is in L for every integer i ≥ 0
Here, y is a nonempty part of the string that can be repeated or removed. The condition |xy| ≤ p confines it to the first p symbols. The lemma follows from the behavior of a deterministic finite automaton: in a sufficiently long accepted input, a state repeats, forming a loop that can be traversed more or fewer times.
The proof pattern
- Assume regularity. This assumption gives you a pumping length p.
- Choose a string. Pick w in the language with |w| ≥ p, chosen so the lemma’s split constraints have useful consequences.
- Consider every permitted split. Let w = xyz be any decomposition satisfying |xy| ≤ p and |y| > 0.
- Choose a pump count. Show that for each such split, at least one value of i ≥ 0 makes xyiz fall outside the language.
- Reach a contradiction. The lemma says every pumped string must remain in the language. If one must leave, the assumption that L is regular is false.
The quantifiers determine who controls each choice: the assumption supplies p; you choose w after p is fixed; then the argument must defeat every valid decomposition. Only after considering a decomposition do you choose a pump count that breaks membership.
#1 Best Overall
Worked example: equal numbers of zeros followed by ones
Consider L = {0n1n | n ≥ 0}. Each string has a block of zeros followed by an equally long block of ones. We will show that this language is not regular.
- Assume, for contradiction, that L is regular, and let p be its pumping length.
- Choose w = 0p1p. It belongs to L and is at least p symbols long.
- Take any valid split w = xyz. Since |xy| ≤ p, the parts x and y lie within the first p symbols, all of which are zeros. Since |y| > 0, y contains at least one zero and no ones.
- Set i = 2. Repeating y adds zeros without adding any ones, so xy2z has more zeros than ones and is not in L.
This works for every valid split, contradicting the requirement that all pumped strings stay in L. Therefore, L is not regular.
Rank #2
Common mistakes to avoid
- Choosing one convenient split: A regular language needs only one valid split to satisfy the pumping property. To contradict it, your proof must show that every split meeting the constraints fails for some pump count.
- Choosing the pumping length yourself: The assumed regularity supplies p. Your witness string must be selected after that value is fixed.
- Checking only one pump count: The lemma requires membership for every i ≥ 0. Your proof needs a value that breaks membership for each candidate split; that value may depend on the split.
- Treating the lemma as a test for regularity: It gives a necessary property of regular languages, not a complete characterization. A language that satisfies the pumping property is not thereby proved regular.
When to use Myhill–Nerode instead
The pumping lemma is not guaranteed to prove every nonregularity claim. Myhill–Nerode provides a full characterization: a language is regular exactly when its indistinguishability relation has finitely many equivalence classes. To prove nonregularity with this method, construct infinitely many prefixes that are pairwise distinguishable by suffixes. See the Boston University CS 332 Myhill–Nerode handout for the theorem and its contrast with the pumping lemma.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsFor instance, the language {aibj | i ≥ j} is an example for which a pumping-lemma nonregularity argument can fail, while distinguishable prefixes can be used to show nonregularity. A failed pumping-lemma attempt says only that this proof technique did not establish the claim; it does not show that the language is regular. The University of Central Florida COT 4210 Myhill–Nerode handout discusses this limitation.
Choose between the methods based on the proof obligation: the pumping lemma requires reasoning about all permitted decompositions of a chosen string, while Myhill–Nerode requires an infinite family of pairwise distinguishable prefixes. Use whichever yields the shorter, clearer argument for the language at hand.
Quick Recap
Best Value
Rank #4
- Alfred Publishing Co. Model#0016486
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




