Nondeterministic Finite Automata (NFA)

the exponential blowup

When you determinize an NFA, the new DFA's states are SETS of the NFA's states. An NFA with n states has 2^n possible subsets, so in the worst case the DFA could need up to 2^n states — going from, say, 20 states to over a million. This worst-case explosion in size when converting an n-state NFA to a DFA is called the exponential blowup. It is the price you may pay for the convenience of nondeterminism.

It is not just a theoretical fear; there are concrete languages that force it. The textbook witness is again "the k-th symbol from the end is a": the NFA needs only about k+1 states, but ANY DFA for this language provably needs at least 2^k states, because a DFA must distinguish all 2^k possible patterns of the last k symbols — there is no smaller machine that can do it. So the blowup is sometimes genuinely unavoidable, not merely a clumsy construction.

Two honest qualifications keep this in perspective. First, 2^n is an upper bound and a worst case; the subset construction builds only REACHABLE subsets, and for most NFAs that is a tiny fraction of all 2^n, so the resulting DFA is often comparable in size to the NFA. Second, blowup is about SIZE, never about POWER — the DFA still recognizes the exact same regular language. The lesson for practice is simply that converting may cost memory, so tools that work directly with NFAs (or keep them lazy) can be far more efficient.

For "the third symbol from the end is a": the NFA has 4 states, the minimal DFA has 2^3 = 8. Push k up: at k = 20 the NFA stays around 21 states while every DFA needs at least 2^20 = 1,048,576 states. The gap is the exponential blowup made concrete.

An n-state NFA can need up to 2^n DFA states; sometimes this bound is provably forced.

2^n is a worst-case UPPER bound, not what always happens — only reachable subsets are built. And blowup affects size, never the language recognized.

Also called
state explosionexponential state blow-up狀態爆炸