Welcome back! In our last lesson, we introduced nondeterminism, a powerful feature that allows a finite automaton to explore multiple computational paths simultaneously. We saw that an NFA accepts an input if any of these paths leads to an accept state. This flexibility often makes designing an NFA much more intuitive than designing a DFA for the same language.
This naturally leads to a fundamental question about computational power: Can NFAs recognize languages that DFAs cannot? Today, we will answer this question with a definitive "no." You will learn how to prove that for any NFA, there is an equivalent DFA that recognizes the same language. We will do this not just theoretically but also constructively, by learning and applying an elegant algorithm known as subset construction. This process is a cornerstone of automata theory and compiler design.
1. The Equivalence of NFAs and DFAs
In the previous lesson, we traced NFA computations by keeping track of the set of active states at each step. This very procedure holds the key to proving the equivalence of NFAs and DFAs. The core insight is this: we can design a DFA that formally simulates the NFA's parallel computation. In this new DFA, each state will correspond to a set of states from the original NFA.
This idea is often called the "parallel view" of nondeterminism. Let's start by reading a brief, formal introduction to this concept.
Introduction to Theory of Computation Equivalence of DFA ...
These lecture notes from UC Merced provide a concise overview of the central idea behind NFA to DFA conversion.
Please read the sections titled "Simulating an NFA on Your Computer", "Two Views of Nondeterminism", and "Constructing an Equivalent DFA". Focus on how the "Parallel View" directly motivates an algorithm that keeps track of the current subset of NFA states. This is the conceptual foundation for the formal construction we will build next.
2. The Subset Construction Algorithm
The reading introduced the idea of a DFA whose states represent subsets of the NFA's states. Let's formalize this. This process is called subset construction or sometimes powerset construction.
Given an NFA , we can construct an equivalent DFA as follows:
-
States : The states of the DFA are subsets of the states of the NFA. Theoretically, , the power set of . In practice, we only include states that are reachable from the start state.
-
Start State : The start state of the DFA is the set of states that the NFA can be in initially, before reading any input. This is the set containing the NFA's start state plus any state reachable from using only -transitions. This is called the -closure of , which we can denote as .
-
Final States : A state in the DFA is a final state if it contains at least one of the final states of the NFA. Formally, .
-
Transition Function : This is the heart of the construction. To compute the transition for a DFA state (which is a set of NFA states) and an input symbol :
a. First, find all states the NFA could transition to from any state in by reading the symbol . This is the union .
b. Then, find the -closure of this resulting set of states. This new set is the destination state in the DFA.So, .
Since you appreciate formal rigor, let's examine the precise mathematical definition of this construction.
Introduction to Theory of Computation Equivalence of DFA ...
This section of the lecture notes provides the complete, formal definition for each component of the new DFA, det(N).
Read the section "Formal Construction". Pay close attention to how each element of the new DFA's 5-tuple (Q', q'_0, F', \delta') is defined in terms of the original NFA's components. The notation \hat{\Delta}(q, w) represents the set of all states the NFA can reach from state q on input string w, which implicitly includes handling \epsilon-transitions.
3. Proof of Correctness
We have constructed a DFA, but how do we prove it is equivalent to the original NFA? The learning outcome requires this proof. The key is to show that for any input string , the state the DFA reaches is exactly the set of states the NFA could possibly be in.
The proof proceeds by induction on the length of the input string .
- Claim: For any string , .
- is the state the DFA is in after starting at and reading .
- is the set of states the NFA could be in after starting at and reading .
This is a powerful claim. If true, it means the DFA accepts if and only if . By our definition of , this means , which in turn means . This is precisely the condition for the NFA to accept .
The following resource provides a clean inductive proof of this claim.
Introduction to Theory of Computation Equivalence of DFA ...
This final section of the lecture notes walks through the formal proof of equivalence.
Read the section "Correctness Proof". Follow the argument for the base case (|w|=0) and the inductive step. This directly fulfills the "prove the equivalence" part of our learning goal and should appeal to your interest in formal logic.
4. Applying the Construction: Examples
Now that we have formally defined and proven the subset construction algorithm, let's see it in action.
Example 1: A Simple Conversion
We'll start with a straightforward NFA that does not have -transitions. This will make it easier to see the core mechanics of building the DFA's transition table state by state.
This video from Neso Academy provides a clear, step-by-step walkthrough of converting a simple NFA to its equivalent DFA.
Watch the following segments: NFA example: Understand the initial NFA and its language. NFA transition table: See how the NFA's transitions are tabulated. Note the phi (∅) entry, representing a dead configuration. DFA transition table: This is the core of the algorithm. Observe how the DFA's states are created on-the-fly, starting from the initial state {A}. Notice how the empty set ∅ in the NFA table becomes a concrete "trap state" in the DFA. Final DFA: See the resulting DFA state diagram.
This example introduces an important practical consideration: although the set of states in the DFA is theoretically the power set of the NFA's states, we only need to create states that are actually reachable from the start state.

Example 2: A More Complex Conversion with -Transitions
Now let's tackle a more complex case involving -transitions. This will require us to carefully apply the concept of the -closure at each step.
Conversion of NFA to DFA (Powerset/Subset Construction Example)
This video from Easy Theory demonstrates the full subset construction algorithm on a more intricate NFA.
Watch the video to see the entire process. The presenter builds the DFA state diagram iteratively. Start state: Pay close attention to how the DFA's start state is computed by finding the \epsilon-closure of the NFA's start state, {q0, q1}. Building the DFA: Follow along as new states (which are sets of NFA states) are created and their transitions are computed. He systematically explores transitions for each newly created state until no new states appear. For instance, when computing the transition from {q0, q1} on input a, he finds the next states are {q1, q2}, and since there are no \epsilon-transitions from q1 or q2, that set becomes the new DFA state. Determining final states: See how the final states of the DFA are identified by checking which sets contain the NFA's original final state, q0. Recap: The video concludes with a concise summary of the algorithm.
This example, while complex, demonstrates the full mechanical power of the subset construction algorithm. It can convert any NFA, no matter how tangled its -transitions are, into a simple, equivalent DFA.
Conclusion
In this lesson, we have formally established one of the most fundamental results in the theory of computation: nondeterministic and deterministic finite automata are equivalent in their expressive power.
Here are the key takeaways:
- Equivalence: Any language that can be recognized by an NFA can also be recognized by a DFA.
- Subset Construction: This is the constructive algorithm that proves the equivalence. It systematically converts an NFA into a DFA.
- DFA States as Sets: The states of the constructed DFA are sets of states from the original NFA.
- The Role of -Closure: -transitions are handled by computing the -closure when determining the DFA's start state and after each transition.
- Proof by Induction: The correctness of the construction is formally proven by induction on the length of the input string, showing that the DFA simulation perfectly mirrors the NFA's set of active states.
You have now mastered the two fundamental types of finite automata and understand their relationship. In our next lesson, we will approach this same class of languages—the regular languages—from an entirely new perspective. Instead of building machines, we will describe languages using a powerful text-based formalism called regular expressions. We will then prove that these, too, are equivalent in power to DFAs and NFAs.