SlideShare a Scribd company logo
Theory of Automata
Non Regular Languages
Exercise
Build an FA that accepts the following
language:
L = {L, ab, aabb, aaabbb, aaaabbbb, ……}
2
We cannot…!!!
3
Nonregular Languages.
Examples:
L = {L, ab, aabb, aaabbb, aaaabbbb, …}
L = {anbn | n=0,1,2,3,4,…}
L = {anbn}
L  language(a*b*)
Palindrome is another non regular language.
4
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 !!!
5
The Pigeonhole Principle
...........
pigeons
pigeonholes
n
m
m
n 
There is a pigeonhole
with at least 2 pigeons
6
How does pigeonhole principle relate to
DFAs?
DFA with states
4
1
q 2
q 3
q
a
b
4
q
b
b b
b
a a
7
1
q 2
q 3
q
a
b
4
q
b
b
b
a a
a
In walks of strings a, aa, aab, no state is
repeated
In walks of strings aabb, bbaa, abbaba, a
state is repeated
8
In general, for any DFA:
String has length number of states
w 
A state must be repeated in the walk of w
q
q
...... ......
walk of w
Repeated state
9
In other words for a string :
transitions are pigeons
states are pigeonholes
q
a
w
q
...... ......
walk of w
Repeated state
10
The Pumping Lemma
11
Take an infinite regular language
Take a string w from the language.
L
There exists a DFA that accepts L
m
states
12
If string has length
w m
w 
|
| (number
of states
of DFA)
then, from the pigeonhole principle:
a state is repeated in the walk w
q
...... ......
walk w
13
q
q
...... ......
walk w
Let be the first state repeated in the
walk of w
14
Write z
y
x
w =
q
...... ......
x
y
z
15
q
...... ......
x
y
z
Observations: m
y
x 
|
|
length number
of states
of DFA
1
|
| 
y
length
Prof. Busch - LSU 16
The string
is accepted
z
x
Additional string:
q
... ...
x z
...
Do not follow loop
y
...
1
 k

i

1
+
i

j

1
+
j

Prof. Busch - LSU 17
The string
is accepted
z
y
y
x
q
... ... ...
x z
Follow loop
2 times
Additional string:
y
...
1
 k

i

1
+
i

j

1
+
j

Prof. Busch - LSU 18
The string
is accepted
z
y
y
y
x
q
... ... ...
x z
Follow loop
3 times
Additional string:
y
...
1
 k

i

1
+
i

j

1
+
j

Prof. Busch - LSU 19
The string
is accepted
z
y
x i
In General:
...
,
2
,
1
,
0
=
i
q
... ... ...
x z
Follow loop
times
i
y
...
1
 k

i

1
+
i

j

1
+
j

Prof. Busch - LSU 20
L
z
y
x i

Therefore: ...
,
2
,
1
,
0
=
i
Language accepted by the DFA
q
... ... ...
x z
y
...
1
 k

i

1
+
i

j

1
+
j

21
The string
is accepted
z
x
Observation:
q
...... ......
x
y
z
22
The string
is accepted
z
y
y
x
Observation:
q
...... ......
x
y
z
23
The string
is accepted
z
y
y
y
x
Observation:
q
...... ......
x
y
z
24
Chapter 10: Nonregular Languages.
first state that is visited more than once
xz L, xyz L, xyyz L, xyyyz L, …, xynz L.
x
y
z
x
y
z
25
In other words, we described:
The Pumping Lemma !!!
26
The Pumping Lemma:
• Given a infinite regular language L
• there exists an integer m
• for any string with length
L
w m
w 
|
|
• we can write z
y
x
w =
• with and
m
y
x 
|
| 1
|
| 
y
• such that: L
z
y
x i
 ...
,
2
,
1
,
0
=
i
27
w = b b b a b a b a
2+ 3
5 6+
b
a b
a,b
4
1–
a
b
a
b
a
b
a
Example
b
x
1 2
b b a
y
2
5
3
b
b a
a
z
3
6
3 6
28
w = b b b a b a b a
b b b a b b a b a b a
L
z
y
x i
 ...
,
2
,
1
,
0
=
i
What does the pumping lemma suggest…???
◼ Since this lemma must be true for any regular language L, we can
logically state it as follows:
◼ L regular  Pumping Lemma true
◼ But the contrapositive implies that:
◼ Pumping Lemma not true  L is not regular
◼ We can show a language is not regular by showing that it violates some
condition of the Pumping Lemma.
◼ We do that by first assuming the language is regular, and deriving a
contradiction.
29
Outline of a pumping lemma proof to show
the non-regularity of some language L:
1. Assume L is regular. Therefore (by the Pumping Lemma) there
exists some number m, which is the number of states in DFA that
accepts L.
2. Choose a specific string ‘w’ such that wL and |w|m. Both of these
conditions must be explicitly stated/verified for ‘w’.
3. Consider an arbitrary factorization of w into xyz such that |y|1 and
|xy|  m. Any possible factorization of w that satisfies these
conditions must be considered.
4. Create the string w' from w by choosing some value for i0. That is,
w' = xyiz for some i0. Show that w'L, no matter how the portions
x, y, and z are determined.
5. Conclude that L is not regular if it contradicts the Pumping Lemma.
30
Prof. Busch - LSU 31
Applications
of
the Pumping Lemma
Prof. Busch - LSU 32
Observation:
Every language of finite size has to be regular
Therefore, every non-regular language
has to be of infinite size
(contains an infinite number of strings)
(we can easily construct an NFA
that accepts every string in the language)
Prof. Busch - LSU 33
Suppose you want to prove that
αn infinite language is not regular
1. Assume the opposite: is regular
2. The pumping lemma should hold for
3. Use the pumping lemma to obtain a
contradiction
L
L
L
4. Therefore, is not regular
L
Prof. Busch - LSU 34
Explanation of Step 3: How to get a contradiction
2. Choose a particular string which satisfies
the length condition
L
w
3. Write xyz
w =
4. Show that L
z
xy
w i

