SlideShare a Scribd company logo
1 of 31
Download to read offline
Lecture-10
NFA-DFA Equivalence Theorem
Group ID - 11
Prepared under CS222 at IIT Jodhpur
Contribution
Each person has contributed almost equally for this
presentation.
Whereas specific contributions include
Muskan Bathla(B18CSE036): 18 to 31
Nivedit Jain(B18CSE039): 1 to 9,16-17
Sanskar Mani(B18CSE048): 10 to 15
2
Hello!
I am NFA
I was very indecisive and confused about my
life…until yesterday….. when I attended Theory
of Computation lecture!
3
I realised that I am no less than DFA and
for every person of my kind, a DFA
counterpart exists!
I set onto a journey of finding my
counterpart…...
5
This was me as NFA.
Then I got some ideas to
see myself as DFA.
Let’s think of powerset’s
state !!
6
If I am at {1} I can go
nowhere if a is supplied,
which in maths can be
said Φ.
And if b is supplied,
then I reach {2}
7
If I am at {3} I got a I can
reach to {1} but from {1},
I can go to {3}, so from
{3} with a I can reach to
{1} or {3} which is {1,3}.
I should also consider
this as one of my end
state as it contains {1}
And if I continued I get...
8
DFA!!!
My Teacher helped me to realise it
formally.
10
Proof Idea :
If a language is recognized by an NFA, then we must show
the existence of a DFA that also recognizes it. The idea is to
convert the NFA into an equivalent DFA that simulates the
NFA.
In NFA’s we keep track of the various states that we are
currently at. We simulate the string by transitioning all the
current states to using their transition function. Then we get
another set of states which we will then call our current
states.
11
Proof Idea (2):
If k is the number of states of the NFA, it has 2k
subsets of
states. Each subset corresponds to one of the possibilities
that the DFA must remember, so the DFA simulating the NFA
will have 2k
states.
Logically analysing the start state should be the initial start
state and the final states should be the subsets containing
any one of the original final states as reaching any of them
would mean acceptance of the string.
12
Formal Proof :
Let N = (Q, Σ, δ, q0
, F) be the NFA recognizing some
language A.
We construct a DFA M = (Q1
, Σ, δ1
, q0
1
F1
) recognizing A.
The steps below explain the construction for the case when
N is devoid of any ε transitions. We would be modifying the
construction later in order to take them into consideration.
13
Formal Proof (2):
1. Q1
= P(Q).
Every state of M is a set of states of N. ( P(Q) if the set of
all subsets of Q or the power set of Q )
2. For R ∈ Q1
and a ∈ Σ, let δ1
(R, a) = {q ∈ Q| q ∈ δ(r, a)
for some r ∈ R}. When M reads a symbol a in state R, we
transition all of the states in the set R and transition to the
state in M containing exactly the states that we have
transitioned to. The transition function δ1
(R, a) could be
expressed formally as - δ1
(R, a) = Ur∈R
δ(r, a)
14
Formal Proof (3):
3. q0
1
= {q0
}.
M starts in the state corresponding to the collection
containing just the start state of N.
4. F1
= {R ∈ Q1
| R contains an accept state of N}.
The machine M accepts if one of the possible states that N
could be in at this point is an accept state. The reason is to
accept any such string which might stop at any such states
which contain a final state of N.
15
Formal Proof (4):
This would have been the end of the construction if there
were no ε transitions. The modification has been explained
in the following slide.
LETs see Modification!!
16
We now need to consider the ε arrows. For any state R of
M, define E(R) to be the collection of states that can be
reached from members of R by going only along ε arrows,
including the members of R themselves so as to include all
the states of N which could be reached without reading the
string. Formally, for R ⊆ Q let E(R) = {q| q can be reached
from R by traveling along 0 or more ε arrows}.
Modification :
17
Now we need to modify the transition function of M to take
into consideration all states that can be reached by going
along ε arrows after every step. Replacing δ(r, a) by E(δ(r,
a)) achieves this effect. Thus δ1
(R, a) = {q ∈ Q| q ∈ E(δ(r, a))
for some r ∈ R}.
We also need to modify the start state of M to all the
states that could be reached by q0
without reading the
string including itself. Changing q0
1
to be E({q0
}) achieves
this effect as this will include all the states that are
reachable without reading a string.
With this our construction is complete.
Modification :
18
1. Let Q’ be the set of states of DFA.
Let T’ be the transition table of DFA.
2. Add start state of NFA to Q’ as the start state of DFA.
Add the transitions of start state to T’.
3. If any new state is present in T’
Add the new state in Q’.
Add transitions of that state in T’.
4. Keep repeating step 3 until no new state is present in T’.
Finally, the transition table T’ so obtained is the complete
transition table of the required DFA..
Steps for converting NFA to DFA
19
Note Points:
1. The start state of DFA is unique and is same as the start
state of NFA.
2. *q represents the final state.
3. If any state makes transition to multiple states for some
input alphabet, then treat those multiple states as a single
state in the DFA.
4. The set of multiple states will be final state of DFA if it
contains a final state of the NFA.
5. In NFA, if the transition of any state over some input
alphabet is null,then perform the transition of that state
over that input alphabet to a dead state in the DFA.
20
Example 1
NFA:
21
State / Alphabet a b
→q0 q0 q0, q1
q1 – *q2
*q2 – –
Transition table of NFA (T)
22
Step1:
Let Q’ be the set of states of DFA.
Let T’ be the transition table of DFA.
Step2:
Add transitions of start state q0 to T’
State / Alphabet a b
→{q0} {q0} {q0, q1}
Solution:
23
Step3:
State / Alphabet a b
→{q0} {q0} {q0, q1}
{q0, q1} {q0} {q0, q1, q2}
New state present in Q’ is {q0, q1}.
Add transitions for set of states {q0, q1} to T’.
24
Step4:
State / Alphabet a b
→{q0} {q0} {q0, q1}
{q0, q1} {q0} {q0, q1, q2}
{q0, q1, q2} {q0} {q0, q1, q2}
New state present in Q’ is {q0, q1, q2}.
Add transitions for set of states {q0, q1, q2} to T’.
25
State / Alphabet a b
→{q0} {q0} {q0, q1}
{q0, q1} {q0} *{q0, q1, q2}
*{q0, q1, q2} {q0} *{q0, q1, q2}
Step5:
Since no new states are left to be added in T’, so we stop.
States containing q2 as its element are treated as final states
of the DFA.
Finally, Transition table for Deterministic Finite Automata
(DFA) is-
26
DFA:
27
Example 2
NFA:
28
State / Alphabet a b
→q0 *q1, q2 –
*q1 – –
q2 *q1, q2 q2
Transition table of NFA (T)
29
Solution:
Transition table of DFA (T’)
State / Alphabet a b
→{q0} *{q1, q2} Ø
*{q1, q2} *{q1, q2} {q2}
{q2} *{q1, q2} {q2}
Ø Ø Ø
30
DFA:
……..And this is how I found my DFA
counterpart!
Thank You for listening to the story of
my journey!

More Related Content

What's hot

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 epsilonkanikkk
 
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
 
Automata theory - Push Down Automata (PDA)
Automata theory - Push Down Automata (PDA)Automata theory - Push Down Automata (PDA)
Automata theory - Push Down Automata (PDA)Akila Krishnamoorthy
 
Lec 3 ---- dfa
Lec 3  ---- dfaLec 3  ---- dfa
Lec 3 ---- dfaAbdul Aziz
 
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 Automata
Nondeterministic Finite AutomataNondeterministic Finite Automata
Nondeterministic Finite AutomataAdel Al-Ofairi
 
Finite automata(For college Seminars)
Finite automata(For college Seminars)Finite automata(For college Seminars)
Finite automata(For college Seminars)Naman Joshi
 
Nondeterministic Finite Automat
Nondeterministic Finite AutomatNondeterministic Finite Automat
Nondeterministic Finite AutomatAdel Al-Ofairi
 
Theory of Automata and formal languages unit 1
Theory of Automata and formal languages unit 1Theory of Automata and formal languages unit 1
Theory of Automata and formal languages unit 1Abhimanyu Mishra
 
Nondeterministic Finite Automata
Nondeterministic Finite Automata Nondeterministic Finite Automata
Nondeterministic Finite Automata parmeet834
 
1.3.1 deterministic finite automaton
1.3.1 deterministic finite automaton1.3.1 deterministic finite automaton
1.3.1 deterministic finite automatonSampath Kumar S
 
NFA Non Deterministic Finite Automata by Mudasir khushik
NFA Non Deterministic Finite Automata by Mudasir khushikNFA Non Deterministic Finite Automata by Mudasir khushik
NFA Non Deterministic Finite Automata by Mudasir khushikMudsaraliKhushik
 
Finite Automata
Finite AutomataFinite Automata
Finite Automataparmeet834
 
1.4. finite automaton with ε moves
1.4. finite automaton with ε   moves1.4. finite automaton with ε   moves
1.4. finite automaton with ε movesSampath Kumar S
 

What's hot (20)

Dfa h11
Dfa h11Dfa h11
Dfa h11
 
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
 
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
 
Automata theory - Push Down Automata (PDA)
Automata theory - Push Down Automata (PDA)Automata theory - Push Down Automata (PDA)
Automata theory - Push Down Automata (PDA)
 
Lec 3 ---- dfa
Lec 3  ---- dfaLec 3  ---- dfa
Lec 3 ---- dfa
 
DFA Minimization
DFA MinimizationDFA Minimization
DFA Minimization
 
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
 
Nfa vs dfa
Nfa vs dfaNfa vs dfa
Nfa vs dfa
 
Nondeterministic Finite Automata
Nondeterministic Finite AutomataNondeterministic Finite Automata
Nondeterministic Finite Automata
 
Finite automata(For college Seminars)
Finite automata(For college Seminars)Finite automata(For college Seminars)
Finite automata(For college Seminars)
 
Nondeterministic Finite Automat
Nondeterministic Finite AutomatNondeterministic Finite Automat
Nondeterministic Finite Automat
 
Finite automata
Finite automataFinite automata
Finite automata
 
Automata Theory - Turing machine
Automata Theory - Turing machineAutomata Theory - Turing machine
Automata Theory - Turing machine
 
Automata
AutomataAutomata
Automata
 
Theory of Automata and formal languages unit 1
Theory of Automata and formal languages unit 1Theory of Automata and formal languages unit 1
Theory of Automata and formal languages unit 1
 
Nondeterministic Finite Automata
Nondeterministic Finite Automata Nondeterministic Finite Automata
Nondeterministic Finite Automata
 
1.3.1 deterministic finite automaton
1.3.1 deterministic finite automaton1.3.1 deterministic finite automaton
1.3.1 deterministic finite automaton
 
NFA Non Deterministic Finite Automata by Mudasir khushik
NFA Non Deterministic Finite Automata by Mudasir khushikNFA Non Deterministic Finite Automata by Mudasir khushik
NFA Non Deterministic Finite Automata by Mudasir khushik
 
Finite Automata
Finite AutomataFinite Automata
Finite Automata
 
1.4. finite automaton with ε moves
1.4. finite automaton with ε   moves1.4. finite automaton with ε   moves
1.4. finite automaton with ε moves
 

Similar to NFA DFA Equivalence theorem

FiniteAutomata_anim.pptx
FiniteAutomata_anim.pptxFiniteAutomata_anim.pptx
FiniteAutomata_anim.pptxamara jyothi
 
FiniteAutomata_anim.pptx
FiniteAutomata_anim.pptxFiniteAutomata_anim.pptx
FiniteAutomata_anim.pptxranjan317165
 
In the automata theory, a nondeterministic finite.pdf
                     In the automata theory, a nondeterministic finite.pdf                     In the automata theory, a nondeterministic finite.pdf
In the automata theory, a nondeterministic finite.pdfannesmkt
 
Nondeterministic Finite Automata AFN.pdf
Nondeterministic Finite Automata AFN.pdfNondeterministic Finite Automata AFN.pdf
Nondeterministic Finite Automata AFN.pdfSergioUlisesRojasAla
 
03-FiniteAutomata.pptx
03-FiniteAutomata.pptx03-FiniteAutomata.pptx
03-FiniteAutomata.pptxssuser47f7f2
 
@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
 
Graph representation of DFA’s Da
Graph representation of DFA’s DaGraph representation of DFA’s Da
Graph representation of DFA’s Daparmeet834
 
FiniteAutomata (1).ppt
FiniteAutomata (1).pptFiniteAutomata (1).ppt
FiniteAutomata (1).pptssuser47f7f2
 
FiniteAutomata.ppt
FiniteAutomata.pptFiniteAutomata.ppt
FiniteAutomata.pptRohitPaul71
 
0227 regularlanguages
 0227 regularlanguages 0227 regularlanguages
0227 regularlanguagesissbp
 
Finite automata examples
Finite automata examplesFinite automata examples
Finite automata examplesankitamakin
 
Finite automata examples
Finite automata examplesFinite automata examples
Finite automata examplesankitamakin
 

Similar to NFA DFA Equivalence theorem (20)

FiniteAutomata_anim.pptx
FiniteAutomata_anim.pptxFiniteAutomata_anim.pptx
FiniteAutomata_anim.pptx
 
FiniteAutomata_anim.pptx
FiniteAutomata_anim.pptxFiniteAutomata_anim.pptx
FiniteAutomata_anim.pptx
 
NFAvsDFA.ppt
NFAvsDFA.pptNFAvsDFA.ppt
NFAvsDFA.ppt
 
In the automata theory, a nondeterministic finite.pdf
                     In the automata theory, a nondeterministic finite.pdf                     In the automata theory, a nondeterministic finite.pdf
In the automata theory, a nondeterministic finite.pdf
 
NFA and DFA
NFA and DFANFA and DFA
NFA and DFA
 
Nondeterministic Finite Automata AFN.pdf
Nondeterministic Finite Automata AFN.pdfNondeterministic Finite Automata AFN.pdf
Nondeterministic Finite Automata AFN.pdf
 
Nfa to-dfa
Nfa to-dfaNfa to-dfa
Nfa to-dfa
 
Fsa
FsaFsa
Fsa
 
03-FiniteAutomata.pptx
03-FiniteAutomata.pptx03-FiniteAutomata.pptx
03-FiniteAutomata.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
 
Theory of computation and automata
Theory of computation and automataTheory of computation and automata
Theory of computation and automata
 
Theory of computation and automata
Theory of computation and automataTheory of computation and automata
Theory of computation and automata
 
Finite Automata
Finite AutomataFinite Automata
Finite Automata
 
Graph representation of DFA’s Da
Graph representation of DFA’s DaGraph representation of DFA’s Da
Graph representation of DFA’s Da
 
flat unit1
flat unit1flat unit1
flat unit1
 
FiniteAutomata (1).ppt
FiniteAutomata (1).pptFiniteAutomata (1).ppt
FiniteAutomata (1).ppt
 
FiniteAutomata.ppt
FiniteAutomata.pptFiniteAutomata.ppt
FiniteAutomata.ppt
 
0227 regularlanguages
 0227 regularlanguages 0227 regularlanguages
0227 regularlanguages
 
Finite automata examples
Finite automata examplesFinite automata examples
Finite automata examples
 
Finite automata examples
Finite automata examplesFinite automata examples
Finite automata examples
 

More from niveditJain

BTP Learning Outcome.pdf
BTP Learning Outcome.pdfBTP Learning Outcome.pdf
BTP Learning Outcome.pdfniveditJain
 
BTP Presentation.pdf
BTP Presentation.pdfBTP Presentation.pdf
BTP Presentation.pdfniveditJain
 
Super Resolution with OCR Optimization
Super Resolution with OCR OptimizationSuper Resolution with OCR Optimization
Super Resolution with OCR OptimizationniveditJain
 
Super Resolution with OCR Optimization
Super Resolution with OCR OptimizationSuper Resolution with OCR Optimization
Super Resolution with OCR OptimizationniveditJain
 
Caste Wise Analysis of MGNREGA in Mandor Block of Jodhpur
Caste Wise Analysis of MGNREGA in Mandor Block of Jodhpur Caste Wise Analysis of MGNREGA in Mandor Block of Jodhpur
Caste Wise Analysis of MGNREGA in Mandor Block of Jodhpur niveditJain
 
Analysis Of MGNREGA on people of Mandor Region on Caste Basis
Analysis Of MGNREGA on people of Mandor Region on Caste BasisAnalysis Of MGNREGA on people of Mandor Region on Caste Basis
Analysis Of MGNREGA on people of Mandor Region on Caste BasisniveditJain
 
Essentialize Extreme Programming practices
Essentialize Extreme Programming practicesEssentialize Extreme Programming practices
Essentialize Extreme Programming practicesniveditJain
 
Context Free Grammar
Context Free GrammarContext Free Grammar
Context Free GrammarniveditJain
 
Maximum weighted edge biclique problem on bipartite graphs
Maximum weighted edge biclique problem on bipartite graphsMaximum weighted edge biclique problem on bipartite graphs
Maximum weighted edge biclique problem on bipartite graphsniveditJain
 
Tesla aquisition of maxwell
Tesla aquisition of maxwellTesla aquisition of maxwell
Tesla aquisition of maxwellniveditJain
 
Literature club Introduction 2k19
Literature club Introduction 2k19Literature club Introduction 2k19
Literature club Introduction 2k19niveditJain
 
Inter IIT Tech Meet 2k19, IIT Jodhpur
Inter IIT Tech Meet 2k19, IIT JodhpurInter IIT Tech Meet 2k19, IIT Jodhpur
Inter IIT Tech Meet 2k19, IIT JodhpurniveditJain
 
Jargons eCell IIT Jodhpur
Jargons eCell IIT JodhpurJargons eCell IIT Jodhpur
Jargons eCell IIT JodhpurniveditJain
 

More from niveditJain (17)

BTP Learning Outcome.pdf
BTP Learning Outcome.pdfBTP Learning Outcome.pdf
BTP Learning Outcome.pdf
 
BTP Presentation.pdf
BTP Presentation.pdfBTP Presentation.pdf
BTP Presentation.pdf
 
BTP Report.pdf
BTP Report.pdfBTP Report.pdf
BTP Report.pdf
 
Project muZiK
Project muZiKProject muZiK
Project muZiK
 
Bucket Sort
Bucket SortBucket Sort
Bucket Sort
 
Super Resolution with OCR Optimization
Super Resolution with OCR OptimizationSuper Resolution with OCR Optimization
Super Resolution with OCR Optimization
 
Super Resolution with OCR Optimization
Super Resolution with OCR OptimizationSuper Resolution with OCR Optimization
Super Resolution with OCR Optimization
 
Caste Wise Analysis of MGNREGA in Mandor Block of Jodhpur
Caste Wise Analysis of MGNREGA in Mandor Block of Jodhpur Caste Wise Analysis of MGNREGA in Mandor Block of Jodhpur
Caste Wise Analysis of MGNREGA in Mandor Block of Jodhpur
 
Analysis Of MGNREGA on people of Mandor Region on Caste Basis
Analysis Of MGNREGA on people of Mandor Region on Caste BasisAnalysis Of MGNREGA on people of Mandor Region on Caste Basis
Analysis Of MGNREGA on people of Mandor Region on Caste Basis
 
Essentialize Extreme Programming practices
Essentialize Extreme Programming practicesEssentialize Extreme Programming practices
Essentialize Extreme Programming practices
 
Context Free Grammar
Context Free GrammarContext Free Grammar
Context Free Grammar
 
Maximum weighted edge biclique problem on bipartite graphs
Maximum weighted edge biclique problem on bipartite graphsMaximum weighted edge biclique problem on bipartite graphs
Maximum weighted edge biclique problem on bipartite graphs
 
Carmeet
CarmeetCarmeet
Carmeet
 
Tesla aquisition of maxwell
Tesla aquisition of maxwellTesla aquisition of maxwell
Tesla aquisition of maxwell
 
Literature club Introduction 2k19
Literature club Introduction 2k19Literature club Introduction 2k19
Literature club Introduction 2k19
 
Inter IIT Tech Meet 2k19, IIT Jodhpur
Inter IIT Tech Meet 2k19, IIT JodhpurInter IIT Tech Meet 2k19, IIT Jodhpur
Inter IIT Tech Meet 2k19, IIT Jodhpur
 
Jargons eCell IIT Jodhpur
Jargons eCell IIT JodhpurJargons eCell IIT Jodhpur
Jargons eCell IIT Jodhpur
 

Recently uploaded

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 

Recently uploaded (20)

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 

NFA DFA Equivalence theorem

  • 1. Lecture-10 NFA-DFA Equivalence Theorem Group ID - 11 Prepared under CS222 at IIT Jodhpur
  • 2. Contribution Each person has contributed almost equally for this presentation. Whereas specific contributions include Muskan Bathla(B18CSE036): 18 to 31 Nivedit Jain(B18CSE039): 1 to 9,16-17 Sanskar Mani(B18CSE048): 10 to 15 2
  • 3. Hello! I am NFA I was very indecisive and confused about my life…until yesterday….. when I attended Theory of Computation lecture! 3
  • 4. I realised that I am no less than DFA and for every person of my kind, a DFA counterpart exists! I set onto a journey of finding my counterpart…...
  • 5. 5 This was me as NFA. Then I got some ideas to see myself as DFA. Let’s think of powerset’s state !!
  • 6. 6 If I am at {1} I can go nowhere if a is supplied, which in maths can be said Φ. And if b is supplied, then I reach {2}
  • 7. 7 If I am at {3} I got a I can reach to {1} but from {1}, I can go to {3}, so from {3} with a I can reach to {1} or {3} which is {1,3}. I should also consider this as one of my end state as it contains {1} And if I continued I get...
  • 9. My Teacher helped me to realise it formally.
  • 10. 10 Proof Idea : If a language is recognized by an NFA, then we must show the existence of a DFA that also recognizes it. The idea is to convert the NFA into an equivalent DFA that simulates the NFA. In NFA’s we keep track of the various states that we are currently at. We simulate the string by transitioning all the current states to using their transition function. Then we get another set of states which we will then call our current states.
  • 11. 11 Proof Idea (2): If k is the number of states of the NFA, it has 2k subsets of states. Each subset corresponds to one of the possibilities that the DFA must remember, so the DFA simulating the NFA will have 2k states. Logically analysing the start state should be the initial start state and the final states should be the subsets containing any one of the original final states as reaching any of them would mean acceptance of the string.
  • 12. 12 Formal Proof : Let N = (Q, Σ, δ, q0 , F) be the NFA recognizing some language A. We construct a DFA M = (Q1 , Σ, δ1 , q0 1 F1 ) recognizing A. The steps below explain the construction for the case when N is devoid of any ε transitions. We would be modifying the construction later in order to take them into consideration.
  • 13. 13 Formal Proof (2): 1. Q1 = P(Q). Every state of M is a set of states of N. ( P(Q) if the set of all subsets of Q or the power set of Q ) 2. For R ∈ Q1 and a ∈ Σ, let δ1 (R, a) = {q ∈ Q| q ∈ δ(r, a) for some r ∈ R}. When M reads a symbol a in state R, we transition all of the states in the set R and transition to the state in M containing exactly the states that we have transitioned to. The transition function δ1 (R, a) could be expressed formally as - δ1 (R, a) = Ur∈R δ(r, a)
  • 14. 14 Formal Proof (3): 3. q0 1 = {q0 }. M starts in the state corresponding to the collection containing just the start state of N. 4. F1 = {R ∈ Q1 | R contains an accept state of N}. The machine M accepts if one of the possible states that N could be in at this point is an accept state. The reason is to accept any such string which might stop at any such states which contain a final state of N.
  • 15. 15 Formal Proof (4): This would have been the end of the construction if there were no ε transitions. The modification has been explained in the following slide. LETs see Modification!!
  • 16. 16 We now need to consider the ε arrows. For any state R of M, define E(R) to be the collection of states that can be reached from members of R by going only along ε arrows, including the members of R themselves so as to include all the states of N which could be reached without reading the string. Formally, for R ⊆ Q let E(R) = {q| q can be reached from R by traveling along 0 or more ε arrows}. Modification :
  • 17. 17 Now we need to modify the transition function of M to take into consideration all states that can be reached by going along ε arrows after every step. Replacing δ(r, a) by E(δ(r, a)) achieves this effect. Thus δ1 (R, a) = {q ∈ Q| q ∈ E(δ(r, a)) for some r ∈ R}. We also need to modify the start state of M to all the states that could be reached by q0 without reading the string including itself. Changing q0 1 to be E({q0 }) achieves this effect as this will include all the states that are reachable without reading a string. With this our construction is complete. Modification :
  • 18. 18 1. Let Q’ be the set of states of DFA. Let T’ be the transition table of DFA. 2. Add start state of NFA to Q’ as the start state of DFA. Add the transitions of start state to T’. 3. If any new state is present in T’ Add the new state in Q’. Add transitions of that state in T’. 4. Keep repeating step 3 until no new state is present in T’. Finally, the transition table T’ so obtained is the complete transition table of the required DFA.. Steps for converting NFA to DFA
  • 19. 19 Note Points: 1. The start state of DFA is unique and is same as the start state of NFA. 2. *q represents the final state. 3. If any state makes transition to multiple states for some input alphabet, then treat those multiple states as a single state in the DFA. 4. The set of multiple states will be final state of DFA if it contains a final state of the NFA. 5. In NFA, if the transition of any state over some input alphabet is null,then perform the transition of that state over that input alphabet to a dead state in the DFA.
  • 21. 21 State / Alphabet a b →q0 q0 q0, q1 q1 – *q2 *q2 – – Transition table of NFA (T)
  • 22. 22 Step1: Let Q’ be the set of states of DFA. Let T’ be the transition table of DFA. Step2: Add transitions of start state q0 to T’ State / Alphabet a b →{q0} {q0} {q0, q1} Solution:
  • 23. 23 Step3: State / Alphabet a b →{q0} {q0} {q0, q1} {q0, q1} {q0} {q0, q1, q2} New state present in Q’ is {q0, q1}. Add transitions for set of states {q0, q1} to T’.
  • 24. 24 Step4: State / Alphabet a b →{q0} {q0} {q0, q1} {q0, q1} {q0} {q0, q1, q2} {q0, q1, q2} {q0} {q0, q1, q2} New state present in Q’ is {q0, q1, q2}. Add transitions for set of states {q0, q1, q2} to T’.
  • 25. 25 State / Alphabet a b →{q0} {q0} {q0, q1} {q0, q1} {q0} *{q0, q1, q2} *{q0, q1, q2} {q0} *{q0, q1, q2} Step5: Since no new states are left to be added in T’, so we stop. States containing q2 as its element are treated as final states of the DFA. Finally, Transition table for Deterministic Finite Automata (DFA) is-
  • 28. 28 State / Alphabet a b →q0 *q1, q2 – *q1 – – q2 *q1, q2 q2 Transition table of NFA (T)
  • 29. 29 Solution: Transition table of DFA (T’) State / Alphabet a b →{q0} *{q1, q2} Ø *{q1, q2} *{q1, q2} {q2} {q2} *{q1, q2} {q2} Ø Ø Ø
  • 31. ……..And this is how I found my DFA counterpart! Thank You for listening to the story of my journey!