GATE Computer ScienceVery hardGATE CS (PYQ pattern)

A DFA over {a, b} has states 0 to 5, transitions 0: a→5, b→0; 1: a→5, b→1; 2: a→1, b→1; 3: a→5, b→3; 4: a→2, b→3; 5: a→4, b→4. Start 0, accepting {1,2}. How many of the 128 strings of length 7 over {a, b} does it accept?

  1. A. 50
  2. B. 36
  3. C. 64
  4. D. 42

Correct answer: D. 42

Propagate path counts through the transition table for 7 steps and add the counts of the accepting states: 42.

More Theory of Computation questions

Exams that ask this topic