GATE Computer ScienceModerateGATE CS
How many binary strings of length 8 contain no three consecutive 0s?
- A. 149
- B. 144
- C. 136
- D. 155
Correct answer: A. 149
Let a(n) = a(n−1) + a(n−2) + a(n−3), by looking at the trailing block 1, 10 or 100. With a(1) = 2, a(2) = 4, a(3) = 7 this gives 13, 24, 44, 81, 149 for n = 8.
More Discrete Mathematics questions
- The divisors of 360 are ordered by divisibility and drawn as a Hasse diagram. How many edges does the diagram have?
- A sequence of 82 distinct real numbers is given. Which is the largest L such that EVERY such sequence is guaranteed to contain an…
- A permutation of {1, 2, …, 10} is chosen uniformly at random. What is the expected number of cycles in its cycle decomposition (fixed…
- How many perfect matchings does the 4-dimensional hypercube graph Q₄ (16 vertices, two vertices adjacent when their 4-bit labels differ in…
- In how many ways can a 4 × 6 board be completely tiled with 1 × 2 dominoes (equivalently, how many perfect matchings does the 4 × 6 grid…
- What is the maximum number of edges in a simple graph with 10 vertices that does not contain K₄ (the complete graph on 4 vertices) as a…