Professional Documents
Culture Documents
Example
Example
DFA
NFA
It is DFA but with different defined by
δ’ :Q x (Σ {}) 2Q
i.e., transitions from a state on an input symbol can be to any set of states.
Thus, it has the ability to be in several states at once. The set (q, λ) may be
empty. This means that there is no transition defined for this specific input
symbol λ. In order for a DFA to be an NFA the following condition must apply
for some state q and input x, i.e. | (q, x) | > 1.
It does not increasing the computational power of automata and is easier to
design.
Example (1). Design an NFA that accepts all strings that contain either 101 or
11 as a substring.
Theory of Computation
Example (2). Design an NFA that accepts all strings over {0,1}
containing a 1 in the third position from the end.
One good way to view this computation of NFA is to say that it stays in
the state q1 until it guesses that it is three places from the end. At that
point if the input symbol is 1, it branches to state q2 and uses q3 and q4
to check on whether its guess was correct.
Theory of Computation
Conversion of NFA to DFA.
The method of converting NFA to DFA can be described by using a formula
known as point- set topology. We shall describe it without its derivation. It is
given by
f( A I ) = f( A I )
Since, we have only so this implies that
A i , x ) = (A i , x)
and DFA is referred to as subset DFA.
To convert NFA of example (2) to equivalent DFA, we know that a DFA may
have many more states. The smallest DFA for A will contain 8 states. It is
given by
Theory of Computation
Example(3). Find DFA by converting the NFA given by
Solution.
Theory of Computation
Let us replace [q0] as A, [q0, q1] as B, [q1, q2] as C, [q0, q1, q2] as D, [q2] as E, and
[q1] as F. Then, the constructed finite automata is
In the finite automata, we are seeing that, for a single state and a single input
the machine can go to only one state. So it is a DFA. The starting state is [q0],
i.e., A. The final states are [q1, q2], i.e., C, [q0, q1, q2], i.e., D, and [q2], i.e., E.
The transition diagram for DFA is
Theory of Computation
Example(6). Construct a DFA from the given NFA