pumping lemma for regular languages
DESCRIPTION
Theoritical understanding of Pumping Lemma for Regular Languages in Automata Theory.TRANSCRIPT
![Page 1: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/1.jpg)
1
Non-regular languages
![Page 2: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/2.jpg)
2
Regular languages
ba* acb *
...etc
*)( bacb
Non-regular languages }0:{ nba nn
}*},{:{ bavvvR
![Page 3: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/3.jpg)
3
How can we prove that a language
is not regular?
L
Prove that there is no DFA that accepts L
Problem: this is not easy to prove
Solution: the Pumping Lemma !!!
![Page 4: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/4.jpg)
4
The Pigeonhole Principle
![Page 5: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/5.jpg)
5
pigeons
pigeonholes
4
3
![Page 6: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/6.jpg)
6
A pigeonhole must
contain at least two pigeons
![Page 7: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/7.jpg)
7
...........
...........
pigeons
pigeonholes
n
m mn
![Page 8: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/8.jpg)
8
The Pigeonhole Principle
...........
pigeons
pigeonholes
n
m
mn There is a pigeonhole
with at least 2 pigeons
![Page 9: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/9.jpg)
9
The Pigeonhole Principle
and
DFAs
![Page 10: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/10.jpg)
10
DFA with states 4
1q 2q 3qa
b
4q
b
b b
b
a a
![Page 11: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/11.jpg)
11
1q 2q 3qa
b
4q
b
b
b
a a
a
In walks of strings:
aab
aa
a no state
is repeated
![Page 12: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/12.jpg)
12
In walks of strings:
1q 2q 3qa
b
4q
b
b
b
a a
a
...abbbabbabb
abbabb
bbaa
aabb a state
is repeated
![Page 13: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/13.jpg)
13
If string has length :
1q 2q 3qa
b
4q
b
b
b
a a
a
w 4|| w
Thus, a state must be repeated
Then the transitions of string
are more than the states of the DFA
w
![Page 14: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/14.jpg)
14
In general, for any DFA:
String has length number of states w
A state must be repeated in the walk of wq
q...... ......
walk of w
Repeated state
![Page 15: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/15.jpg)
15
In other words for a string :
transitions are pigeons
states are pigeonholes q
a
w
q...... ......
walk of w
Repeated state
![Page 16: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/16.jpg)
16
The Pumping Lemma
![Page 17: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/17.jpg)
17
Take an infinite regular language L
There exists a DFA that accepts L
mstates
![Page 18: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/18.jpg)
18
Take string with w Lw
There is a walk with label : w
.........
walk w
![Page 19: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/19.jpg)
19
If string has length w mw || (number
of states
of DFA)
then, from the pigeonhole principle:
a state is repeated in the walk w
q...... ......
walk w
![Page 20: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/20.jpg)
20
q
q...... ......
walk w
Let be the first state repeated in the
walk of w
![Page 21: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/21.jpg)
21
Write zyxw
q...... ......
x
y
z
![Page 22: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/22.jpg)
22
q...... ......
x
y
z
Observations: myx ||length number
of states
of DFA 1|| ylength
![Page 23: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/23.jpg)
23
The string
is accepted
zxObservation:
q...... ......
x
y
z
![Page 24: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/24.jpg)
24
The string
is accepted
zyyxObservation:
q...... ......
x
y
z
![Page 25: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/25.jpg)
25
The string
is accepted
zyyyxObservation:
q...... ......
x
y
z
![Page 26: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/26.jpg)
26
The string
is accepted
zyx iIn General:
...,2,1,0i
q...... ......
x
y
z
![Page 27: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/27.jpg)
27
Lzyx i ∈In General: ...,2,1,0i
q...... ......
x
y
z
Language accepted by the DFA
![Page 28: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/28.jpg)
28
In other words, we described:
The Pumping Lemma !!!
![Page 29: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/29.jpg)
29
The Pumping Lemma:
• Given a infinite regular language L
• there exists an integer m
• for any string with length Lw mw ||
• we can write zyxw
• with and myx || 1|| y
• such that: Lzyx i ...,2,1,0i
![Page 30: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/30.jpg)
30
Applications
of
the Pumping Lemma
![Page 31: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/31.jpg)
31
Theorem: The language }0:{ nbaL nn
is not regular
Proof: Use the Pumping Lemma
![Page 32: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/32.jpg)
32
Assume for contradiction
that is a regular language L
Since is infinite
we can apply the Pumping Lemma
L
}0:{ nbaL nn
![Page 33: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/33.jpg)
33
Let be the integer in the Pumping Lemma
Pick a string such that: w Lw
mw ||length
mmbaw We pick
m
}0:{ nbaL nn
![Page 34: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/34.jpg)
34
it must be that length
From the Pumping Lemma
1||,|| ymyx
babaaaaabaxyz mm ............
1, kay k
x y z
m m
Write: zyxba mm
Thus:
![Page 35: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/35.jpg)
35
From the Pumping Lemma: Lzyx i
...,2,1,0i
Thus:
mmbazyx
Lzyx 2
1, kay k
![Page 36: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/36.jpg)
36
From the Pumping Lemma:
Lbabaaaaaaazxy ...............2
x y z
km m
Thus:
Lzyx 2
mmbazyx 1, kay k
y
Lba mkm
![Page 37: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/37.jpg)
37
Lba mkm
}0:{ nbaL nnBUT:
Lba mkm
CONTRADICTION!!!
1≥k
![Page 38: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/38.jpg)
38
Our assumption that
is a regular language is not true
L
Conclusion: L is not a regular language
Therefore:
![Page 39: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/39.jpg)
39
Regular languages
Non-regular languages }0:{ nba nn
![Page 40: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/40.jpg)
40
Regular languages
Non-regular languages *}:{ vvvL R
![Page 41: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/41.jpg)
41
Theorem: The language
is not regular
Proof: Use the Pumping Lemma
*}:{ vvvL R },{ ba
![Page 42: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/42.jpg)
42
Assume for contradiction
that is a regular language L
Since is infinite
we can apply the Pumping Lemma
L
*}:{ vvvL R
![Page 43: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/43.jpg)
43
mmmm abbaw We pick
Let be the integer in the Pumping Lemma
Pick a string such that: w Lw
mw ||length
m
and
*}:{ vvvL R
![Page 44: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/44.jpg)
44
Write zyxabba mmmm
it must be that length
From the Pumping Lemma
ababbabaaaaxyz ..................
x y z
m m m m
1||,|| ymyx
1, kay kThus:
![Page 45: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/45.jpg)
45
From the Pumping Lemma: Lzyx i
...,2,1,0i
Thus: Lzyx 2
1, kay kmmmm abbazyx
![Page 46: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/46.jpg)
46
From the Pumping Lemma:
Lababbabaaaaaazxy ∈.....................=2
x y z
km + m m m
1, kay k
y
Lzyx 2
Thus:
mmmm abbazyx
Labba mmmkm
![Page 47: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/47.jpg)
47
Labba mmmkm
Labba mmmkm
BUT:
CONTRADICTION!!!
1k
*}:{ vvvL R
![Page 48: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/48.jpg)
48
Our assumption that
is a regular language is not true
L
Conclusion: L is not a regular language
Therefore:
![Page 49: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/49.jpg)
49
Regular languages
Non-regular languages
}0,:{ lncbaL lnln
![Page 50: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/50.jpg)
50
Theorem: The language
is not regular
Proof: Use the Pumping Lemma
}0,:{ lncbaL lnln
![Page 51: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/51.jpg)
51
Assume for contradiction
that is a regular language L
Since is infinite
we can apply the Pumping Lemma
L
}0,:{ lncbaL lnln
![Page 52: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/52.jpg)
52
mmm cbaw 2We pick
Let be the integer in the Pumping Lemma
Pick a string such that: w Lw
mw ||length
m
}0,:{ lncbaL lnln
and
![Page 53: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/53.jpg)
53
Write zyxcba mmm 2
it must be that length
From the Pumping Lemma
cccbcabaaaaaxyz ..................
x y z
m m m2
1||,|| ymyx
1, kay kThus:
![Page 54: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/54.jpg)
54
From the Pumping Lemma: Lzyx i
...,2,1,0i
Thus:
mmm cbazyx 2
Lxzzyx ∈=0
1, kay k
![Page 55: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/55.jpg)
55
From the Pumping Lemma:
Lcccbcabaaaxz ...............
x z
km m m2
mmm cbazyx 2 1, kay k
Lxz
Thus: Lcba mmkm 2
![Page 56: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/56.jpg)
56
Lcba mmkm 2
Lcba mmkm 2
BUT:
CONTRADICTION!!!
}0,:{ lncbaL lnln
1k
![Page 57: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/57.jpg)
57
Our assumption that
is a regular language is not true
L
Conclusion: L is not a regular language
Therefore:
![Page 58: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/58.jpg)
58
Regular languages
Non-regular languages }0:{ ! naL n
![Page 59: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/59.jpg)
59
Theorem: The language
is not regular
Proof: Use the Pumping Lemma
}0:{ ! naL n
nnn )1(21!
![Page 60: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/60.jpg)
60
Assume for contradiction
that is a regular language L
Since is infinite
we can apply the Pumping Lemma
L
}0:{ ! naL n
![Page 61: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/61.jpg)
61
!maw We pick
Let be the integer in the Pumping Lemma
Pick a string such that: w Lw
mw ||length
m
}0:{ ! naL n
![Page 62: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/62.jpg)
62
Write zyxam !
it must be that length
From the Pumping Lemma
aaaaaaaaaaaxyz m ...............!
x y z
m mm !
1||,|| ymyx
mkay k 1,Thus:
![Page 63: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/63.jpg)
63
From the Pumping Lemma: Lzyx i
...,2,1,0i
Thus:
!mazyx
Lzyx 2
mkay k 1,
![Page 64: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/64.jpg)
64
From the Pumping Lemma:
Laaaaaaaaaaaazxy ..................2
x y z
km mm !
Thus:
!mazyx mkay k 1,
Lzyx 2
y
La km !
![Page 65: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/65.jpg)
65
La km !
!! pkm
}0:{ ! naL nSince:
mk 1
There must exist such that: p
![Page 66: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/66.jpg)
66
However:
)!1(
)1(!
!!
!!
!
m
mm
mmm
mm
mmkm ! for 1m
)!1(! mkm
!! pkm for any p
![Page 67: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/67.jpg)
67
La km !
La km !
BUT:
CONTRADICTION!!!
}0:{ ! naL n
mk 1
![Page 68: Pumping Lemma for Regular Languages](https://reader030.vdocuments.net/reader030/viewer/2022033020/563dba24550346aa9aa30f58/html5/thumbnails/68.jpg)
68
Our assumption that
is a regular language is not true
L
Conclusion: L is not a regular language
Therefore: