SlideShare a Scribd company logo
Equivalence with FA
* Any Regex can be converted to FA and vice versa,
because:
* Regex and FA are equivalent in their descriptive
power
** Regular language is one that is recognized by
some FA, remember?
Hence: (Lemma) if a language is described by a
RegEx, then it is a regular language.
See Proof: P.67, example 1.56
11/25/13
Lemma: If a language is regular, then it is
descried by a RegEx.
Because A is regular, it is accepted by a DFA. We
describe a procedure for converting DFAs into
equivalent RegEx.
Breaking the procedure into 2 parts, using a new
type of FA called Generalized Nondeterministic
Finite Automaton (GNFA)
Hence, 1st convert DFA to GNFA, then GNFA to
RegEx

11/25/13
GNFA is NFA, but Regex could be used as labels
on arrows. Figure 1.61 P.70 shows an example of
GNFA, which is on the special form that it should
ALWAYS have.

11/25/13
To convert a NFA to GNFA (and
keep the special form)
Add a new start state with ε arrow to the old start
Add a new accept state with ε arrow coming from
the old accept state.
If any arrow has more than one label, or there
are more than one arrow between two states on
the same direction, replace with one arrow and
“union” the labels
If two states have no arrows between them, add
an arrow with Φ label
11/25/13
Convert the GNFA to RegEx
In GNFA, the start and accept states are must,
and they're different, hence no. of states (k) of
any GNFA is always >=2.
If k>2, then GNFA is constructed by reducing the
number to k=2 (an arrow form start to accept
states) whose label is the RegEx.
Example, converting a 3 state DFA to RegEx.
3k DFA > 5k GNFA > 4k GNFA > 3k GNFA > 2k
GNFA > RegEx
11/25/13
Convert the GNFA to RegEx
The Challenge in reducing the states if greater than
2, by Ripping the a state out of the machine
(other than the start, accept states), we call it q rip ,
we repair the machine by altering the removed
qrip with labeled arrow. The label should cover the
absence of qrip .The new label form start to accept
states is the RegEx.
Figure 1.63 P. 72

11/25/13
Formal definition of GNFA
Just like the DFA, it's a 5-tuple with same parameters
except for δ, which can be given as:
δ: (Q - {qaccept }) X (Q – {qstart}) → R
R is the collection of all RegEx over the alphabet ∑,
The domain of the transition function is (Q - {qaccept })
X (Q – {qstart}) simply because in GNFA, an arrow
connects every state to every other state, except no
arrows are coming from qaccept or going to qstart.
Read: P.73 - 76

11/25/13
Nonregular Languages
Some languages cannot be recognized by any
FA (a limitation of FA)
Assume the language B = {0n1n | n>=0}. No DFA
can recognize it because the resulting number of
0s is unlimited, and therefore no DFA can
remember this number of possibilities.
But just because the language appears to require
unbounded memory doesn't mean it's nonregular.
So we need a method to prove the nonregularity
11/25/13
Nonregular Languages
Assume we have 2 languages C and D, over the
alphabet ∑ = {0,1}, where:
C = { w | w has an equal no. of 0s and 1s}, and
D = { w | w has an equal number of occurrences of
01 and 10 as substrings}
Which one is nonregular?
See problem 1.48
>> Difficult? We need a mathematical proof for
certainty.
11/25/13
The pumping lemma for regular
languages
Theorem (Pumping Lemma): “All regular
languages have a special property, if a language
doesn't have that property, it is not regular”.
The property states that all strings in the
language can be “pumped” if they are at least as
long as a certain special value called the
“pumping length”. In other words:
Such string contains a section that can be repeated
any number of times with the resulting string
remaining in the language
11/25/13
Pumping lemma: 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 conditions:
1- for each i>=0, xyiz ∈ A
2- |y| >0, and
3- |xy| <= p.
Figure 1.71 P.78
11/25/13
Non­regular languages

n

{a b : n≥ 0}
vv

R

:

Regular languages
a∗b

b∗c + a

b + c ( a + b )∗¿
¿

etc . ..

11/25/13

n

v ∈ {a , b }
∗¿
¿
¿
¿
How can we prove that a language L
is not regular?
Prove that there is no DFA or NFA or RE 
that accepts L 
Difficulty: this is not easy to prove
(since there is an infinite number
 of them)
Solution: use the Pumping Lemma !!!
11/25/13
The Pigeonhole Principle

11/25/13
4

3

11/25/13

pigeons

pigeonholes
A pigeonhole must
contain at least two pigeons

11/25/13
n

pigeons
...........

m

pigeonholes
...........

11/25/13

n> m
The Pigeonhole Principle

pigeons

n

pigeonholes

m

n> m

There is a pigeonhole
with at least 2 pigeons

...........

11/25/13
The Pigeonhole Principle
and
DFAs

11/25/13
Consider a DFA with 4
b

q1

b

b

a

q2

a

a
11/25/13

states

b

q3
a

q4
aaaab
Consider the walk of a “long’’ string:

(length at least 4)

A state is repeated in the walk of aaaab
a

q1

q2

b

q1

a

q3

a

a

q3

b

a

q2

b

q4
b

a

a

11/25/13

q2

q3

b

a

q4
The state is repeated as a result of 
the pigeonhole principle

Walk of
Pigeons:

(walk states)

q1

a

q2

a

q3

a

aaaab
q2

a

q3

b

q4

Are more than

q1

Nests:
(Automaton states)

11/25/13

q2

q3
Repeated
state

q4
aabb
Consider the walk of a “long’’ string:
(length at least 4)

Due to the pigeonhole principle:
A state is repeated in the walk of aabb
a

q1

q2

b

a

q3

b

q4

b

q4

b

b

q1

a

q2

a

a
11/25/13

q3

b

a

q4
The state is repeated as a result of
the pigeonhole principle
aabb

Walk of
Pigeons:

q1

a

a

q2

q3

b

q4

b

q4

(walk states)

Are more than

Nests:
(Automaton states)
11/25/13

q1

q2

q3

Automaton States

q4
Repeated
state
In General:

If ∣w∣ ≥ #states of DFA,
by the pigeonhole principle,
a state is repeated in the walk

Walk of
q1

σ1

σ2

....

σi

w = σ 1 σ 2 ⋯σ k
qi

σ i +1

σj

....

qi

σ j+1

....

σk

Arbitrary DFA
q1
11/25/13

σ1

σ2

w

......

qi

......

Repeated state

σk

qz

qz
∣w∣ ≥ #states of DFA =m

Pigeons: (walk states)
....
q1

Walk of
qi

....

w

qi

....

qz

Are
more
than
Nests:

q1

q2

(Automaton states)
11/25/13

....

qi

....

A state is
repeated

q m−1

qm
The Pumping Lemma

11/25/13
Take an infinite regular language

L

(contains an infinite number of strings)

There exists a DFA that accepts

L

m

states
11/25/13
Take string

w ∈L

∣w∣ ≥ m

with

(number of
states of DFA)

then, at least one state is repeated
in the walk of w
Walk in DFA of
w = σ 1 σ 2 ⋯σ k
σ1

σ2

......

q

......

σk

Repeated state in DFA
11/25/13
There could be many states repeated
Take q to be the first state repeated
One dimensional projection of walk

w
:

First
occurrence
σ1

σ2

....

σi

