Part-02 (Conversion ε-NFA to without epsilon NFA)

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

Theory of Computation: Conversion ε-NFA to without epsilon NFA [Part-02]

Epsilon- Closure ε-closure

Epsilon closure of a state is simply the set of all states we can reach by following the transition
function from the given state that are labeled with ε.
Or, the ε closure(P) is a set of states which are reachable from state P on ε-transitions.
The epsilon closure is as mentioned below −
ε-closure (P) = P, where P ∈ Q
If there exists ε-closure (P) = {q} and 𝛿 (q, ε) =r then, ε-closure (P) = {q, r}

Example
Find ε-closure for the following Non-deterministic finite automata (NFA) with epsilon.

Solution
ε-closure (q0) = {q0, q1, q2} [self-state+ ε-reachable states]
ε-closure (q1) = {q1, q2} [q1 is self-state and q2 is a state obtained from q1 with epsilon input]
ε-closure (q2) = {q2}

Eliminating ε Transitions

In this method, we try to remove all the ε-transitions from the given Non-deterministic finite
automata (NFA) −
The method is mentioned below stepwise −
• Step 1 − Find out all the ε-transitions from each state from Q. That will be called as ε-
closure(qi) where, qi ∈Q.
• Step 2 − Then, 𝛿' transitions can be obtained. The 𝛿' transitions means an ε-closure on 𝛿
moves.
• Step 3 − Step 2 is repeated for each input symbol and for each state of given NFA.

Md. Mohibullah, Assistant Professor, Department of CSE, Comilla University

1
Theory of Computation: Conversion ε-NFA to without epsilon NFA [Part-02]

• Step 4 − By using the resultant status, the transition table for equivalent NFA without ε
can be built.
NFA with ε to without ε is as follows −
𝛿' (q, a) = ε- closure (δ (δ^ (q, ε), a))
where, δ^ (q, ε) = ε - closure(q)

Example-01:
Convert the following NFA with ε to NFA without ε.

Solution: We will first obtain ε-closures of q0, q1 and q2 as follows:

1. ε-closure(q0) = {q0}
2. ε-closure(q1) = {q1, q2}
3. ε-closure(q2) = {q2}

The δ' transition on each input symbol is as follows:


Now the δ' transition on q0 is obtained as:
δ'(q0, a) = ε-closure (δ (δ^ (q0, ε), a))
= ε-closure(δ(ε-closure(q0), a))
= ε-closure (δ (q0, a))
= ε-closure(q1)
= {q1, q2}
δ'(q0, b) = ε-closure (δ (δ^ (q0, ε), b))
= ε-closure(δ(ε-closure(q0), b))
= ε-closure (δ (q0, b))

Now the δ' transition on q1 is obtained as:
δ'(q1, a) = ε-closure (δ (δ^ (q1, ε), a))
= ε-closure(δ(ε-closure(q1), a))

Md. Mohibullah, Assistant Professor, Department of CSE, Comilla University

2
Theory of Computation: Conversion ε-NFA to without epsilon NFA [Part-02]

= ε-closure (δ (q1, q2), a)


= ε-closure (δ (q1, a) ∪ δ (q2, a))
= ε-closure (Ф ∪ Ф)

δ'(q1, b) = ε-closure (δ (δ^ (q1, ε), b))
= ε-closure (δ (ε-closure(q1), b))
= ε-closure (δ (q1, q2), b)
= ε-closure (δ (q1, b) ∪ δ (q2, b))
= ε-closure (Ф ∪ q2)
= {q2}

The δ' transition on q2 is obtained as:


δ'(q2, a) = ε-closure (δ (δ^ (q2, ε), a))
= ε-closure (δ (ε-closure(q2), a))
= ε-closure (δ (q2, a))
= ε-closure(Ф)

δ'(q2, b) = ε-closure (δ (δ^ (q2, ε), b))
= ε-closure (δ (ε-closure(q2), b))
= ε-closure (δ (q2, b))
= ε-closure(q2)
= {q2}

Now we will summarize all the computed δ' transitions:


δ'(q0, a) = {q1, q2}
δ'(q0, b) = Ф
δ'(q1, a) = Ф
δ'(q1, b) = {q2}
δ'(q2, a) = Ф
δ'(q2, b) = {q2}

Md. Mohibullah, Assistant Professor, Department of CSE, Comilla University

3
Theory of Computation: Conversion ε-NFA to without epsilon NFA [Part-02]

The transition table can be:

States a b

→ q0 {q1, q2} Ф

* q1 Ф {q2}

* q2 Ф {q2}

State q1 and q2 become the final state as ε-closure of q1 and q2 contain the final state q2. The
NFA can be shown by the following transition diagram:

Md. Mohibullah, Assistant Professor, Department of CSE, Comilla University

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy