ε-NFA to NFA Conversion

Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

ε-NFA to NFA Conversion

Afsana Afrin
Lecturer
Dept of Computer Science and Engineering
Bangladesh Army University of Science & Technology

15-Jul-20 ε -NFA to DFA Conversion 1


ε-NFA

Non-deterministic finite automata(NFA) is a finite automata where


for some cases when a specific input is given to the current state,
the machine goes to multiple states or more than 1 states. It can
contain ε move. If any FA contains ε transaction or move, the finite
automata is called NFA with ∈ move.

15-Jul-20 ε -NFA to DFA Conversion 2


Epsilon Closure

ε-closure: ε-closure for a given state A means a set of


states which can be reached from the state A with only
ε(null) move including the state A itself.

15-Jul-20 ε -NFA to DFA Conversion 3


Example

Convert the NFA with ε into its equivalent NFA.

15-Jul-20 ε -NFA to DFA Conversion 4


Example

Solution: For the given transition diagram we will first


construct the transition table.

0 1 ε
→q0 ∅ ∅ {q1,q2}
q1 {q3} ∅ ∅
q2 ∅ {q3} ∅
q3 ∅ {q4} ∅
*q4 ∅ ∅ ∅

15-Jul-20 ε -NFA to DFA Conversion 5


Solution

Let us obtain ε-closure of each state.

ε-closure {q0} = {q0, q1, q2}


ε-closure {q1} = {q1}
ε-closure {q2} = {q2}
ε-closure {q3} = {q3}
ε-closure {q4} = {q4}

15-Jul-20 ε -NFA to DFA Conversion 6


Solution

ε-closure 0 ε-closure
q0

q0 q1 q3 q3

q2

15-Jul-20 ε -NFA to DFA Conversion 7


Solution

ε-closure 1 ε-closure
q0

q0 q1

q2 q3 q3

15-Jul-20 ε -NFA to DFA Conversion 8


Solution

ε-closure 0 ε-closure
q1 q1 q3 q3

ε-closure 1 ε-closure
q1 q1 ∅

15-Jul-20 ε -NFA to DFA Conversion 9


Solution

ε-closure 0 ε-closure
q2 q2 ∅

ε-closure 1 ε-closure
q2 q2 q3 q3

15-Jul-20 ε -NFA to DFA Conversion 10


Solution

ε-closure 0 ε-closure
q3 q3 ∅

ε-closure 1 ε-closure
q3 q3 q4 q4

15-Jul-20 ε -NFA to DFA Conversion 11


Solution

ε-closure 0 ε-closure
q4 q4 ∅

ε-closure 1 ε-closure
q4 q4 ∅

15-Jul-20 ε -NFA to DFA Conversion 12


Solution

0 1
→q0 {q3} {q3}
q1 {q3} ∅
q2 ∅ {q3}
q3 ∅ {q4}
*q4 ∅ ∅

Figure: Transition Table

15-Jul-20 ε -NFA to DFA Conversion 13


Thank You

15-Jul-20 ε -NFA to DFA Conversion 14

You might also like