Beruflich Dokumente
Kultur Dokumente
-1-
Lecture 17
Objectives
We reason by contradiction:
o Suppose we have managed to construct a DFA M for L
o We argue something must be wrong with this DFA
o In particular, M must accept some strings outside L
0r1n+1
Tahir Naseem/Handout 17
-2-
Pigeonhole principle
Suppose you are tossing n + 1 balls into n bins. Then two balls end up in the same bin.
If you have a DFA with n states and it reads n + 1 consecutive 0s, then it must end up in the
same state twice.
0r1n+1
The DFA will then also accept strings that go around the loop multiple times
But such strings have more 0s than 1s, so they are not in L2!
Tahir Naseem/Handout 17
-3-
an+1am
For every sufficiently long input z in L, there is a middle part in z that, even if repeated any
number of times, keeps the input inside L
Pumping Lemma:
It is a theorem that is used to prove that given language is non regular.
Definition:
If A is a regular language, then there is a number p (the pumping length) where, if s is any
string in A of length at least p, then s may be divided into three pieces, s = xyz, satisfying the
following conditions:
1. for each i 0, xyiz A,
2. |y| > 0, and
3. |xy| p.
Recall the notation where |s| represents the length of string s, yi means that i copies of y are
concatenated together, and y0 equals .
Every infinite regular language must satisfy the condition of pumping lemma.
Pumping lemma is necessary but not sufficient to prove that given regular is non
regular.
Example:
Pumping lemma for (ab)* is
x=
y = ab
z=