4.6.4 · D5Theory of Computation

Question bank — NFA to DFA conversion — subset construction

1,572 words7 min readBack to topic

Reminders you'll lean on (all built in the parent):

  • A DFA state is a set of NFA states — the "cloud" the NFA could be in.
  • = everywhere you can silently drift on -edges from (includes ).
  • = real one-symbol step, no yet.
  • ; accept iff .

True or false — justify

Every DFA produced by subset construction has exactly states for an -state NFA.
False. is only the upper bound (all possible subsets); we build only the subsets reachable from the start, which is usually far fewer.
The subset construction can turn an NFA into a DFA that accepts a different language.
False. The whole point is ; the construction is a proof that NFA and DFA have equal power, both recognising exactly the regular languages (Closure Properties of Regular Languages).
If the NFA has no -transitions, then for every set .
True. only follows -edges; with none present nothing drifts, so each set is its own closure and the recipe collapses to .
The resulting DFA is always the smallest DFA for that language.
False. Subset construction gives a correct DFA, often with redundant states; you still need DFA Minimization — Myhill–Nerode to get the minimal one.
A single NFA final state can make many different DFA states accepting.
True. Every subset that contains that final state () is accepting, and one final state can appear in many reachable subsets.
The dead state has an outgoing edge on every symbol, all pointing to itself.
True. for any , so once the cloud is empty it stays empty forever — a self-looping, non-accepting trap.
If a DFA state satisfies exactly, it is accepting; otherwise it is not.
False. The rule is intersection, not equality: is accepting whenever , so can be accepting while containing many non-final states too.
Subset construction can fail to terminate if the NFA has cycles.
False. There are at most subsets total, so only finitely many DFA states can ever be created; cycles in the NFA never create infinitely many subsets.
The start state of the DFA is always .
False. It is ; if has -edges the start cloud is larger than .
Two different NFAs can produce the very same DFA under subset construction.
True. As long as they recognise the same language and drift to the same reachable clouds, the reachable-subset DFA can coincide — the construction depends on behaviour, not on how the NFA was drawn.

Spot the error

A student writes the start state as and calls it done — what's wrong before we even look at closures?
takes a set, not a bare state; it must be . A DFA state is a set of NFA states, so the argument must be a set too.
"Each step I apply first, then : ." Where's the bug?
The order is backwards for the result. Correct is : you must close after the move so any -drift following the new symbol is captured. (Closing before also matters, but the final closure after MOVE is the one people drop.)
"I generated all subsets first, then drew edges." Why is this wasteful and sometimes misleading?
Most of those subsets are unreachable from the start and clutter the diagram; you only ever need the ones the start state can actually reach by following transitions.
", and since is only one state, is only partly accepting." Fix the reasoning.
There is no "partly accepting" — a DFA state is accepting or not. Because , is fully accepting; the NFA succeeds if any single path reaches a final state.
"MOVE gave me on symbol , so I just leave that transition blank." Why is that not a legal DFA?
A DFA's must be total — defined on every (state, symbol) pair. The blank must go to the dead state , which then self-loops and rejects.
" is a final NFA state, so I make every reachable subset accepting." Spot the overreach.
A subset is accepting only if it contains a final state. If then only subsets containing (and any other subset touching ) are accepting — not automatically all of them.

Why questions

Why must we close along -edges before reading any input, i.e. why not start at plain ?
The NFA can silently slide along -edges without consuming a symbol, so before the first real symbol it may already sit in several states — the DFA must carry that whole cloud from the start.
Why is "the NFA accepts if any path accepts" mirrored by "" rather than ""?
The NFA explores paths in parallel and only needs one successful branch. The subset lists all currently-alive branches, so a single alive final state () means acceptance; requiring would wrongly demand all branches be final.
Why does the construction always terminate even when the NFA loops forever on some input?
The DFA states are subsets of the finite set , and there are only subsets. New DFA states can only be created finitely often, so the algorithm halts regardless of NFA cycles.
Why is the empty set treated as a real state rather than "no state"?
A DFA is never allowed to have no current state — it must always be somewhere. encodes "all NFA branches died", which is a legitimate, permanent rejecting situation, so it becomes the trap state.
Why can produce a set that is not closed, forcing a follow-up ?
only takes real labelled steps and stops the instant the symbol is consumed; the states it lands on may themselves have outgoing -edges, so we must close again to include that fresh drift.
Why do subset construction and Thompson's construction pair up so naturally?
Regular Expressions to NFA — Thompson's construction produces -NFAs from regexes; subset construction (with ) then converts those -NFAs to DFAs, completing the pipeline regex NFA DFA.
Why does the DFA sometimes have fewer states than the NFA, not just more?
Subset construction bounds states by but only builds reachable clouds; if many NFA states always travel together, they collapse into a handful of subsets, so the reachable DFA can be smaller than .

Edge cases

An NFA whose start state is also a final state, with no input read. Does the DFA accept the empty string ?
Yes. The start DFA state is , which contains , so it satisfies and accepts immediately.
An NFA state with no outgoing edge on symbol . What is its contribution to ?
It contributes (the empty union term). If every state in lacks an -edge, and the DFA goes to the dead state on .
A one-state NFA with a single state that is both start and final and self-loops on every symbol. What DFA results?
A one-state DFA equal to , accepting, self-looping on all symbols — it accepts , matching the NFA.
An -cycle in the NFA (). Does loop forever?
No. collects a set; once and are already in it, revisiting adds nothing, so the fixpoint is reached and the closure is just .
An NFA where the start state can reach a final state using only -edges. Is the empty string accepted?
Yes. then contains that final state, so the DFA start state is accepting and — no symbol needs to be read.
What DFA does subset construction give for an NFA with no final states at all?
Every reachable subset has empty intersection with , so no DFA state is accepting; the DFA recognises the empty language , matching the NFA (which can never accept). Note: this is the empty language, distinct from the string set — relevant when checking with the Pumping Lemma for Regular Languages.
Can a reachable non-start subset ever be the empty set while the start subset is non-empty?
Yes. If from a live cloud some symbol has no available edges, , so the reachable DFA legitimately includes the dead state as a genuine, reachable node.