第 448 题:(2015 AIME II, 12)
There are $2^{10} = 1024$ possible $10$-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 $3$ adjacent letters that are identical.
- A string is determined by its first letter and the lengths of its runs, a composition of $10$ into parts $1,2,3$.
- These compositions satisfy $c_n=c_{n-1}+c_{n-2}+c_{n-3}$, giving $1,2,4,7,13,24,44,81,149,274$ for $n=1,\dots,10$.
- So $2\cdot274=548$ strings. The answer is $\boxed{548}$.
There are $2^{9} = 512$ possible $9$-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 $3$ adjacent letters that are identical.