Explaining NFA to DFA subset construction and exponential blowup
The subset construction converts an NFA with n states into a DFA whose states are sets of those NFA states—i.e., subsets of the original state set. Each DFA state represents all possible NFA states reachable after reading an input prefix, which means the DFA tracks all nondeterministic paths simultaneously. Since there are 2^n possible subsets of an n-element set, the DFA can have up to 2^n states in the worst case.
Some NFAs, such as those recognizing languages where the nth symbol from the end is a '1', exhibit this worst-case behavior: the NFA uses only about n+1 states, but the equivalent minimal DFA needs to remember all combinations of the last n input symbols, requiring 2^n states. This blowup occurs because the deterministic machine must encode all potential nondeterministic branches as distinct states.
Though in practice many subsets are unreachable, this worst-case exponential growth is inherent and arises from how determinization replaces nondeterministic guessing with explicit state tracking of all possibilities.
A nondeterministic automaton can, on a given input prefix, be in several different control states at once: when it has a choice it can follow both branches. A deterministic automaton has to make a single, well–defined move. The standard way to simulate the nondeterminism deterministically is therefore to keep track of “all the places the NFA could be right now”.
The powerset, or subset, construction does exactly that. If (Q) is the set of (n) NFA states, the states of the constructed DFA are drawn from (\mathcal{P}(Q)), the set of all subsets of (Q). The start state is the ε–closure of the NFA start state, and from a subset (S\subseteq Q) and an input symbol (a) you go to the ε–closure of (\bigcup_{q\in S}\delta(q,a)), i.e. the set of all NFA states reachable by reading (a) from any state in (S). Acceptance is defined similarly: a DFA subset is accepting if it contains at least one accepting NFA state.
In many cases only a small fraction of (\mathcal{P}(Q)) is ever reached, so the resulting DFA is only modestly larger than the NFA. In the worst case, however, different inputs lead to different subsets, and you can end up reaching every subset of (Q). Since (|\mathcal{P}(Q)|=2^n), the number of DFA states can blow up exponentially in (n).
A concrete family showing this is (L_n={w\in{0,1}^* :) the (n)‑th symbol from the end of (w) is (1}). There is an NFA with (n+1) states for (L_n): it nondeterministically “guesses” when it is (n) symbols from the end and then checks that position is a (1). Any DFA for (L_n) must remember the last (n) symbols read to know what the (n)‑th from the end was, and there are (2^n) possible length‑(n) suffixes, so the minimal DFA has (2^n) states. This illustrates how representing sets of NFA states can force an exponential increase.