Skip to main content

2015 AIME II Problem 12

Problem 12 of 15HarderCombinatorics

There are 210=10242^{10} = 1024 possible 1010-letter strings in which each letter is either an A or a B. Find the number of such strings that do not have more than 33 adjacent letters that are identical.

Your answer

Integer from 0 to 999
Show solution

Solution

The condition says every maximal run of identical letters has length at most 3.3. Let sns_n count the valid strings of length nn whose first letter is A; by symmetry the answer is 2s10.2s_{10}. Removing the first run (of length 1,1, 2,2, or 33) leaves a valid shorter string beginning with B, so sn=sn−1+sn−2+sn−3.s_n = s_{n-1} + s_{n-2} + s_{n-3}. Starting from s1=1,s_1 = 1, s2=2,s_2 = 2, s3=4,s_3 = 4, the sequence runs 7,13,24,44,81,149,274,7, 13, 24, 44, 81, 149, 274, so s10=274.s_{10} = 274. The number of valid strings is 2⋅274=548.2 \cdot 274 = 548.
AoPS wiki

Tagged: recursive counting · arrangements with restrictions

More practice