NFA Builder
Design your Nondeterministic Finite Automaton ā add states, transitions, and epsilon moves
š Automaton Settings
ā Add Transition
š Transition Table
šÆ Example NFAs
Subset Construction
Convert NFA to DFA using the Powerset/Subset Construction algorithm ā watch it unfold step by step
ā Algorithm Steps
š ε-Closure Table
š DFA Transition Table
DFA Minimization
Minimize the DFA using the Table-Filling (Myhill-Nerode) algorithm
ā Minimization Steps
š² Distinguishability Table
š Equivalence Classes
String Simulation
Watch your automaton process input strings step by step with live state highlighting
š® Simulation Controls
š Current State
š Computation History
š§Ŗ Batch Test
š¤ Input Tape
Theory Reference
Formal definitions and key theorems from Unit 1 & Unit 2 of TOC
DFA (Deterministic Finite Automaton)
A 5-tuple M = (Q, Ī£, Ī“, qā, F) where:
- Q ā finite set of states
- Ī£ ā finite input alphabet
- Ī“: Q à Σ ā Q ā total transition function
- qā ā Q ā initial state
- F ā Q ā set of accepting states
NFA (Nondeterministic Finite Automaton)
A 5-tuple M = (Q, Ī£, Ī“, qā, F) where:
- Ī“: Q Ć (Ī£ āŖ {ε}) ā 2^Q ā transition to a set of states
- May have ε-transitions (move without consuming input)
- Multiple transitions for same (state, symbol) allowed
ε-Closure
ε-closure(q) = set of all states reachable from q via zero or more ε-transitions.
āŖ{ε-closure(p) | p ā Ī“(q, ε)}
Extended to sets: ε-closure(S) = āŖ{ε-closure(q) | q ā S}
Subset Construction (NFA ā DFA)
- Start state = ε-closure({qā})
- For each DFA state S and symbol a:
Ī“_DFA(S, a) = ε-closure(āŖ{Ī“_NFA(q,a) | qāS}) - Mark S as accepting if S ā© F ā ā
- Repeat until no new states
DFA Minimization (Table-Filling)
- Base: Mark (p,q) if exactly one is in F
- Inductive: Mark (p,q) if āa: (Ī“(p,a), Ī“(q,a)) is marked
- Repeat until no new marks
- Merge all unmarked pairs into equivalence classes
Myhill-Nerode Theorem
A language L is regular iff the Myhill-Nerode equivalence relation ā”_L has finitely many equivalence classes.
The number of equivalence classes equals the number of states in the minimal DFA for L.
Pumping Lemma
If L is regular, ā pumping length p such that every string w ā L with |w| ā„ p can be written as w = xyz where:
- |y| ā„ 1 (y is non-empty)
- |xy| ⤠p
- āi ā„ 0: xy^i z ā L
Closure Properties
Regular languages are closed under:
- Union: Lā āŖ Lā
- Concatenation: Lā Ā· Lā
- Kleene Star: L*
- Complement: LĢ
- Intersection: Lā ā© Lā
- Reversal: L^R