GATE Computer ScienceVery hardGATE CSE · NIELIT

How many strings of length 12 over {a, b} contain neither aba nor bbb as a substring?

  1. A. 189
  2. B. 196
  3. C. 184
  4. D. 204

Correct answer: A. 189

Count with the transfer matrix of the 4-state automaton that tracks the relevant suffix (or enumerate all 4096 strings): 189.

More Theory of Computation questions

Exams that ask this topic