Mathematics (JEE)ModerateCodeforces Div2 C
How many binary strings of length 7 contain neither the substring 000 nor the substring 111?
- A. 42
- B. 128
- C. 81
- D. 84
Correct answer: A. 42
Enumerating all 128 strings and rejecting any with three equal consecutive bits leaves 42.
Practise more Permutations, Combinations and Probability questionsPermutations, Combinations and Probability: notes and key points
More Permutations, Combinations and Probability questions
- How many permutations p of {1, 2, 3, 4, 5} have exactly one interior peak, meaning exactly one index i in {2, 3, 4} with p(i-1) < p(i) >…
- How many 3-element subsets of {1, 2, ..., 9} have elements summing to exactly 15?
- How many functions f from {0, 1, 2, 3} to itself satisfy f(x) != x and f(x) != x + 1 (addition mod 4) for every x?
- How many permutations of {1, 2, ..., 7} have exactly 2 cycles in cycle notation (fixed points count as cycles)?
- How many nonempty subsets of {1, 2, ..., 8} have an element sum divisible by 6?
- How many 4-element subsets of {1, 2, ..., 12} contain no two elements whose difference is exactly 4?