Second
occurrence

q

σ i +1

Unique states
11/25/13

....

σj

q

σ j+1

....

σk
We can write

w = xyz

One dimensional projection of walk

w
:

First
occurrence
σ1

σ2

....

x=σ 1 ⋯σ i
11/25/13

σi

Second
occurrence

q

σ i +1

....

y =σ i +1 ⋯σ j

σj

q

σ j+1

....

σk

z=σ j +1 ⋯σ k
In DFA:

w=x y z

contains only
first occurrence of

y

...

σj

...

σ1

11/25/13

x

σi

σ i +1

q

σ j+1

...

...
z

σk

q
Observation:

length

∣x y∣ ≤ m

number
of states
of DFA

y

...
Unique States
σj

...

σ1

11/25/13

x

σi

σ i +1

q

Since, in xy no
state is repeated
(except q)
Observation:

length

∣ y∣ ≥ 1

Since there is at least one transition in loop
y

...

σj

σ i +1

q

11/25/13
We do not care about the form of string

z

x
may actually overlap with the paths of

y

...
z

...
11/25/13

x

q

z

y
and
Additional string:

The string
is accepted

Do not follow loop

x z

y

...

σj

...

σ1

11/25/13

x

σi

σ i +1

q

σ j+1

...

...
z

σk
Additional string:

The string
is accepted

Follow loop
2 times

y

...

σj

...

σ1

11/25/13

x y y z

x

σi

σ i +1

q

σ j+1

...

...
z

σk
The string
is accepted

Additional string:

Follow loop
3 times

y

...

σj

...

σ1

11/25/13

x y y y z

x

σi

σ i +1

q

σ j+1

...

...
z

σk
In General:

The string
is accepted

Follow loop
i times

xy z
i=0, 1, 2, . ..

y

...

σj

...

σ1

11/25/13

i

x

σi

σ i +1

q

σ j+1

...

...
z

σk
i

Therefore:

x y z ∈L

i=0, 1, 2, . ..

Language accepted by the DFA
y

...

σj

...

σ1

11/25/13

x

σi

σ i +1

q

σ j+1

...

...
z

σk
We just described:

The Pumping Lemma !!!

11/25/13
The Pumping Lemma:
• Given a infinite regular language
• there exists an integer
• for any string w ∈ L
• we can write

(critical length)

with length ∣w∣ ≥ m

w=x y z

• with ∣x y∣ ≤ m
• such that:
11/25/13

m

L

i

and

x y z ∈L

∣ y∣ ≥ 1

i=0, 1, 2, . ..
In the book:
Critical length m

11/25/13

p
= Pumping length
Applications
of
the Pumping Lemma

11/25/13
Observation:
Every language of finite size has to be regular
(we can easily construct an NFA
that accepts every string in the language)

Therefore, every non-regular language
has to be of infinite size
(contains an infinite number of strings)
11/25/13
Suppose you want to prove that
An infinite language L is not regular
1. Assume the opposite: L

is regular

2. The pumping lemma should hold forL
3. Use the pumping lemma to obtain a
contradiction
4. Therefore, L is not regular
11/25/13
Explanation of Step 3: How to get a contradiction
1. Let m

be the critical length for

2. Choose a particular stringw ∈ L
∣w∣≥m
the length condition
3. Write

L
which satisfies

w=xyz

4. Show that

'

i

w =xy z∉L

for some

5. This gives a contradiction, since from
'
i
pumping lemma

w =xy z∈L

11/25/13

i≠1
Note:

It suffices to show that
only one string w ∈ L
gives a contradiction

You don’t need to obtain
contradiction for everyw ∈ L

11/25/13
Example
Theorem: L = { 0 n 1 n | n ∈ N } is not regular.
Proof: By contradiction; assume L is regular. Let n
be the pumping length guaranteed by the
pumping lemma.
Consider the string w = 0 n 1 n . Then |w| = 2n ≥ n
and w ∈ L, so we can write
w = xyz such that y ≠ ε and for any natural
number i, xyiz ∈ L. We
consider three cases:
Case 1: y consists solely of 0s. Then xyiz = xz = 0 n - |y| 1 n ,
and since
|y| > 0, xz ∉ L.
Case 2: y consists solely of 1s. Then xy i z = xz = 0 n 1 n - |y| , and
since
|y| > 0, xz ∉ L.
Case 3: y consists of k 0s followed by m 1s. Then xy i z has
the
form 0 n 1 m 0 k 1 n + m , so xy i z ∉ L.
In all three cases we reach a contradiction, so our
assumption was
wrong and L is not regular. ■
Example of Pumping Lemma application

Theorem:

The language

n

n

L={a b : n≥0}
is not regular

Proof:

11/25/13

Use the Pumping Lemma
n

n

L={a b : n≥0}
Assume for contradiction
thatL
is a regular language

SinceL
is infinite
we can apply the Pumping Lemma
11/25/13
n

n

L={a b : n≥0}
Let

m

be the critical length for L

Pick a string

w

such that: w ∈ L
and length ∣w∣ ≥m
We pick

11/25/13

m

w=a b

m
From the Pumping Lemma:
m m

we can write

w=a b =x y z

with lengths

∣x y∣ ≤m , ∣ y∣≥1
m

w=

m

m m

xyz=a b = a ...aa ... aa .. . ab.. . b
x

11/25/13

Thus:

k

y

z

y =a , 1≤k ≤m
m m

k

y =a , 1≤k ≤m

x y z=a b

From the Pumping Lemma:

i

x y z ∈L
i=0, 1, 2, . ..

Thus:

11/25/13

2

x y z ∈L
m m

k

y =a , 1≤k ≤m

x y z=a b

2

x y z ∈L

From the Pumping Lemma:
m+k

m

2

xy z= a...aa...aa ...aa...ab...b ∈L
x

Thus:
11/25/13

y

a

y

m+k

z

m

b ∈L
a

BUT:

m+k

m

b ∈L

n

n

L={a b : n≥0}

a

m+k

m

b ∉L

CONTRADICTION!!!
11/25/13

k≥ 1
Therefore:

Our assumption thatL
is a regular language is not true

Conclusion: L

11/25/13

is not a regular language

END OF PROOF
Non-regular language

n n

{a b : n≥0}

Regular languages
¿ ¿

L(a b )

11/25/13
Read
P. 80 – 82 (examples)
Solve Exercises and Problems (P. 83 – 98)
Prepare for a quiz!

11/25/13
Ad

More Related Content

What's hot (20)

Theory of Computation Basics of Finite Acceptors
Theory of Computation Basics of Finite AcceptorsTheory of Computation Basics of Finite Acceptors
Theory of Computation Basics of Finite Acceptors
Rushabh2428
 
Formal Languages and Automata Theory Unit 1
Formal Languages and Automata Theory Unit 1Formal Languages and Automata Theory Unit 1
Formal Languages and Automata Theory Unit 1
Srimatre K
 
Context free languages
Context free languagesContext free languages
Context free languages
Jahurul Islam
 
Nondeterministic Finite Automata
Nondeterministic Finite Automata Nondeterministic Finite Automata
Nondeterministic Finite Automata
parmeet834
 
Finite automata(For college Seminars)
Finite automata(For college Seminars)Finite automata(For college Seminars)
Finite automata(For college Seminars)
Naman Joshi
 
