GATE Computer ScienceVery hardGATE CS (PYQ pattern)

How many binary strings of length 14 contain neither 010 nor 101 as a substring?

  1. A. 1180
  2. B. 754
  3. C. 1220
  4. D. 2187

Correct answer: C. 1220

Every run (maximal block of equal digits) except the first and last must have length ≥ 2; a run-length count over all compositions of 14 gives 1220.

More Discrete Mathematics questions

Exams that ask this topic