GATE Computer ScienceVery hardGATE CS (PYQ pattern)

An ε-NFA over {a, b} has states 0, 1, 2, 3, start state 0 and accepting set {0,3}. Transitions: δ(0): a→{1,2}, b→{3}, ε→∅; δ(1): a→{2}, b→{0,1}, ε→{2}; δ(2): a→{1}, b→{0}, ε→∅; δ(3): a→∅, b→{0,3}, ε→{2}. How many of the 32 strings of length 5 over {a, b} does it accept?

  1. A. 20
  2. B. 13
  3. C. 16
  4. D. 12

Correct answer: C. 16

Convert to a DFA (subset construction with ε-closure) and run all 32 strings of length 5: 16 end in an accepting subset. Counting accepting paths instead of strings would overcount.

More Theory of Computation questions

Exams that ask this topic