GATE Computer ScienceModerateGATE CSE · NIELIT

How many strings of length 7 over {a, b} do not contain aa as a substring?

  1. A. 21
  2. B. 33
  3. C. 34
  4. D. 55

Correct answer: C. 34

Counts follow Fibonacci: lengths 1..7 give 2, 3, 5, 8, 13, 21, 34.

More Theory of Computation questions

Exams that ask this topic