Home › GATE CSE › computerscience › Theory of Computation › An NFA with $n$ states can be converted to an eq…
An NFA with $n$ states can be converted to an equivalent DFA. The resulting DFA has AT MOST how many states?
A$n$ states (same as NFA)
B$n^2$ states
C$2^n$ states (exponential blow-up)
D$n!$ states
Answer & Solution
Correct answer: C. $2^n$ states (exponential blow-up)
1. The SUBSET (powerset) CONSTRUCTION converts an NFA to an equivalent DFA.
2. Each state of the DFA represents a SUBSET of the NFA's states (the set of NFA states the NFA could be in after reading the input).
3. The number of subsets of an $n$-element set is $2^n$. So the DFA has at most $2^n$ states.
4. For SOME languages, this exponential blow-up is unavoidable — there exist NFAs with $n$ states whose minimal equivalent DFA needs $2^n$ states.
5. For OTHER languages, the DFA may be much smaller (e.g. for a single-state NFA the DFA has 1 state).
6. Options A, B, D underestimate the bound.
_Source: Jeff Erickson, "Models of Computation", §2.6 (Powerset construction)._
Related questions
Which class of grammars generates ALL recursively enumerable languages?What is a LEFTMOST DERIVATION?Which of the following languages is CONTEXT-FREE?Consider the grammar $S \to (S) \mid SS \mid \varepsilon$. The language generated isEvery regular language is also context-free. The PROOF construction isThe CYK algorithm parses a CFG in CNF. Its time complexity for a string of length $n$ isA LEFT-RECURSIVE rule in a CFG has the form $A \to A\alpha$ for some non-empty $\alpha$. WContext-free languages are CLOSED under which of the following operations?