0% found this document useful (0 votes)
46 views1 page

Pumping Lemma

This document explains the pumping lemma for regular languages and provides two examples of using it to prove that certain languages are not regular. Specifically: 1. It outlines the pumping lemma, which states that for any regular language L, there is a number p such that any string s in L of length at least p can be broken into xyz such that xyiz is in L for all i. 2. It then gives an example language L1 = {0n1n | n >= 0} and shows that the string 0p1p cannot be pumped while satisfying the pumping lemma conditions, proving L1 is not regular. 3. A second example language L2 = {ww | w in {0

Uploaded by

jitprosen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views1 page

Pumping Lemma

This document explains the pumping lemma for regular languages and provides two examples of using it to prove that certain languages are not regular. Specifically: 1. It outlines the pumping lemma, which states that for any regular language L, there is a number p such that any string s in L of length at least p can be broken into xyz such that xyiz is in L for all i. 2. It then gives an example language L1 = {0n1n | n >= 0} and shows that the string 0p1p cannot be pumped while satisfying the pumping lemma conditions, proving L1 is not regular. 3. A second example language L2 = {ww | w in {0

Uploaded by

jitprosen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Proof of the Pumping Lemma

The language L is regular, so there exists a DFA M such that L = L(M ). Say M has p states, {q1 , . . . , qp }.
We are also given input string s ∈ L with s = s1 s2 · · · sn (n = |s| ≥ p).
M on input s (accepts):
s1 s2 s
3 sp−1 sp sp+1n s
r1 −→ r2 −→ r3 −→ · · · −−−→ rp −→ rp+1 −−−→ · · · −→ rn+1
Where rn+1 is an accept state. (Remark: the r’s are not necessarily unique – rl and rm may refer to the
same qp .)
M went through at least p + 1 states, but has only p distinct states. By pigeonhole principle, some state
repeats (there exists a cycle). This implies that there exists some j, k with j 6= k such that rj = rk . We also
know that k ≤ p + 1.
Thus, M looks like this on input s :
r1 s1 r2 s2 r3 s3 · · · sj−1 rj = rk sk rk+1 · · · sn rn+1

sk−1 sj

rk−1 rj+1

Let the input before the loop s1 s2 · · · sj−1 = x, the input in the loop sj · · · sk−1 = y, and teh input after
the loop sk · · · sn = z. By assumption, s = xyz ∈ L(M ).
We have shown that
1. For all i ≥ 0, xy i z ∈ L (because we may exploit the loop)
2. |y| ≥ 1 (because j, k are distinct)
3. |xy| ≤ p (because |xy| = k − 1 and k ≤ p + 1.)
This is really useful to show that certain languages are not regular.

Example: Given L = {0n 1n |n ≥ 0}, show that L is not regular.


Proof (by contradiction):
1. Assume L is regular
2. There exists a p (pumping length) from pumping lemma
3. Choose s = 0p 1p (s satisfies |s| ≥ p because |s| = 2p)
4. For any x, y, z such that s = xyz, |y| ≥ 1 and |xy| ≤ p, so y contains only 0s
5. Choose some i such that xy i z 6∈ L. Here, we choose i = 2. xy 2 z = xyyz = 0p+|y| 1p , which is not in L
because |y| =
6 0. This contradicts the pumping lemma, which implies that L is not regular.
Example: Given L = {ww|w ∈ {0, 1}∗ }, show L is not regular.
Proof (by contradiction):
1. Assume L is regular
2. There exists a p (pumping length) from pumping lemma
3. Choose s = 0p 10p .
4. For any x, y, z such that s = xyz and |y| ≥ 1 and |xy| ≤ p, so y contains only 0s.
5. Choose some i such that xy i z 6∈ L. Here, we choose i = 2. xy 2 z = xyyz = 0p+|y| 10p , but |y| =
6 0 so this
string is not in L, contradicting the pumping lemma. Thus, L is not regular.
(The example 0p 0p will not work because it may still remain in the language after pumping in step 5)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy