simple problem to convert NFA with epsilon to without epsilon

4,379 views 15 slides Mar 22, 2018
Slide 1
Slide 1 of 15
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15

About This Presentation

conversion of NFA,this will helps to easily solve the problems
by this small example you can solve large problems also.by solving this type of small problems we can get a more ideas to solve this type of problems


Slide Content

Simple problem to convert nfa+epsilon to without epsilon KANIMOZHI S BE(CSE)

q1 q0 q2 FS a € b

Consider the above problem

Step1: want to take a epsilon closure for all states because it contains empty states

Steps to convert with epsilon to without epsilon Step1: want to take a epsilon closure for all states because it contains empty states Step2: Then check the inputs with all states .while checking the with the input it will produce new some states Step3: Then construct a transition table for the respective outputs.

Step1: Epsilon closure of q0={q0} Because it not move to next state with epsilon closure For taking epsilon closure it contains the current state then new state Epsilon closure of q1={q1,q2} Here it contains two state because the q1 is move to next state with epsilon closure. Epsilon closure of q2={q2}

Epsilon closure (q0)={q0} Epsilon closure(q1)={q1,q2} Epsilon closure(q2)={q2}

’(q0,a)=epsilon closure((q0,a)) =e-closure((q0,epsilon),a) =e-closure(e-closure(q0),a)[here e-closure of q0 is only q0 so we can take e-closure of q0 is q0 alone] =e-closure(q0,a) =e-closure(q1) [finally the state q1 contains two states q1,q2 as e-closure so we can take it] ={q1,q2} ’(q0,b)=epsilon closure((q0,b)) =e-closure((q0,epsilon),b) =e-closure(e-closure(q0),b)[here e-closure of q0 is only q0 so we can take e-closure of q0 is q0 alone] =e-closure(q0,b)[here no input for q0,b so simply write it as ] =e-closure()[no e-closure for  so no states] ={}

’(q1,a)=epsilon closure((q1,a)) =e-closure((q1,epsilon),a) =e-closure(e-closure(q1),a)[here e-closure of q1 is q1,q2 so we can take e-closure of q1 is q1,q2] = e-closure((q1,q2),a) = e-closure((q1,a)U(q2,a)) =e-closure(U) [finally from the two states there is no input so that is empty] ={} ’(q1,b)=epsilon closure((q1,b)) =e-closure((q1,epsilon),b) =e-closure(e-closure(q1,q2),b)[here e-closure of q1 is q1,q2 so we can take e-closure of q1 is q1q2 alone] =e-closure(q1,b)U(q2,b)[here for input (q1,b)is  (q2,b) is q2 so simply write as (Uq2] =e-closure(q2)[ e-closure for q2 is q2] ={q2}

’(q2,a)=epsilon closure((q2,a)) =e-closure((q2,epsilon),a) =e-closure(e-closure(q2),a)[here e-closure of q2 is q2 alone so take q2 only] = e-closure((q2),a) = e-closure() =e-closure() [finally from the state there is no input so that is empty] ={} ’(q2,b)=epsilon closure((q2,b)) =e-closure((q2,epsilon),b) =e-closure(e-closure(q2),b)[here e-closure of q2 is q2 so we can take e-closure of q2 is q2 alone] =e-closure(q2,b)[here for input (q2,b)is q2 so simply write as (q2)] =e-closure(q2)[ e-closure for q2 is q2] ={q2}

TRANSITION TABLE a b q0 (q1,q2)  q1   q2  q2

In the table the row it will denotes about the states The column it will denotes about the input By the input checking process we can construct the table

TRANSITION DIAGRAM b a b q0 q1 q2 a

We can construct a transition diagram using the transition table

Thank you