SlideShare a Scribd company logo
Theory of Computation
By Rushabh Wadkar
Topics to be covered
DFA & NFA Problems Contd.
NFA to DFA
Extended transition functions(NFA)
eNFA to NFA
Day 4
DFA Problems
Draw a DFA to accept decimal strings divisible by 3.
M=(Q, ∑, δ, q0
, F)
DFA Problems
Draw a DFA to accept decimal strings divisible by 3.
● To begin, we identify the radix, input alphabet and divisor.
r=10 | d={0,1,2,3,4,5,6,7,8,9} | k=3
● 𝛿(qi
,0) = qj
Where, j =( r * i + d) mod k.
● j =( 10 * i + d) mod 3.
● Since mod3 has remainders 0,1,2 ; i = 0,1,2.
DFA Problems
Draw a DFA to accept decimal strings divisible by 3.
M=(Q, ∑, δ, q0
, F)
DFA Problems
Draw a DFA to accept na
(w) and nb
(w) are both even.
∑ = (a,b)
DFA Problems
Draw a DFA to accept na
(w)mod3=0 and
nb
(w)mod2=0.
∑ = (a,b)
DFA Problems
Draw a DFA to accept
na
(w)mod5=0 and
nb
(w)mod3=0.
∑ = (a,b)
DFA Problems
Draw a DFA to accept
na
(w)mod5 ≠ nb
(w)mod3.
∑ = (a,b)
DFA Problems
Draw a DFA to accept
na
(w)mod5 > nb
(w)mod3.
∑ = (a,b)
NFA Problems
Draw a NFA that satisfies the language:
L= {an
∪bn
: n>=0}
NFA Problems
Draw a NFA that satisfies the language:
L= {0101n
∪0100 : n>=0}
NFA Problems
Draw a NFA that contains either ‘01’ or ‘10’ on Σ = {0,1}
NFA Problems
Draw a NFA that according to the transition graph
𝛿 0 1
q0
q0
,q1
q0
,q2
q1
q3
-
q2
q2
,q3
q3
q3
q3
q3
NFA to DFA
Step 1 − Create state table from the given NFA
Step 2 − Mark the start state of the DFA by q0 (Same as the NDFA).
Step 3 − Find out the combination of States {Q0
, Q1
,... , Qn
} for each possible input
alphabet.
Step 4 − Each time we generate a new DFA state under the input alphabet
columns, we have to apply step 3 again, otherwise go to step 5.
Step 5 − The states which contain any of the final states of the NDFA are the final
states of the equivalent DFA.
Let X = (Qx, ∑, δx, q0, Fx) be a NFA which accepts the language L(X). We have to design an
equivalent DFA Y = (Qy, ∑, δy, q0, Fy) such that L(Y) = L(X).
NFA to DFA
Q.Consider a NFA with the following transitions:
𝛿(q0
,0) = {q0
q1
}
𝛿(q1
,0) = Φ
𝛿(q0
,1) = q1
𝛿(q1
,1) = {q0
q1
}
NFA to DFA
𝛿 0 1
q0
q0
q1
q1
q1
- q0
q1
Required transition graph :
NFA to DFA
We identify the required states :
We already have the
transitions for q0
,q1
on
0 & 1.
The new found state
is {q0
q1
}. Let us find
transition for this.
NFA to DFA
Required transition graph for DFA :
Notice the final
states.
NFA to DFA
Required DFA :
NFA to DFA
Q.Consider a NFA with the following transitions:
NFA to DFA
We identify the required states :
We already have the
transitions for q0
,q1
on
0 & 1.
The new found state
is {q0
q1
}. Let us find
transition for this.
NFA to DFA
Similarly for the newly generated q0
q1
q2
Required transition
graph for DFA :
NFA to DFA
*notice that q1 was not marked as final in
slide 22. Here we can either consider it as a
final state. Or remove finals that contain q1
NFA to DFA
Q.Consider the following NFA
NFA to DFA
Required transition graph :
Required transition graph for DFA :
NFA to DFA
ε-NFA
An example of ε-NFA to understand it better.
ε-NFA
States: It consists of 3 states, q0
, q1
, q2
∈ Q
Input Alphabets: There are 2 input symbols in the alphabet ∑ = {a, b}
Transitions: δ(qi
,a) = qj
δ(qi
,a) = {qi
,qj
}
δ(qi
,ε) = qj
Let us take a closer look at this ε-NFA now.
ε-NFA
It is defined using the quintuple M=(Q, Σ, 𝛿, q0
, F)
Where,
Q = Set of internal states in the ε-NFA
Σ = Finite set of symbols (input alphabet)
𝛿 = Transition function defined by 𝛿= QxΣ∪ε--->2Q
q0
= Initial state ∈ Q
F = Set of final states ∈ Q
ε-NFA
Epsilon closure(ECLOSE) is finding all the states which can be reached from the
present state on one or more epsilon transitions.
ECLOSE(A) = ABD
ECLOSE(B) = BD
ECLOSE(C) = C
ECLOSE(D) = D
ε-NFA
Epsilon closure(ECLOSE) follows the properties of extended transitions
ε-NFA
Ref: Finite
Automata and
Formal Languages
(Padma Reddy)
ε-NFA Example Problems
Draw a ε-NFA that accepts zero or more a’s or zero OR more b’s
or zero OR more c’s
ε-NFA to DFA
Step 1 : Take ∈ closure for the beginning state of NFA as beginning state of DFA.
Step 2 : Find the states that can be traversed from the present for each input
symbol(union of transition value and their closures for each states of NFA).
Step 3 : If any new state is found take it as current state and repeat step 2.
Step 4 : Do repeat Step 2 and Step 3 until no new state present in DFA transition table.
Step 5 : Mark the states of DFA which contains final state of NFA as final states of DFA.
ε-NFA to DFA
Find the DFA for the following NFA.
ε-NFA to DFA
To find the start state of the DFA we will find the eclosure of the current start
state. .
.
. the start state for DFA is ECLOSE(q0
) = {q0
q1
q2
}
ε-NFA to DFA
From the transitions of {q0
q1
q2
}, we arrive on state {q1
q2
}
ε-NFA to DFA
And then finally for state {q2
},
ε-NFA to DFA
From the following we can draw the transition table
Understanding
differences!
End of Day 4
www.linkedin.com/in/wadkar-rushabh
@RushabhWadkar
Thank you...
Ad

More Related Content

What's hot (20)

Dfa h11
Dfa h11Dfa h11
Dfa h11
Rajendran
 
Finite automata(For college Seminars)
Finite automata(For college Seminars)Finite automata(For college Seminars)
Finite automata(For college Seminars)
Naman Joshi
 
Nfa vs dfa
Nfa vs dfaNfa vs dfa
Nfa vs dfa
raosir123
 
Finite Automata
Finite AutomataFinite Automata
Finite Automata
parmeet834
 
NFA or Non deterministic finite automata
NFA or Non deterministic finite automataNFA or Non deterministic finite automata
NFA or Non deterministic finite automata
deepinderbedi
 
formal definitions in theory of computation
formal definitions in theory of computationformal definitions in theory of computation
formal definitions in theory of computation
kanikkk
 
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
 
DFA Minimization
DFA MinimizationDFA Minimization
DFA Minimization
guest5873b2d
 
Finite automata
Finite automataFinite automata
Finite automata
Rajesh Yaramadi
 
push down automata
push down automatapush down automata
push down automata
Christopher Chizoba
 
Push down automata
Push down automataPush down automata
Push down automata
Somya Bagai
 
Nondeterministic Finite Automata
Nondeterministic Finite AutomataNondeterministic Finite Automata
Nondeterministic Finite Automata
Adel Al-Ofairi
 
Finite automata
Finite automataFinite automata
Finite automata
Sutee Sudprasert
 
Automata Theory - Turing machine
Automata Theory - Turing machineAutomata Theory - Turing machine
Automata Theory - Turing machine
Akila Krishnamoorthy
 
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
 
Automata
AutomataAutomata
Automata
Jena Catherine Bel D
 
Ch2 finite automaton
Ch2 finite automatonCh2 finite automaton
Ch2 finite automaton
meresie tesfay
 
Push Down Automata (PDA) | TOC (Theory of Computation) | NPDA | DPDA
Push Down Automata (PDA) | TOC  (Theory of Computation) | NPDA | DPDAPush Down Automata (PDA) | TOC  (Theory of Computation) | NPDA | DPDA
Push Down Automata (PDA) | TOC (Theory of Computation) | NPDA | DPDA
Ashish Duggal
 
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
 
Pda
PdaPda
Pda
Self-employed
 
Finite automata(For college Seminars)
Finite automata(For college Seminars)Finite automata(For college Seminars)
Finite automata(For college Seminars)
Naman Joshi
 
Finite Automata
Finite AutomataFinite Automata
Finite Automata
parmeet834
 
NFA or Non deterministic finite automata
NFA or Non deterministic finite automataNFA or Non deterministic finite automata
NFA or Non deterministic finite automata
deepinderbedi
 
formal definitions in theory of computation
formal definitions in theory of computationformal definitions in theory of computation
formal definitions in theory of computation
kanikkk
 
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
 
Push down automata
Push down automataPush down automata
Push down automata
Somya Bagai
 
Nondeterministic Finite Automata
Nondeterministic Finite AutomataNondeterministic Finite Automata
Nondeterministic Finite Automata
Adel Al-Ofairi
 
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
 
Push Down Automata (PDA) | TOC (Theory of Computation) | NPDA | DPDA
Push Down Automata (PDA) | TOC  (Theory of Computation) | NPDA | DPDAPush Down Automata (PDA) | TOC  (Theory of Computation) | NPDA | DPDA
Push Down Automata (PDA) | TOC (Theory of Computation) | NPDA | DPDA
Ashish Duggal
 
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
 

Similar to Theory of Computation FSM Conversions and Problems (20)

AUTOMATA THEORY AUTOMATA THEORYAutomata3Chapter2.pptx
AUTOMATA THEORY AUTOMATA THEORYAutomata3Chapter2.pptxAUTOMATA THEORY AUTOMATA THEORYAutomata3Chapter2.pptx
AUTOMATA THEORY AUTOMATA THEORYAutomata3Chapter2.pptx
ArjayBalberan1
 
Nondeterministic Finite Automat
Nondeterministic Finite AutomatNondeterministic Finite Automat
Nondeterministic Finite Automat
Adel Al-Ofairi
 
Finite automata examples
Finite automata examplesFinite automata examples
Finite automata examples
ankitamakin
 
Finite automata examples
Finite automata examplesFinite automata examples
Finite automata examples
ankitamakin
 
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
 
Nondeterministic Finite Automata AFN.pdf
Nondeterministic Finite Automata AFN.pdfNondeterministic Finite Automata AFN.pdf
Nondeterministic Finite Automata AFN.pdf
SergioUlisesRojasAla
 
Automata theory
Automata theoryAutomata theory
Automata theory
Pardeep Vats
 
Nondeterministic Finite Automata
Nondeterministic Finite Automata Nondeterministic Finite Automata
Nondeterministic Finite Automata
parmeet834
 
NFAvsDFA.ppt
NFAvsDFA.pptNFAvsDFA.ppt
NFAvsDFA.ppt
ARITRACSE0078
 
Theory of computation Unit 1 Lecute 2.pptx
Theory of computation Unit 1 Lecute 2.pptxTheory of computation Unit 1 Lecute 2.pptx
Theory of computation Unit 1 Lecute 2.pptx
RishabhGupta238479
 
@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
 
Finite Automata
Finite AutomataFinite Automata
Finite Automata
A. S. M. Shafi
 
Formal language and automata theoryLAT Class notes.pptx
Formal language and automata theoryLAT Class notes.pptxFormal language and automata theoryLAT Class notes.pptx
Formal language and automata theoryLAT Class notes.pptx
SrinivasRedyySarviga
 
FiniteAutomata (1).ppt
FiniteAutomata (1).pptFiniteAutomata (1).ppt
FiniteAutomata (1).ppt
ssuser47f7f2
 
FiniteAutomata.ppt
FiniteAutomata.pptFiniteAutomata.ppt
FiniteAutomata.ppt
RohitPaul71
 
FiniteAutomata-DFA and NFA from Theory of Computation.ppt
FiniteAutomata-DFA and NFA from Theory of Computation.pptFiniteAutomata-DFA and NFA from Theory of Computation.ppt
FiniteAutomata-DFA and NFA from Theory of Computation.ppt
AdharshKumarSingh
 
NFA and DFA
NFA and DFANFA and DFA
NFA and DFA
Rup Chowdhury
 
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
Rushabh2428
 
Theory of automata
Theory of automataTheory of automata
Theory of automata
Arslan905905
 
AUTOMATA THEORY AUTOMATA THEORYAutomata3Chapter2.pptx
AUTOMATA THEORY AUTOMATA THEORYAutomata3Chapter2.pptxAUTOMATA THEORY AUTOMATA THEORYAutomata3Chapter2.pptx
AUTOMATA THEORY AUTOMATA THEORYAutomata3Chapter2.pptx
ArjayBalberan1
 
Nondeterministic Finite Automat
Nondeterministic Finite AutomatNondeterministic Finite Automat
Nondeterministic Finite Automat
Adel Al-Ofairi
 
Finite automata examples
Finite automata examplesFinite automata examples
Finite automata examples
ankitamakin
 
Finite automata examples
Finite automata examplesFinite automata examples
Finite automata examples
ankitamakin
 
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
 
Nondeterministic Finite Automata AFN.pdf
Nondeterministic Finite Automata AFN.pdfNondeterministic Finite Automata AFN.pdf
Nondeterministic Finite Automata AFN.pdf
SergioUlisesRojasAla
 
Nondeterministic Finite Automata
Nondeterministic Finite Automata Nondeterministic Finite Automata
Nondeterministic Finite Automata
parmeet834
 
Theory of computation Unit 1 Lecute 2.pptx
Theory of computation Unit 1 Lecute 2.pptxTheory of computation Unit 1 Lecute 2.pptx
Theory of computation Unit 1 Lecute 2.pptx
RishabhGupta238479
 
@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
 
Formal language and automata theoryLAT Class notes.pptx
Formal language and automata theoryLAT Class notes.pptxFormal language and automata theoryLAT Class notes.pptx
Formal language and automata theoryLAT Class notes.pptx
SrinivasRedyySarviga
 
FiniteAutomata (1).ppt
FiniteAutomata (1).pptFiniteAutomata (1).ppt
FiniteAutomata (1).ppt
ssuser47f7f2
 
FiniteAutomata.ppt
FiniteAutomata.pptFiniteAutomata.ppt
FiniteAutomata.ppt
RohitPaul71
 
FiniteAutomata-DFA and NFA from Theory of Computation.ppt
FiniteAutomata-DFA and NFA from Theory of Computation.pptFiniteAutomata-DFA and NFA from Theory of Computation.ppt
FiniteAutomata-DFA and NFA from Theory of Computation.ppt
AdharshKumarSingh
 
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
Rushabh2428
 
Theory of automata
Theory of automataTheory of automata
Theory of automata
Arslan905905
 
Ad

Recently uploaded (20)

UPSA JUDGEMENT.pdfCopyright Infringement: High Court Rules against UPSA: A Wa...
UPSA JUDGEMENT.pdfCopyright Infringement: High Court Rules against UPSA: A Wa...UPSA JUDGEMENT.pdfCopyright Infringement: High Court Rules against UPSA: A Wa...
UPSA JUDGEMENT.pdfCopyright Infringement: High Court Rules against UPSA: A Wa...
businessweekghana
 
Chemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptxChemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptx
Mayuri Chavan
 
PUBH1000 Slides - Module 12: Advocacy for Health
PUBH1000 Slides - Module 12: Advocacy for HealthPUBH1000 Slides - Module 12: Advocacy for Health
PUBH1000 Slides - Module 12: Advocacy for Health
JonathanHallett4
 
Classification of mental disorder in 5th semester bsc. nursing and also used ...
Classification of mental disorder in 5th semester bsc. nursing and also used ...Classification of mental disorder in 5th semester bsc. nursing and also used ...
Classification of mental disorder in 5th semester bsc. nursing and also used ...
parmarjuli1412
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-14-2025 .pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 5-14-2025  .pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 5-14-2025  .pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-14-2025 .pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
Unit 5 ACUTE, SUBACUTE,CHRONIC TOXICITY.pptx
Unit 5 ACUTE, SUBACUTE,CHRONIC TOXICITY.pptxUnit 5 ACUTE, SUBACUTE,CHRONIC TOXICITY.pptx
Unit 5 ACUTE, SUBACUTE,CHRONIC TOXICITY.pptx
Mayuri Chavan
 
ITI COPA Question Paper PDF 2017 Theory MCQ
ITI COPA Question Paper PDF 2017 Theory MCQITI COPA Question Paper PDF 2017 Theory MCQ
ITI COPA Question Paper PDF 2017 Theory MCQ
SONU HEETSON
 
114P_English.pdf114P_English.pdf114P_English.pdf
114P_English.pdf114P_English.pdf114P_English.pdf114P_English.pdf114P_English.pdf114P_English.pdf
114P_English.pdf114P_English.pdf114P_English.pdf
paulinelee52
 
Pope Leo XIV, the first Pope from North America.pptx
Pope Leo XIV, the first Pope from North America.pptxPope Leo XIV, the first Pope from North America.pptx
Pope Leo XIV, the first Pope from North America.pptx
Martin M Flynn
 
MCQS (EMERGENCY NURSING) DR. NASIR MUSTAFA
MCQS (EMERGENCY NURSING) DR. NASIR MUSTAFAMCQS (EMERGENCY NURSING) DR. NASIR MUSTAFA
MCQS (EMERGENCY NURSING) DR. NASIR MUSTAFA
Dr. Nasir Mustafa
 
Final Evaluation.docx...........................
Final Evaluation.docx...........................Final Evaluation.docx...........................
Final Evaluation.docx...........................
l1bbyburrell
 
"Bridging Cultures Through Holiday Cards: 39 Students Celebrate Global Tradit...
"Bridging Cultures Through Holiday Cards: 39 Students Celebrate Global Tradit..."Bridging Cultures Through Holiday Cards: 39 Students Celebrate Global Tradit...
"Bridging Cultures Through Holiday Cards: 39 Students Celebrate Global Tradit...
AlionaBujoreanu
 
How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18
Celine George
 
Cyber security COPA ITI MCQ Top Questions
Cyber security COPA ITI MCQ Top QuestionsCyber security COPA ITI MCQ Top Questions
Cyber security COPA ITI MCQ Top Questions
SONU HEETSON
 
How to Manage Cross Selling in Odoo 18 Sales
How to Manage Cross Selling in Odoo 18 SalesHow to Manage Cross Selling in Odoo 18 Sales
How to Manage Cross Selling in Odoo 18 Sales
Celine George
 
Dastur_ul_Amal under Jahangir Key Features.pptx
Dastur_ul_Amal under Jahangir Key Features.pptxDastur_ul_Amal under Jahangir Key Features.pptx
Dastur_ul_Amal under Jahangir Key Features.pptx
omorfaruqkazi
 
IPL QUIZ | THE QUIZ CLUB OF PSGCAS | 2025.pdf
IPL QUIZ | THE QUIZ CLUB OF PSGCAS | 2025.pdfIPL QUIZ | THE QUIZ CLUB OF PSGCAS | 2025.pdf
IPL QUIZ | THE QUIZ CLUB OF PSGCAS | 2025.pdf
Quiz Club of PSG College of Arts & Science
 
Module_2_Types_and_Approaches_of_Research (2).pptx
Module_2_Types_and_Approaches_of_Research (2).pptxModule_2_Types_and_Approaches_of_Research (2).pptx
Module_2_Types_and_Approaches_of_Research (2).pptx
drroxannekemp
 
How to Manage Amounts in Local Currency in Odoo 18 Purchase
How to Manage Amounts in Local Currency in Odoo 18 PurchaseHow to Manage Amounts in Local Currency in Odoo 18 Purchase
How to Manage Amounts in Local Currency in Odoo 18 Purchase
Celine George
 
The role of wall art in interior designing
The role of wall art in interior designingThe role of wall art in interior designing
The role of wall art in interior designing
meghaark2110
 
UPSA JUDGEMENT.pdfCopyright Infringement: High Court Rules against UPSA: A Wa...
UPSA JUDGEMENT.pdfCopyright Infringement: High Court Rules against UPSA: A Wa...UPSA JUDGEMENT.pdfCopyright Infringement: High Court Rules against UPSA: A Wa...
UPSA JUDGEMENT.pdfCopyright Infringement: High Court Rules against UPSA: A Wa...
businessweekghana
 
Chemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptxChemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptx
Mayuri Chavan
 
PUBH1000 Slides - Module 12: Advocacy for Health
PUBH1000 Slides - Module 12: Advocacy for HealthPUBH1000 Slides - Module 12: Advocacy for Health
PUBH1000 Slides - Module 12: Advocacy for Health
JonathanHallett4
 
Classification of mental disorder in 5th semester bsc. nursing and also used ...
Classification of mental disorder in 5th semester bsc. nursing and also used ...Classification of mental disorder in 5th semester bsc. nursing and also used ...
Classification of mental disorder in 5th semester bsc. nursing and also used ...
parmarjuli1412
 
Unit 5 ACUTE, SUBACUTE,CHRONIC TOXICITY.pptx
Unit 5 ACUTE, SUBACUTE,CHRONIC TOXICITY.pptxUnit 5 ACUTE, SUBACUTE,CHRONIC TOXICITY.pptx
Unit 5 ACUTE, SUBACUTE,CHRONIC TOXICITY.pptx
Mayuri Chavan
 
ITI COPA Question Paper PDF 2017 Theory MCQ
ITI COPA Question Paper PDF 2017 Theory MCQITI COPA Question Paper PDF 2017 Theory MCQ
ITI COPA Question Paper PDF 2017 Theory MCQ
SONU HEETSON
 
114P_English.pdf114P_English.pdf114P_English.pdf
114P_English.pdf114P_English.pdf114P_English.pdf114P_English.pdf114P_English.pdf114P_English.pdf
114P_English.pdf114P_English.pdf114P_English.pdf
paulinelee52
 
Pope Leo XIV, the first Pope from North America.pptx
Pope Leo XIV, the first Pope from North America.pptxPope Leo XIV, the first Pope from North America.pptx
Pope Leo XIV, the first Pope from North America.pptx
Martin M Flynn
 
MCQS (EMERGENCY NURSING) DR. NASIR MUSTAFA
MCQS (EMERGENCY NURSING) DR. NASIR MUSTAFAMCQS (EMERGENCY NURSING) DR. NASIR MUSTAFA
MCQS (EMERGENCY NURSING) DR. NASIR MUSTAFA
Dr. Nasir Mustafa
 
Final Evaluation.docx...........................
Final Evaluation.docx...........................Final Evaluation.docx...........................
Final Evaluation.docx...........................
l1bbyburrell
 
"Bridging Cultures Through Holiday Cards: 39 Students Celebrate Global Tradit...
"Bridging Cultures Through Holiday Cards: 39 Students Celebrate Global Tradit..."Bridging Cultures Through Holiday Cards: 39 Students Celebrate Global Tradit...
"Bridging Cultures Through Holiday Cards: 39 Students Celebrate Global Tradit...
AlionaBujoreanu
 
How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18How to Share Accounts Between Companies in Odoo 18
How to Share Accounts Between Companies in Odoo 18
Celine George
 
Cyber security COPA ITI MCQ Top Questions
Cyber security COPA ITI MCQ Top QuestionsCyber security COPA ITI MCQ Top Questions
Cyber security COPA ITI MCQ Top Questions
SONU HEETSON
 
How to Manage Cross Selling in Odoo 18 Sales
How to Manage Cross Selling in Odoo 18 SalesHow to Manage Cross Selling in Odoo 18 Sales
How to Manage Cross Selling in Odoo 18 Sales
Celine George
 
Dastur_ul_Amal under Jahangir Key Features.pptx
Dastur_ul_Amal under Jahangir Key Features.pptxDastur_ul_Amal under Jahangir Key Features.pptx
Dastur_ul_Amal under Jahangir Key Features.pptx
omorfaruqkazi
 
Module_2_Types_and_Approaches_of_Research (2).pptx
Module_2_Types_and_Approaches_of_Research (2).pptxModule_2_Types_and_Approaches_of_Research (2).pptx
Module_2_Types_and_Approaches_of_Research (2).pptx
drroxannekemp
 
How to Manage Amounts in Local Currency in Odoo 18 Purchase
How to Manage Amounts in Local Currency in Odoo 18 PurchaseHow to Manage Amounts in Local Currency in Odoo 18 Purchase
How to Manage Amounts in Local Currency in Odoo 18 Purchase
Celine George
 
The role of wall art in interior designing
The role of wall art in interior designingThe role of wall art in interior designing
The role of wall art in interior designing
meghaark2110
 
Ad

Theory of Computation FSM Conversions and Problems

  • 1. Theory of Computation By Rushabh Wadkar
  • 2. Topics to be covered DFA & NFA Problems Contd. NFA to DFA Extended transition functions(NFA) eNFA to NFA Day 4
  • 3. DFA Problems Draw a DFA to accept decimal strings divisible by 3. M=(Q, ∑, δ, q0 , F)
  • 4. DFA Problems Draw a DFA to accept decimal strings divisible by 3. ● To begin, we identify the radix, input alphabet and divisor. r=10 | d={0,1,2,3,4,5,6,7,8,9} | k=3 ● 𝛿(qi ,0) = qj Where, j =( r * i + d) mod k. ● j =( 10 * i + d) mod 3. ● Since mod3 has remainders 0,1,2 ; i = 0,1,2.
  • 5. DFA Problems Draw a DFA to accept decimal strings divisible by 3. M=(Q, ∑, δ, q0 , F)
  • 6. DFA Problems Draw a DFA to accept na (w) and nb (w) are both even. ∑ = (a,b)
  • 7. DFA Problems Draw a DFA to accept na (w)mod3=0 and nb (w)mod2=0. ∑ = (a,b)
  • 8. DFA Problems Draw a DFA to accept na (w)mod5=0 and nb (w)mod3=0. ∑ = (a,b)
  • 9. DFA Problems Draw a DFA to accept na (w)mod5 ≠ nb (w)mod3. ∑ = (a,b)
  • 10. DFA Problems Draw a DFA to accept na (w)mod5 > nb (w)mod3. ∑ = (a,b)
  • 11. NFA Problems Draw a NFA that satisfies the language: L= {an ∪bn : n>=0}
  • 12. NFA Problems Draw a NFA that satisfies the language: L= {0101n ∪0100 : n>=0}
  • 13. NFA Problems Draw a NFA that contains either ‘01’ or ‘10’ on Σ = {0,1}
  • 14. NFA Problems Draw a NFA that according to the transition graph 𝛿 0 1 q0 q0 ,q1 q0 ,q2 q1 q3 - q2 q2 ,q3 q3 q3 q3 q3
  • 15. NFA to DFA Step 1 − Create state table from the given NFA Step 2 − Mark the start state of the DFA by q0 (Same as the NDFA). Step 3 − Find out the combination of States {Q0 , Q1 ,... , Qn } for each possible input alphabet. Step 4 − Each time we generate a new DFA state under the input alphabet columns, we have to apply step 3 again, otherwise go to step 5. Step 5 − The states which contain any of the final states of the NDFA are the final states of the equivalent DFA. Let X = (Qx, ∑, δx, q0, Fx) be a NFA which accepts the language L(X). We have to design an equivalent DFA Y = (Qy, ∑, δy, q0, Fy) such that L(Y) = L(X).
  • 16. NFA to DFA Q.Consider a NFA with the following transitions: 𝛿(q0 ,0) = {q0 q1 } 𝛿(q1 ,0) = Φ 𝛿(q0 ,1) = q1 𝛿(q1 ,1) = {q0 q1 }
  • 17. NFA to DFA 𝛿 0 1 q0 q0 q1 q1 q1 - q0 q1 Required transition graph :
  • 18. NFA to DFA We identify the required states : We already have the transitions for q0 ,q1 on 0 & 1. The new found state is {q0 q1 }. Let us find transition for this.
  • 19. NFA to DFA Required transition graph for DFA : Notice the final states.
  • 21. NFA to DFA Q.Consider a NFA with the following transitions:
  • 22. NFA to DFA We identify the required states : We already have the transitions for q0 ,q1 on 0 & 1. The new found state is {q0 q1 }. Let us find transition for this.
  • 23. NFA to DFA Similarly for the newly generated q0 q1 q2
  • 24. Required transition graph for DFA : NFA to DFA *notice that q1 was not marked as final in slide 22. Here we can either consider it as a final state. Or remove finals that contain q1
  • 25. NFA to DFA Q.Consider the following NFA
  • 26. NFA to DFA Required transition graph :
  • 27. Required transition graph for DFA : NFA to DFA
  • 28. ε-NFA An example of ε-NFA to understand it better.
  • 29. ε-NFA States: It consists of 3 states, q0 , q1 , q2 ∈ Q Input Alphabets: There are 2 input symbols in the alphabet ∑ = {a, b} Transitions: δ(qi ,a) = qj δ(qi ,a) = {qi ,qj } δ(qi ,ε) = qj Let us take a closer look at this ε-NFA now.
  • 30. ε-NFA It is defined using the quintuple M=(Q, Σ, 𝛿, q0 , F) Where, Q = Set of internal states in the ε-NFA Σ = Finite set of symbols (input alphabet) 𝛿 = Transition function defined by 𝛿= QxΣ∪ε--->2Q q0 = Initial state ∈ Q F = Set of final states ∈ Q
  • 31. ε-NFA Epsilon closure(ECLOSE) is finding all the states which can be reached from the present state on one or more epsilon transitions. ECLOSE(A) = ABD ECLOSE(B) = BD ECLOSE(C) = C ECLOSE(D) = D
  • 32. ε-NFA Epsilon closure(ECLOSE) follows the properties of extended transitions
  • 33. ε-NFA Ref: Finite Automata and Formal Languages (Padma Reddy)
  • 34. ε-NFA Example Problems Draw a ε-NFA that accepts zero or more a’s or zero OR more b’s or zero OR more c’s
  • 35. ε-NFA to DFA Step 1 : Take ∈ closure for the beginning state of NFA as beginning state of DFA. Step 2 : Find the states that can be traversed from the present for each input symbol(union of transition value and their closures for each states of NFA). Step 3 : If any new state is found take it as current state and repeat step 2. Step 4 : Do repeat Step 2 and Step 3 until no new state present in DFA transition table. Step 5 : Mark the states of DFA which contains final state of NFA as final states of DFA.
  • 36. ε-NFA to DFA Find the DFA for the following NFA.
  • 37. ε-NFA to DFA To find the start state of the DFA we will find the eclosure of the current start state. . . . the start state for DFA is ECLOSE(q0 ) = {q0 q1 q2 }
  • 38. ε-NFA to DFA From the transitions of {q0 q1 q2 }, we arrive on state {q1 q2 }
  • 39. ε-NFA to DFA And then finally for state {q2 },
  • 40. ε-NFA to DFA From the following we can draw the transition table
  • 42. End of Day 4 www.linkedin.com/in/wadkar-rushabh @RushabhWadkar Thank you...
  翻译: