SlideShare a Scribd company logo
1 of 25
Limits of DFA & NDFA
Chapter 2
Limits of Deterministic Finite Automaton (DFA)
Non Deterministic Finite Automaton (NDFA)
Dr.Tarek Althami College of Science & Computer Engineering, Yanbu 2012-2013
Computation Theory
Regular languages
•A language L over the alphabet  is regular iff
(if and only if) there is a Deterministic Finite
Automaton that accepts L.
Limits of DFA & NDFA 2
Regular languages
Show that the language
L = {awa : w  {a,b}*}
is regular.
To do this, all we have to do is construct a DFA
that accepts this language
Limits of DFA & NDFA 3
L = {awa : w  {a,b}*}
This finite accepter accepts all and only the strings of the
language given above. But note that there are two arcs out of q1
labeled a. How does the FA know which path to take on an a?
It doesn’t; it has to magically guess right. Also, there are no
arcs out of q2. So this FA is nondeterministic.
q0
a
a,b
q1 q2
a
b
q3
Limits of DFA & NDFA 4
Nondeterminism
A finite automaton is deterministic if:
from every node there is exactly one arc labeled
for each character in the alphabet of the language
Limits of DFA & NDFA 5
L = {awa : w  {a,b}*}
q0
a
b
q1 q2
b
This is a deterministic version of the previous automaton;
there is exactly one arc out of each state labeled with each
symbol from .
q3
a,b
b
a
a
Limits of DFA & NDFA 6
Nondeterministic finite accepters
Actually, any nondeterministic FA can be
turned into a deterministic FA. That is why this
class of automata is called Deterministic Finite
Accepters.
Limits of DFA & NDFA 7
Deterministic finite accepters
L = {ambn : m, n  0}
Give a DFA that accepts this language
Limits of DFA & NDFA 8
L = {ambn : m, n  0}
What do we know about this language’s automaton?
• Will it accept the empty string? If so, how do we
represent that?
• Will it accept strings that begin with an a?
• Having begun with an a, seeing indefinitely many more
a’s are OK ; the automaton can loop here.
• Will it accept strings that begin with a b?
• Once it sees a b, the automaton now has to be on guard.
• As long as it continues to see b’s , it’s OK; loop.
• If the string ends here, accept.
• If it sees an a after seeing a b, reject.
Limits of DFA & NDFA 9
L = {ambn : m, n  0}
q0
a
a
q1 q2
b
b
a
b
Does this automaton correspond to (represent, accept) the above
language?
(Be careful!)
q3
q4
Limits of DFA & NDFA 10
L = {ambn : m, n  0}
q0
a
q1
b
a
b
Does this automaton correspond to (represent, accept) the above
language? Is it deterministic?
q2
a,b
Limits of DFA & NDFA 11
Some exercises
a
b
b
a
a,b
Use set notation to describe the language accepted by the
above DFA
q0 q1 q2
Limits of DFA & NDFA 12
Some exercises
L(M) = {anbm}, where n  0 and m  1
q0 q1 q2
a
b
b
a
a,b
Limits of DFA & NDFA 13
Limits of DFA & NDFA 14
For any alphabet , there exists a language that cannot be
recognized by any finite automaton (the set of languages ​​is
much larger than the one of automata)
Limits of DFA
Theorem
Example 1
 The language consisting of all palindromes over the
alphabet , cannot be accepted by any DFA. Therefore it
is not a regular language. If we take the alphabet = {a,
b}, some examples of palindromes are :
{a, b, aa, bb, aaa, aba, . . .}



Limits of DFA & NDFA 15
Example 2
 there exists no DFA which can determine if the arithmetic
expression parentheses are properly balanced
a + b ) / c * (a - d) False
a+ ( b / c * (a - d) + g) True
Example 3
 there exists no DFA having the language L (M) = anbn, n>=0
Limits of DFA
NDFA
q0
1
q1 q2
0,1
0

