Difference between revisions of "Mock AIME 1 2006-2007 Problems/Problem 11"
m |
(→Solution) |
||
Line 2: | Line 2: | ||
Let <math>\mathcal{S}_{n}</math> be the set of strings with only 0's or 1's with length <math>n</math> such that any 3 adjacent place numbers sum to at least 1. For example, <math>00100</math> works, but <math>10001</math> does not. Find the number of elements in <math>\mathcal{S}_{11}</math>. | Let <math>\mathcal{S}_{n}</math> be the set of strings with only 0's or 1's with length <math>n</math> such that any 3 adjacent place numbers sum to at least 1. For example, <math>00100</math> works, but <math>10001</math> does not. Find the number of elements in <math>\mathcal{S}_{11}</math>. | ||
==Solution== | ==Solution== | ||
− | { | + | Let <math>A_1(n)</math> be the number of such strings of length <math>n</math> ending in 1, <math>A_2(n)</math> be the number of such strings of length <math>n</math> ending in a single 0 and <math>A_3(n)</math> be the number of such strings of length <math>n</math> ending in a double zero. Then <math>A_1(1) = 1, A_2(1) = 1, A_3(1) = 0, A_1(2) = 2, A_2(2) = 1</math> and <math>A_3(2) = 1</math>. Note that <math>S_n = A_1(n) + A_2(n) + A_3(n)</math>. For <math>n \geq 2</math> we have <math>A_1(n) = S_{n - 1} = A_1(n - 1) + A_2(n - 1) + A_3(n - 1)</math> (since we may add a 1 to the end of any valid string of length <math>n - 1</math> to get a valid string of length <math>n</math>), <math>A_2(n) = A_1(n -1)</math> (since every valid string ending in 10 can be arrived at by adding a 0 to a string ending in 1) and <math>A_3(n) = A_2(n - 1)</math> (since every valid string ending in 100 can be arrived at by adding a 0 to a string ending in 10). |
+ | Thus <math>S_n = A_1(n) + A_2(n) + A_3(n) = S_{n - 1} + A_1(n - 1) + A_2(n - 1) = S_{n -1} + S_{n - 2} + A_1(n - 2) = S_{n - 1} + S_{n -2} + S_{n - 3}</math>. Then using the initial values <math>S_1 = 1, S_2 = 2, S_3 = 4</math> we can easily compute that <math>S_11 = 504</math>. | ||
---- | ---- | ||
Revision as of 17:04, 23 August 2006
Problem
Let be the set of strings with only 0's or 1's with length such that any 3 adjacent place numbers sum to at least 1. For example, works, but does not. Find the number of elements in .
Solution
Let be the number of such strings of length ending in 1, be the number of such strings of length ending in a single 0 and be the number of such strings of length ending in a double zero. Then and . Note that . For we have (since we may add a 1 to the end of any valid string of length to get a valid string of length ), (since every valid string ending in 10 can be arrived at by adding a 0 to a string ending in 1) and (since every valid string ending in 100 can be arrived at by adding a 0 to a string ending in 10).
Thus . Then using the initial values we can easily compute that .