Nonregular languages - PowerPoint PPT Presentation

1 / 69
About This Presentation
Title:

Nonregular languages

Description:

BUT: CONTRADICTION!!! Courtesy Costas Busch - RPI. 38 ... Use the Pumping Lemma. Assume for contradiction. that is a regular language. Since is infinite ... – PowerPoint PPT presentation

Number of Views:106
Avg rating:3.0/5.0
Slides: 70
Provided by: costas4
Category:

less

Transcript and Presenter's Notes

Title: Nonregular languages


1
Non-regular languages

2
Non-regular languages
Regular languages
3
How can we prove that a language is not regular?
Problem this is not easy to prove
Solution the Pumping Lemma !!!
4
The Pigeonhole Principle

5
pigeons

pigeonholes
6

A pigeonhole must contain at least two pigeons
7

pigeons
...........
pigeonholes
...........
8
The Pigeonhole Principle

pigeons
pigeonholes
There is a pigeonhole with at least 2 pigeons
...........
9
The Pigeonhole Principleand DFAs

10

DFA with states
11
In walks of strings
no state is repeated

12
In walks of strings
a state is repeated

13
If string has length

Then the transitions of string are more than the
states of the DFA
Thus, a state must be repeated
14
In general, for any DFA String has
length number of states
A state must be repeated in the walk of
walk of
......
......
Repeated state
15
In other words for a string
transitions are pigeons
states are pigeonholes
walk of
......
......
Repeated state
16
The Pumping Lemma

17
Take an infinite regular language
There exists a DFA that accepts
states
18
Take string with
There is a walk with label
.........
walk
19
If string has length
(number of states of DFA)
then, from the pigeonhole principle
a state is repeated in the walk
......
......
walk
20
Let be the first state repeated in the walk
of
......
......
walk
21
Write
......
......
22
Observations
length
number of states of DFA
length
......
......
23
The string is accepted
Observation
......
......
24
The string is accepted
Observation
......
......
25
The string is accepted
Observation
......
......
26
The string is accepted
In General
......
......
27
In General
Language accepted by the DFA
......
......
28
In other words, we described
The Pumping Lemma !!!
29
The Pumping Lemma
  • Given a infinite regular language
  • there exists an integer
  • for any string with length
  • we can write
  • with and
  • such that

30
Applications ofthe Pumping Lemma

31
Theorem
The language
is not regular
Proof
Use the Pumping Lemma
32
Assume for contradiction that is a regular
language
Since is infinite we can apply the Pumping
Lemma
33
Let be the integer in the Pumping Lemma
Pick a string such that
length
We pick
34
Write
From the Pumping Lemma
it must be that length
Thus
35
From the Pumping Lemma
Thus
36
From the Pumping Lemma
Thus
37
BUT
CONTRADICTION!!!
38
Our assumption that is a regular language is not
true
Therefore
Conclusion
is not a regular language
39
Non-regular languages
Regular languages
40
Non-regular languages
Regular languages
41
Theorem
The language
is not regular
Proof
Use the Pumping Lemma
42
Assume for contradiction that is a regular
language
Since is infinite we can apply the Pumping
Lemma
43
Let be the integer in the Pumping Lemma
Pick a string such that
and
length
We pick
44
Write
From the Pumping Lemma
it must be that length
Thus
45
From the Pumping Lemma
Thus
46
From the Pumping Lemma
Thus
47
BUT
CONTRADICTION!!!
48
Our assumption that is a regular language is not
true
Therefore
Conclusion
is not a regular language
49
Non-regular languages
Regular languages
50
Theorem
The language
is not regular
Proof
Use the Pumping Lemma
51
Assume for contradiction that is a regular
language
Since is infinite we can apply the Pumping
Lemma
52
Let be the integer in the Pumping Lemma
Pick a string such that
and
length
We pick
53
Write
From the Pumping Lemma
it must be that length
Thus
54
From the Pumping Lemma
Thus
55
From the Pumping Lemma
Thus
56
BUT
CONTRADICTION!!!
57
Our assumption that is a regular language is not
true
Therefore
Conclusion
is not a regular language
58
Non-regular languages
Regular languages
59
Theorem
The language
is not regular
Proof
Use the Pumping Lemma
60
Assume for contradiction that is a regular
language
Since is infinite we can apply the Pumping
Lemma
61
Let be the integer in the Pumping Lemma
Pick a string such that
length
We pick
62
Write
From the Pumping Lemma
it must be that length
Thus
63
From the Pumping Lemma
Thus
64
From the Pumping Lemma
Thus
65
Since
There must exist such that
66
However
for
for any
67
BUT
CONTRADICTION!!!
68
Our assumption that is a regular language is not
true
Therefore
Conclusion
is not a regular language
69
Summary
  • Showing regular
  • construct DFA, NFA
  • construct regular expression
  • show L is the union, concatenation, intersection
    (regular operations) of regular languages.
  • Showing non-regular
  • pumping lemma
  • assume regular, apply closure properties of
    regular languages and obtain a known non-regular
    language.
Write a Comment
User Comments (0)
About PowerShow.com