0% found this document useful (0 votes)
15 views23 pages

Unit I-Session 11and 12

Chapter on Theory of computation

Uploaded by

SushilKumar Azad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views23 pages

Unit I-Session 11and 12

Chapter on Theory of computation

Uploaded by

SushilKumar Azad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 23

Theory of Computation

Ms. Archna Goyal, Dr. Preeti Rathi & Dr. Vandna Batra

Faculty
School of Engineering & Technology(SOET)
K. R. Mangalam University

Unit I
Introduction to Formal Proof
Session 11 and 12

NFA to DFA Conversion


Session 11 and 12 Outlook

1. Overview of previous session


2. NFA to DFA Conversion
3. Steps for converting NFA to DFA
4. Examples
Learning Outcomes

• Able to apply the subset construction method or the powerset


construction method to systematically convert a given NFA into
an equivalent DFA, demonstrating their ability to use learned
techniques to solve problems in automata theory.
• Understand the relationship between NFAs and DFAs,
recognizing that any language accepted by an NFA can also be
accepted by a DFA, and vice versa.
• Analyze the structure and behavior of NFAs and DFAs during
the conversion process, identifying patterns in transitions and
states that allow them to efficiently construct an equivalent
DFA.
Overview of Session 10
In previous session, We discussed the:
 Definition of language acceptability by finite automata.
 Learn the steps how finite automata process input strings and
determine their acceptability.
 Examples demonstrating the acceptability of strings by FA.
NFA to DFA Conversion

 In NFA, when a specific input is given to the current state,


the machine goes to multiple states.
 It can have zero, one or more than one move on a given
input symbol.
 On the other hand, in DFA, when a specific input is given to
the current state, the machine goes to only one state.
 DFA has only one move on a given input symbol.
 Let, M = (Q, Σ, δ, q0, F) is an NFA which accepts the
language L(M).
 There should be equivalent DFA denoted by M' = (Q', Σ',
q0', δ', F') such that L(M) = L(M').
Steps for converting NFA to DFA

 Step 1: Initially Q' = ϕ


 Step 2: Add q0 of NFA to Q'. (find the transitions from this
start state).
 Step 3: Q', find the possible set of states for each input
symbol. If this set of states is not in Q', then add it to Q'. S
 Step 4: In DFA, the final state will be all the states which
contain F(final states of NFA)
Example 1
 Convert the following NFA to DFA
00,1
0 0,1

1 0
q0 q1 q2

1
 Solution:
For the given transition diagram first we construct
transition table Input
State
0 1
q0 q0 q1
q1 q1, q2 q1
q2 q2 q1, q2
Example 1
 Now we will obtain δ' transition for state q0.
1. δ'([q0], 0) = [q0]
2. δ'([q0], 1) = [q1]
 The δ' transition for state q1 is obtained as
1. δ'([q1], 0) = [q1, q2] (new state generated)
2. δ'([q1], 1) = [q1]
 The δ' transition for state q2 is obtained as:
1. δ'([q2], 0) = [q2]
2. δ'([q2], 1) = [q1, q2]
Example 1
 Now we will obtain δ' transition on [q1, q2].
1. δ'([q1, q2], 0) = δ(q1, 0) ∪ δ(q2, 0)
= {q1, q2} ∪ {q2}
= [q1, q2]
2. δ'([q1, q2], 1) = δ(q1, 1) ∪ δ(q2, 1)
= {q1} ∪ {q1, q2}
= {q1, q2}
= [q1, q2]
The state [q1, q2] is the final state as well because it contains
a final state q2. The transition table for the constructed DFA
will be:
Example 1
 The transition table for the constructed DFA will be:
Input
State
0 1
q0 q0 q1
q1 q1, q2 q1
*q2 q2 q1, q2
*[q1,q2] q1, q2 q1, q2
Example 1
 The Transition diagram will be:
Example 2
 Convert the following NFA to DFA
M = {q0, q1, q2},  = {a, b}, , initial = {qb}, F = {q2}
Input
State
a b
q0 q0, q1 q2
q1 q0 q1
q2 ɸ q0, q1
 Solution:
For the given transition table first we construct
transition diagram
Example 2
 Now we will obtain δ' transition for state q0.
1. δ'([q0], a) = [q0, q1] (new state generated)
2. δ'([q0], b) = [q2]
 The δ' transition for state q1 is obtained as
1. δ'([q1], a) = [q0]
2. δ'([q1], b) = [q1]
 The δ' transition for state q2 is obtained as
1. δ'([q2], a) = [ɛ]
2. δ'([q2], b) = [q0, q1]
Example 2
 Now we will obtain δ' transition on [q0, q1].
1. δ'([q0, q1], a) = δ(q0, a) ∪ δ(q1, a)
= {q0, q1} ∪ {q0}
= [q0, q1]
2. δ'([q0, q1], b) = δ(q0, b) ∪ δ(q1, b)
= {q2} ∪ {q1}
= [q1, q2]
The state [q1, q2] is the final state as well because it contains a
final state q2.
The transition table for the constructed DFA will be:
Example 2
 Now we will obtain δ' transition on [q1, q2].
1. δ'([q1, q2], a) = δ(q1, a) ∪ δ(q2, a)
= {q0} ∪ {ɛ}
= [q0]
2. δ'([q1, q2], b) = δ(q1, b) ∪ δ(q2, b)
= {q1} ∪ {q0, q1}
= [q0, q1]
The transition table for the constructed DFA will be:
Example 2
 The transition table for the constructed DFA will be:
Input
State
a b
q0 q0, q1 q2
q1 q0 q1
*q2 ɛ q0 , q 1
[q0, q1] q0 q1, q2
*[q1, q2] q0 q0, q1
Example 2
 The Transition diagram will be:
Review of Session
In previous session, We discussed:
 Introduction to conversion techniques: subset construction
method and powerset construction method.
 Step-by-step explanation of how to convert an NFA to a DFA
using each technique.
 Demonstration of the conversion process with examples.
 Explanation of how to systematically construct the equivalent
DFA states and transitions based on the NFA's behavior.
Exercise
1. Convert the following NFAs to DFAs.

1.

2.

Input
State
3. 0 1
q0 {q0, q1} q0
q1 q2 q1
q2 q3 q2
*q3 ɸ q3
Support Material references
Reference Book
• "Introduction to Automata Theory, Languages, and Computation"
by Hopcroft
• "Theory of Computer Science: Automata, Languages and
Computation" by K L P Mishra
Website References
• MIT OpenCourseWare - Introduction to the Theory of
Computation:
Website: MIT OCW - 6.045J / 18.400J
• Sipser's "Introduction to the Theory of Computation" Resources:
Website: Michael Sipser's Resources
• GeeksforGeeks Theory of Computation:
Website: GeeksforGeeks - Theory of Computation
• Coursera - Automata Theory Specialization:
Website: Automata Theory Specialization
Support Material references

Youtube Channels
• Theory of Computation THE GATEHUB

https://www.youtube.com/watch?v=p1oqDS0fayc&list=PL1
QH9gyQXfgsUBfYUR0WirJASgif4pHVX&index=1

• Theory of Computation by Easy Engineering Classes


https://www.youtube.com/watch?v=iD6u_2iNnu0

• Mod-01 Lec-01 What is theory of computation?nptelhrd


https://www.youtube.com/watch?v=al4AK6ruRek
THANK YOU

You might also like