NFA to DFA (Subset Construction)

Context: FIT2014_MOC · leg 2 of the Kleene’s Theorem cycle · turns a convenient NFA into a deterministic machine · Assignment 1 hand skill Problem it solves: given an NFA (possibly with -transitions), build a DFA recognising the same language.

Quick Revision

  • 🎯 Trigger: an NFA to determinise ➔ make each set of NFA states into a single DFA state, and fill a table until no new sets appear.
  • ⚡ Key Constraint: whenever a state joins a set you must also add everything reachable from it along -transitions (-closure) — forgetting this is the standard error.

📐 The idea

  • In a DFA ➔ a string traces a unique path to a single ; accepted iff that state is Final; Start State.
  • In an NFA ➔ a string traces a set of paths ending in a set of states, , which may have zero, one or many members; accepted iff contains a Final state.
  • The construction
  • Step relation (no -transitions) ➔

⚙️ The procedure

  1. Start set; then add the -closure (every state reachable from a member along -transitions). This set is the DFA’s Start state.
  2. Take the first incomplete row of the DFA table; call its set .
  3. For each letter of the alphabet: compute , then add the -closure of that set. Write it in row , column .
  4. If the resulting set is new, add it as a new (incomplete) row.
  5. Repeat until every row is complete — no new sets appear.
  6. Final states ➔ any DFA state whose set contains an NFA Final state is labelled Final.

📊 Worked trace (no -transitions)

NFA: state 1 is Start with self-loops on and ; ; state 3 Final.

DFA state (set)Final?
Start
✓ (contains 3)
✓ (contains 3)
  • Reading it and , which contains the Final state 3 — so is accepted.

📊 Worked trace (with -transitions)

NFA: Start with self-loop ; ; self-loop ; ; Final.

DFA state (set)Final?
Start
  • Start set closes under to — the machine is “already” in states 2 and 3 before reading anything.
  • is a real state ➔ it is the dead/sink state: once there, every letter keeps you there and it is never Final.

✍️ Practice

⚠️ Common Mistakes

  • 💡 Forgetting the -closure ➔ it must be applied to the Start set and after every letter step; omitting it produces a DFA that rejects strings the NFA accepts.
  • 💡 is a legitimate DFA state ➔ don’t leave the cell blank; the DFA must be total, and is the sink.
  • 💡 Final = contains an NFA Final state ➔ the whole set need not consist of Final states; one member suffices (matching the NFA’s “some path accepts” rule).
  • 💡 Sets, not sequences and are the same DFA state; normalise the order so you don’t create duplicate rows.

🧠 Active Recall