Example
Example
Example
Example (1) Let us assume that we are given to construct a DFA that accepts any
combinations of string of a, b, c. That means the string can start with a or b or c.
After any symbol, any of the other symbols can come in any combination and all
strings are accepted. One solution to this is the DFA given by
But it is not clear as to how any combinations of a, b, c will come. In this case, an
NFA with move plays its role as represented by the transition diagram given below.
Now it is clear that the string can start with a or b or c. And for the transitions from
any state, we can move to any other state with no input. So, if c comes after ‘a’, we
can go from q0 to q2 easily with no input. The same thing can occur for all the other
states. The corresponding NFA is given by
Theory of Computation
Step 1:
(i). Between the states q0 and q1, there is a move. If we want to remove that
transition, we have to find all the edges starting from q1.The edges are q1 to q1 for
input 1 and q1 to q2 for input .
(ii). All these transitions starting from the state q0 are duplicated, keeping the edge
label the same. q0 is the initial state, so we make q1 also an initial state. The
modified transition diagram is given below.
Discrete Mathematics
Step 2.
(i).Between q1 and q2, there is a transition. To remove that transition, we find
all the edges starting from q2. The edge is q2 to q2 for input 2.
(ii). Duplicate the transition starting from the state q1, keeping the edge label
the same. q1 is the initial state, so make q2 also an initial state. q2 is the final
state, so make q1 also a final state. The modified transition diagram is given
below.
Step 3
(i). Between q0 and q2, there is a transition. To remove that transition, we find
all the edges starting from q2. The edge is q2 to q2 for input 2.
(ii). Duplicate the transition starting from the state q0, keeping the edge label
the same. q0 is the initial state, so make q2 also an initial state. q2 is the final
state, so make q0 also a final state. The modified transition diagram is given
Discrete Mathematics
This is the equivalent NFA without move obtained from the NFA with
transaction.
Example (3). Convert the following NFA with move to an equivalent NFA
without move.
Theory of Computation
Equivalence of NFA and DFA.
In contrast to the NFA, the DFA has no transitions. Also, for every (q, a) with
q Q and a there is at most one successor state. Therefore, for every string
w * , there is at most one w path in the transition diagram for DFA . If w is in the
language of DFA then this path leads from the initial state to a final state. So, DFA
are preferred for practical purposes. A DFA can simulate the behavior of NFA by
increasing the number of states. A DFA M = (Q, , , q0, F ) can be viewed as an NFA
M’= ( Q, , , q0, F ) by defining ( q, a) = {(q, a)}
Conversion of NFA into DFA.
Theorem. If a language L is accepted by an NFA then there is a DFA that accepts L.
Proof. We shall use a constructive procedure by using subset construction. If there
are two w paths in NFA, the corresponding states from a common state q in DFA will
be
(ii) Show that the following NFA and DFA are equivalent