ChatDiagram
4 templates · State diagram

NFA to DFA Subset Construction State Diagrams

These state diagrams show the subset construction algorithm in action: converting an NFA into an equivalent DFA by treating sets of NFA states as single DFA states. Whether you're working through a theory assignment or designing a lexer, the examples below help you see ε-closures, subset transitions, and accepting states clearly.

Standard OMG UML 2.5.1 §14 + Harel (1987) statechartEngine schematex-stateExport SVG · PNG · PDF
How to

How to use a state diagram template.

  1. 01Define the NFA

    List the NFA states, input alphabet, transition function, start state, and accepting states, including any ε-transitions.

  2. 02Compute ε-closures

    For each set of NFA states, determine all states reachable without consuming input to handle ε-transitions correctly.

  3. 03Build DFA states from subsets

    Create a DFA state for each distinct subset of NFA states visited during simulation, then connect transitions based on the NFA's moves.

  4. 04Mark start and accepting DFA states

    Set the starting DFA state to the ε-closure of the original start state, and accept any DFA state whose subset contains at least one NFA accepting state.

  5. 05Generate the diagram

    Enter your NFA into ChatDiagram's state diagram generator to render the subset construction visually and export the result.

FAQ

Questions about state diagram templates

What is the subset construction algorithm?

Subset construction converts a nondeterministic finite automaton (NFA) into an equivalent deterministic finite automaton (DFA) by treating each set of NFA states as a single DFA state.

How do ε-transitions affect subset construction?

ε-transitions require computing the ε-closure of each subset: every state reachable from the subset without consuming an input symbol is included before transitions are determined.

What is the maximum number of DFA states when converting an NFA with n states?

In the worst case, subset construction can produce up to 2^n DFA states, although many practical NFAs result in far fewer states.

Can subset construction handle multiple accepting states in an NFA?

Yes—any DFA state whose subset contains at least one NFA accepting state becomes an accepting state, so multiple accept states are handled naturally.