12.conversion of NDFA To DFA
12.conversion of NDFA To DFA
Automaton (DFA) involves transforming the NFA, which may have multiple possible
transitions for a given input symbol, into a DFA, where each state has exactly one transition for
each input symbol. This process ensures that the DFA can simulate the behavior of the NFA
while adhering to the deterministic constraints.
The most common method for converting an NFA to a DFA is the subset construction
algorithm (also known as the powerset construction). Here's a step-by-step guide:
States: QNQ_NQN
Input Alphabet: Σ\SigmaΣ
Transition Function: δN:QN×Σ→2QN\delta_N: Q_N \times \Sigma \to 2^{Q_N}δN
:QN×Σ→2QN
Initial State: q0Nq_{0N}q0N
Accepting States: FNF_NFN
States: Each state in the DFA corresponds to a subset of the states in the NFA.
Input Alphabet: The same as the NFA's input alphabet.
Transition Function: Defined based on the subsets of NFA states.
Initial State: The subset containing the NFA's initial state and any states reachable via ε-
transitions.
Accepting States: Any subset that contains at least one of the NFA's accepting states.
Initial State of the DFA: Compute the ε-closure of the initial state of the NFA. The ε-
closure of a state is the set of states reachable from it using only ε-transitions.
Compute the transitions for each input symbol. For an input symbol aaa, find the set of
states reachable from each state in the subset under aaa. This involves:
o For each state in the subset, look up the NFA transition function δN\delta_NδN to
determine the set of next states.
o Take the union of these sets to get the new subset of states.
o Compute the ε-closure of this new set of states to handle any ε-transitions.
A subset of states in the DFA is an accepting state if it contains at least one accepting
state from the NFA.
Example
Resulting DFA:
This DFA simulates the behavior of the original NFA and accepts the same set of strings. The
subset construction algorithm provides a systematic way to create a DFA that recognizes the
same language as a given NFA.