Formal Languages
Non-Regular Languages
AUST Zahle
Eng. Charbel Boustany
2
Regular languages
b
a* a
c
b 
*
...
etc
*
)
( b
a
c
b 

Non-regular languages
}
0
:
{ 
n
b
a n
n
}*}
,
{
:
{ b
a
v
vvR

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 !!!
4
The Pigeonhole Principle
5
pigeons
pigeonholes
4
3
6
A pigeonhole must
contain at least two pigeons
7
...........
...........
pigeons
pigeonholes
n
m m
n 
8
The Pigeonhole Principle
...........
pigeons
pigeonholes
n
m
m
n 
There is a pigeonhole
with at least 2 pigeons
9
The Pigeonhole Principle
and
DFAs
10
DFA with states
4
1
q 2
q 3
q
a
b
4
q
b
b b
b
a a
11
1
q 2
q 3
q
a
b
4
q
b
b
b
a a
a
In walks of strings:
aab
aa
a no state
is repeated
12
In walks of strings:
1
q 2
q 3
q
a
b
4
q
b
b
b
a a
a
...
abbbabbabb
abbabb
bbaa
aabb a state
is repeated
13
If string has length :
1
q 2
q 3
q
a
b
4
q
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
14
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
15
In other words for a string :
transitions are pigeons
states are pigeonholes
q
a
w
q
...... ......
walk of w
Repeated state
16
The Pumping Lemma
17
Take an infinite regular language L
There exists a DFA that accepts L
m
states
18
Take string with
w L
w
There is a walk with label :
w
.........
walk w
19
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
20
q
q
...... ......
walk w
Let be the first state repeated in the
walk of w
21
Write z
y
x
w 
q
...... ......
x
y
z
22
q
...... ......
x
y
z
Observations: m
y
x 
|
|
length number
of states
of DFA
1
|
| 
y
length
23
The string
is accepted
z
x
Observation:
q
...... ......
x
y
z
24
The string
is accepted
z
y
y
x
Observation:
q
...... ......
x
y
z
25
The string
is accepted
z
y
y
y
x
Observation:
q
...... ......
x
y
z
26
The string
is accepted
z
y
x i
In General:
...
,
2
,
1
,
0

i
q
...... ......
x
y
z
27
L
z
y
x i
∈
In General: ...
,
2
,
1
,
0

i
q
...... ......
x
y
z
Language accepted by the DFA
28
In other words, we described:
The Pumping Lemma !!!
29
The Pumping Lemma:
• Given an infinite regular languageL
• 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
30
Applications
of
the Pumping Lemma
31
Theorem: The language }
0
:
{ 
 n
b
a
L n
n
is not regular
Proof: Use the Pumping Lemma
32
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
33
Let be the integer in the Pumping Lemma
Pick a string such that:
w L
w 
m
w 
|
|
length
m
m
b
a
w 
We pick
m
}
0
:
{ 
 n
b
a
L n
n
34
it must be that length
From the Pumping Lemma
1
|
|
,
|
| 
 y
m
y
x
b
ab
aa
aa
a
b
a
xyz m
m
...
...
...
...


1
, 
 k
a
y k
x y z
m m
Write: z
y
x
b
a m
m

Thus:
35
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
1
, 
 k
a
y k
36
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  1
, 
 k
a
y k
y
L
b
a m
k
m


37
L
b
a m
k
m


}
0
:
{ 
 n
b
a
L n
n
BUT:
L
b
a m
k
m


CONTRADICTION!!!
1
≥
k
38
Our assumption that
is a regular language is not true
L
Conclusion: L is not a regular language
Therefore:
39
Regular languages
Non-regular languages }
0
:
{ 
n
b
a n
n

More Related Content

PPT
non regular language updated theory of automata.ppt
PPTX
Pumming Lemma
PDF
Pumping lema topic of theory of automata
PPT
Non regular languages
PPT
non regular language and pumping lemma toc
PPT
4_Regular_Expressionssssssssssassssss.ppt
PPTX
AUTOMATA AUTOMATA Automata5Chapter4.pptx
PPT
TuringMachines and its introduction for computer science studetns
non regular language updated theory of automata.ppt
Pumming Lemma
Pumping lema topic of theory of automata
Non regular languages
non regular language and pumping lemma toc
4_Regular_Expressionssssssssssassssss.ppt
AUTOMATA AUTOMATA Automata5Chapter4.pptx
TuringMachines and its introduction for computer science studetns

Similar to xcjkfvhdfjlkghfkjbnfkbnfgbnklnbknbmcvbnlkcnb (6)

PPT
PPT 2.1.1(The Pumping Lemma for Regular sets, Application of the Pumping Lemm...
PPTX
RegularLanguageProperties.pptx
PPT
Finite automata examples
PPT
Finite automata examples
PPT
TuringMachineS FOUNDATION OF DATA SCIENCE
PPT
THEORY OF COMPUTATION PROCESS AND MECHANISUMS
PPT 2.1.1(The Pumping Lemma for Regular sets, Application of the Pumping Lemm...
RegularLanguageProperties.pptx
Finite automata examples
Finite automata examples
TuringMachineS FOUNDATION OF DATA SCIENCE
THEORY OF COMPUTATION PROCESS AND MECHANISUMS
Ad

Recently uploaded (20)

PDF
electrical machines course file-anna university
PPTX
Module1.pptxrjkeieuekwkwoowkemehehehrjrjrj
DOCX
ENVIRONMENTAL PROTECTION AND MANAGEMENT (18CVL756)
PDF
Research on ultrasonic sensor for TTU.pdf
PDF
ASPEN PLUS USER GUIDE - PROCESS SIMULATIONS
PDF
MACCAFERRY GUIA GAVIONES TERRAPLENES EN ESPAÑOL
PPTX
ARCHITECTURE AND PROGRAMMING OF EMBEDDED SYSTEMS
PDF
B461227.pdf American Journal of Multidisciplinary Research and Review
PPTX
SE unit 1.pptx aaahshdhajdviwhsiehebeiwheiebeiev
PDF
AIGA 012_04 Cleaning of equipment for oxygen service_reformat Jan 12.pdf
PPTX
AI-Reporting for Emerging Technologies(BS Computer Engineering)
PDF
LS-6-Digital-Literacy (1) K12 CURRICULUM .pdf
PPT
Module_1_Lecture_1_Introduction_To_Automation_In_Production_Systems2023.ppt
PPTX
Real Estate Management PART 1.pptxFFFFFFFFFFFFF
PDF
THE PEDAGOGICAL NEXUS IN TEACHING ELECTRICITY CONCEPTS IN THE GRADE 9 NATURAL...
PDF
BBC NW_Tech Facilities_30 Odd Yrs Ago [J].pdf
PDF
Module 1 part 1.pdf engineering notes s7
PPTX
INTERNET OF THINGS - EMBEDDED SYSTEMS AND INTERNET OF THINGS
PPTX
Software-Development-Life-Cycle-SDLC.pptx
PPTX
MODULE 02 - CLOUD COMPUTING-Virtual Machines and Virtualization of Clusters a...
electrical machines course file-anna university
Module1.pptxrjkeieuekwkwoowkemehehehrjrjrj
ENVIRONMENTAL PROTECTION AND MANAGEMENT (18CVL756)
Research on ultrasonic sensor for TTU.pdf
ASPEN PLUS USER GUIDE - PROCESS SIMULATIONS
MACCAFERRY GUIA GAVIONES TERRAPLENES EN ESPAÑOL
ARCHITECTURE AND PROGRAMMING OF EMBEDDED SYSTEMS
B461227.pdf American Journal of Multidisciplinary Research and Review
SE unit 1.pptx aaahshdhajdviwhsiehebeiwheiebeiev
AIGA 012_04 Cleaning of equipment for oxygen service_reformat Jan 12.pdf
AI-Reporting for Emerging Technologies(BS Computer Engineering)
LS-6-Digital-Literacy (1) K12 CURRICULUM .pdf
Module_1_Lecture_1_Introduction_To_Automation_In_Production_Systems2023.ppt
Real Estate Management PART 1.pptxFFFFFFFFFFFFF
THE PEDAGOGICAL NEXUS IN TEACHING ELECTRICITY CONCEPTS IN THE GRADE 9 NATURAL...
BBC NW_Tech Facilities_30 Odd Yrs Ago [J].pdf
Module 1 part 1.pdf engineering notes s7
INTERNET OF THINGS - EMBEDDED SYSTEMS AND INTERNET OF THINGS
Software-Development-Life-Cycle-SDLC.pptx
MODULE 02 - CLOUD COMPUTING-Virtual Machines and Virtualization of Clusters a...
Ad

xcjkfvhdfjlkghfkjbnfkbnfgbnklnbknbmcvbnlkcnb