Placement AptitudeVery hardAmazon OA · CAT
How many binary strings of length 7 contain three consecutive 1's somewhere?
- A. 40
- B. 81
- C. 47
- D. 48
Correct answer: C. 47
Count the complement: strings with no 111 satisfy a(n) = a(n − 1) + a(n − 2) + a(n − 3) with a(1) = 2, a(2) = 4, a(3) = 7, giving 13, 24, 44, 81 for n = 4 to 7. So 128 − 81 = 47.
Practise more Permutations, Combinations and Probability (Placement) questionsPermutations, Combinations and Probability (Placement): notes and key points
More Permutations, Combinations and Probability (Placement) questions
- Three different numbers are chosen at random from 1, 2, …, 10. What is the probability that they can be the side lengths of a…
- Three vertices of a regular octagon are chosen at random. What is the probability that the triangle formed is acute-angled?
- How many points (x, y) with integer coordinates satisfy |x| + |y| ≤ 3?
- How many points (x, y) with integer coordinates lie strictly inside the circle x² + y² = 10?
- Two different numbers are chosen at random from 1, 2, …, 100. What is the probability that their product ends in 0?
- How many of the numbers from 1 to 1000 contain the digit 7 at least once?