Pumping Lemma
It says: if is regular, there is a constant (pumping length) such that any string in with can be split into three parts where:
-
(middle part is non-empty)
-
(loop happens early)
-
for all
-
Formal Statement
If is a regular language, then there exists an integer (called the pumping length) such that any string in with can be written as:
where:
-
is not empty),
-
(i.e., the “loop”——occurs within the first characters),
-
For all , (i.e., you can pump any number of times, and the resulting string stays in )
- If A is a regular language, then some DFA M decides the language.
- Let p be the number of states in M.
- Consider any string s∈ A with length greater than or equal to p. The characters in s will cause the machine to transition through a number of states, eventually reaching an accepting state after the last character in s.
- Because the number of characters in s equals or exceeds the number of states in M, the machine will pass through at least one state more than once as M reads s. That is, the path that s traces through the machine has at least one loop in it.
- For this argument we will use the first repeated state along the path: we will circle back around to that state for the first time before we have processed p characters.
- We divide our path into three parts: x is the portion of s that leads from the start state to the first occurance of the repeated state. y is the part of s that traces the loop back around to the repeated state. z is the final part of s that takes us eventually to the accepting state.
- M will now accept any string of the form xy^iz for i ≥ 0, because such a string takes M from start to the repeated state, goes i times around the loop back to the repeated state, and then runs from the repeated state on to the accepting state.
Proof (via DFA and Pigeonhole Principle)
Follows the classic DFA-based argument:
-
Let .
-
Set , the number of states in .
-
Consider any string with .
-
As processes , it transitions through states. By the pigeonhole principle, since there are only distinct states, some state must repeat within the first
-
Decompose as:
-
: the prefix leading up to the first occurrence of that repeated state,
-
: the substring that loops from the first to the second occurrence of that same state,
-
: the remaining suffix.
-
-
This guarantees:
-
is non-empty (it represents at least one transition),
-
,
-
Pumping —i.e., repeating it—keeps the machine in the same looped state and thus for all
-
Use of the Pumping Lemma
-
Main purpose: To prove a language is not regular.
-
How:
-
Assume is regular.
-
Apply the lemma to a carefully chosen string in .
-
Show that pumping breaks the property of the language.
-
Conclude is not regular (proof by contradiction).
We can say,If an infinite Language (L) does not satisfy all three conditions of the Pumping Lemma, then it is not a regular language.
Detailed Examples
Language:
Goal: Show L is not regular.
-
Assume is regular.
-
Let be the pumping length given by the lemma.
-
Choose the specific string , which is in and satisfies .
-
According to the lemma, with:
-
— so and consist only of s,
-
— for some .
-
-
Pump with :
.
Now the number of s (which is ) is not equal to the number of s (), so . -
This contradicts the pumping lemma’s requirement that for all .
Thus, cannot be regular—proof by contradiction is complete.
- We want to prove that A = { aⁿbⁿ | n ≥ 0 } is not regular.
- Assume A is regular and let the pumping length be p = 3.
- Choose a string S = aaabbb from A (n = 3).
- Split S into x = aa, y = a, z = bbb, where |xy| ≤ p and |y| > 0.
- Pump y: xy²z = aaaabbb, which has 4 a’s and 3 b’s → not in A.
- So, the string after pumping is not in the language → A is not regular
A simple, short description of the given example to prove that the language A = { anb2n | n ≥ 0 } is not Regular is given below
- We want to prove that A = { aⁿb²ⁿ | n ≥ 0 } is not regular.
- Assume A is regular and let the pumping length be p = 3.
- Choose a string S = aaabbbbbb from A (n = 3 → 3 a’s and 6 b’s).
- Split S into x = aa, y = a, z = bbbbbb, where |xy| ≤ p and |y| > 0.
- Pump y: xy²z = aaaabbbbbb, which has 4 a’s and 6 b’s → not in A (should be a⁴b⁸).
- So, the string after pumping is not in the language → A is not regular
A straightforward, short description of the given example to prove that the language A = { yy | y ∈ {0,1}* } is not Regular is given below
- We want to prove A = {yy | y ∈ {0,1}*} is not regular.
- Assume it is regular and choose a string S = 0101 from A.
- Let pumping length be p = 2, so |xy| ≤ 2 and |y| > 0.
- Split: x = 0, y = 1, z = 01 → S = xyz = 0101.
- Pump y: xy²z = 01101, which is not in the form yy.
- So, pumping fails → A is not regular.
Comments
Post a Comment