SlideShare a Scribd company logo
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

Dfa h11
Dfa h11Dfa h11
Dfa h11
Rajendran
 
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
 
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
Rushabh2428
 
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 ---- dfa
Abdul 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 1
Srimatre 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
 
Finite automata
Finite automataFinite automata
Finite automata
ManishTadhiyal
 
Automata Theory - Turing machine
Automata Theory - Turing machineAutomata Theory - Turing machine
Automata Theory - Turing machine
Akila Krishnamoorthy
 
Automata
AutomataAutomata
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
Abhimanyu 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 automaton
Sampath 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 khushik
MudsaraliKhushik
 
Finite Automata
Finite AutomataFinite Automata
Finite Automata
parmeet834
 
1.4. finite automaton with ε moves
1.4. finite automaton with ε   moves1.4. finite automaton with ε   moves
1.4. finite automaton with ε moves
Sampath 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.pptx
ranjan317165
 
FiniteAutomata_anim.pptx
FiniteAutomata_anim.pptxFiniteAutomata_anim.pptx
FiniteAutomata_anim.pptx
amara jyothi
 
NFAvsDFA.ppt
NFAvsDFA.pptNFAvsDFA.ppt
NFAvsDFA.ppt
ARITRACSE0078
 
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
annesmkt
 
NFA and DFA
NFA and DFANFA and DFA
NFA and DFA
Rup Chowdhury
 
Nondeterministic Finite Automata AFN.pdf
Nondeterministic Finite Automata AFN.pdfNondeterministic Finite Automata AFN.pdf
Nondeterministic Finite Automata AFN.pdf
SergioUlisesRojasAla
 
Nfa to-dfa
Nfa to-dfaNfa to-dfa
Nfa to-dfa
rsivashankari
 
Fsa
FsaFsa
03-FiniteAutomata.pptx
03-FiniteAutomata.pptx03-FiniteAutomata.pptx
03-FiniteAutomata.pptx
ssuser47f7f2
 
@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
FariyaTasneem1
 
Theory of computation and automata
Theory of computation and automataTheory of computation and automata
Theory of computation and automata
Prof. Dr. K. Adisesha
 
Theory of computation and automata
Theory of computation and automataTheory of computation and automata
Theory of computation and automata
Prof. Dr. K. Adisesha
 
Finite Automata
Finite AutomataFinite Automata
Finite Automata
A. S. M. Shafi
 
Graph representation of DFA’s Da
Graph representation of DFA’s DaGraph representation of DFA’s Da
Graph representation of DFA’s Da
parmeet834
 
flat unit1
flat unit1flat unit1
flat unit1
Janhavi Vishwanath
 
FiniteAutomata.ppt
FiniteAutomata.pptFiniteAutomata.ppt
FiniteAutomata.ppt
RohitPaul71
 
FiniteAutomata (1).ppt
FiniteAutomata (1).pptFiniteAutomata (1).ppt
FiniteAutomata (1).ppt
ssuser47f7f2
 
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 examples
ankitamakin
 

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.ppt
FiniteAutomata.pptFiniteAutomata.ppt
FiniteAutomata.ppt
 
FiniteAutomata (1).ppt
FiniteAutomata (1).pptFiniteAutomata (1).ppt
FiniteAutomata (1).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.pdf
niveditJain
 
BTP Presentation.pdf
BTP Presentation.pdfBTP Presentation.pdf
BTP Presentation.pdf
niveditJain
 
BTP Report.pdf
BTP Report.pdfBTP Report.pdf
BTP Report.pdf
niveditJain
 
Project muZiK
Project muZiKProject muZiK
Project muZiK
niveditJain
 
Bucket Sort
Bucket SortBucket Sort
Bucket Sort
niveditJain
 
Super Resolution with OCR Optimization
Super Resolution with OCR OptimizationSuper Resolution with OCR Optimization
Super Resolution with OCR Optimization
niveditJain
 
Super Resolution with OCR Optimization
Super Resolution with OCR OptimizationSuper Resolution with OCR Optimization
Super Resolution with OCR Optimization
niveditJain
 
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 Basis
niveditJain
 
Essentialize Extreme Programming practices
Essentialize Extreme Programming practicesEssentialize Extreme Programming practices
Essentialize Extreme Programming practices
niveditJain
 
Context Free Grammar
Context Free GrammarContext Free Grammar
Context Free Grammar
niveditJain
 
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
niveditJain
 
Carmeet
CarmeetCarmeet
Carmeet
niveditJain
 
Tesla aquisition of maxwell
Tesla aquisition of maxwellTesla aquisition of maxwell
Tesla aquisition of maxwell
niveditJain
 
Literature club Introduction 2k19
Literature club Introduction 2k19Literature club Introduction 2k19
Literature club Introduction 2k19
niveditJain
 
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
niveditJain
 
Jargons eCell IIT Jodhpur
Jargons eCell IIT JodhpurJargons eCell IIT Jodhpur
Jargons eCell IIT Jodhpur
niveditJain
 

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

Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 

Recently uploaded (20)

Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 

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!