DFA Construction, NFA Conversion & Minimization
“5-tuple formalisms, trap states, subset powerset construction, and minimal state proofs.”
1.Formal Definition of Deterministic Finite Automata (DFA)
§ 1.1.A Deterministic Finite Automaton (DFA) is a 5-tuple M = (Q, \Sigma, \delta, q_0, F), where:
1. Q: A finite, non-empty set of internal states.
2. \Sigma: A finite alphabet of input symbols.
3. \delta: The transition function mapping Q × \Sigma \to Q (strictly deterministic: exactly one next state for every state-symbol pair).
4. q_0 \in Q: The unique initial start state.
5. F \subseteq Q: The set of accepting (final) states.
Language of a DFA:
L(M) = { w \in \Sigma^ \mid \delta^(q_0, w) \in F }, where \delta^ is the extended transition function defined inductively by \delta^(q, \epsilon) = q and \delta^(q, wa) = \delta(\delta^(q, w), a).
NFA vs DFA Equivalence:
In a Non-deterministic Finite Automaton (NFA), the transition function maps Q × (\Sigma \cup {\epsilon}) \to 2^Q (the powerset of states). Every NFA with n states can be converted into an equivalent DFA via the Subset Construction Algorithm with at most 2^n states.
For binary numbers divisible by k: The minimal DFA requires EXACTLY k states (representing remainders 0, 1, ..., k-1). For strings where the count of a symbol modulo k is r: Exactly k states. For conditions involving both length modulo m and count modulo n: Exactly m × n states if \gcd(m, n) = 1 in the cross-product automaton!
2. GATE Worked Numerical: Minimal DFA State Counting
Do not forget the Dead / Trap State! In DFAs, every state MUST have defined transitions for every symbol in Sigma. An invalid prefix that can never lead to an accepting string must transition to a dead trap state.
Problem: Find the minimum number of states in a DFA accepting all binary strings over {0, 1} that start with '01' and end with '10'.
Step 1: Identify shortest valid string:
Can a string of length 3 satisfy both conditions simultaneously? '010' starts with '01' and ends with '10'! Minimum length = 3.
Step 2: Construct states tracking progress:
State 0 (q0, Start): Seen nothing. On '1' -> Dead state (q_dead), because the string must start with '0'. On '0' -> q1.
State 1 (q1): Seen '0'. On '0' -> Dead state (must start with '01'). On '1' -> q2.
State 2 (q2): Successfully started with '01'. Now we look for ending in '10'. Currently ends in '1'. On '1' -> stay in q2. On '0' -> q3.
State 3 (q3, Final): Started with '01' AND currently ends with '10'! Accept. If '0' arrives -> now ends with '00', not '10' -> go to q4 (seen '0' after valid start). If '1' arrives -> now ends in '1' -> back to q2.
State 4 (q4): Seen '0' after valid start. On '0' -> stay in q4. On '1' -> back to q2.
State 5 (q_dead): Trap state for invalid starting prefixes ('1...' or '00...').
Total Minimal States = 6 states (q0, q1, q2, q3, q4, q_dead).
3.Myhill-Nerode Table-Filling Minimization Algorithm
§ 1.3.Two states p, q \in Q in a DFA are equivalent (p \equiv q) if for all strings w \in \Sigma^, \delta^(p, w) \in F \iff \delta^*(q, w) \in F. If there exists even one string w such that one state lands in F and the other lands outside F, the states are distinguishable.
Table-Filling Algorithm Steps:
1. Construct a lower triangular matrix for all state pairs (p, q) with p \ne q.
2. Base Step (0-equivalence): Mark pair (p, q) with an 'X' if one state is in F and the other is in Q \setminus F.
3. Inductive Step (k-equivalence): For each unmarked pair (p, q), examine each symbol a \in \Sigma. If the transition pair (\delta(p, a), \delta(q, a)) is already marked with 'X', mark (p, q) with 'X'.
4. Repeat Step 3 until a full pass makes zero new marks.
5. All remaining unmarked pairs are equivalent and can be merged into single compound states.
Primary Academic References & Exam Sources
Every concept in Notes From a B.Tech Brain is synthesized from authoritative academic texts, seminal peer-reviewed research, verified exam archives, and renowned university lectures.
Curated for clarity, rigorous numerical solving, and semester excellence:
GATE-focused with clear minimal DFA construction and language classification.
Exam-pattern oriented with closure table drilling and decidability proofs.
Mathematically rigorous treatment for high-rank GATE aspirants.