GATE Computer ScienceModerateGATE CS

How many binary strings of length 8 contain no three consecutive 0s?

  1. A. 149
  2. B. 144
  3. C. 136
  4. D. 155

Correct answer: A. 149

Let a(n) = a(n−1) + a(n−2) + a(n−3), by looking at the trailing block 1, 10 or 100. With a(1) = 2, a(2) = 4, a(3) = 7 this gives 13, 24, 44, 81, 149 for n = 8.

More Discrete Mathematics questions

Exams that ask this topic