Removing Null moves from NFA While Learning about removing null moves from NFA , I came across a thought....

To Remove Epsilon moves we follow following steps :


Find Closure of all states which have null moves
Mark these states which have null moves
Make a revised transition table without epsilon column and Find all possible transition for those marked states by using their Closures.
you will get nfa without null moves/epsilon moves


Where is the issue : Actually, Doubt arises when you think of an nfa like this :

If we try to remove epsilon moves out of it...



Initial transition Table : 


Now finding closure for q0, q1 and q3.

Which is CL(q0) = {q0,q1,q2}
CL(q1) = {q1,q2}
CL(q3) = {q2,q3}
We find a transition table after following above steps which is : 


The question gets quite tricky...

because now this nfa has q1,q2 where there is no way to reach them..

So What do you think we will remove q1 and q2 as they are unreachable or we will draw a nfa with them...
In your construction you correctly computed the closures of the original states and then made the $a$- and $b$-transitions, but you omitted step (3) of the algorithm: compute the closures of the results again. For example, from $q_0$ on input of $a$ the first step is
$$
q_0\stackrel{CL}{\longrightarrow} \{q_0, q_1, q_2\}
$$
then, on seeing an $a$ we make the transitions, as you did:
$$
\{q_0, q_1, q_2\}\stackrel{a}{\longrightarrow} \{\delta(q_0, a), \delta(q_1, a), \delta(q_2, a)\}=\{q_3, q_4\}
$$
then (here's the step you omitted), you take the closure again:
$$
\{q_3, q_4\}\stackrel{CL}{\longrightarrow} \{q_2, q_3, q_4\}
$$
and thus you'll have the new transition $\delta'(q_0, a) = \{q_2, q_3, q_4\}$.

If you do this for all the state-symbol pairs, you'll find that the transitions of your new NFA are
$$\begin{array}{c|cc}
 &amp; a &amp; b\\ \hline
q_0 &amp; \{q_2, q_3, q_4\} &amp; \{q_2, q_3\} \\
q_1 &amp; \{q_2, q_3, q_4\} &amp; \varnothing \\
q_2 &amp; \{q_4\} &amp; \varnothing \\
q_3 &amp; \{q_4\} &amp; \{q_5\} \\
q_4 &amp; \{q_5\} &amp; \{q_2, q_3\} \\
q_5 &amp; \varnothing &amp; \varnothing \\
\end{array}$$
Since $q_1$ is an unreachable state, it can be eliminated without changing the langauge of the resulting NFA.