Toc Module l5
Toc Module l5
Prepared By : Dr K RAJENDRA PRASAD, PROFESSOR, DEPT. OF CSE (CS), IARE (Autonomous), NANDYAL
1
Finite automata with and without epsilon transitions
Prepared By : Dr K RAJENDRA PRASAD, PROFESSOR, DEPT. OF CSE (CS), IARE (Autonomous), NANDYAL
2
Finite automata with and without epsilon transitions
Problems
Prepared By : Dr K RAJENDRA PRASAD, PROFESSOR, DEPT. OF CSE (CS), IARE (Autonomous), NANDYAL
3
Finite automata with and without epsilon transitions
Prepared By : Dr K RAJENDRA PRASAD, PROFESSOR, DEPT. OF CSE (CS), IARE (Autonomous), NANDYAL
4
Finite automata with and without epsilon transitions
Prepared By : Dr K RAJENDRA PRASAD, PROFESSOR, DEPT. OF CSE (CS), IARE (Autonomous), NANDYAL
5
Finite automata with and without epsilon transitions
Prepared By : Dr K RAJENDRA PRASAD, PROFESSOR, DEPT. OF CSE (CS), IARE (Autonomous), NANDYAL
6
Epsilon-Closure (є-closure)
Prepared By : Dr K RAJENDRA PRASAD, PROFESSOR, DEPT. OF CSE (CS), IARE (Autonomous), NANDYAL
7
Epsilon-Closure (є-closure)
Є-closure(1)={1,2,3,4,6}
Є-closure(2)=?
Є-closure (3)=?
Є-closure (4)=?
Є-closure (5)=?
Prepared By : Dr K RAJENDRA PRASAD, PROFESSOR, DEPT. OF CSE (CS), IARE (Autonomous), NANDYAL
8
Epsilon-Closure (є-closure)
1. ε-closure(q0) = {q0}
2. ε-closure(q1) = {q1, q2}
3. ε-closure(q2) = {q2}
Prepared By : Dr K RAJENDRA PRASAD, PROFESSOR, DEPT. OF CSE (CS), IARE (Autonomous), NANDYAL
9
Eliminating є moves in NFA (convert є-NFA to DFA)
Prepared By : Dr K RAJENDRA PRASAD, PROFESSOR, DEPT. OF CSE (CS), IARE (Autonomous), NANDYAL
10
Epsilon-Closure (є-closure)
Solution:
Let us obtain ε-closure of each state.
1. ε-closure {q0} = {q0, q1, q2}
2. ε-closure {q1} = {q1}
3. ε-closure {q2} = {q2}
4. ε-closure {q3} = {q3}
5. ε-closure {q4} = {q4}
Now, let ε-closure {q0} = {q0, q1, q2} be state A.
Hence
Prepared By : Dr K RAJENDRA PRASAD, PROFESSOR, DEPT. OF CSE (CS), IARE (Autonomous), NANDYAL
12
Epsilon-Closure (є-closure)
Now,
δ'(B, 0) = ε-closure {δ(q3, 0) }
=ϕ
δ'(B, 1) = ε-closure {δ(q3, 1) }
= ε-closure {q4}
= {q4} i.e. state C
For state C:
1. δ'(C, 0) = ε-closure {δ(q4, 0) }
=ϕ
2. δ'(C, 1) = ε-closure {δ(q4, 1) }
=ϕ
Prepared By : Dr K RAJENDRA PRASAD, PROFESSOR, DEPT. OF CSE (CS), IARE (Autonomous), NANDYAL
13
Epsilon-Closure (є-closure)
Prepared By : Dr K RAJENDRA PRASAD, PROFESSOR, DEPT. OF CSE (CS), IARE (Autonomous), NANDYAL
14
Epsilon-Closure (є-closure)
Prepared By : Dr K RAJENDRA PRASAD, PROFESSOR, DEPT. OF CSE (CS), IARE (Autonomous), NANDYAL
15
Epsilon-Closure (є-closure)
Prepared By : Dr K RAJENDRA PRASAD, PROFESSOR, DEPT. OF CSE (CS), IARE (Autonomous), NANDYAL
16
Epsilon-Closure (є-closure)
Solution: Let us obtain the ε-closure of each state.
1. ε-closure(q0) = {q0, q1, q2}
2. ε-closure(q1) = {q1, q2}
3. ε-closure(q2) = {q2}
Now we will obtain δ' transition. Let ε-closure(q0) = {q0, q1, q2}
call it as state A.
δ'(A, 0) = ε-closure{δ((q0, q1, q2), 0)}
= ε-closure{δ(q0, 0) ∪ δ(q1, 0) ∪ δ(q2, 0)}
= ε-closure{q0}
= {q0, q1, q2}
Prepared By : Dr K RAJENDRA PRASAD, PROFESSOR, DEPT. OF CSE (CS), IARE (Autonomous), NANDYAL
18
Epsilon-Closure (є-closure)
Now we will find the transitions on states B and C for each input.
Hence
δ'(B, 0) = ε-closure{δ((q1, q2), 0)}
= ε-closure{δ(q1, 0) ∪ δ(q2, 0)}
= ε-closure{ϕ}
=ϕ
δ'(B, 1) = ε-closure{δ((q1, q2), 1)}
= ε-closure{δ(q1, 1) ∪ δ(q2, 1)}
= ε-closure{q1}
= {q1, q2} i.e. state B itself
δ'(B, 2) = ε-closure{δ((q1, q2), 2)}
= ε-closure{δ(q1, 2) ∪ δ(q2, 2)}
= ε-closure{q2}
= {q2} i.e. state C itself
Prepared By : Dr K RAJENDRA PRASAD, PROFESSOR, DEPT. OF CSE (CS), IARE (Autonomous), NANDYAL
19
Epsilon-Closure (є-closure)
Prepared By : Dr K RAJENDRA PRASAD, PROFESSOR, DEPT. OF CSE (CS), IARE (Autonomous), NANDYAL
20
Epsilon-Closure (є-closure)
Prepared By : Dr K RAJENDRA PRASAD, PROFESSOR, DEPT. OF CSE (CS), IARE (Autonomous), NANDYAL
21
Epsilon-Closure (є-closure)
As A = {q0, q1, q2} in which final state q2 lies hence A is final state.
B = {q1, q2} in which the state q2 lies hence B is also final state. C
= {q2}, the state q2 lies hence C is also a final state.
Prepared By : Dr K RAJENDRA PRASAD, PROFESSOR, DEPT. OF CSE (CS), IARE (Autonomous), NANDYAL
22
Epsilon-Closure (є-closure)
Prepared By : Dr K RAJENDRA PRASAD, PROFESSOR, DEPT. OF CSE (CS), IARE (Autonomous), NANDYAL
23
Epsilon-Closure (є-closure)
Prepared By : Dr K RAJENDRA PRASAD, PROFESSOR, DEPT. OF CSE (CS), IARE (Autonomous), NANDYAL
24