L3 cfg
L3 cfgL3 cfg
L3 cfg
Self-employed
 
Unit iii
Unit iiiUnit iii
Unit iii
TPLatchoumi
 
NFA DFA Equivalence theorem
NFA DFA Equivalence theorem NFA DFA Equivalence theorem
NFA DFA Equivalence theorem
niveditJain
 
NFA Converted to DFA , Minimization of DFA , Transition Diagram
NFA Converted to DFA , Minimization of DFA , Transition DiagramNFA Converted to DFA , Minimization of DFA , Transition Diagram
NFA Converted to DFA , Minimization of DFA , Transition Diagram
Abdullah Jan
 
simple problem to convert NFA with epsilon to without epsilon
simple problem to convert NFA with epsilon to without epsilonsimple problem to convert NFA with epsilon to without epsilon
simple problem to convert NFA with epsilon to without epsilon
kanikkk
 
Chomsky hierarchy
Chomsky hierarchyChomsky hierarchy
Chomsky hierarchy
SANUC2
 
Finite Automata
Finite AutomataFinite Automata
Finite Automata
parmeet834
 
push down automata
push down automatapush down automata
push down automata
Christopher Chizoba
 
Chapt 06
Chapt 06Chapt 06
Chapt 06
guest2bb25
 
DFA Minimization
DFA MinimizationDFA Minimization
DFA Minimization
guest5873b2d
 
Nfa to-dfa
Nfa to-dfaNfa to-dfa
Nfa to-dfa
rsivashankari
 
Minimization of DFA
Minimization of DFAMinimization of DFA
Minimization of DFA
kunj desai
 
Qtpvbscripttrainings
QtpvbscripttrainingsQtpvbscripttrainings
Qtpvbscripttrainings
Ramu Palanki
 
Mba admission in india
Mba admission in indiaMba admission in india
Mba admission in india
Edhole.com
 
Push down automata
Push down automataPush down automata
Push down automata
Somya Bagai
 
Theory of Computation Basics of Finite Acceptors
Theory of Computation Basics of Finite AcceptorsTheory of Computation Basics of Finite Acceptors
Theory of Computation Basics of Finite Acceptors
Rushabh2428
 
Formal Languages and Automata Theory Unit 1
Formal Languages and Automata Theory Unit 1Formal Languages and Automata Theory Unit 1
Formal Languages and Automata Theory Unit 1
Srimatre K
 
Context free languages
Context free languagesContext free languages
Context free languages
Jahurul Islam
 
Nondeterministic Finite Automata
Nondeterministic Finite Automata Nondeterministic Finite Automata
Nondeterministic Finite Automata
parmeet834
 
Finite automata(For college Seminars)
Finite automata(For college Seminars)Finite automata(For college Seminars)
Finite automata(For college Seminars)
Naman Joshi
 
NFA DFA Equivalence theorem
NFA DFA Equivalence theorem NFA DFA Equivalence theorem
NFA DFA Equivalence theorem
niveditJain
 
NFA Converted to DFA , Minimization of DFA , Transition Diagram
NFA Converted to DFA , Minimization of DFA , Transition DiagramNFA Converted to DFA , Minimization of DFA , Transition Diagram
NFA Converted to DFA , Minimization of DFA , Transition Diagram
Abdullah Jan
 
simple problem to convert NFA with epsilon to without epsilon
simple problem to convert NFA with epsilon to without epsilonsimple problem to convert NFA with epsilon to without epsilon
simple problem to convert NFA with epsilon to without epsilon
kanikkk
 
Chomsky hierarchy
Chomsky hierarchyChomsky hierarchy
Chomsky hierarchy
SANUC2
 
Finite Automata
Finite AutomataFinite Automata
Finite Automata
parmeet834
 
Minimization of DFA
Minimization of DFAMinimization of DFA
Minimization of DFA
kunj desai
 
Qtpvbscripttrainings
QtpvbscripttrainingsQtpvbscripttrainings
Qtpvbscripttrainings
Ramu Palanki
 
Mba admission in india
Mba admission in indiaMba admission in india
Mba admission in india
Edhole.com
 
Push down automata
Push down automataPush down automata
Push down automata
Somya Bagai
 

Viewers also liked (20)

Pda to cfg h2
Pda to cfg h2Pda to cfg h2
Pda to cfg h2
Rajendran
 
Finite automata intro
Finite automata introFinite automata intro
Finite automata intro
lavishka_anuj
 
Kleene's theorem
Kleene's theoremKleene's theorem
Kleene's theorem
Samita Mukesh
 
Agricultural Productivity and Economic Development in Southern Africa
Agricultural Productivity and Economic Development in Southern AfricaAgricultural Productivity and Economic Development in Southern Africa
Agricultural Productivity and Economic Development in Southern Africa
Jason Welker
 
Water-Food-Energy Nexus in the context of groundwater use in India: Experienc...
Water-Food-Energy Nexus in the context of groundwater use in India: Experienc...Water-Food-Energy Nexus in the context of groundwater use in India: Experienc...
Water-Food-Energy Nexus in the context of groundwater use in India: Experienc...
International Water Management Institute (IWMI)
 
Chapter 01 Foundation
Chapter 01 FoundationChapter 01 Foundation
Chapter 01 Foundation
Alamgir Alwani
 
An Agricultural Economics Research Agenda in Ethiopia – Some Reflections
An Agricultural Economics Research Agenda in Ethiopia – Some ReflectionsAn Agricultural Economics Research Agenda in Ethiopia – Some Reflections
An Agricultural Economics Research Agenda in Ethiopia – Some Reflections
essp2
 
Drupal - A Web Based Content Management System
Drupal - A Web Based Content Management SystemDrupal - A Web Based Content Management System
Drupal - A Web Based Content Management System
Sudarshan Bengani
 
Selecting a content management system
Selecting a content management systemSelecting a content management system
Selecting a content management system
gmcinnis
 
How to fit a content management system in your digital strategy?
How to fit a content management system in your digital strategy?How to fit a content management system in your digital strategy?
How to fit a content management system in your digital strategy?
Amplexor
 
Modeling the water food-energy nexus in the arab world: River basin modeling ...
Modeling the water food-energy nexus in the arab world: River basin modeling ...Modeling the water food-energy nexus in the arab world: River basin modeling ...
Modeling the water food-energy nexus in the arab world: River basin modeling ...
International Food Policy Research Institute (IFPRI)
 
Plataformas educativas
Plataformas educativasPlataformas educativas
Plataformas educativas
Jaime León
 
Ceu lecture 5
Ceu lecture 5Ceu lecture 5
Ceu lecture 5
Jorge Nunez Ferrer
 
Food-Energy-Water Nexus Introduction
Food-Energy-Water Nexus IntroductionFood-Energy-Water Nexus Introduction
Food-Energy-Water Nexus Introduction
Meyer_IFPRI
 
CEU lecture 3 2016
CEU lecture 3 2016CEU lecture 3 2016
CEU lecture 3 2016
Jorge Nunez Ferrer
 
The Water Energy and Food Security Nexus - is it really new?
The Water Energy and Food Security Nexus - is it really new?The Water Energy and Food Security Nexus - is it really new?
The Water Energy and Food Security Nexus - is it really new?
International Water Management Institute (IWMI)
 
Proof in Mathematics
Proof in MathematicsProof in Mathematics
Proof in Mathematics
mscartersmaths
 
CEU lecture 6
CEU lecture 6CEU lecture 6
CEU lecture 6
Jorge Nunez Ferrer
 
Ceu lecture 4
Ceu lecture 4Ceu lecture 4
Ceu lecture 4
Jorge Nunez Ferrer
 
Agricultural Economics Mid Term Progress Submission
Agricultural Economics Mid Term Progress SubmissionAgricultural Economics Mid Term Progress Submission
Agricultural Economics Mid Term Progress Submission
Anirudh Jayaraman
 
Finite automata intro
Finite automata introFinite automata intro
Finite automata intro
lavishka_anuj
 
Agricultural Productivity and Economic Development in Southern Africa
Agricultural Productivity and Economic Development in Southern AfricaAgricultural Productivity and Economic Development in Southern Africa
Agricultural Productivity and Economic Development in Southern Africa
Jason Welker
 
An Agricultural Economics Research Agenda in Ethiopia – Some Reflections
An Agricultural Economics Research Agenda in Ethiopia – Some ReflectionsAn Agricultural Economics Research Agenda in Ethiopia – Some Reflections
An Agricultural Economics Research Agenda in Ethiopia – Some Reflections
essp2
 
Drupal - A Web Based Content Management System
Drupal - A Web Based Content Management SystemDrupal - A Web Based Content Management System
Drupal - A Web Based Content Management System
Sudarshan Bengani
 
Selecting a content management system
Selecting a content management systemSelecting a content management system
Selecting a content management system
gmcinnis
 
How to fit a content management system in your digital strategy?
How to fit a content management system in your digital strategy?How to fit a content management system in your digital strategy?
How to fit a content management system in your digital strategy?
Amplexor
 
Plataformas educativas
Plataformas educativasPlataformas educativas
Plataformas educativas
Jaime León
 
Food-Energy-Water Nexus Introduction
Food-Energy-Water Nexus IntroductionFood-Energy-Water Nexus Introduction
Food-Energy-Water Nexus Introduction
Meyer_IFPRI
 
Agricultural Economics Mid Term Progress Submission
Agricultural Economics Mid Term Progress SubmissionAgricultural Economics Mid Term Progress Submission
Agricultural Economics Mid Term Progress Submission
Anirudh Jayaraman
 
Ad

Similar to Theory of Computation - Lectures 6 & 7 (20)

xcjkfvhdfjlkghfkjbnfkbnfgbnklnbknbmcvbnlkcnb
xcjkfvhdfjlkghfkjbnfkbnfgbnklnbknbmcvbnlkcnbxcjkfvhdfjlkghfkjbnfkbnfgbnklnbknbmcvbnlkcnb
xcjkfvhdfjlkghfkjbnfkbnfgbnklnbknbmcvbnlkcnb
ssuser4293bd
 
AUTOMATA AUTOMATA Automata5Chapter4.pptx
AUTOMATA AUTOMATA Automata5Chapter4.pptxAUTOMATA AUTOMATA Automata5Chapter4.pptx
AUTOMATA AUTOMATA Automata5Chapter4.pptx
ArjayBalberan1
 
RegularLanguageProperties.pptx
RegularLanguageProperties.pptxRegularLanguageProperties.pptx
RegularLanguageProperties.pptx
Ezhumalai p
 
toc Properties of Regular Languages .pptx
toc Properties of Regular Languages .pptxtoc Properties of Regular Languages .pptx
toc Properties of Regular Languages .pptx
SathyanandamSathyana
 
Pumming Lemma
Pumming LemmaPumming Lemma
Pumming Lemma
Hemant Chetwani
 
09.LearningMaterial_Sample.pdf
09.LearningMaterial_Sample.pdf09.LearningMaterial_Sample.pdf
09.LearningMaterial_Sample.pdf
ssuser47f7f2
 
Chapter 3 REGULAR EXPRESSION.pdf
Chapter 3 REGULAR EXPRESSION.pdfChapter 3 REGULAR EXPRESSION.pdf
Chapter 3 REGULAR EXPRESSION.pdf
dawod yimer
 