=
 for some 1

i
5. This gives a contradiction, since from
pumping lemma L
z
xy
w i

=

m
w 
|
|
1. Let be the critical length for
m L
Prof. Busch - LSU 35
Note: It suffices to show that
only one string
gives a contradiction
L
w
You don’t need to obtain
contradiction for every L
w
36
}
0
:
{ 
= n
b
a
L n
n
Prof. Busch - LSU 37
Theorem: The language }
0
:
{ 
= n
b
a
L n
n
is not regular
Proof: Use the Pumping Lemma
Example of Pumping Lemma application
Prof. Busch - LSU 40
Assume for contradiction
that is a regular language
L
Since is infinite
we can apply the Pumping Lemma
L
}
0
:
{ 
= n
b
a
L n
n
Prof. Busch - LSU 41
Let be the critical length for
Pick a string such that:
w L
w 
m
w 
|
|
and length
m
m
b
a
w =
We pick
m
}
0
:
{ 
= n
b
a
L n
n
L
Prof. Busch - LSU 42
with lengths
From the Pumping Lemma:
1
|
|
,
|
| 
 y
m
y
x
b
ab
aa
aa
a
b
a
xyz m
m
...
...
...
...
=
=
m
k
a
y k


= 1
,
x y z
m m
we can write z
y
x
b
a
w m
m
=
=
Thus:
=
w
Prof. Busch - LSU 43
From the Pumping Lemma: L
z
y
x i

...
,
2
,
1
,
0
=
i
Thus:
m
m
b
a
z
y
x =
L
z
y
x 
2
m
k
a
y k


= 1
,
Prof. Busch - LSU 44
From the Pumping Lemma:
L
b
ab
aa
aa
aa
a
z
xy 
= ...
...
...
...
...
2
x y z
k
m + m
Thus:
L
z
y
x 
2
m
m
b
a
z
y
x =
y
L
b
a m
k
m

+
m
k
a
y k


= 1
,
Prof. Busch - LSU 45
L
b
a m
k
m

+
}
0
:
{ 
= n
b
a
L n
n
BUT:
L
b
a m
k
m

+
CONTRADICTION!!!
1
≥
k
Prof. Busch - LSU 46
Our assumption that
is a regular language is not true
L
Conclusion: L is not a regular language
Therefore:
END OF PROOF
Prof. Busch - LSU 47
Regular languages
Non-regular language }
0
:
{ 
n
b
a n
n
)
( *
*
b
a
L
48
}
0
,
:
{ 
= +
l
n
c
b
a
L l
n
l
n
Prof. Busch - LSU 49
Regular languages
Non-regular languages
}
0
,
:
{ 
= +
l
n
c
b
a
L l
n
l
n
Prof. Busch - LSU 50
Theorem: The language
is not regular
Proof: Use the Pumping Lemma
}
0
,
:
{ 
= +
l
n
c
b
a
L l
n
l
n
Prof. Busch - LSU 51
Assume for contradiction
that is a regular language
L
Since is infinite
we can apply the Pumping Lemma
L
}
0
,
:
{ 
= +
l
n
c
b
a
L l
n
l
n
Prof. Busch - LSU 52
m
m
m
c
b
a
w 2
=
We pick
Let be the critical length of
Pick a string such that:
w L
w 
m
w 
|
|
length
m
}
0
,
:
{ 
= +
l
n
c
b
a
L l
n
l
n
and
L
Prof. Busch - LSU 53
We can write z
y
x
c
b
a
w m
m
m
=
= 2
With lengths
From the Pumping Lemma:
c
cc
bc
ab
aa
aa
a
xyz ...
...
...
...
...
...
=
x y z
m m m
2
1
|
|
,
|
| 
 y
m
y
x
Thus:
=
w
m
k
a
y k


= 1
,
Prof. Busch - LSU 54
From the Pumping Lemma: L
z
y
x i

...
,
2
,
1
,
0
=
i
Thus:
m
m
m
c
b
a
z
y
x 2
=
L
xz
z
y
x ∈
=
0
m
k
a
y k


= 1
,
Prof. Busch - LSU 55
From the Pumping Lemma:
L
c
cc
bc
ab
aa
a
xz 
= ...
...
...
...
...
x z
k
m − m m
2
m
m
m
c
b
a
z
y
x 2
=
L
xz 
Thus: L
c
b
a m
m
k
m

− 2
m
k
a
y k


= 1
,
Prof. Busch - LSU 56
L
c
b
a m
m
k
m

− 2
L
c
b
a m
m
k
m

− 2
BUT:
CONTRADICTION!!!
}
0
,
:
{ 
= +
l
n
c
b
a
L l
n
l
n
1

k
Prof. Busch - LSU 57
Our assumption that
is a regular language is not true
L
Conclusion: L is not a regular language
Therefore:
END OF PROOF
58
}
0
:
{ !

= n
a
L n
Prof. Busch - LSU 59
Regular languages
Non-regular languages }
0
:
{ !

= n
a
L n
Prof. Busch - LSU 60
Theorem: The language
is not regular
Proof: Use the Pumping Lemma
}
0
:
{ !

= n
a
L n
n
n
n 
−

= )
1
(
2
1
! 
Prof. Busch - LSU 61
Assume for contradiction
that is a regular language
L
Since is infinite
we can apply the Pumping Lemma
L
}
0
:
{ !

= n
a
L n
Prof. Busch - LSU 62
!
m
a
w =
We pick
Let be the critical length of
Pick a string such that:
w L
w 
m
w 
|
|
length
m
}
0
:
{ !

= n
a
L n
L
Prof. Busch - LSU 63
We can write z
y
x
a
w m
=
= !
With lengths
From the Pumping Lemma:
a
aa
aa
aa
aa
a
a
xyz m
...
...
...
...
...
!
=
=
x y z
m m
m −
!
1
|
|
,
|
| 
 y
m
y
x
m
k
a
y k


= 1
,
Thus:
=
w
Prof. Busch - LSU 64
From the Pumping Lemma: L
z
y
x i

...
,
2
,
1
,
0
=
i
Thus:
!
m
a
z
y
x =
L
z
y
x 
2
m
k
a
y k


= 1
,
Prof. Busch - LSU 65
From the Pumping Lemma:
L
a
aa
aa
aa
aa
aa
a
z
xy 
= ...
...
...
...
...
...
2
x y z
k
m + m
m −
!
Thus:
!
m
a
z
y
x = m
k
a
y k


= 1
,
L
z
y
x 
2
y
L
a k
m

+
!
Prof. Busch - LSU 66
L
a k
m

+
!
!
! p
k
m =
+
}
0
:
{ !

= n
a
L n
Since:
m
k 

1
There must exist such that:
p
Prof. Busch - LSU 67
However:
)!
1
(
)
1
(
!
!
!
!
!
!
+
=
+
=
+

+

+

m
m
m
m
m
m
m
m
m
m
k
m +
! for 1

m
)!
1
(
! +

+ m
k
m
!
! p
k
m 
+ for any p
Prof. Busch - LSU 68
L
a k
m

+
!
L
a k
m

+
!
BUT:
CONTRADICTION!!!
}
0
:
{ !

= n
a
L n
m
k 

1
Prof. Busch - LSU 69
Our assumption that
is a regular language is not true
L
Conclusion: L is not a regular language
Therefore:
END OF PROOF
71
Palindrome
Prof. Busch - LSU 72
Theorem: The language
is not regular
Proof: Use the Pumping Lemma
*}
:
{ 

= v
vv
L R
}
,
{ b
a
=

Prof. Busch - LSU 73
Assume for contradiction
that is a regular language
L
Since is infinite
we can apply the Pumping Lemma
L
*}
:
{ 

= v
vv
L R
Prof. Busch - LSU 74
m
m
m
m
a
b
b
a
w =
We pick
Let be the critical length for
Pick a string such that:
w L
w 
m
w 
|
|
length
m
and
*}
:
{ 

= v
vv
L R
L
Prof. Busch - LSU 75
we can write: z
y
x
a
b
b
a
w m
m
m
m
=
=
with lengths:
From the Pumping Lemma:
a
ba
bb
ab
a
aa
a
xyz ...
...
...
...
...
...
=
x y z
m m m m
1
|
|
,
|
| 
 y
m
y
x
m
k
a
y k


= 1
,
Thus:
=
w
Prof. Busch - LSU 76
From the Pumping Lemma: L
z
y
x i

...
,
2
,
1
,
0
=
i
Thus: L
z
y
x 
2
m
m
m
m
a
b
b
a
z
y
x = m
k
a
y k


= 1
,
77
Example: Palindrome is non regular
Theorem: Palindrome L = {anban | n=0,1,2,3,4,…}
= {b, aba, aabaa, …} is not regular.
Proof (incomplete).
The left an will be pumped to aq while the right an
remains fixed, imbalance.
Note: Solve this yourself with all steps as required.
78
PRIME = {ap | p is a prime number}
79
Theorem: PRIME = {ap | p is a prime number}
= {aa, aaa, aaaaa, aaaaaaa, …}
is not regular.
Proof: p>N (N= # of states in assumed FA), ap=xyz from
pumping lemma. ap accepted →
xyp+1z = xyzyp (why?) = apyp = ap(am)p = a(m+1)p accepted
But (m+1)p is not a prime number … contradiction.
Example: PRIME is non regular
Example: anbanb is nonregular
◼ Assume L is regular and let m be the integer from the pumping
lemma.
◼ Choose w = ambamb. Clearly, w ε L so by the pumping lemma, w =
xyz such that |xy|  m. |y| > 0 and xyiz ε L for all i ≥ 0.
◼ Let p = |y|.
◼ Consider what happens when i = 0.
◼ The resulting string, xz = am-pbamb.
◼ Since p ≥ 1, the number of a’s in the two runs are not the same,
and thus this string is not in L.
◼ Therefore L is not regular.
80
Example: How to attempt the Regular pumping
Lemma Problems in Exams
Prove that language L={a3bncn-3 | n>3} is non
regular
1. Suppose for contradiction that the language is regular, hence, a DFA with ‘m’
states will accept this language.
2. We choose w=a3bmcm-3 such that |w|≥m
3. We can decompose w into xyz such that |y| ≥ 1 and |xy|≤m and xyiz is in L for
all i≥0.
4. Since |xy|≤m, these are the possible factorizations of xy
a) y consists of all a’s
Pumping y will lead to more than 3 a’s, contradiction as w’ not in L
a) y consists of a’s and b’s
Pumping y will lead to a string with b’s before a’s, contradiction.
a) y consists of all b’s
Pumping y will lead to more b’s and the c’s are untouched, difference
becomes more than 3, contradiction
5. The given language is non-regular as it violates the conditions of the pumping
lemma.
81
Theory of Automata
Fall 2018
Chapter - 11
Decidability
84
Chapter 11: Decidability
A problem is called a decision problem if its solution is
either YES or NO.
Definition: a decision problem is decidable, or
effectively solvable, if there is an algorithm that can
find the answer for any input in a finite number of
steps.
Decision Problems…
◼ Membership: Does
◼ Do two regular expressions define the same
language?
◼ Do two finite automata accept the same language?
◼ Is L Empty?
◼ Is L finite or infinite?
85
L
w 
86
Membership Question
Question: Given regular language L and string w
how can we check if ?
L
w 
Answer: Take the DFA that accepts L
and check if w is accepted
DFA
L
w
w
87
Given regular language
how can we check
if is empty: ?
L
L
Take the DFA that accepts
Check if there is any path from
the initial state to a final state
L
)
( 
=
L
Question:
Answer:
88
DFA


L
DFA

=
L
89
Chapter 11: Decidability
Method: Answer the question: is there any path from – to +?
The Blue Paint Algorithm:
1. Mark the start state. (Paint it blue.)
2. From every blue state, follow every arrow that goes out
of the state, and paint the destination state blue. Delete
each arrow that was followed.
3. Repeat step 2 until there are no new blue states.
4. If there is any final state that is blue, then there are
words in the language accepted by the finite automaton.
If not, the language is empty.
90
Chapter 11: Decidability
– a,b b
b
a
a
+
a
a
b
b
a
b
a
–
b
+
a
a
b
b
– a,b b
b
a
+
a
a
b
b
a
91
Chapter 11: Decidability
a
–
b
+
a
a
b
b
– +
a
a
b
b
The language is empty.
92
Given regular language
how can we check
if is finite?
L
L
Take the DFA that accepts
Check if there is a walk with cycle
from the initial state to a final state
L
Question:
Answer:
93
DFA
L is infinite
DFA
L is finite
94
Given regular languages and
how can we check if ?
1
L 2
L
2
1 L
L =
Question:

=


 )