An NDFA can be non-deterministic by:
(1) having more than one edge with the same label originate from one
vertex: see state q1, which has two arcs labeled 0 emanating from it
(2) having states without an edge originating from it for some symbol: see
state q2, which has no edges labeled 0 or 1. (This may be interpreted
as a transition to the empty set.)
(3) having lambda-transitions: see state q0, which has an arc indicating
that a -move from q0 to q2 is possible
Limits of DFA & NDFA 16
NDFA
 A non-deterministic finite accepter (abbreviated NFA or
NDFA) is defined by the quintuple : M = (Q, , , q0, F)
• Q is a finite, nonempty set of states
•  is finite set of input symbols called alphabet
• : Q  (  {})  2Q is the transition function
• q0  Q is the initial state
• F  Q is a set of final or “accepting” states
Limits of DFA & NDFA 17
NDFA
Differences between a DFA and an NDFA:
(1) in an NDFA, the range of  is in the powerset of Q
(instead of just Q), so that from the current state,
upon reading a symbol:
(a) more than one state might be the next state of the
NDFA
(b) no state may be defined as the next state of the
NDFA
(2) -moves are possible; that is, a transition from one
state to another may occur without reading a symbol
from the input string.
Limits of DFA & NDFA 18
NDFA
 The extended transition function for an NDFA is
defined so that * (qi, w) contains qj iff there is a
walk in the transition graph from qi to qj labeled
w.
 The language L accepted by an NDFA
M = (Q, , , q0, F) is defined as
L(M) = {w  * : δ* (q0, w)  F  }
That is, the language consists of all strings w for
which there is a walk labeled w from the start
state to a final state in the transition graph.
Limits of DFA & NDFA 19
NDFA = DFA
 One kind of automaton is more powerful than
another if it can accept and reject some kinds
of languages that the other cannot.
 Two finite accepters are equivalent if both
accept the same language, that is,
L(M1) = L(M2)
 As mentioned previously, we can always find
an equivalent DFA for any given NDFA.
Therefore, NDFA’s are no more powerful than
DFA’s.
Limits of DFA & NDFA 20
NDFA  DFA
Theorem
Let L be the language accepted by a non-
deterministic finite accepter MN = (QN, , N,
q0, FN) . Then there exists a deterministic finite
accepter MD = (QD, , D, q0, FD) such that L =
L(MD).
.
Limits of DFA & NDFA 21
NDFA  DFA
 Convert the following NDFA into an equivalent
DFA
• Q = {1, 2, 3}
• ={a, b}
• = {(1, b, 2) (1, b, 3) (3, a, 1) (3, a, 2)}
• q0= {1}
• F= {3}
• The state transition diagram is :
Limits of DFA & NDFA
3
b a
1
2
a
b
22
NDFA  DFA
 The new transition function : Q  (  {})  2Q
 Our new DFA will have a state labeled ∅
 construction of the new DFA is based on the following
results:
• Q’ = P(Q)={∅, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}}
• ={a, b}
• q0= q0’={1}
• F= {{3}, {1, 3}, {2, 3}, {1, 2, 3}}
•  (∅, a) = ∅  (∅, b) = ∅
•  ({1}, a) = ∅  ({1}, b) = {2, 3}
•  ({2}, a) = ∅  ({2}, b) = ∅
•  ({3}, a) = {1, 2}  ({3},b) = ∅
•  ({1, 2}, a) = ∅  ({1, 2}, b) = {2, 3}
•  ({1, 3}, a) = {1, 2}  ({1, 3}, b) = {2, 3}
•  ({2, 3}, a) = {1, 2}  ({2, 3}, b) = ∅
•  ({1, 2, 3}, a) = {1, 2}  ({1, 2, 3}, b) = {2, 3}
Limits of DFA & NDFA
3
b a
1
2
a
b
23
NDFA  DFA
Limits of DFA & NDFA
{3}
b
{∅}
a b
{2,3}
{1,3} {1,2,3}
{2}
{1, 2}
{1}
a a a
a
a
a
b
b
b
b
b
a b
 If we eliminate the states which can not
be achieved, we obtain the following DFA
{∅}
{2,3} {1, 2}
{1}
a a
a
b
b
b
a b
 It is easier to see that the
language the automaton accepts is
L(M)={b (a b)n / n ∈ N }
24
Conclusion
Limits of DFA & NDFA 25
 Finite automaton can recognize in a program key
words, identifiers and numbers, but not arithmetic
expressions parentheses and Begin-End blocks. In the
next chapters we will define more powerful machines to
recognize a wider range of languages.

More Related Content

What's hot

Chomsky classification of Language
Chomsky classification of LanguageChomsky classification of Language
Chomsky classification of LanguageDipankar Boruah
 
AI - Local Search - Hill Climbing
AI - Local Search - Hill ClimbingAI - Local Search - Hill Climbing
AI - Local Search - Hill ClimbingAndrew Ferlitsch
 
Moore and mealy machines
Moore and mealy machinesMoore and mealy machines
Moore and mealy machinesAYESHA JAVED
 
Pumping lemma for regular set h1
Pumping lemma for regular set h1Pumping lemma for regular set h1
Pumping lemma for regular set h1Rajendran
 
State space search and Problem Solving techniques
State space search and Problem Solving techniquesState space search and Problem Solving techniques
State space search and Problem Solving techniquesKirti Verma
 
Reformulating Branch Coverage as a Many-Objective Optimization Problem
Reformulating Branch Coverage as a Many-Objective Optimization ProblemReformulating Branch Coverage as a Many-Objective Optimization Problem
Reformulating Branch Coverage as a Many-Objective Optimization ProblemAnnibale Panichella
 
Linear differential equation with constant coefficient
Linear differential equation with constant coefficientLinear differential equation with constant coefficient
Linear differential equation with constant coefficientSanjay Singh
 
System of Homogeneous and Non-Homogeneous equations ppt nadi.pptx
System of Homogeneous and Non-Homogeneous equations ppt nadi.pptxSystem of Homogeneous and Non-Homogeneous equations ppt nadi.pptx
System of Homogeneous and Non-Homogeneous equations ppt nadi.pptxVinayKp11
 
Homogeneous Linear Differential Equations
 Homogeneous Linear Differential Equations Homogeneous Linear Differential Equations
Homogeneous Linear Differential EquationsAMINULISLAM439
 
Uninformed search
Uninformed searchUninformed search
Uninformed searchBablu Shofi
 
Intro to AI STRIPS Planning & Applications in Video-games Lecture6-Part1
Intro to AI STRIPS Planning & Applications in Video-games Lecture6-Part1Intro to AI STRIPS Planning & Applications in Video-games Lecture6-Part1
Intro to AI STRIPS Planning & Applications in Video-games Lecture6-Part1Stavros Vassos
 
Lecture 16 memory bounded search
Lecture 16 memory bounded searchLecture 16 memory bounded search
Lecture 16 memory bounded searchHema Kashyap
 
TOC 1 | Introduction to Theory of Computation
TOC 1 | Introduction to Theory of ComputationTOC 1 | Introduction to Theory of Computation
TOC 1 | Introduction to Theory of ComputationMohammad Imam Hossain
 
halfadder & halfsubtractor using 4:1 MUX
halfadder & halfsubtractor using 4:1 MUXhalfadder & halfsubtractor using 4:1 MUX
halfadder & halfsubtractor using 4:1 MUXU Reshmi
 
Lecture 12 Heuristic Searches
Lecture 12 Heuristic SearchesLecture 12 Heuristic Searches
Lecture 12 Heuristic SearchesHema Kashyap
 

What's hot (20)

TOC 3 | Different Operations on DFA
TOC 3 | Different Operations on DFATOC 3 | Different Operations on DFA
TOC 3 | Different Operations on DFA
 
Chomsky classification of Language
Chomsky classification of LanguageChomsky classification of Language
Chomsky classification of Language
 
AI - Local Search - Hill Climbing
AI - Local Search - Hill ClimbingAI - Local Search - Hill Climbing
AI - Local Search - Hill Climbing
 
Moore and mealy machines
Moore and mealy machinesMoore and mealy machines
Moore and mealy machines
 
Pumping lemma for regular set h1
Pumping lemma for regular set h1Pumping lemma for regular set h1
Pumping lemma for regular set h1
 
State space search and Problem Solving techniques
State space search and Problem Solving techniquesState space search and Problem Solving techniques
State space search and Problem Solving techniques
 
Reformulating Branch Coverage as a Many-Objective Optimization Problem
Reformulating Branch Coverage as a Many-Objective Optimization ProblemReformulating Branch Coverage as a Many-Objective Optimization Problem
Reformulating Branch Coverage as a Many-Objective Optimization Problem
 
Linear differential equation with constant coefficient
Linear differential equation with constant coefficientLinear differential equation with constant coefficient
Linear differential equation with constant coefficient
 
lattice
 lattice lattice
lattice
 
System of Homogeneous and Non-Homogeneous equations ppt nadi.pptx
System of Homogeneous and Non-Homogeneous equations ppt nadi.pptxSystem of Homogeneous and Non-Homogeneous equations ppt nadi.pptx
System of Homogeneous and Non-Homogeneous equations ppt nadi.pptx
 
Homogeneous Linear Differential Equations
 Homogeneous Linear Differential Equations Homogeneous Linear Differential Equations
Homogeneous Linear Differential Equations
 
Uninformed search
Uninformed searchUninformed search
Uninformed search
 
Intro to AI STRIPS Planning & Applications in Video-games Lecture6-Part1
Intro to AI STRIPS Planning & Applications in Video-games Lecture6-Part1Intro to AI STRIPS Planning & Applications in Video-games Lecture6-Part1
Intro to AI STRIPS Planning & Applications in Video-games Lecture6-Part1
 
Lecture: Automata
Lecture: AutomataLecture: Automata
Lecture: Automata
 
Lecture 16 memory bounded search
Lecture 16 memory bounded searchLecture 16 memory bounded search
Lecture 16 memory bounded search
 
Pda
PdaPda
Pda
 
Automata theory
Automata theoryAutomata theory
Automata theory
 
TOC 1 | Introduction to Theory of Computation
TOC 1 | Introduction to Theory of ComputationTOC 1 | Introduction to Theory of Computation
TOC 1 | Introduction to Theory of Computation
 
halfadder & halfsubtractor using 4:1 MUX
halfadder & halfsubtractor using 4:1 MUXhalfadder & halfsubtractor using 4:1 MUX
halfadder & halfsubtractor using 4:1 MUX
 
Lecture 12 Heuristic Searches
Lecture 12 Heuristic SearchesLecture 12 Heuristic Searches
Lecture 12 Heuristic Searches
 

Similar to Chapter 2 limits of DFA NDFA.ppt

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 AcceptorsRushabh2428
 
CS 162 Fall 2015 Homework 1 Problems September 29, 2015 Timothy Johnson 1. Ex...
CS 162 Fall 2015 Homework 1 Problems September 29, 2015 Timothy Johnson 1. Ex...CS 162 Fall 2015 Homework 1 Problems September 29, 2015 Timothy Johnson 1. Ex...
CS 162 Fall 2015 Homework 1 Problems September 29, 2015 Timothy Johnson 1. Ex...parmeet834
 
Theory of Computation Regular Expressions, Minimisation & Pumping Lemma
Theory of Computation Regular Expressions, Minimisation & Pumping LemmaTheory of Computation Regular Expressions, Minimisation & Pumping Lemma
Theory of Computation Regular Expressions, Minimisation & Pumping LemmaRushabh2428
 
Finite automata examples
Finite automata examplesFinite automata examples
Finite automata examplesankitamakin
 
Finite automata examples
Finite automata examplesFinite automata examples
Finite automata examplesankitamakin
 
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 1Srimatre K
 
Nondeterministic Finite Automat
Nondeterministic Finite AutomatNondeterministic Finite Automat
Nondeterministic Finite AutomatAdel Al-Ofairi
 
FiniteAutomata_anim.pptx
FiniteAutomata_anim.pptxFiniteAutomata_anim.pptx
FiniteAutomata_anim.pptxamara jyothi
 
FiniteAutomata_anim.pptx
FiniteAutomata_anim.pptxFiniteAutomata_anim.pptx
FiniteAutomata_anim.pptxranjan317165
 
