GATE Computer ScienceVery hardGATE CS (PYQ pattern)

An ε-NFA over {a, b} has states 0–4, start state 0 and accepting state 3, with moves δ(0, a) = {1}, δ(1, b) = {2}, δ(2, a) = {0, 3}, δ(3, b) = {3}, δ(4, a) = {4}, δ(4, b) = {2} and ε-moves 0 → 4 and 3 → 0 (a missing move means no transition). The subset construction starts from the ε-closure of {0}. How many DFA states are reachable (count ∅ if it arises), and how many states does the minimal DFA have?

  1. A. 8 and 5
  2. B. 7 and 5
  3. C. 8 and 8
  4. D. 8 and 6

Correct answer: A. 8 and 5

Start {0, 4}. Reachable subsets: {0,4}, {1,4}, {2}, {4}, {0,3,4} (a from {2} gives {0,3} and the ε-moves add 4), ∅, {0,2,3,4}, {0,1,3,4}: 8 including ∅. The accepting ones are the 3 subsets containing 3. Partition refinement then merges equivalent states, leaving a minimal DFA of 5 states (∅ survives as the dead state).

More Compiler Design questions

Exams that ask this topic