Mathematics (JEE)Very hardGATE CS
How many strings of length 6 over {A, B, C} contain neither the substring AA nor the substring BB?
- A. 243
- B. 239
- C. 300
- D. 192
Correct answer: B. 239
Track the last letter with a recurrence: a string may append C after anything, but A or B only after a different letter. Option 243 is 3⁵ and ignores both restrictions.
Practise more Permutations, Combinations and Probability questionsPermutations, Combinations and Probability: notes and key points
More Permutations, Combinations and Probability questions
- How many binary strings of length 7 have no two adjacent 1s and begin with 0?
- How many binary strings of length 6 avoid three equal consecutive digits (no substring 000 or 111)?
- How many 4-digit strings over the digits 0 to 9 have their digits in non-decreasing order (each digit at least as large as the one before…
- How many words of length 6 over {a, b}, containing exactly two a's, are palindromes?
- How many words of length 5 over the alphabet {A, B, C, D} use every one of the four letters at least once?
- How many words of length 4 over {A, B, C} contain all three letters at least once?