CS911-Lecture-13_34826.pptx
CS911-Lecture-13_34826.pptxCS911-Lecture-13_34826.pptx
CS911-Lecture-13_34826.pptxALIZAIB KHAN
 
Winter 9 Decidability.pptx
Winter 9 Decidability.pptxWinter 9 Decidability.pptx
Winter 9 Decidability.pptxHarisPrince
 
Theory of Computation FSM Conversions and Problems
Theory of Computation FSM Conversions and ProblemsTheory of Computation FSM Conversions and Problems
Theory of Computation FSM Conversions and ProblemsRushabh2428
 
Theory of Computation.pptx
Theory of Computation.pptxTheory of Computation.pptx
Theory of Computation.pptxsavita325705
 
@vtucode.in-module-1-21CS51-5th-semester (1).pdf
@vtucode.in-module-1-21CS51-5th-semester (1).pdf@vtucode.in-module-1-21CS51-5th-semester (1).pdf
@vtucode.in-module-1-21CS51-5th-semester (1).pdfFariyaTasneem1
 

Similar to Chapter 2 limits of DFA NDFA.ppt (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
 
CS 162 Fall 2015 Homework 1 Problems September 29, 2015 Timothy Johnson 1. Ex...
CS 162 Fall 2015 Homework 1 Problems September 29, 2015 Timothy Johnson 1. Ex...CS 162 Fall 2015 Homework 1 Problems September 29, 2015 Timothy Johnson 1. Ex...
CS 162 Fall 2015 Homework 1 Problems September 29, 2015 Timothy Johnson 1. Ex...
 
Hwsoln03 toc
Hwsoln03 tocHwsoln03 toc
Hwsoln03 toc
 
Lec1.pptx
Lec1.pptxLec1.pptx
Lec1.pptx
 
Theory of Computation Regular Expressions, Minimisation & Pumping Lemma
Theory of Computation Regular Expressions, Minimisation & Pumping LemmaTheory of Computation Regular Expressions, Minimisation & Pumping Lemma
Theory of Computation Regular Expressions, Minimisation & Pumping Lemma
 
Finite automata examples
Finite automata examplesFinite automata examples
Finite automata examples
 
Finite automata examples
Finite automata examplesFinite automata examples
Finite automata examples
 
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
 
Nondeterministic Finite Automat
Nondeterministic Finite AutomatNondeterministic Finite Automat
Nondeterministic Finite Automat
 
FiniteAutomata_anim.pptx
FiniteAutomata_anim.pptxFiniteAutomata_anim.pptx
FiniteAutomata_anim.pptx
 
FiniteAutomata_anim.pptx
FiniteAutomata_anim.pptxFiniteAutomata_anim.pptx
FiniteAutomata_anim.pptx
 
CS911-Lecture-13_34826.pptx
CS911-Lecture-13_34826.pptxCS911-Lecture-13_34826.pptx
CS911-Lecture-13_34826.pptx
 
Winter 9 Decidability.pptx
Winter 9 Decidability.pptxWinter 9 Decidability.pptx
Winter 9 Decidability.pptx
 
Nfa vs dfa
Nfa vs dfaNfa vs dfa
Nfa vs dfa
 
Theory of Computation FSM Conversions and Problems
Theory of Computation FSM Conversions and ProblemsTheory of Computation FSM Conversions and Problems
Theory of Computation FSM Conversions and Problems
 
Theory of Computation.pptx
Theory of Computation.pptxTheory of Computation.pptx
Theory of Computation.pptx
 
@vtucode.in-module-1-21CS51-5th-semester (1).pdf
@vtucode.in-module-1-21CS51-5th-semester (1).pdf@vtucode.in-module-1-21CS51-5th-semester (1).pdf
@vtucode.in-module-1-21CS51-5th-semester (1).pdf
 
Finite automata
Finite automataFinite automata
Finite automata
 
flat unit1
flat unit1flat unit1
flat unit1
 
Finite automata
Finite automataFinite automata
Finite automata
 

Recently uploaded

Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacingjaychoudhary37
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 

Recently uploaded (20)

Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacing
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 

Chapter 2 limits of DFA NDFA.ppt

  • 1. Limits of DFA & NDFA Chapter 2 Limits of Deterministic Finite Automaton (DFA) Non Deterministic Finite Automaton (NDFA) Dr.Tarek Althami College of Science & Computer Engineering, Yanbu 2012-2013 Computation Theory
  • 2. Regular languages •A language L over the alphabet  is regular iff (if and only if) there is a Deterministic Finite Automaton that accepts L. Limits of DFA & NDFA 2
  • 3. Regular languages Show that the language L = {awa : w  {a,b}*} is regular. To do this, all we have to do is construct a DFA that accepts this language Limits of DFA & NDFA 3
  • 4. L = {awa : w  {a,b}*} This finite accepter accepts all and only the strings of the language given above. But note that there are two arcs out of q1 labeled a. How does the FA know which path to take on an a? It doesn’t; it has to magically guess right. Also, there are no arcs out of q2. So this FA is nondeterministic. q0 a a,b q1 q2 a b q3 Limits of DFA & NDFA 4
  • 5. Nondeterminism A finite automaton is deterministic if: from every node there is exactly one arc labeled for each character in the alphabet of the language Limits of DFA & NDFA 5
  • 6. L = {awa : w  {a,b}*} q0 a b q1 q2 b This is a deterministic version of the previous automaton; there is exactly one arc out of each state labeled with each symbol from . q3 a,b b a a Limits of DFA & NDFA 6
  • 7. Nondeterministic finite accepters Actually, any nondeterministic FA can be turned into a deterministic FA. That is why this class of automata is called Deterministic Finite Accepters. Limits of DFA & NDFA 7
  • 8. Deterministic finite accepters L = {ambn : m, n  0} Give a DFA that accepts this language Limits of DFA & NDFA 8
  • 9. L = {ambn : m, n  0} What do we know about this language’s automaton? • Will it accept the empty string? If so, how do we represent that? • Will it accept strings that begin with an a? • Having begun with an a, seeing indefinitely many more a’s are OK ; the automaton can loop here. • Will it accept strings that begin with a b? • Once it sees a b, the automaton now has to be on guard. • As long as it continues to see b’s , it’s OK; loop. • If the string ends here, accept. • If it sees an a after seeing a b, reject. Limits of DFA & NDFA 9
  • 10. L = {ambn : m, n  0} q0 a a q1 q2 b b a b Does this automaton correspond to (represent, accept) the above language? (Be careful!) q3 q4 Limits of DFA & NDFA 10
  • 11. L = {ambn : m, n  0} q0 a q1 b a b Does this automaton correspond to (represent, accept) the above language? Is it deterministic? q2 a,b Limits of DFA & NDFA 11
  • 12. Some exercises a b b a a,b Use set notation to describe the language accepted by the above DFA q0 q1 q2 Limits of DFA & NDFA 12
  • 13. Some exercises L(M) = {anbm}, where n  0 and m  1 q0 q1 q2 a b b a a,b Limits of DFA & NDFA 13
  • 14. Limits of DFA & NDFA 14 For any alphabet , there exists a language that cannot be recognized by any finite automaton (the set of languages ​​is much larger than the one of automata) Limits of DFA Theorem Example 1  The language consisting of all palindromes over the alphabet , cannot be accepted by any DFA. Therefore it is not a regular language. If we take the alphabet = {a, b}, some examples of palindromes are : {a, b, aa, bb, aaa, aba, . . .}   
  • 15. Limits of DFA & NDFA 15 Example 2  there exists no DFA which can determine if the arithmetic expression parentheses are properly balanced a + b ) / c * (a - d) False a+ ( b / c * (a - d) + g) True Example 3  there exists no DFA having the language L (M) = anbn, n>=0 Limits of DFA
  • 16. NDFA q0 1 q1 q2 0,1 0  An NDFA can be non-deterministic by: (1) having more than one edge with the same label originate from one vertex: see state q1, which has two arcs labeled 0 emanating from it (2) having states without an edge originating from it for some symbol: see state q2, which has no edges labeled 0 or 1. (This may be interpreted as a transition to the empty set.) (3) having lambda-transitions: see state q0, which has an arc indicating that a -move from q0 to q2 is possible Limits of DFA & NDFA 16
  • 17. NDFA  A non-deterministic finite accepter (abbreviated NFA or NDFA) is defined by the quintuple : M = (Q, , , q0, F) • Q is a finite, nonempty set of states •  is finite set of input symbols called alphabet • : Q  (  {})  2Q is the transition function • q0  Q is the initial state • F  Q is a set of final or “accepting” states Limits of DFA & NDFA 17
  • 18. NDFA Differences between a DFA and an NDFA: (1) in an NDFA, the range of  is in the powerset of Q (instead of just Q), so that from the current state, upon reading a symbol: (a) more than one state might be the next state of the NDFA (b) no state may be defined as the next state of the NDFA (2) -moves are possible; that is, a transition from one state to another may occur without reading a symbol from the input string. Limits of DFA & NDFA 18
  • 19. NDFA  The extended transition function for an NDFA is defined so that * (qi, w) contains qj iff there is a walk in the transition graph from qi to qj labeled w.  The language L accepted by an NDFA M = (Q, , , q0, F) is defined as L(M) = {w  * : δ* (q0, w)  F  } That is, the language consists of all strings w for which there is a walk labeled w from the start state to a final state in the transition graph. Limits of DFA & NDFA 19
  • 20. NDFA = DFA  One kind of automaton is more powerful than another if it can accept and reject some kinds of languages that the other cannot.  Two finite accepters are equivalent if both accept the same language, that is, L(M1) = L(M2)  As mentioned previously, we can always find an equivalent DFA for any given NDFA. Therefore, NDFA’s are no more powerful than DFA’s. Limits of DFA & NDFA 20
  • 21. NDFA  DFA Theorem Let L be the language accepted by a non- deterministic finite accepter MN = (QN, , N, q0, FN) . Then there exists a deterministic finite accepter MD = (QD, , D, q0, FD) such that L = L(MD). . Limits of DFA & NDFA 21
  • 22. NDFA  DFA  Convert the following NDFA into an equivalent DFA • Q = {1, 2, 3} • ={a, b} • = {(1, b, 2) (1, b, 3) (3, a, 1) (3, a, 2)} • q0= {1} • F= {3} • The state transition diagram is : Limits of DFA & NDFA 3 b a 1 2 a b 22
  • 23. NDFA  DFA  The new transition function : Q  (  {})  2Q  Our new DFA will have a state labeled ∅  construction of the new DFA is based on the following results: • Q’ = P(Q)={∅, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}} • ={a, b} • q0= q0’={1} • F= {{3}, {1, 3}, {2, 3}, {1, 2, 3}} •  (∅, a) = ∅  (∅, b) = ∅ •  ({1}, a) = ∅  ({1}, b) = {2, 3} •  ({2}, a) = ∅  ({2}, b) = ∅ •  ({3}, a) = {1, 2}  ({3},b) = ∅ •  ({1, 2}, a) = ∅  ({1, 2}, b) = {2, 3} •  ({1, 3}, a) = {1, 2}  ({1, 3}, b) = {2, 3} •  ({2, 3}, a) = {1, 2}  ({2, 3}, b) = ∅ •  ({1, 2, 3}, a) = {1, 2}  ({1, 2, 3}, b) = {2, 3} Limits of DFA & NDFA 3 b a 1 2 a b 23
  • 24. NDFA  DFA Limits of DFA & NDFA {3} b {∅} a b {2,3} {1,3} {1,2,3} {2} {1, 2} {1} a a a a a a b b b b b a b  If we eliminate the states which can not be achieved, we obtain the following DFA {∅} {2,3} {1, 2} {1} a a a b b b a b  It is easier to see that the language the automaton accepts is L(M)={b (a b)n / n ∈ N } 24
  • 25. Conclusion Limits of DFA & NDFA 25  Finite automaton can recognize in a program key words, identifiers and numbers, but not arithmetic expressions parentheses and Begin-End blocks. In the next chapters we will define more powerful machines to recognize a wider range of languages.