GATE Computer ScienceVery hardGATE CSE

A DFA over {a, b} has states 0–3, start 0 and accepting state 3. Transitions: 0 –a→ 1, 0 –b→ 0; 1 –a→ 2, 1 –b→ 0; 2 –a→ 2, 2 –b→ 3; 3 –a→ 1, 3 –b→ 3. How many strings of length 10 does it accept?

  1. A. 263
  2. B. 243
  3. C. 255
  4. D. 285

Correct answer: C. 255

Run the transition-count recurrence (matrix power) from state 0 for 10 steps and sum the counts in state 3: 255.

More Theory of Computation questions

Exams that ask this topic