Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
51 views8 pages

Infiniteness Test The Pumping Lemma Nonregular Languages

1) The Pumping Lemma states that for any regular language, there is a number n such that any string in the language longer than n can be broken into sections x, y, z such that xyiz is also in the language for all i. 2) It can be used to prove that a language is not regular by finding a string that does not satisfy the pumping conditions. 3) An example is the language of strings with the same number of 0s and 1s, which is shown not to be regular using the Pumping Lemma on the string 0^n 1^n.

Uploaded by

youtube new
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)
51 views8 pages

Infiniteness Test The Pumping Lemma Nonregular Languages

1) The Pumping Lemma states that for any regular language, there is a number n such that any string in the language longer than n can be broken into sections x, y, z such that xyiz is also in the language for all i. 2) It can be used to prove that a language is not regular by finding a string that does not satisfy the pumping conditions. 3) An example is the language of strings with the same number of 0s and 1s, which is shown not to be regular using the Pumping Lemma on the string 0^n 1^n.

Uploaded by

youtube new
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/ 8

The Pumping Lemma

Infiniteness Test
The Pumping Lemma
Nonregular Languages

1
The Infiniteness Problem
•  Is a given regular language infinite?
•  Start with a DFA for the language.
•  Key idea: if the DFA has n states, and
the language contains any string of
length n or more, then the language is
infinite.
•  Otherwise, the language is surely finite.
•  Limited to strings of length n or less.
2
Proof of Key Idea
•  If an n-state DFA accepts a string w of
length n or more, then there must be a
state that appears twice on the path
labeled w from the start state to a final
state.
•  Because there are at least n+1 states
along the path.

3
Proof – (2)

w = xyz

y
x z

Then xyiz is in the language for all i > 0.

Since y is not ε, we see an infinite


number of strings in L.
4
Infiniteness Test: Finding a Cycle
1.  Eliminate states not reachable from
the start state.
2.  Eliminate states that do not reach a
final state.
3.  Test if the remaining transition graph
has any cycles.

5
The Pumping Lemma
•  We have, almost accidentally, proved a
statement that is quite useful for showing
certain languages are not regular.
•  Called the pumping lemma for regular
languages.

6
Statement of the Pumping Lemma
Number of
For every regular language L states of
DFA for L
There is an integer n, such that
For every string w in L of length > n
We can write w = xyz such that:
1.  |xy| < n.
Labels along
2.  |y| > 0. first cycle on
3.  For all i > 0, xyiz is in L. path labeled w
7
Example: Use of Pumping Lemma
•  We have claimed {0k1k | k > 1} is not a
regular language.
•  Suppose it were. Then there would be
an associated n for the pumping lemma.
•  Let w = 0n1n. We can write w = xyz,
where x and y consist of 0’s, and y ≠ ε.
•  But then xyyz would be in L, and this
string has more 0’s than 1’s.
8

You might also like