PPT 2.1.1(The Pumping Lemma for Regular sets, Application of the Pumping Lemm...
PPT 2.1.1(The Pumping Lemma for Regular sets, Application of the Pumping Lemm...PPT 2.1.1(The Pumping Lemma for Regular sets, Application of the Pumping Lemm...
PPT 2.1.1(The Pumping Lemma for Regular sets, Application of the Pumping Lemm...
ArjunMehra32
 
non regular language updated theory of automata.ppt
non regular language updated theory of automata.pptnon regular language updated theory of automata.ppt
non regular language updated theory of automata.ppt
abdulrehmanshahzad69
 
non regular language and pumping lemma toc
non regular language and pumping lemma tocnon regular language and pumping lemma toc
non regular language and pumping lemma toc
nkdhanani2
 
Pumping lemma for regular set h1
Pumping lemma for regular set h1Pumping lemma for regular set h1
Pumping lemma for regular set h1
Rajendran
 
Lecture-8-Pumpdndndndndnddndning Lemma.pdf
Lecture-8-Pumpdndndndndnddndning Lemma.pdfLecture-8-Pumpdndndndndnddndning Lemma.pdf
Lecture-8-Pumpdndndndndnddndning Lemma.pdf
mounirmn33
 
Class6
 Class6 Class6
Class6
issbp
 
Theory of Automata and formal languages unit 2
Theory of Automata and formal languages unit 2Theory of Automata and formal languages unit 2
Theory of Automata and formal languages unit 2
Abhimanyu Mishra
 
Introduction to the Theory of Computation, Winter 2003 A. Hevia and J. Mao S...
 Introduction to the Theory of Computation, Winter 2003 A. Hevia and J. Mao S... Introduction to the Theory of Computation, Winter 2003 A. Hevia and J. Mao S...
Introduction to the Theory of Computation, Winter 2003 A. Hevia and J. Mao S...
parmeet834
 
Mba ebooks ! Edhole
Mba ebooks ! EdholeMba ebooks ! Edhole
Mba ebooks ! Edhole
Edhole.com
 
Free Ebooks Download ! Edhole
Free Ebooks Download ! EdholeFree Ebooks Download ! Edhole
Free Ebooks Download ! Edhole
Edhole.com
 
Regular pumping
Regular pumping Regular pumping
Regular pumping
Wael Badawy
 
hop-chap4.ppt
hop-chap4.ppthop-chap4.ppt
hop-chap4.ppt
UniversityHacks
 
MidtermI-review.pptx
MidtermI-review.pptxMidtermI-review.pptx
MidtermI-review.pptx
amara jyothi
 
xcjkfvhdfjlkghfkjbnfkbnfgbnklnbknbmcvbnlkcnb
xcjkfvhdfjlkghfkjbnfkbnfgbnklnbknbmcvbnlkcnbxcjkfvhdfjlkghfkjbnfkbnfgbnklnbknbmcvbnlkcnb
xcjkfvhdfjlkghfkjbnfkbnfgbnklnbknbmcvbnlkcnb
ssuser4293bd
 
AUTOMATA AUTOMATA Automata5Chapter4.pptx
AUTOMATA AUTOMATA Automata5Chapter4.pptxAUTOMATA AUTOMATA Automata5Chapter4.pptx
AUTOMATA AUTOMATA Automata5Chapter4.pptx
ArjayBalberan1
 
RegularLanguageProperties.pptx
RegularLanguageProperties.pptxRegularLanguageProperties.pptx
RegularLanguageProperties.pptx
Ezhumalai p
 
toc Properties of Regular Languages .pptx
toc Properties of Regular Languages .pptxtoc Properties of Regular Languages .pptx
toc Properties of Regular Languages .pptx
SathyanandamSathyana
 
09.LearningMaterial_Sample.pdf
09.LearningMaterial_Sample.pdf09.LearningMaterial_Sample.pdf
09.LearningMaterial_Sample.pdf
ssuser47f7f2
 
Chapter 3 REGULAR EXPRESSION.pdf
Chapter 3 REGULAR EXPRESSION.pdfChapter 3 REGULAR EXPRESSION.pdf
Chapter 3 REGULAR EXPRESSION.pdf
dawod yimer
 
PPT 2.1.1(The Pumping Lemma for Regular sets, Application of the Pumping Lemm...
PPT 2.1.1(The Pumping Lemma for Regular sets, Application of the Pumping Lemm...PPT 2.1.1(The Pumping Lemma for Regular sets, Application of the Pumping Lemm...
PPT 2.1.1(The Pumping Lemma for Regular sets, Application of the Pumping Lemm...
ArjunMehra32
 
non regular language updated theory of automata.ppt
non regular language updated theory of automata.pptnon regular language updated theory of automata.ppt
non regular language updated theory of automata.ppt
abdulrehmanshahzad69
 
non regular language and pumping lemma toc
non regular language and pumping lemma tocnon regular language and pumping lemma toc
non regular language and pumping lemma toc
nkdhanani2
 
Pumping lemma for regular set h1
Pumping lemma for regular set h1Pumping lemma for regular set h1
Pumping lemma for regular set h1
Rajendran
 
Lecture-8-Pumpdndndndndnddndning Lemma.pdf
Lecture-8-Pumpdndndndndnddndning Lemma.pdfLecture-8-Pumpdndndndndnddndning Lemma.pdf
Lecture-8-Pumpdndndndndnddndning Lemma.pdf
mounirmn33
 
Class6
 Class6 Class6
Class6
issbp
 
Theory of Automata and formal languages unit 2
Theory of Automata and formal languages unit 2Theory of Automata and formal languages unit 2
Theory of Automata and formal languages unit 2
Abhimanyu Mishra
 
Introduction to the Theory of Computation, Winter 2003 A. Hevia and J. Mao S...
 Introduction to the Theory of Computation, Winter 2003 A. Hevia and J. Mao S... Introduction to the Theory of Computation, Winter 2003 A. Hevia and J. Mao S...
Introduction to the Theory of Computation, Winter 2003 A. Hevia and J. Mao S...
parmeet834
 
Mba ebooks ! Edhole
Mba ebooks ! EdholeMba ebooks ! Edhole
Mba ebooks ! Edhole
Edhole.com
 
Free Ebooks Download ! Edhole
Free Ebooks Download ! EdholeFree Ebooks Download ! Edhole
Free Ebooks Download ! Edhole
Edhole.com
 
Regular pumping
Regular pumping Regular pumping
Regular pumping
Wael Badawy
 
MidtermI-review.pptx
MidtermI-review.pptxMidtermI-review.pptx
MidtermI-review.pptx
amara jyothi
 
Ad

More from Dr. Maamoun Ahmed (7)

A* - Astar - A-Star
A* - Astar - A-StarA* - Astar - A-Star
A* - Astar - A-Star
Dr. Maamoun Ahmed
 
Minimum spanning trees – prim's and kruskal's algorithms
Minimum spanning trees – prim's and kruskal's algorithmsMinimum spanning trees – prim's and kruskal's algorithms
Minimum spanning trees – prim's and kruskal's algorithms
Dr. Maamoun Ahmed
 
Finding Minimum Spanning Tree using Prim's Algorithm - Matrix approach
Finding Minimum Spanning Tree using Prim's Algorithm - Matrix approachFinding Minimum Spanning Tree using Prim's Algorithm - Matrix approach
Finding Minimum Spanning Tree using Prim's Algorithm - Matrix approach
Dr. Maamoun Ahmed
 
Solving linear homogeneous recurrence relations
Solving linear homogeneous recurrence relationsSolving linear homogeneous recurrence relations
Solving linear homogeneous recurrence relations
Dr. Maamoun Ahmed
 
Theory of Computation - Lectures 4 and 5
Theory of Computation - Lectures 4 and 5Theory of Computation - Lectures 4 and 5
Theory of Computation - Lectures 4 and 5
Dr. Maamoun Ahmed
 
Theory of Computation - Lecture 3
Theory of Computation - Lecture 3Theory of Computation - Lecture 3
Theory of Computation - Lecture 3
Dr. Maamoun Ahmed
 
Theory of Computation - Strings and Languages and Proofs (Lecture 2)
Theory of Computation  - Strings and Languages and Proofs (Lecture 2)Theory of Computation  - Strings and Languages and Proofs (Lecture 2)
Theory of Computation - Strings and Languages and Proofs (Lecture 2)
Dr. Maamoun Ahmed
 
Minimum spanning trees – prim's and kruskal's algorithms
Minimum spanning trees – prim's and kruskal's algorithmsMinimum spanning trees – prim's and kruskal's algorithms
Minimum spanning trees – prim's and kruskal's algorithms
Dr. Maamoun Ahmed
 
Finding Minimum Spanning Tree using Prim's Algorithm - Matrix approach
Finding Minimum Spanning Tree using Prim's Algorithm - Matrix approachFinding Minimum Spanning Tree using Prim's Algorithm - Matrix approach
Finding Minimum Spanning Tree using Prim's Algorithm - Matrix approach
Dr. Maamoun Ahmed
 
Solving linear homogeneous recurrence relations
Solving linear homogeneous recurrence relationsSolving linear homogeneous recurrence relations
Solving linear homogeneous recurrence relations
Dr. Maamoun Ahmed
 
Theory of Computation - Lectures 4 and 5
Theory of Computation - Lectures 4 and 5Theory of Computation - Lectures 4 and 5
Theory of Computation - Lectures 4 and 5
Dr. Maamoun Ahmed
 
Theory of Computation - Lecture 3
Theory of Computation - Lecture 3Theory of Computation - Lecture 3
Theory of Computation - Lecture 3
Dr. Maamoun Ahmed
 
Theory of Computation - Strings and Languages and Proofs (Lecture 2)
Theory of Computation  - Strings and Languages and Proofs (Lecture 2)Theory of Computation  - Strings and Languages and Proofs (Lecture 2)
Theory of Computation - Strings and Languages and Proofs (Lecture 2)
Dr. Maamoun Ahmed
 

Recently uploaded (20)

PUBH1000 Slides - Module 10: Health Promotion
PUBH1000 Slides - Module 10: Health PromotionPUBH1000 Slides - Module 10: Health Promotion
PUBH1000 Slides - Module 10: Health Promotion
JonathanHallett4
 
How to Use Upgrade Code Command in Odoo 18
How to Use Upgrade Code Command in Odoo 18How to Use Upgrade Code Command in Odoo 18
How to Use Upgrade Code Command in Odoo 18
Celine George
 
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
parmarjuli1412
 
Module_2_Types_and_Approaches_of_Research (2).pptx
Module_2_Types_and_Approaches_of_Research (2).pptxModule_2_Types_and_Approaches_of_Research (2).pptx
Module_2_Types_and_Approaches_of_Research (2).pptx
drroxannekemp
 
Launch of The State of Global Teenage Career Preparation - Andreas Schleicher...
Launch of The State of Global Teenage Career Preparation - Andreas Schleicher...Launch of The State of Global Teenage Career Preparation - Andreas Schleicher...
Launch of The State of Global Teenage Career Preparation - Andreas Schleicher...
EduSkills OECD
 
Letter to Secretary Linda McMahon from U.S. Senators
Letter to Secretary Linda McMahon from U.S. SenatorsLetter to Secretary Linda McMahon from U.S. Senators
Letter to Secretary Linda McMahon from U.S. Senators
Mebane Rash
 
UPSA JUDGEMENT.pdfCopyright Infringement: High Court Rules against UPSA: A Wa...
UPSA JUDGEMENT.pdfCopyright Infringement: High Court Rules against UPSA: A Wa...UPSA JUDGEMENT.pdfCopyright Infringement: High Court Rules against UPSA: A Wa...
UPSA JUDGEMENT.pdfCopyright Infringement: High Court Rules against UPSA: A Wa...
businessweekghana
 
A report on the county distress rankings in NC
A report on the county distress rankings in NCA report on the county distress rankings in NC
A report on the county distress rankings in NC
Mebane Rash
 
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
Dr. Nasir Mustafa
 
Classification of mental disorder in 5th semester bsc. nursing and also used ...
Classification of mental disorder in 5th semester bsc. nursing and also used ...Classification of mental disorder in 5th semester bsc. nursing and also used ...
Classification of mental disorder in 5th semester bsc. nursing and also used ...
parmarjuli1412
 
Rebuilding the library community in a post-Twitter world
Rebuilding the library community in a post-Twitter worldRebuilding the library community in a post-Twitter world
Rebuilding the library community in a post-Twitter world
Ned Potter
 
materi 3D Augmented Reality dengan assemblr
materi 3D Augmented Reality dengan assemblrmateri 3D Augmented Reality dengan assemblr
materi 3D Augmented Reality dengan assemblr
fatikhatunnajikhah1
 
PUBH1000 Slides - Module 11: Governance for Health
PUBH1000 Slides - Module 11: Governance for HealthPUBH1000 Slides - Module 11: Governance for Health
PUBH1000 Slides - Module 11: Governance for Health
JonathanHallett4
 
"Bridging Cultures Through Holiday Cards: 39 Students Celebrate Global Tradit...
"Bridging Cultures Through Holiday Cards: 39 Students Celebrate Global Tradit..."Bridging Cultures Through Holiday Cards: 39 Students Celebrate Global Tradit...
"Bridging Cultures Through Holiday Cards: 39 Students Celebrate Global Tradit...
AlionaBujoreanu
 
Final Evaluation.docx...........................
Final Evaluation.docx...........................Final Evaluation.docx...........................
Final Evaluation.docx...........................
l1bbyburrell
 
IMPACT_OF_SOCIAL-MEDIA- AMONG- TEENAGERS
IMPACT_OF_SOCIAL-MEDIA- AMONG- TEENAGERSIMPACT_OF_SOCIAL-MEDIA- AMONG- TEENAGERS
IMPACT_OF_SOCIAL-MEDIA- AMONG- TEENAGERS
rajaselviazhagiri1
 
Dastur_ul_Amal under Jahangir Key Features.pptx
Dastur_ul_Amal under Jahangir Key Features.pptxDastur_ul_Amal under Jahangir Key Features.pptx
Dastur_ul_Amal under Jahangir Key Features.pptx
omorfaruqkazi
 
Module 1: Foundations of Research
Module 1: Foundations of ResearchModule 1: Foundations of Research
Module 1: Foundations of Research
drroxannekemp
 
How to Manage Cross Selling in Odoo 18 Sales
How to Manage Cross Selling in Odoo 18 SalesHow to Manage Cross Selling in Odoo 18 Sales
How to Manage Cross Selling in Odoo 18 Sales
Celine George
 
Aerospace Engineering Homework Help Guide – Expert Support for Academic Success
Aerospace Engineering Homework Help Guide – Expert Support for Academic SuccessAerospace Engineering Homework Help Guide – Expert Support for Academic Success
Aerospace Engineering Homework Help Guide – Expert Support for Academic Success
online college homework help
 
PUBH1000 Slides - Module 10: Health Promotion
PUBH1000 Slides - Module 10: Health PromotionPUBH1000 Slides - Module 10: Health Promotion
PUBH1000 Slides - Module 10: Health Promotion
JonathanHallett4
 
How to Use Upgrade Code Command in Odoo 18
How to Use Upgrade Code Command in Odoo 18How to Use Upgrade Code Command in Odoo 18
How to Use Upgrade Code Command in Odoo 18
Celine George
 
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
parmarjuli1412
 
Module_2_Types_and_Approaches_of_Research (2).pptx
Module_2_Types_and_Approaches_of_Research (2).pptxModule_2_Types_and_Approaches_of_Research (2).pptx
Module_2_Types_and_Approaches_of_Research (2).pptx
drroxannekemp
 
Launch of The State of Global Teenage Career Preparation - Andreas Schleicher...
Launch of The State of Global Teenage Career Preparation - Andreas Schleicher...Launch of The State of Global Teenage Career Preparation - Andreas Schleicher...
Launch of The State of Global Teenage Career Preparation - Andreas Schleicher...
EduSkills OECD
 
Letter to Secretary Linda McMahon from U.S. Senators
Letter to Secretary Linda McMahon from U.S. SenatorsLetter to Secretary Linda McMahon from U.S. Senators
Letter to Secretary Linda McMahon from U.S. Senators
Mebane Rash
 
UPSA JUDGEMENT.pdfCopyright Infringement: High Court Rules against UPSA: A Wa...
UPSA JUDGEMENT.pdfCopyright Infringement: High Court Rules against UPSA: A Wa...UPSA JUDGEMENT.pdfCopyright Infringement: High Court Rules against UPSA: A Wa...
UPSA JUDGEMENT.pdfCopyright Infringement: High Court Rules against UPSA: A Wa...
businessweekghana
 
A report on the county distress rankings in NC
A report on the county distress rankings in NCA report on the county distress rankings in NC
A report on the county distress rankings in NC
Mebane Rash
 
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
Dr. Nasir Mustafa
 
Classification of mental disorder in 5th semester bsc. nursing and also used ...
Classification of mental disorder in 5th semester bsc. nursing and also used ...Classification of mental disorder in 5th semester bsc. nursing and also used ...
Classification of mental disorder in 5th semester bsc. nursing and also used ...
parmarjuli1412
 
Rebuilding the library community in a post-Twitter world
Rebuilding the library community in a post-Twitter worldRebuilding the library community in a post-Twitter world
Rebuilding the library community in a post-Twitter world
Ned Potter
 
materi 3D Augmented Reality dengan assemblr
materi 3D Augmented Reality dengan assemblrmateri 3D Augmented Reality dengan assemblr
materi 3D Augmented Reality dengan assemblr
fatikhatunnajikhah1
 
PUBH1000 Slides - Module 11: Governance for Health
PUBH1000 Slides - Module 11: Governance for HealthPUBH1000 Slides - Module 11: Governance for Health
PUBH1000 Slides - Module 11: Governance for Health
JonathanHallett4
 
"Bridging Cultures Through Holiday Cards: 39 Students Celebrate Global Tradit...
"Bridging Cultures Through Holiday Cards: 39 Students Celebrate Global Tradit..."Bridging Cultures Through Holiday Cards: 39 Students Celebrate Global Tradit...
"Bridging Cultures Through Holiday Cards: 39 Students Celebrate Global Tradit...
AlionaBujoreanu
 
Final Evaluation.docx...........................
Final Evaluation.docx...........................Final Evaluation.docx...........................
Final Evaluation.docx...........................
l1bbyburrell
 
IMPACT_OF_SOCIAL-MEDIA- AMONG- TEENAGERS
IMPACT_OF_SOCIAL-MEDIA- AMONG- TEENAGERSIMPACT_OF_SOCIAL-MEDIA- AMONG- TEENAGERS
IMPACT_OF_SOCIAL-MEDIA- AMONG- TEENAGERS
rajaselviazhagiri1
 
Dastur_ul_Amal under Jahangir Key Features.pptx
Dastur_ul_Amal under Jahangir Key Features.pptxDastur_ul_Amal under Jahangir Key Features.pptx
Dastur_ul_Amal under Jahangir Key Features.pptx
omorfaruqkazi
 
Module 1: Foundations of Research
Module 1: Foundations of ResearchModule 1: Foundations of Research
Module 1: Foundations of Research
drroxannekemp
 
How to Manage Cross Selling in Odoo 18 Sales
How to Manage Cross Selling in Odoo 18 SalesHow to Manage Cross Selling in Odoo 18 Sales
How to Manage Cross Selling in Odoo 18 Sales
Celine George
 
Aerospace Engineering Homework Help Guide – Expert Support for Academic Success
Aerospace Engineering Homework Help Guide – Expert Support for Academic SuccessAerospace Engineering Homework Help Guide – Expert Support for Academic Success
Aerospace Engineering Homework Help Guide – Expert Support for Academic Success
online college homework help
 

Theory of Computation - Lectures 6 & 7

  • 1. Equivalence with FA * Any Regex can be converted to FA and vice versa, because: * Regex and FA are equivalent in their descriptive power ** Regular language is one that is recognized by some FA, remember? Hence: (Lemma) if a language is described by a RegEx, then it is a regular language. See Proof: P.67, example 1.56 11/25/13
  • 2. Lemma: If a language is regular, then it is descried by a RegEx. Because A is regular, it is accepted by a DFA. We describe a procedure for converting DFAs into equivalent RegEx. Breaking the procedure into 2 parts, using a new type of FA called Generalized Nondeterministic Finite Automaton (GNFA) Hence, 1st convert DFA to GNFA, then GNFA to RegEx 11/25/13
  • 3. GNFA is NFA, but Regex could be used as labels on arrows. Figure 1.61 P.70 shows an example of GNFA, which is on the special form that it should ALWAYS have. 11/25/13
  • 4. To convert a NFA to GNFA (and keep the special form) Add a new start state with ε arrow to the old start Add a new accept state with ε arrow coming from the old accept state. If any arrow has more than one label, or there are more than one arrow between two states on the same direction, replace with one arrow and “union” the labels If two states have no arrows between them, add an arrow with Φ label 11/25/13
  • 5. Convert the GNFA to RegEx In GNFA, the start and accept states are must, and they're different, hence no. of states (k) of any GNFA is always >=2. If k>2, then GNFA is constructed by reducing the number to k=2 (an arrow form start to accept states) whose label is the RegEx. Example, converting a 3 state DFA to RegEx. 3k DFA > 5k GNFA > 4k GNFA > 3k GNFA > 2k GNFA > RegEx 11/25/13
  • 6. Convert the GNFA to RegEx The Challenge in reducing the states if greater than 2, by Ripping the a state out of the machine (other than the start, accept states), we call it q rip , we repair the machine by altering the removed qrip with labeled arrow. The label should cover the absence of qrip .The new label form start to accept states is the RegEx. Figure 1.63 P. 72 11/25/13
  • 7. Formal definition of GNFA Just like the DFA, it's a 5-tuple with same parameters except for δ, which can be given as: δ: (Q - {qaccept }) X (Q – {qstart}) → R R is the collection of all RegEx over the alphabet ∑, The domain of the transition function is (Q - {qaccept }) X (Q – {qstart}) simply because in GNFA, an arrow connects every state to every other state, except no arrows are coming from qaccept or going to qstart. Read: P.73 - 76 11/25/13
  • 8. Nonregular Languages Some languages cannot be recognized by any FA (a limitation of FA) Assume the language B = {0n1n | n>=0}. No DFA can recognize it because the resulting number of 0s is unlimited, and therefore no DFA can remember this number of possibilities. But just because the language appears to require unbounded memory doesn't mean it's nonregular. So we need a method to prove the nonregularity 11/25/13
  • 9. Nonregular Languages Assume we have 2 languages C and D, over the alphabet ∑ = {0,1}, where: C = { w | w has an equal no. of 0s and 1s}, and D = { w | w has an equal number of occurrences of 01 and 10 as substrings} Which one is nonregular? See problem 1.48 >> Difficult? We need a mathematical proof for certainty. 11/25/13
  • 10. The pumping lemma for regular languages Theorem (Pumping Lemma): “All regular languages have a special property, if a language doesn't have that property, it is not regular”. The property states that all strings in the language can be “pumped” if they are at least as long as a certain special value called the “pumping length”. In other words: Such string contains a section that can be repeated any number of times with the resulting string remaining in the language 11/25/13
  • 11. Pumping lemma: 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 conditions: 1- for each i>=0, xyiz ∈ A 2- |y| >0, and 3- |xy| <= p. Figure 1.71 P.78 11/25/13
  • 12. Non­regular languages n {a b : n≥ 0} vv R : Regular languages a∗b b∗c + a b + c ( a + b )∗¿ ¿ etc . .. 11/25/13 n v ∈ {a , b } ∗¿ ¿ ¿ ¿
  • 16. A pigeonhole must contain at least two pigeons 11/25/13
  • 18. The Pigeonhole Principle pigeons n pigeonholes m n> m There is a pigeonhole with at least 2 pigeons ........... 11/25/13
  • 20. Consider a DFA with 4 b q1 b b a q2 a a 11/25/13 states b q3 a q4
  • 21. aaaab Consider the walk of a “long’’ string: (length at least 4) A state is repeated in the walk of aaaab a q1 q2 b q1 a q3 a a q3 b a q2 b q4 b a a 11/25/13 q2 q3 b a q4
  • 23. aabb Consider the walk of a “long’’ string: (length at least 4) Due to the pigeonhole principle: A state is repeated in the walk of aabb a q1 q2 b a q3 b q4 b q4 b b q1 a q2 a a 11/25/13 q3 b a q4
  • 24. The state is repeated as a result of the pigeonhole principle aabb Walk of Pigeons: q1 a a q2 q3 b q4 b q4 (walk states) Are more than Nests: (Automaton states) 11/25/13 q1 q2 q3 Automaton States q4 Repeated state
  • 25. In General: If ∣w∣ ≥ #states of DFA, by the pigeonhole principle, a state is repeated in the walk Walk of q1 σ1 σ2 .... σi w = σ 1 σ 2 ⋯σ k qi σ i +1 σj .... qi σ j+1 .... σk Arbitrary DFA q1 11/25/13 σ1 σ2 w ...... qi ...... Repeated state σk qz qz
  • 26. ∣w∣ ≥ #states of DFA =m Pigeons: (walk states) .... q1 Walk of qi .... w qi .... qz Are more than Nests: q1 q2 (Automaton states) 11/25/13 .... qi .... A state is repeated q m−1 qm
  • 28. Take an infinite regular language L (contains an infinite number of strings) There exists a DFA that accepts L m states 11/25/13
  • 29. Take string w ∈L ∣w∣ ≥ m with (number of states of DFA) then, at least one state is repeated in the walk of w Walk in DFA of w = σ 1 σ 2 ⋯σ k σ1 σ2 ...... q ...... σk Repeated state in DFA 11/25/13
  • 30. There could be many states repeated Take q to be the first state repeated One dimensional projection of walk w : First occurrence σ1 σ2 .... σi Second occurrence q σ i +1 Unique states 11/25/13 .... σj q σ j+1 .... σk
  • 31. We can write w = xyz One dimensional projection of walk w : First occurrence σ1 σ2 .... x=σ 1 ⋯σ i 11/25/13 σi Second occurrence q σ i +1 .... y =σ i +1 ⋯σ j σj q σ j+1 .... σk z=σ j +1 ⋯σ k
  • 32. In DFA: w=x y z contains only first occurrence of y ... σj ... σ1 11/25/13 x σi σ i +1 q σ j+1 ... ... z σk q
  • 33. Observation: length ∣x y∣ ≤ m number of states of DFA y ... Unique States σj ... σ1 11/25/13 x σi σ i +1 q Since, in xy no state is repeated (except q)
  • 34. Observation: length ∣ y∣ ≥ 1 Since there is at least one transition in loop y ... σj σ i +1 q 11/25/13
  • 35. We do not care about the form of string z x may actually overlap with the paths of y ... z ... 11/25/13 x q z y and
  • 36. Additional string: The string is accepted Do not follow loop x z y ... σj ... σ1 11/25/13 x σi σ i +1 q σ j+1 ... ... z σk
  • 37. Additional string: The string is accepted Follow loop 2 times y ... σj ... σ1 11/25/13 x y y z x σi σ i +1 q σ j+1 ... ... z σk
  • 38. The string is accepted Additional string: Follow loop 3 times y ... σj ... σ1 11/25/13 x y y y z x σi σ i +1 q σ j+1 ... ... z σk
  • 39. In General: The string is accepted Follow loop i times xy z i=0, 1, 2, . .. y ... σj ... σ1 11/25/13 i x σi σ i +1 q σ j+1 ... ... z σk
  • 40. i Therefore: x y z ∈L i=0, 1, 2, . .. Language accepted by the DFA y ... σj ... σ1 11/25/13 x σi σ i +1 q σ j+1 ... ... z σk
  • 41. We just described: The Pumping Lemma !!! 11/25/13
  • 42. The Pumping Lemma: • Given a infinite regular language • there exists an integer • for any string w ∈ L • we can write (critical length) with length ∣w∣ ≥ m w=x y z • with ∣x y∣ ≤ m • such that: 11/25/13 m L i and x y z ∈L ∣ y∣ ≥ 1 i=0, 1, 2, . ..
  • 43. In the book: Critical length m 11/25/13 p = Pumping length
  • 45. Observation: Every language of finite size has to be regular (we can easily construct an NFA that accepts every string in the language) Therefore, every non-regular language has to be of infinite size (contains an infinite number of strings) 11/25/13
  • 46. Suppose you want to prove that An infinite language L is not regular 1. Assume the opposite: L is regular 2. The pumping lemma should hold forL 3. Use the pumping lemma to obtain a contradiction 4. Therefore, L is not regular 11/25/13
  • 47. Explanation of Step 3: How to get a contradiction 1. Let m be the critical length for 2. Choose a particular stringw ∈ L ∣w∣≥m the length condition 3. Write L which satisfies w=xyz 4. Show that ' i w =xy z∉L for some 5. This gives a contradiction, since from ' i pumping lemma w =xy z∈L 11/25/13 i≠1
  • 48. Note: It suffices to show that only one string w ∈ L gives a contradiction You don’t need to obtain contradiction for everyw ∈ L 11/25/13
  • 49. Example Theorem: L = { 0 n 1 n | n ∈ N } is not regular. Proof: By contradiction; assume L is regular. Let n be the pumping length guaranteed by the pumping lemma. Consider the string w = 0 n 1 n . Then |w| = 2n ≥ n and w ∈ L, so we can write w = xyz such that y ≠ ε and for any natural number i, xyiz ∈ L. We consider three cases:
  • 50. Case 1: y consists solely of 0s. Then xyiz = xz = 0 n - |y| 1 n , and since |y| > 0, xz ∉ L. Case 2: y consists solely of 1s. Then xy i z = xz = 0 n 1 n - |y| , and since |y| > 0, xz ∉ L. Case 3: y consists of k 0s followed by m 1s. Then xy i z has the form 0 n 1 m 0 k 1 n + m , so xy i z ∉ L. In all three cases we reach a contradiction, so our assumption was wrong and L is not regular. ■
  • 51. Example of Pumping Lemma application Theorem: The language n n L={a b : n≥0} is not regular Proof: 11/25/13 Use the Pumping Lemma
  • 52. n n L={a b : n≥0} Assume for contradiction thatL is a regular language SinceL is infinite we can apply the Pumping Lemma 11/25/13
  • 53. n n L={a b : n≥0} Let m be the critical length for L Pick a string w such that: w ∈ L and length ∣w∣ ≥m We pick 11/25/13 m w=a b m
  • 54. From the Pumping Lemma: m m we can write w=a b =x y z with lengths ∣x y∣ ≤m , ∣ y∣≥1 m w= m m m xyz=a b = a ...aa ... aa .. . ab.. . b x 11/25/13 Thus: k y z y =a , 1≤k ≤m
  • 55. m m k y =a , 1≤k ≤m x y z=a b From the Pumping Lemma: i x y z ∈L i=0, 1, 2, . .. Thus: 11/25/13 2 x y z ∈L
  • 56. m m k y =a , 1≤k ≤m x y z=a b 2 x y z ∈L From the Pumping Lemma: m+k m 2 xy z= a...aa...aa ...aa...ab...b ∈L x Thus: 11/25/13 y a y m+k z m b ∈L
  • 57. a BUT: m+k m b ∈L n n L={a b : n≥0} a m+k m b ∉L CONTRADICTION!!! 11/25/13 k≥ 1
  • 58. Therefore: Our assumption thatL is a regular language is not true Conclusion: L 11/25/13 is not a regular language END OF PROOF
  • 59. Non-regular language n n {a b : n≥0} Regular languages ¿ ¿ L(a b ) 11/25/13
  • 60. Read P. 80 – 82 (examples) Solve Exercises and Problems (P. 83 – 98) Prepare for a quiz! 11/25/13
  翻译: