Converting a Given -NFA to a DFA via -Closures
NFA to DFA Conversion (Subset Construction) with $\varepsilon$-Closures
You are given the following -NFA (states: ; alphabet: ):
- Start state:
- Accepting (final) states: not explicitly stated in the prompt, so conversion is about the transition structure only (final states can be derived if you later specify which are accepting).
Transitions:
| State | -transition | -transition | -transition |
|---|---|---|---|
| (start) | |||
We will:
- Compute all reachable -closures of NFA state sets.
- Use subset construction to build the equivalent DFA, where each DFA state is a set of NFA states (a subset).
Key definitions used throughout:
- [epsilon-closure]{def="The set of NFA states reachable from a state (or set) using only -moves"}
- subset construction
- DFA transition function
Core conversion rule (what we compute)
For any set of NFA states and input symbol , the DFA transition is:
So the workflow is:
- Move on symbol using the NFA’s labeled transitions:
- Then “expand” by following any number of -moves via -closure.
We’ll compute these exactly for the given machine.
Step 1 — Compute $\varepsilon$-closures of individual states
- 1Step 1
For each state , start with the set containing only .
- 2Step 2
From any state already in the closure, follow its -transition(s) (if any), and repeat until no new states are added.
- 3Step 3
Given , include . From , add via . Thus you reach .
- 4Step 4
Given , you can’t reach any new state; closure is just .
- 5Step 5
From , you can go to via -transitions. From , you can go to via , so ultimately you reach .
- 6Step 6
So: , , .
Closure intuition
Think of -closure as “all states you can be in right now without consuming input.” When converting to a DFA, every DFA state must represent such an -expanded set.
Step 1 results (individual closures)
Now we must compute closures of sets that arise during subset construction. (A set closure is the union of closures of its members, then expanded consistently.)
[set -closure]{def="Closure of a set S is the union of individual closures of states in S"}
Step 2 — DFA construction via subset construction
- 1Step 1
is
- 2Step 2
Compute , then take . We compute it explicitly below.
- 3Step 3
Similarly compute , then take .
- 4Step 4
If the resulting subsets are new, add them to the DFA state set and repeat for each.
- 5Step 5
In this machine, the DFA stabilizes quickly because many transitions lead back into .
Step 2 details: transitions
Let the current DFA state be the subset of NFA states.
From on input
First compute the NFA move on :
So:
Now take -closure:
Since and already have closure and closes to , we get:
Therefore:
From on input
Compute NFA move on :
So:
Now take -closure:
We use set closure:
Therefore:
About accepting states
The DFA final/accepting states depend on which NFA states are final. The prompt doesn’t specify them, so only the DFA transition structure is determined here. If you later specify final NFA states, DFA finals are exactly subsets that intersect those states.
Result: The DFA transition table
We started from . Both inputs loop back to the same subset, so the DFA has only one reachable DFA state:
Thus the DFA transition function is:
| DFA state (subset of NFA states) | on | on |
|---|---|---|
Accepting states (conditional)
Let be the set of accepting states of the -NFA. Then the accepting DFA states are:
- is accepting iff
- (and if you treat acceptance as “some path accepts after -closure”, you can equivalently test ’s elements.)
Because the only DFA state is , the DFA accepts all strings iff any of is accepting in the NFA; otherwise it accepts none.
From -NFA to DFA (what you do in practice)
Compute $\u03b5$-closures
1Find ."
Initialize DFA start state
2Set ."
Subset transitions
3For each DFA state and symbol , compute then -close it."
Finalize reachable subsets
4Stop when no new subsets appear; mark accepting subsets if given NFA finals."
Quick verification with a state-based view
Even without running more iterations:
- From , an -move gets you to .
- From , an -move gets you to and .
- From , does nothing.
- So as soon as you start, the -closure is already the full set .
- On and , the NFA transitions from states inside this full set always return you (after -closure) to the same full set.
Mermaid sketch of “closure collapse”:
Common edge-cases & checks
Knowledge Check
What is the -closure of state in the given -NFA?