Trying to simulate an NFA with a DFA is less straight-forward.
Warm-up: which of the following are equivalent to plain NFAs?
MultistartNFA
: an NFA allowing more than one start stateSingleAcceptNFA
: an NFA allowing only a single accept stateInjectiveNFA
: an NFA for which the destination of each transition rule is either \(\emptyset\) or a singleton \(\{q_i\}\)NoLoopNFA
: an NFA for which no transition rule is of the form \(q \stackrel{a}{\rightarrow} q\) for any \((q, a) \in Q \times \Sigma\)NoEpsilonNFA
: an NFA with no \(\emptystring\) transitions.
Example processing the string 010110
:
010110
Begin in the state(s) \(\{q_1\}\).
Read 0
and transition to state(s) \(\{q_1\}\).
010110
Read 1
and transition to state(s) \(\{q_1, q_2, q_3\}\).
010110
Read 0
and transition to state(s) \(\{q_1, q_3\}\).
010110
Read 1
and transition to state(s) \(\{q_1, q_2, q_3, q_4\}\).
010110
Read 1
and transition to state(s) \(\{q_1, q_2, q_3, q_4\}\).
010110
Read 0
and transition to state(s) \(\{q_1, q_3, q_4\}\).
010110
Since an accept state is highlighted, the NFA accepts the string.
What would a DFA need to keep track of in order to simulate this NFA?
To simulate an NFA with \(|Q|\) states operating on a string \(w\), how many distinct sets of states must we keep track of in the worst case?
There exist \(k\)-state NFAs for which the smallest equivalent DFA has \(2^k\) states!
Example near this bound:
\(k^\text{th}\)-to-last symbol NFA
Theorem: If a language is NFA-decidable, then it is also DFA-decidable.
Proof (no \(\emptystring\) transitions)
For any \(R \subseteq Q_N\), define: \[ E(R) = \setbuild{q \in Q_N}{q \text{ is reachable from some $r \in R$ by a sequence of 0 or more $\emptystring$ transitions}} \]
Theorem: If a language is NFA-decidable, then it is also DFA-decidable.
Proof
This convention for handling \(\emptystring\) transitions is not the only possible one!
Corollary: a language is DFA-decidable if and only if it is NFA-decidable.