Mathematics (JEE)HardCodeforces Div2 C
How many strings of length 5 over {1, 2, 3} have every pair of adjacent symbols differing by at most 1?
- A. 243
- B. 81
- C. 99
- D. 128
Correct answer: C. 99
Track the number of valid strings ending in 1, 2 or 3: the counts (1,1,1), (2,3,2), (5,7,5), (12,17,12), (29,41,29) give a total of 99 at length 5.
Practise more Permutations, Combinations and Probability questionsPermutations, Combinations and Probability: notes and key points
More Permutations, Combinations and Probability questions
- How many permutations of {1, 2, 3, 4, 5, 6} have exactly two descents, that is, exactly two positions i with p(i) > p(i+1)?
- How many permutations of {1, 2, 3, 4, 5, 6} have exactly 3 cycles in their cycle decomposition (fixed points count as cycles)?
- How many trailing zeros does 150! have when written in base 12?
- A 3 × 4 rectangular board is tiled completely by 1 × 2 dominoes (in either orientation). How many tilings are possible?
- A 3 × 6 rectangular board is tiled completely by 1 × 2 dominoes. How many tilings are possible?
- A 1 × 7 strip is tiled with single squares and 1 × 2 dominoes. How many tilings are possible?