Difference between revisions of "2015 AMC 12A Problems/Problem 22"
m (→Solution) |
(→Problem) |
||
Line 1: | Line 1: | ||
==Problem== | ==Problem== | ||
− | For each positive integer <math>n</math>, let <math>S(n)</math> be the number of sequences of length <math>n</math> consisting solely of the letters <math>A</math> and <math>B</math>, with no more than three <math>A</math>s in a row and no more than three <math>B</math>s in a row. What is the remainder when <math>S(2015)</math> is divided by 12? | + | For each positive integer <math>n</math>, let <math>S(n)</math> be the number of sequences of length <math>n</math> consisting solely of the letters <math>A</math> and <math>B</math>, with no more than three <math>A</math>s in a row and no more than three <math>B</math>s in a row. What is the remainder when <math>S(2015)</math> is divided by <math>12</math>? |
<math> \textbf{(A)}\ 0\qquad\textbf{(B)}\ 4\qquad\textbf{(C)}\ 6\qquad\textbf{(D)}}\ 8\qquad\textbf{(E)}\ 10 </math> | <math> \textbf{(A)}\ 0\qquad\textbf{(B)}\ 4\qquad\textbf{(C)}\ 6\qquad\textbf{(D)}}\ 8\qquad\textbf{(E)}\ 10 </math> |
Revision as of 00:36, 5 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
?
$\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 of increase at an exponential rate. 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
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
.