(
)
( 2
1
2
1 L
L
L
L
Find if
Answer:
95

=


 )
(
)
( 2
1
2
1 L
L
L
L

=
 2
1 L
L 
=
 2
1 L
L
and
2
1 L
L =
1
L
2
L 1
L
2
L
2
1 L
L  1
2 L
L 
2
L 1
L
96




 )
(
)
( 2
1
2
1 L
L
L
L


 2
1 L
L 

 2
1 L
L
or
1
L
2
L 1
L
2
L
2
1 L
L  1
2 L
L 
2
1 L
L 
97
Chapter 11: Decidability
Theorem: Let F be a finite automaton with N states. If the
language accepted by F is not empty, then it contains at
least one word with N or fewer letters.
Method 3. Try all words with N and fewer letters.
If the finite automaton accepts none of them, then the
language accepted by this automaton is empty.
98
Chapter 11: Decidability
Problem 3. Does the language defined by a finite
automaton has a finite number of words? Infinite?
None?
None? Done previously.
Finite or Infinite language?
Solution 1: Does corresponding RE contain * ?
Solution 2: Use the following theorem.
99
Infinite language…???
Theorem. Let F be a finite automaton with N states.
F accepts a word w such that N  length(w) < 2N if and only if
the language accepted by F is infinite.
Proof: Apply Pumping lemma.
 If w, N  length(w) is accepted, then w created loop while
following N states
 pumping lemma creates infinite number of accepted words
SUMMARY
◼ Membership: Does
◼ Do two regular expressions define the same
language?
◼ Do two finite automata accept the same language?
◼ Is L Empty?
◼ Is L finite or infinite?
100
L
w 
◼ This lecture concludes the course for
the mid term exam
101

More Related Content

PPT
non regular language updated theory of automata.ppt
PPT
non regular language and pumping lemma toc
PDF
Pumping lemma for cfl
PPTX
Pumping lemma
PDF
Free Ebooks Download ! Edhole
PDF
Mba ebooks ! Edhole
PPT
Top school in ghaziabad
PPT
xcjkfvhdfjlkghfkjbnfkbnfgbnklnbknbmcvbnlkcnb
non regular language updated theory of automata.ppt
non regular language and pumping lemma toc
Pumping lemma for cfl
Pumping lemma
Free Ebooks Download ! Edhole
Mba ebooks ! Edhole
Top school in ghaziabad
xcjkfvhdfjlkghfkjbnfkbnfgbnklnbknbmcvbnlkcnb

Similar to Pumping lema topic of theory of automata (20)

PPTX
Pumming Lemma
PPT
hop-chap4.ppt
PDF
Chapter 3 REGULAR EXPRESSION.pdf
PPTX
RegularLanguageProperties.pptx
PPTX
FOrmalLanguage and Automata -undecidability.pptx
PPTX
AUTOMATA AUTOMATA Automata5Chapter4.pptx
PPTX
pumpexamples.pptx
PPTX
Module 1 TOC.pptx
PPTX
3.6 &amp; 7. pumping lemma for cfl &amp; problems based on pl
PDF
PRESENTATION ON NON REGULAR LANGUAGE.pdf
PPT
hw4s05solns.ppt
PPTX
Mod 2_RegularExpressions.pptx
PPTX
1. Introduction automata throry and intoduction
PPTX
1. Introduction to machine learning and AI
PPT
Lesson-01-29092022-081117pm.ppt
PPTX
Lecture1.pptxjendfkdmdmmdmmedhf bf fbbd ed
PPTX
Theory of computation Lec2
PPTX
Pumping lemma for regular set h1
PDF
01-Introduction&Languages.pdf
PDF
Introduction to the Theory of Computation, Winter 2003 A. Hevia and J. Mao S...
Pumming Lemma
hop-chap4.ppt
Chapter 3 REGULAR EXPRESSION.pdf
RegularLanguageProperties.pptx
FOrmalLanguage and Automata -undecidability.pptx
AUTOMATA AUTOMATA Automata5Chapter4.pptx
pumpexamples.pptx
Module 1 TOC.pptx
3.6 &amp; 7. pumping lemma for cfl &amp; problems based on pl
PRESENTATION ON NON REGULAR LANGUAGE.pdf
hw4s05solns.ppt
Mod 2_RegularExpressions.pptx
1. Introduction automata throry and intoduction
1. Introduction to machine learning and AI
Lesson-01-29092022-081117pm.ppt
Lecture1.pptxjendfkdmdmmdmmedhf bf fbbd ed
Theory of computation Lec2
Pumping lemma for regular set h1
01-Introduction&Languages.pdf
Introduction to the Theory of Computation, Winter 2003 A. Hevia and J. Mao S...
Ad

Recently uploaded (20)

PPTX
CYBER SECURITY PPT.pptx CYBER SECURITY APPLICATION AND USAGE
PPTX
Your Guide to a Winning Interview Aug 2025.
PPTX
Principles of Inheritance and variation class 12.pptx
PPTX
Sports and Dance -lesson 3 powerpoint presentation
DOC
field study for teachers graduating samplr
PDF
Blue-Modern-Elegant-Presentation (1).pdf
PPTX
Slideham presentation for the students a
PDF
iTop VPN Crack Latest Version 2025 Free Download With Keygen
PPTX
Prokaryotes v Eukaryotes PowerPoint.pptx
PPTX
microtomy kkk. presenting to cryst in gl
PDF
シュアーイノベーション採用ピッチ資料|Company Introduction & Recruiting Deck
PPTX
DPT-MAY24.pptx for review and ucploading
PDF
Why Today’s Brands Need ORM & SEO Specialists More Than Ever.pdf
PPTX
ESD MODULE-5hdbdhbdbdbdbbdbdbbdndbdbdbdbbdbd
PDF
Understanding the Rhetorical Situation Presentation in Blue Orange Muted Il_2...
PDF
servsafecomprehensive-ppt-full-140617222538-phpapp01.pdf
PPT
APPROACH TO DEVELOPMENTALlllllllllllllllll
PPT
NO000387 (1).pptsbsnsnsnsnsnsnsmsnnsnsnsjsnnsnsnsnnsnnansnwjwnshshshs
PDF
Entrepreneurship PowerPoint for students
PPTX
FINAL PPT.pptx cfyufuyfuyuy8ioyoiuvy ituyc utdfm v
CYBER SECURITY PPT.pptx CYBER SECURITY APPLICATION AND USAGE
Your Guide to a Winning Interview Aug 2025.
Principles of Inheritance and variation class 12.pptx
Sports and Dance -lesson 3 powerpoint presentation
field study for teachers graduating samplr
Blue-Modern-Elegant-Presentation (1).pdf
Slideham presentation for the students a
iTop VPN Crack Latest Version 2025 Free Download With Keygen
Prokaryotes v Eukaryotes PowerPoint.pptx
microtomy kkk. presenting to cryst in gl
シュアーイノベーション採用ピッチ資料|Company Introduction & Recruiting Deck
DPT-MAY24.pptx for review and ucploading
Why Today’s Brands Need ORM & SEO Specialists More Than Ever.pdf
ESD MODULE-5hdbdhbdbdbdbbdbdbbdndbdbdbdbbdbd
Understanding the Rhetorical Situation Presentation in Blue Orange Muted Il_2...
servsafecomprehensive-ppt-full-140617222538-phpapp01.pdf
APPROACH TO DEVELOPMENTALlllllllllllllllll
NO000387 (1).pptsbsnsnsnsnsnsnsmsnnsnsnsjsnnsnsnsnnsnnansnwjwnshshshs
Entrepreneurship PowerPoint for students
FINAL PPT.pptx cfyufuyfuyuy8ioyoiuvy ituyc utdfm v
Ad

Pumping lema topic of theory of automata

  • 1. Theory of Automata Non Regular Languages
  • 2. Exercise Build an FA that accepts the following language: L = {L, ab, aabb, aaabbb, aaaabbbb, ……} 2 We cannot…!!!
  • 3. 3 Nonregular Languages. Examples: L = {L, ab, aabb, aaabbb, aaaabbbb, …} L = {anbn | n=0,1,2,3,4,…} L = {anbn} L  language(a*b*) Palindrome is another non regular language.
  • 4. 4 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 !!!
  • 5. 5 The Pigeonhole Principle ........... pigeons pigeonholes n m m n  There is a pigeonhole with at least 2 pigeons
  • 6. 6 How does pigeonhole principle relate to DFAs? DFA with states 4 1 q 2 q 3 q a b 4 q b b b b a a
  • 7. 7 1 q 2 q 3 q a b 4 q b b b a a a In walks of strings a, aa, aab, no state is repeated In walks of strings aabb, bbaa, abbaba, a state is repeated
  • 8. 8 In general, for any DFA: String has length number of states w  A state must be repeated in the walk of w q q ...... ...... walk of w Repeated state
  • 9. 9 In other words for a string : transitions are pigeons states are pigeonholes q a w q ...... ...... walk of w Repeated state
  • 11. 11 Take an infinite regular language Take a string w from the language. L There exists a DFA that accepts L m states
  • 12. 12 If string has length w m w  | | (number of states of DFA) then, from the pigeonhole principle: a state is repeated in the walk w q ...... ...... walk w
  • 13. 13 q q ...... ...... walk w Let be the first state repeated in the walk of w
  • 15. 15 q ...... ...... x y z Observations: m y x  | | length number of states of DFA 1 | |  y length
  • 16. Prof. Busch - LSU 16 The string is accepted z x Additional string: q ... ... x z ... Do not follow loop y ... 1  k  i  1 + i  j  1 + j 
  • 17. Prof. Busch - LSU 17 The string is accepted z y y x q ... ... ... x z Follow loop 2 times Additional string: y ... 1  k  i  1 + i  j  1 + j 
  • 18. Prof. Busch - LSU 18 The string is accepted z y y y x q ... ... ... x z Follow loop 3 times Additional string: y ... 1  k  i  1 + i  j  1 + j 
  • 19. Prof. Busch - LSU 19 The string is accepted z y x i In General: ... , 2 , 1 , 0 = i q ... ... ... x z Follow loop times i y ... 1  k  i  1 + i  j  1 + j 
  • 20. Prof. Busch - LSU 20 L z y x i  Therefore: ... , 2 , 1 , 0 = i Language accepted by the DFA q ... ... ... x z y ... 1  k  i  1 + i  j  1 + j 
  • 24. 24 Chapter 10: Nonregular Languages. first state that is visited more than once xz L, xyz L, xyyz L, xyyyz L, …, xynz L. x y z x y z
  • 25. 25 In other words, we described: The Pumping Lemma !!!
  • 26. 26 The Pumping Lemma: • Given a infinite regular language L • there exists an integer m • for any string with length L w m w  | | • we can write z y x w = • with and m y x  | | 1 | |  y • such that: L z y x i  ... , 2 , 1 , 0 = i
  • 27. 27 w = b b b a b a b a 2+ 3 5 6+ b a b a,b 4 1– a b a b a b a Example b x 1 2 b b a y 2 5 3 b b a a z 3 6 3 6
  • 28. 28 w = b b b a b a b a b b b a b b a b a b a L z y x i  ... , 2 , 1 , 0 = i
  • 29. What does the pumping lemma suggest…??? ◼ Since this lemma must be true for any regular language L, we can logically state it as follows: ◼ L regular  Pumping Lemma true ◼ But the contrapositive implies that: ◼ Pumping Lemma not true  L is not regular ◼ We can show a language is not regular by showing that it violates some condition of the Pumping Lemma. ◼ We do that by first assuming the language is regular, and deriving a contradiction. 29
  • 30. Outline of a pumping lemma proof to show the non-regularity of some language L: 1. Assume L is regular. Therefore (by the Pumping Lemma) there exists some number m, which is the number of states in DFA that accepts L. 2. Choose a specific string ‘w’ such that wL and |w|m. Both of these conditions must be explicitly stated/verified for ‘w’. 3. Consider an arbitrary factorization of w into xyz such that |y|1 and |xy|  m. Any possible factorization of w that satisfies these conditions must be considered. 4. Create the string w' from w by choosing some value for i0. That is, w' = xyiz for some i0. Show that w'L, no matter how the portions x, y, and z are determined. 5. Conclude that L is not regular if it contradicts the Pumping Lemma. 30
  • 31. Prof. Busch - LSU 31 Applications of the Pumping Lemma
  • 32. Prof. Busch - LSU 32 Observation: Every language of finite size has to be regular Therefore, every non-regular language has to be of infinite size (contains an infinite number of strings) (we can easily construct an NFA that accepts every string in the language)
  • 33. Prof. Busch - LSU 33 Suppose you want to prove that αn infinite language is not regular 1. Assume the opposite: is regular 2. The pumping lemma should hold for 3. Use the pumping lemma to obtain a contradiction L L L 4. Therefore, is not regular L
  • 34. Prof. Busch - LSU 34 Explanation of Step 3: How to get a contradiction 2. Choose a particular string which satisfies the length condition L w 3. Write xyz w = 4. Show that L z xy w i  =  for some 1  i 5. This gives a contradiction, since from pumping lemma L z xy w i  =  m w  | | 1. Let be the critical length for m L
  • 35. Prof. Busch - LSU 35 Note: It suffices to show that only one string gives a contradiction L w You don’t need to obtain contradiction for every L w
  • 37. Prof. Busch - LSU 37 Theorem: The language } 0 : {  = n b a L n n is not regular Proof: Use the Pumping Lemma Example of Pumping Lemma application
  • 38. Prof. Busch - LSU 40 Assume for contradiction that is a regular language L Since is infinite we can apply the Pumping Lemma L } 0 : {  = n b a L n n
  • 39. Prof. Busch - LSU 41 Let be the critical length for Pick a string such that: w L w  m w  | | and length m m b a w = We pick m } 0 : {  = n b a L n n L
  • 40. Prof. Busch - LSU 42 with lengths From the Pumping Lemma: 1 | | , | |   y m y x b ab aa aa a b a xyz m m ... ... ... ... = = m k a y k   = 1 , x y z m m we can write z y x b a w m m = = Thus: = w
  • 41. Prof. Busch - LSU 43 From the Pumping Lemma: L z y x i  ... , 2 , 1 , 0 = i Thus: m m b a z y x = L z y x  2 m k a y k   = 1 ,
  • 42. Prof. Busch - LSU 44 From the Pumping Lemma: L b ab aa aa aa a z xy  = ... ... ... ... ... 2 x y z k m + m Thus: L z y x  2 m m b a z y x = y L b a m k m  + m k a y k   = 1 ,
  • 43. Prof. Busch - LSU 45 L b a m k m  + } 0 : {  = n b a L n n BUT: L b a m k m  + CONTRADICTION!!! 1 ≥ k
  • 44. Prof. Busch - LSU 46 Our assumption that is a regular language is not true L Conclusion: L is not a regular language Therefore: END OF PROOF
  • 45. Prof. Busch - LSU 47 Regular languages Non-regular language } 0 : {  n b a n n ) ( * * b a L
  • 47. Prof. Busch - LSU 49 Regular languages Non-regular languages } 0 , : {  = + l n c b a L l n l n
  • 48. Prof. Busch - LSU 50 Theorem: The language is not regular Proof: Use the Pumping Lemma } 0 , : {  = + l n c b a L l n l n
  • 49. Prof. Busch - LSU 51 Assume for contradiction that is a regular language L Since is infinite we can apply the Pumping Lemma L } 0 , : {  = + l n c b a L l n l n
  • 50. Prof. Busch - LSU 52 m m m c b a w 2 = We pick Let be the critical length of Pick a string such that: w L w  m w  | | length m } 0 , : {  = + l n c b a L l n l n and L
  • 51. Prof. Busch - LSU 53 We can write z y x c b a w m m m = = 2 With lengths From the Pumping Lemma: c cc bc ab aa aa a xyz ... ... ... ... ... ... = x y z m m m 2 1 | | , | |   y m y x Thus: = w m k a y k   = 1 ,
  • 52. Prof. Busch - LSU 54 From the Pumping Lemma: L z y x i  ... , 2 , 1 , 0 = i Thus: m m m c b a z y x 2 = L xz z y x ∈ = 0 m k a y k   = 1 ,
  • 53. Prof. Busch - LSU 55 From the Pumping Lemma: L c cc bc ab aa a xz  = ... ... ... ... ... x z k m − m m 2 m m m c b a z y x 2 = L xz  Thus: L c b a m m k m  − 2 m k a y k   = 1 ,
  • 54. Prof. Busch - LSU 56 L c b a m m k m  − 2 L c b a m m k m  − 2 BUT: CONTRADICTION!!! } 0 , : {  = + l n c b a L l n l n 1  k
  • 55. Prof. Busch - LSU 57 Our assumption that is a regular language is not true L Conclusion: L is not a regular language Therefore: END OF PROOF
  • 57. Prof. Busch - LSU 59 Regular languages Non-regular languages } 0 : { !  = n a L n
  • 58. Prof. Busch - LSU 60 Theorem: The language is not regular Proof: Use the Pumping Lemma } 0 : { !  = n a L n n n n  −  = ) 1 ( 2 1 ! 
  • 59. Prof. Busch - LSU 61 Assume for contradiction that is a regular language L Since is infinite we can apply the Pumping Lemma L } 0 : { !  = n a L n
  • 60. Prof. Busch - LSU 62 ! m a w = We pick Let be the critical length of Pick a string such that: w L w  m w  | | length m } 0 : { !  = n a L n L
  • 61. Prof. Busch - LSU 63 We can write z y x a w m = = ! With lengths From the Pumping Lemma: a aa aa aa aa a a xyz m ... ... ... ... ... ! = = x y z m m m − ! 1 | | , | |   y m y x m k a y k   = 1 , Thus: = w
  • 62. Prof. Busch - LSU 64 From the Pumping Lemma: L z y x i  ... , 2 , 1 , 0 = i Thus: ! m a z y x = L z y x  2 m k a y k   = 1 ,
  • 63. Prof. Busch - LSU 65 From the Pumping Lemma: L a aa aa aa aa aa a z xy  = ... ... ... ... ... ... 2 x y z k m + m m − ! Thus: ! m a z y x = m k a y k   = 1 , L z y x  2 y L a k m  + !
  • 64. Prof. Busch - LSU 66 L a k m  + ! ! ! p k m = + } 0 : { !  = n a L n Since: m k   1 There must exist such that: p
  • 65. Prof. Busch - LSU 67 However: )! 1 ( ) 1 ( ! ! ! ! ! ! + = + = +  +  +  m m m m m m m m m m k m + ! for 1  m )! 1 ( ! +  + m k m ! ! p k m  + for any p
  • 66. Prof. Busch - LSU 68 L a k m  + ! L a k m  + ! BUT: CONTRADICTION!!! } 0 : { !  = n a L n m k   1
  • 67. Prof. Busch - LSU 69 Our assumption that is a regular language is not true L Conclusion: L is not a regular language Therefore: END OF PROOF
  • 69. Prof. Busch - LSU 72 Theorem: The language is not regular Proof: Use the Pumping Lemma *} : {   = v vv L R } , { b a = 
  • 70. Prof. Busch - LSU 73 Assume for contradiction that is a regular language L Since is infinite we can apply the Pumping Lemma L *} : {   = v vv L R
  • 71. Prof. Busch - LSU 74 m m m m a b b a w = We pick Let be the critical length for Pick a string such that: w L w  m w  | | length m and *} : {   = v vv L R L
  • 72. Prof. Busch - LSU 75 we can write: z y x a b b a w m m m m = = with lengths: From the Pumping Lemma: a ba bb ab a aa a xyz ... ... ... ... ... ... = x y z m m m m 1 | | , | |   y m y x m k a y k   = 1 , Thus: = w
  • 73. Prof. Busch - LSU 76 From the Pumping Lemma: L z y x i  ... , 2 , 1 , 0 = i Thus: L z y x  2 m m m m a b b a z y x = m k a y k   = 1 ,
  • 74. 77 Example: Palindrome is non regular Theorem: Palindrome L = {anban | n=0,1,2,3,4,…} = {b, aba, aabaa, …} is not regular. Proof (incomplete). The left an will be pumped to aq while the right an remains fixed, imbalance. Note: Solve this yourself with all steps as required.
  • 75. 78 PRIME = {ap | p is a prime number}
  • 76. 79 Theorem: PRIME = {ap | p is a prime number} = {aa, aaa, aaaaa, aaaaaaa, …} is not regular. Proof: p>N (N= # of states in assumed FA), ap=xyz from pumping lemma. ap accepted → xyp+1z = xyzyp (why?) = apyp = ap(am)p = a(m+1)p accepted But (m+1)p is not a prime number … contradiction. Example: PRIME is non regular
  • 77. Example: anbanb is nonregular ◼ Assume L is regular and let m be the integer from the pumping lemma. ◼ Choose w = ambamb. Clearly, w ε L so by the pumping lemma, w = xyz such that |xy|  m. |y| > 0 and xyiz ε L for all i ≥ 0. ◼ Let p = |y|. ◼ Consider what happens when i = 0. ◼ The resulting string, xz = am-pbamb. ◼ Since p ≥ 1, the number of a’s in the two runs are not the same, and thus this string is not in L. ◼ Therefore L is not regular. 80
  • 78. Example: How to attempt the Regular pumping Lemma Problems in Exams Prove that language L={a3bncn-3 | n>3} is non regular 1. Suppose for contradiction that the language is regular, hence, a DFA with ‘m’ states will accept this language. 2. We choose w=a3bmcm-3 such that |w|≥m 3. We can decompose w into xyz such that |y| ≥ 1 and |xy|≤m and xyiz is in L for all i≥0. 4. Since |xy|≤m, these are the possible factorizations of xy a) y consists of all a’s Pumping y will lead to more than 3 a’s, contradiction as w’ not in L a) y consists of a’s and b’s Pumping y will lead to a string with b’s before a’s, contradiction. a) y consists of all b’s Pumping y will lead to more b’s and the c’s are untouched, difference becomes more than 3, contradiction 5. The given language is non-regular as it violates the conditions of the pumping lemma. 81
  • 79. Theory of Automata Fall 2018 Chapter - 11 Decidability
  • 80. 84 Chapter 11: Decidability A problem is called a decision problem if its solution is either YES or NO. Definition: a decision problem is decidable, or effectively solvable, if there is an algorithm that can find the answer for any input in a finite number of steps.
  • 81. Decision Problems… ◼ Membership: Does ◼ Do two regular expressions define the same language? ◼ Do two finite automata accept the same language? ◼ Is L Empty? ◼ Is L finite or infinite? 85 L w 
  • 82. 86 Membership Question Question: Given regular language L and string w how can we check if ? L w  Answer: Take the DFA that accepts L and check if w is accepted DFA L w w
  • 83. 87 Given regular language how can we check if is empty: ? L L Take the DFA that accepts Check if there is any path from the initial state to a final state L ) (  = L Question: Answer:
  • 85. 89 Chapter 11: Decidability Method: Answer the question: is there any path from – to +? The Blue Paint Algorithm: 1. Mark the start state. (Paint it blue.) 2. From every blue state, follow every arrow that goes out of the state, and paint the destination state blue. Delete each arrow that was followed. 3. Repeat step 2 until there are no new blue states. 4. If there is any final state that is blue, then there are words in the language accepted by the finite automaton. If not, the language is empty.
  • 86. 90 Chapter 11: Decidability – a,b b b a a + a a b b a b a – b + a a b b – a,b b b a + a a b b a
  • 87. 91 Chapter 11: Decidability a – b + a a b b – + a a b b The language is empty.
  • 88. 92 Given regular language how can we check if is finite? L L Take the DFA that accepts Check if there is a walk with cycle from the initial state to a final state L Question: Answer:
  • 90. 94 Given regular languages and how can we check if ? 1 L 2 L 2 1 L L = Question:  =    ) ( ) ( 2 1 2 1 L L L L Find if Answer:
  • 91. 95  =    ) ( ) ( 2 1 2 1 L L L L  =  2 1 L L  =  2 1 L L and 2 1 L L = 1 L 2 L 1 L 2 L 2 1 L L  1 2 L L  2 L 1 L
  • 92. 96      ) ( ) ( 2 1 2 1 L L L L    2 1 L L    2 1 L L or 1 L 2 L 1 L 2 L 2 1 L L  1 2 L L  2 1 L L 
  • 93. 97 Chapter 11: Decidability Theorem: Let F be a finite automaton with N states. If the language accepted by F is not empty, then it contains at least one word with N or fewer letters. Method 3. Try all words with N and fewer letters. If the finite automaton accepts none of them, then the language accepted by this automaton is empty.
  • 94. 98 Chapter 11: Decidability Problem 3. Does the language defined by a finite automaton has a finite number of words? Infinite? None? None? Done previously. Finite or Infinite language? Solution 1: Does corresponding RE contain * ? Solution 2: Use the following theorem.
  • 95. 99 Infinite language…??? Theorem. Let F be a finite automaton with N states. F accepts a word w such that N  length(w) < 2N if and only if the language accepted by F is infinite. Proof: Apply Pumping lemma.  If w, N  length(w) is accepted, then w created loop while following N states  pumping lemma creates infinite number of accepted words
  • 96. SUMMARY ◼ Membership: Does ◼ Do two regular expressions define the same language? ◼ Do two finite automata accept the same language? ◼ Is L Empty? ◼ Is L finite or infinite? 100 L w 
  • 97. ◼ This lecture concludes the course for the mid term exam 101