NFAs and DFAs both recognize the same class of languages, regular languages. In other words, there is no language for which we can build an NFA but not a DFA.
To prove this is the case, we will need to show that every NFA can be converted into an equivalent DFA.
The main idea is that, given some NFA, we will construct from it a DFA which simulates the NFA, accepting when it accepts and rejecting when it rejects.
What do we need to keep track of when simulating an NFA?
Let $N = (Q, \Sigma, \delta, q_{0}, F)$ be the NFA recognizing some language $A$. We construct a DFA $M = (Q^\prime, \Sigma, \delta^\prime, q_{0}^\prime, F^\prime)$ recognizing the same language $A$.
For now, we discount the possibility of $\epsilon$ transitions.
Basically, the DFA we build has a state for every possible combination of states the NFA could be in. As it reads input, it essentially simulates all paths through the NFA concurrently.
In order to handle these, there is an extra bit of notation:
Given that $R$ is a set of states, let
$E(R) = \{q \;|\; q \text{ can be reached from R by traveling along 0 or more } \epsilon \text{ arrows}\}$
Then we modify the transition function of M to add in the states we can reach by $\epsilon$-transitions after each step:
$\delta(R, a) = \{q \in Q \;|\; q \in E(\delta(r, a)) \text{ for some } r \in R\}$.
The transition function basically works by looking at the set of states we are currently in ($R$), and finding every state we could get to from this state, given the input ($a$), in the NFA, and where we can then go via $\epsilon$-transitions.
We also must modify the start state to include $\epsilon$-transitions from the start state:
$q_{0}^\prime = E(q_{0})$
Using this algorithm, we can construct an equivalent DFA for any NFA. Thus, any language that has an NFA which recognizes it is regular.
How could we convert the following NFA into a DFA, using the above procedure?
Copyright © 2024 Ian Finlayson | Licensed under a Creative Commons BY-NC-SA 4.0 License.