Mathematics (JEE)ModerateCodeforces Div2 C

How many binary strings of length 7 contain neither the substring 000 nor the substring 111?

  1. A. 42
  2. B. 128
  3. C. 81
  4. D. 84

Correct answer: A. 42

Enumerating all 128 strings and rejecting any with three equal consecutive bits leaves 42.

More Permutations, Combinations and Probability questions

Exams that ask this topic