GATE Computer ScienceVery hardGATE CS (PYQ pattern)

How many binary strings of length 14 contain neither 00 nor 111 as a substring?

  1. A. 53
  2. B. 86
  3. C. 107
  4. D. 377

Correct answer: B. 86

A DP on the ending (… 1, … 11, … 0) shows the counts satisfy a linear recurrence; brute force over all 2¹⁴ strings gives 86.

More Discrete Mathematics questions

Exams that ask this topic