Difference between revisions of "Mock AIME 1 2006-2007 Problems/Problem 11"

m
m (spelling)
Line 17: Line 17:
 
*[[Mock AIME 1 2006-2007]]
 
*[[Mock AIME 1 2006-2007]]
  
[[Category:Intemediate Combinatorics Problems]]
+
[[Category:Intermediate Combinatorics Problems]]

Revision as of 11:55, 30 September 2006

Problem

Let $\mathcal{S}_{n}$ be the set of strings with only 0's or 1's with length $n$ such that any 3 adjacent place numbers sum to at least 1. For example, $00100$ works, but $10001$ does not. Find the number of elements in $\mathcal{S}_{11}$.

Solution

We will solve this problem by constructing a recursion satisfied by $\mathcal{S}_n$.

Let $\displaystyle A_1(n)$ be the number of such strings of length $n$ ending in 1, $A_2(n)$ be the number of such strings of length $n$ ending in a single 0 and $A_3(n)$ be the number of such strings of length $n$ ending in a double zero. Then $A_1(1) = 1, A_2(1) = 1, A_3(1) = 0, A_1(2) = 2, A_2(2) = 1$ and $A_3(2) = 1$.

Note that $\mathcal{S}_n = A_1(n) + A_2(n) + A_3(n)$. For $n \geq 2$ we have $A_1(n) = \mathcal{S}_{n - 1} = A_1(n - 1) + A_2(n - 1) + A_3(n - 1)$ (since we may add a 1 to the end of any valid string of length $n - 1$ to get a valid string of length $n$), $A_2(n) = A_1(n -1)$ (since every valid string ending in 10 can be arrived at by adding a 0 to a string ending in 1) and $A_3(n) = A_2(n - 1)$ (since every valid string ending in 100 can be arrived at by adding a 0 to a string ending in 10).

Thus $\mathcal{S}_n = A_1(n) + A_2(n) + A_3(n) = \mathcal{S}_{n - 1} + A_1(n - 1) + A_2(n - 1) = \mathcal{S}_{n -1} + \mathcal{S}_{n - 2} + A_1(n - 2) = \mathcal{S}_{n - 1} + \mathcal{S}_{n -2} + \mathcal{S}_{n - 3}$. Then using the initial values $\mathcal{S}_1 = 1, \mathcal{S}_2 = 2, \mathcal{S}_3 = 4$ we can easily compute that $\mathcal{S}_{11} = 504$.