Difference between revisions of "2015 AMC 12A Problems/Problem 22"
m (→Solution) |
m (→Solution) |
||
Line 11: | Line 11: | ||
Let us define <math>A(n)</math> as the number of sequences of length <math>n</math> ending with an <math>A</math>, and <math>B(n)</math> as the number of sequences of length <math>n</math> ending in <math>B</math>. Note that <math>A(n) = B(n)</math> and <math>S(n) = A(n) + B(n)</math>, so <math>S(n) = 2A(n)</math>. | Let us define <math>A(n)</math> as the number of sequences of length <math>n</math> ending with an <math>A</math>, and <math>B(n)</math> as the number of sequences of length <math>n</math> ending in <math>B</math>. Note that <math>A(n) = B(n)</math> and <math>S(n) = A(n) + B(n)</math>, so <math>S(n) = 2A(n)</math>. | ||
− | For a sequence of length <math>n</math> ending in <math>A</math>, it must be a string of <math>A</math>s appended onto a sequence | + | For a sequence of length <math>n</math> ending in <math>A</math>, it must be a string of <math>A</math>s appended onto a sequence ending in <math>B</math> of length <math>n-1, n-2, \text{or}\ n-3</math>. So we have the recurrence <cmath>A(n) = B(n-1) + B(n-2) + B(n-3) = A(n-1) + A(n-2) + A(n-3).</cmath> |
We can thus begin calculating values of <math>A(n)</math>. We see that the sequence goes (starting from <math>A(0) = 1</math>): <math>1,1,2,4,7,13,24...</math> | We can thus begin calculating values of <math>A(n)</math>. We see that the sequence goes (starting from <math>A(0) = 1</math>): <math>1,1,2,4,7,13,24...</math> |
Revision as of 23:29, 4 February 2015
Problem
For each positive integer , let be the number of sequences of length consisting solely of the letters and , with no more than three s in a row and no more than three s in a row. What is the remainder when is divided by 12?
$\textbf{(A)}\ 0\qquad\textbf{(B)}\ 4\qquad\textbf{(C)}\ 6\qquad\textbf{(D)}}\ 8\qquad\textbf{(E)}\ 10$ (Error compiling LaTeX. Unknown error_msg)
Solution
One method of approach is to find a recurrence for .
Let us define as the number of sequences of length ending with an , and as the number of sequences of length ending in . Note that and , so .
For a sequence of length ending in , it must be a string of s appended onto a sequence ending in of length . So we have the recurrence
We can thus begin calculating values of . We see that the sequence goes (starting from ):
A problem arises though - the values soon get to be far to large. Notice however, that we need only find . In fact, we can abuse the fact that and only find . Going one step further, we need only find the period of and to find .
Here are the values of , starting with :
Since the period is and , .
Similarly, here are the values of , starting with :
Since the period is and , .
Knowing that and , we see that , and . Hence, the answer is .