GATE Computer ScienceVery hardGATE CS (PYQ pattern)
How many binary strings of length 14 contain neither 00 nor 111 as a substring?
- A. 53
- B. 86
- C. 107
- 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
- How many binary strings of length 14 contain neither 010 nor 101 as a substring?
- 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?