ScholarQuill logoScholarQuillUniversity Notes
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
Study Tools
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
Contact
ScholarQuill logo
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
ScholarQuill logoScholarQuillUniversity Notes
Study PortalCOMP3148Pumping Lemma Nonregul…
Ctrl + K
Login
Explore
Search
Semester
Papers
CGPA
    COMP3148

    Theory of Automata

    Progress0 / 25 done
    Topics25
    1Finite State Models2Language definitions preliminaries3Regular expressions/Regular languages4Finite automata (FAs)5Transition graphs (TGs)6NFAs7Kleene's theorem8Transducers (automata with output)9Pumping lemma and non-regular language10Grammars and PDA11CFGs12Derivations, derivation trees and ambiguity13Simplifying CFLs14Normal form grammars and parsing15Decidability16Context sensitive languages17Grammars and linear bounded automata (LBA)18Chomsky's hierarchy of grammars19Turing Machines Theory20Turing machines21Post machine22Variations on TM23TM encoding24Universal Turing Machine25Defining Computers by TMs
    11 min read
    Topic 9 of 25
    Topic Study Note Illustration
    09

    Pumping lemma and non-regular language

    The Pumping Lemma is a fundamental tool in the theory of formal languages, particularly in proving that certain languages are non-regular . It provides a necessary property...

    Pumping Lemma and Non-Regular Languages

    The Pumping Lemma is a fundamental tool in the theory of formal languages, particularly in proving that certain languages are non-regular. It provides a necessary property that all regular languages must satisfy. The Pumping Lemma for regular languages is often used to demonstrate that a given language is not regular by showing that it fails to satisfy this property.

    Pumping Lemma for Regular Languages

    The Pumping Lemma states that for any regular language LLL, there exists a constant ppp (called the pumping length) such that any string sss in LLL that has a length greater than or equal to ppp can be split into three parts, s=xyzs = xyzs=xyz, satisfying the following conditions:

    1. Length of y: ∣y∣>0|y| > 0∣y∣>0, meaning yyy is non-empty.
    2. Length of x and y: ∣xy∣≤p|xy| \leq p∣xy∣≤p, meaning the length of the combined string xyxyxy is at most ppp, which ensures that xxx and yyy are within the first ppp characters of sss.
    3. Pumping Condition: For all i≥0i \geq 0i≥0, the string xyizxy^i zxyiz is also in the language LLL. This means that repeating (pumping) the portion yyy any number of times (including zero) results in a string that still belongs to the language LLL.

    In other words, if LLL is a regular language, for any sufficiently long string s∈Ls \in Ls∈L, we can decompose sss into three parts xxx, yyy, and zzz such that the middle part yyy can be "pumped" (repeated any number of times) and the resulting strings will still belong to the language.

    Pumping Lemma Formal Statement

    Let LLL be a regular language. Then there exists a constant ppp (the pumping length) such that for any string s∈Ls \in Ls∈L with ∣s∣≥p|s| \geq p∣s∣≥p, we can write sss as:

    s=xyzs = xyzs=xyz

    where:

    • ∣xy∣≤p|xy| \leq p∣xy∣≤p,
    • ∣y∣>0|y| > 0∣y∣>0,
    • For all i≥0i \geq 0i≥0, xyiz∈Lxy^i z \in Lxyiz∈L.

    Using the Pumping Lemma to Prove a Language is Non-Regular

    To prove that a language LLL is non-regular, we can use the pumping lemma to derive a contradiction. Here's how the process works:

    1. Assume that LLL is regular.
    2. By the pumping lemma, there exists a pumping length ppp for LLL.
    3. Choose a string s∈Ls \in Ls∈L such that ∣s∣≥p|s| \geq p∣s∣≥p.
    4. Decompose sss into three parts s=xyzs = xyzs=xyz, where:
      • ∣xy∣≤p|xy| \leq p∣xy∣≤p,
      • ∣y∣>0|y| > 0∣y∣>0,
      • For all i≥0i \geq 0i≥0, xyiz∈Lxy^i z \in Lxyiz∈L.
    5. Analyze what happens when the string is pumped, particularly for different values of iii. If for any iii, the resulting string xyizxy^i zxyiz does not belong to LLL, then we have a contradiction.
    6. Conclusion: Since we reached a contradiction, our original assumption that LLL is regular must be false. Therefore, LLL is non-regular.

    Example: Using the Pumping Lemma to Prove a Language is Non-Regular

    Consider the language L={anbn∣n≥0}L = \{ a^n b^n | n \geq 0 \}L={anbn∣n≥0}, which consists of strings of the form anbna^n b^nanbn where the number of aaa's is equal to the number of bbb's.

    We want to prove that LLL is non-regular using the pumping lemma.

    Step 1: Assume LLL is Regular

    Assume that LLL is regular. Then, by the pumping lemma, there exists a pumping length ppp such that any string s∈Ls \in Ls∈L of length at least ppp can be split into three parts s=xyzs = xyzs=xyz such that:

    • ∣xy∣≤p|xy| \leq p∣xy∣≤p,
    • ∣y∣>0|y| > 0∣y∣>0,
    • For all i≥0i \geq 0i≥0, xyiz∈Lxy^i z \in Lxyiz∈L.

    Step 2: Choose a String s∈Ls \in Ls∈L

    Let’s choose the string s=apbps = a^p b^ps=apbp. Clearly, s∈Ls \in Ls∈L because it has ppp aaa's followed by ppp bbb's.

    Step 3: Decompose the String s=xyzs = xyzs=xyz

    According to the pumping lemma, we can decompose s=apbps = a^p b^ps=apbp into parts xxx, yyy, and zzz such that:

    • ∣xy∣≤p|xy| \leq p∣xy∣≤p,
    • ∣y∣>0|y| > 0∣y∣>0,
    • xyiz∈Lxy^i z \in Lxyiz∈L for all i≥0i \geq 0i≥0.

    Since ∣xy∣≤p|xy| \leq p∣xy∣≤p, both xxx and yyy must consist only of aaa's. So, x=akx = a^kx=ak and y=amy = a^my=am for some kkk and mmm, where m>0m > 0m>0 (since ∣y∣>0|y| > 0∣y∣>0).

    Thus, the decomposition is:

    s=akambp=ak+mbp.s = a^k a^m b^p = a^{k+m} b^p.s=akambp=ak+mbp.

    Step 4: Pump the String

    Now, pump the middle part yyy (the part consisting of aaa's):

    • For i=2i = 2i=2, we get the string xy2z=aka2mbp=ak+2mbpxy^2 z = a^k a^{2m} b^p = a^{k+2m} b^pxy2z=aka2mbp=ak+2mbp.
    • This string is not in LLL because the number of aaa's and bbb's is no longer equal.

    Thus, we have a contradiction, as the string xy2zxy^2 zxy2z does not belong to LLL, which contradicts the pumping lemma.

    Step 5: Conclusion

    Since we have reached a contradiction, our assumption that LLL is regular must be false. Therefore, the language L={anbn∣n≥0}L = \{ a^n b^n | n \geq 0 \}L={anbn∣n≥0} is non-regular.

    Non-Regular Languages

    A non-regular language is a language that cannot be recognized by any finite automaton. These languages do not satisfy the pumping lemma for regular languages, and therefore, they cannot be described by regular expressions, finite automata, or DFAs. Some classic examples of non-regular languages include:

    1. L={anbn∣n≥0}L = \{ a^n b^n | n \geq 0 \}L={anbn∣n≥0}: As shown above, this language is non-regular.
    2. L={w∣w contains the same number of a’s as b’s}L = \{ w \mid w \text{ contains the same number of a's as b's} \}L={w∣w contains the same number of a’s as b’s}: This language involves counting, which is not possible with a finite state machine.
    3. L={anbncn∣n≥0}L = \{ a^n b^n c^n | n \geq 0 \}L={anbncn∣n≥0}: This language requires counting three different symbols, which finite automata cannot handle.

    Conclusion

    The Pumping Lemma is a powerful tool for proving that certain languages are non-regular. It essentially shows that for regular languages, there is a property that all sufficiently long strings must have, which involves repeating parts of the string. If a language fails to meet this property, it cannot be regular. The pumping lemma is used to derive contradictions by showing that no matter how you decompose a string in a non-regular language, pumping it will lead to a string that is not in the language, thereby proving that the language is non-regular.

    ← Previous topic 8
    Transducers (automata with output)
    Next topic 10 →
    Grammars and PDA

    Past Papers

    Open this section to view and download past papers

    Click on Show Past Papers to load available exam papers.

    Reading Progress
    0%
    11mremaining
    1.8kwords
    Intermediatelevel
    On This Page

    No headings found

    Study Toolkit

    Subject Portal

    Theory of Automata