Group2 Assignment2 TOC
Group2 Assignment2 TOC
GROUP PROJECT
Topic: Pumping Lemma Application
Group 2 2|Page
Pumping Lemma Application
I. Explanation of pumping lemma for regular languages
Pumping lemma for regular languages is one of the most critical concept in the theory
of computation, which serves as a fundamental tool in formal language theory to prove
that certain languages are not regular. The language are not the regular languages since
they cannot be recognized by a finite automaton due to their structural complexity.
According to the pumping lemma for regular languages, if a language L is regular, there
exists a the pumping length of positive integer p, such that any string s in L with a length
of at least p (|s| ≥ p) can be divided into three substrings like s = xyz, satisfying three
specific conditions
• The length of substring y is greater than zero (|y| ≥ 1), meaning y is non-empty
• The combined length of substrings x and y is less than or equal to p (|xy| ≤ p)
• For all integer i ≥ 0, the string xyiz (where y is repeated i times) must also belong
to L.
Basically, the pumping lemma theory ensure that after the substring y is pumped
repeatedly with any number of times, the final string remains within the language,
provided the language is regular.
The pumping lemma proves that a language is not regular through a proof by
contradiction. The process involves assuming that a given language L is regular, which
implies the existence of a pumping length p. Then, selecting a string s from L with |s| ≥
p to be able to split it into three substrings x, y, and z based on the lemma’s constraints.
The goal is to prove that with at least one i, the pumped string xyiz is not in L, thereby
contradicting the assumption of regular language. If a contradiction exists, L will not be
regular.
Consider the language L = {a^n b^n | n ≥ 1}, which consists of strings with an equal
number of ‘a’s followed by ‘b’s (‘ab’, ‘aabb’, ‘aaabbb’,….). First, assuming that L is
regular and let p is the pumping length. Then, choosing the string s = a^p b^p with the
total length of 2p, which is greater than or equal to p. According to the pumping lemma
theory, s must be split into three substrings xyz where |xy| ≤ p and |y| ≥ 1. Since |xy| ≤
p, the substring x must consist only ‘a’, and |y| ≥ 1 must consists at least one ‘a’. If we
pump y by choosing i = 2, the resulting string xy2z will contain more ‘a’s than ‘b’s,
which is not in L. Due to this contradiction no matter how we choose specific y within
the constraints, the assumption of regular language is contradicted, then L is not regular.
Pumping lemma is a necessary condition for regular language, not a sufficient one. The
impossibility to find a contradiction does not mean that a language is regular; the lemma
is strictly a tool for disproof. A common error in pumping lemma application is selecting
an inappropriate string s or failing to consider all possible substrings of x, y, and z.
In conclusion, the pumping lemma is a fundamental tool in formal language theory,
particularly useful for proving that a certain language is not regular. Although pumping
lemma is not useful in confirming whether a language is regular, it plays a significant
role in contradicting to show that a language is not regular. The pumping lemma can be
applied in analyzing and classifying formal languages by using its condition of
application and the way to construct counterfactual arguments.
Group 2 3|Page
Pumping Lemma Application
II. Example of pumping lemma application
1. Given the language L = {a^n b^n c^n | n ≥ 1}, applying the pumping lemma step-
by-step to this language is not regular
Step 1: assume that L is regular
Step 2: Let p as pumping length such that every string s∈ L where |s| ≥ p may be
divided into 3 parts s = x y z such that the following conditions must be true:
• |y| ≥ 1
• |xy| ≤ p
• xyiz ∈ L for all i ≥ 0
Step 3: Choose the string s = a^p b^p c^p ∈ L
Step 4: Reasoning
• |xy| ≤ p, so x contains only ‘a’
• |y| ≥ 1, so y contains at least one ‘a’
Now the string will be:
• x = a^k
• y = a^m (where m ≥ 1, and k + m ≤ p)
• z = a^(p - k - m) b^p c^p
Let’s pump y with i = 2:
xy2z = a^k (a^m)^2 a^(p - k - m) b^p c^p
= a^(k + 2m + (p - k - m)) b^p c^p
= a^(p + m) b^p c^p
As we can see, the new string is not in L since the number of ‘a’s is greater than the
number of ‘b’s and the number of ‘c’s. After all, the pumping does not satisfy the
condition xyiz ∈ L for all i ≥ 0. As a result, the language L = {a^n b^n c^n | n ≥ 1} is not
regular.
Step 5: Example
Let p = 3, and the string s = aaabbbccc.
For i = 2, I will have xy2z, leading to the number of ‘a’ being greater than the number
of ‘b’s, and the number of ‘c’s, which is not in L
Step 6: Conclusion
So L₂ is not regular.
2. Given the language L₂ = { ww | w ∈ {a, b} }*, applying the pumping lemma step-
by-step to this language is not regular
Step 1: Assume L₂ is regular.
Step 2: Let p be the pumping length.
Step 3: Choose the string
s = a^p a^p ∈ L₂ (which is of form ww, where w = aᵖ)
Step 4: Reasoning
Group 2 4|Page
Pumping Lemma Application
Assuming L is a regular language, there exists a pumping length p such that any string
'S' where |S|≥P may be divided into 3 parts S = xyz.
If the language failed to meet one of these condition, the language is considered as non-
regular:
• |y|≥1
• |xy|≤p
• xyᶦ z∈A for all I≥0
Notice that if p is located in the 2nd w, we will violated the 1st condition: |xy| ≤ p.
(aaaaaaaa) y = ‘aa’, x = ‘aaa’ |xy| = 5 > p = 4
y is only in the 1st w and y contain at least 1 a
• y = a^k (k >=1)
• x = a^m (m = p - k, m >=0)
• z = a^(p - k - m) a^p
Given s = xyᶦ z, if we alter I in a way that it violate xyᶦ z∈A for all I≥0, L would
consider as non-regular
Step 5: Example: p = 4, s = aaaaaaaa
aaaaaaaa, y = ‘aaa’
for i = 2, s = aaaaaaaaaaa ∉ L₂ (not in the form of ww)
Step 6: Conclusion:
So L₂ is not regular.
III. The visual flowchart explaining proof strategy
Step 1: Assume that L is regular
Step 2: Let p as a pumping length
Step 3: Choose a specific string s, which belongs to L
Step 4:
Split the string s into three substring x, y and z
Resoning the substrings according to the conditions of pumping lemma theory with
|y| ≥ 1
|xy| ≤ p
Step 5: Choose a value I to pump substring y
Step 6: Check if the pumped string is in L or not
If yes, we come back step4 and do again
If nop, move to step 7
Step 7: The pumped string is not in L, leading to the contradiction with the condition
xyⁱz ∉ L for all i ≥ 0
Step 8: Conclude that L is not regular
Group 2 5|Page
Pumping Lemma Application
Group 2 6|Page