GATE Computer ScienceVery hardGATE CS (PYQ pattern)
How many binary strings of length 14 contain neither 010 nor 101 as a substring?
- A. 1180
- B. 754
- C. 1220
- 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
- In how many ways can a 2 × 10 rectangle be tiled with 1 × 2 dominoes (placed either way) and 2 × 2 squares?
- Ten distinct lines are drawn in the plane so that exactly 4 of them are mutually parallel, no other two are parallel and no three lines…
- 100 people stand in a circle numbered 1 to 100. Starting with person 1, every second person still in the circle is eliminated (1 goes…
- 14 identical sweets are distributed among 4 children A, B, C, D so that each child gets at least 1 and at most 5. In how many…
- How many distinct arrangements of the letters of ABRACADABRA have no two identical letters adjacent?
- How many odd numbers appear in rows 0 to 99 of Pascal's triangle (row n being C(n,0), …, C(n,n))?