← 🔁 Finite Automata (DFA, NFA, ε-NFA)
Subtopic 3 of 5

1.3NFA → DFA: subset construction

The idea

The subset construction turns an NFA into a DFA whose states are sets of NFA states.

Think of it like this: Instead of cloning yourself, you keep a list of everywhere the clones are and update the whole list at once.

Why it exists

It proves NFA = DFA, and it is the standard exam procedure for counting DFA states.

How it works

  1. Start state = ε-closure of the NFA start state.
  2. For each symbol a: take every state in the current set, follow a-moves, then ε-closure.
  3. Repeat for each new set until no new set appears.
  4. A set is final if it contains an NFA final state. n states give at most 2ⁿ sets.

Worked example: Third symbol from the end is a

The NFA has 4 states but the reachable DFA has 8 = 2³ states: it must remember the last three symbols.

Now play with it

  • →Press "Add next DFA state" and watch each new subset appear.
  • →Compare the NFA size, reachable DFA size and the 2ⁿ bound.
a,baa,ba,bq0q1q2q3
DFA state= NFA stateson aon b
A{q0}BA
B{q0,q1}CD
C{q0,q1,q2}EF
D{q0,q2}GH
*E{q0,q1,q2,q3}EF
*F{q0,q2,q3}GH
*G{q0,q1,q3}CD
*H{q0,q3}BA
NFA states n4
Reachable DFA states8
Worst case 2ⁿ16
Minimal DFA states8

* = final DFA state (contains an NFA final state). Only reachable subsets are built, so the DFA is often smaller than 2ⁿ, but some languages really need it.

Check yourself

An NFA with 3 states is converted to a DFA by the subset construction. The maximum number of DFA states is

Remember: DFA states are subsets of NFA states; at most 2ⁿ.
Exam notes (the dense version)

Each DFA state is a set of NFA states. Start from the ε-closure of the start state; for each symbol take move(set, a) and then its ε-closure; a DFA state is final if it contains an NFA final state. n NFA states can give up to 2n DFA states.

Previous year questions: Finite Automata (DFA, NFA, ε-NFA) (6)

PYQs are grouped by topic, so this is the full set for Finite Automata (DFA, NFA, ε-NFA); try the ones that match this subtopic. Open all 6 on the topic page.