返回题库

AIME 2008 I · 第 11 题

AIME 2008 I — Problem 11

专题
Contest Math
难度
L4
来源
AIME

题目详情

Problem

Consider sequences that consist entirely of AA's and BB's and that have the property that every run of consecutive AA's has even length, and every run of consecutive BB's has odd length. Examples of such sequences are AAAA, BB, and AABAAAABAA, while BBABBBAB is not such a sequence. How many such sequences have length 14?

解析

Solution 1a

Let ana_n and bnb_n denote, respectively, the number of sequences of length nn ending in AA and BB. If a sequence ends in an AA, then it must have been formed by appending two AAs to the end of a string of length n2n-2. If a sequence ends in a B,B, it must have either been formed by appending one BB to a string of length n1n-1 ending in an AA, or by appending two BBs to a string of length n2n-2 ending in a BB. Thus, we have the recursions

an=an2+bn2bn=an1+bn2\begin{aligned} a_n &= a_{n-2} + b_{n-2}\\ b_n &= a_{n-1} + b_{n-2} \end{aligned} By counting, we find that a1=0,b1=1,a2=1,b2=0a_1 = 0, b_1 = 1, a_2 = 1, b_2 = 0.

nanbnnanbn101861021091111312101621411112227533123743624134964765148092\begin{array}{|r||r|r|||r||r|r|} \hline n & a_n & b_n & n & a_n & b_n\\ \hline 1&0&1& 8&6&10\\ 2&1&0& 9&11&11\\ 3&1&2& 10&16&21\\ 4&1&1& 11&22&27\\ 5&3&3& 12&37&43\\ 6&2&4& 13&49&64\\ 7&6&5& 14&80&92\\ \hline \end{array} Therefore, the number of such strings of length 1414 is a14+b14=172a_{14} + b_{14} = \boxed{172}.

Solution 1b

Let ana_n and bnb_n denote, respectively, the number of sequences of length nn ending in AA and BB.

Additionally, let tnt_n denote the total number of sequences of length nn. Then, tn=an+bnt_n=a_n+b_n, as the total amount of sequences of length nn consists of the sequences of length nn ending in AA and the sequences of length nn ending in BB.

an=an2+bn2bn=an1+bn2\begin{aligned} a_n &= a_{n-2} + b_{n-2}\\ b_n &= a_{n-1} + b_{n-2} \end{aligned} The recursion for ana_n tells us that an=an2+bn2a_n=a_{n-2}+b_{n-2}. However, this is also the definition for tn2t_{n-2}. Therefore, an=tn2a_n=t_{n-2}.

We also know from our recursion for bnb_n that bn=an1+bn2b_n=a_{n-1}+b_{n-2}. Substituting for ana_n and bnb_n into our recursion for tnt_n gives us tn=tn2+an1+bn2t_n=t_{n-2}+a_{n-1}+b_{n-2}.

Furthermore, note that since an=tn2a_n=t_{n-2}, an1=tn3a_{n-1}=t_{n-3}. Furthermore, using our definition for tn2t_{n-2}, we can rewrite bn2b_{n-2} as tn2an2t_{n-2}-a_{n-2}. Substituting for an1a_{n-1} and bn2b_{n-2} into our recursion for tnt_n gives us tn=tn2+tn3+tn2an2t_n=t_{n-2}+t_{n-3}+t_{n-2}-a_{n-2}.

Finally, note that since an=tn2a_n=t_{n-2}, an2=tn4a_{n-2}=t_{n-4}. Substituting for an2a_{n-2} into our recursion for tnt_n gives us tn=2tn2+tn3tn4t_n=2t_{n-2}+t_{n-3}-t_{n-4}. We now have a recursion only in terms of tt.

By counting, we find that t1=1t_1=1, t2=1t_2=1, t3=3t_3=3, and t4=2t_4=2.

ntnntn1181621922331037421149561280661311371114172\begin{array}{|r|r||r|r|} \hline n & t_n & n & t_n\\ \hline 1&1&8&16\\ 2&1&9&22\\ 3&3&10&37\\ 4&2&11&49\\ 5&6&12&80\\ 6&6&13&113\\ 7&11&14&172\\ \hline \end{array} Therefore, the number of such sequences of length 14 is 172\boxed{172}.

Solution 1c

Define AnA_{n} being sequences with the first letter being A, BnB_{n} being sequences with the first letter being B.

A14A_{14} = B12B_{12} + B10B_{10} + B8B_{8} + B6B_{6} + B4B_{4} + B2B_{2} (1) B14B_{14} = A13A_{13} + A11A_{11} + A9A_{9} + A7A_{7} + A5A_{5} + A3A_{3} + A1A_{1} (2)

We also know that

A12A_{12} = B10B_{10} + B8B_{8} + B6B_{6} + B4B_{4} + B2B_{2} B12B_{12} = A11A_{11} + A9A_{9} + A7A_{7} + A5A_{5} + A3A_{3} + A1A_{1}

We can Plug in A12A_{12} and B12B_{12} into (1) and (2) to get

A14A_{14} = B12B_{12} + A12A_{12} B14B_{14} = A13A_{13} + B12B_{12}

We have the equation and the rest of the solutions are in Solution 1a.

Note: Only solution 1c is written by me. 1a and 1b are not written by me.

~toub3490

Solution 2

We replace "14" with "2n2n". We first note that we must have an even number of chunks of BB's, because of parity issues. We then note that every chunk of BB's except the last one must end in the sequence BAABAA, since we need at least two AA's to separate it from the next chunk of BB's. The last chunk of BB's must, of course, end with a BB. Thus our sequence must look like this :

A’sB’sBAAA’sB’sBAAA’sB’sBA’s,\boxed{\quad A\text{'s} \quad} \boxed{\quad B\text{'s} \quad} BAA \boxed{\quad A\text{'s} \quad} \cdots \boxed{\quad B\text{'s} \quad}BAA \boxed{\quad A\text{'s} \quad} \boxed{\quad B\text{'s} \quad} B \boxed{\quad A\text{'s} \quad} , where each box holds an even number of letters (possibly zero).

If we want a sequence with 2k2k chunks of BB's, then we have (2n6k+2)(2n - 6k + 2) letters with which to fill the boxes. Since each box must have an even number of letters, we may put the letters in the boxes in pairs. Then we have (n3k+1)(n - 3k + 1) pairs of letters to put into 4k+14k + 1 boxes. By a classic balls-and-bins argument, the number of ways to do this is

(n+k+14k).\binom{n + k + 1}{4k} . It follows that the total number of desirable sequences is

k(n+k+14k).\sum_k \binom{n + k + 1}{4k} . For n=7n = 7, this evaluates as (80)+(94)+(108)=1+126+45=172\binom{8}{0} + \binom{9}{4} + \binom{10}{8} = 1 + 126 + 45 = \boxed{172}.

Solution 3

There must be an even amount of runs of consecutive BBs due to parity. Thus, we can split this sequence into the following cases: AA, BAABBAAB, AABAABAABAAB, BAABAABAABAA, AABAABAAAABAABAA, BAABAABAABBAABAABAAB, AABAABAABAABAABAABAABAAB, BAABAABAABAABAABAABAABAA, and AABAABAABAABAAAABAABAABAABAA, in which the amount of letters in one run does not necessarily represent the amount of letters there can be.

For the first case and the last case, there is only one possible sequence of letters.

For all other cases, we can insert two of the same letter at a time into a run that has the exact same letter. For example, for the second case, we can insert two AAs and make the sequence BAAAABBAAAAB. There are three "slots" in which we can insert two additional letters in, and we must insert five groups of new letters. By stars and bars, the number of ways for the second case is (72)=21\binom{7}{2}=21.

Applying this logic to all of the other cases gives us (73)\binom{7}{3}, (73)\binom{7}{3}, (74)\binom{7}{4}, (86)\binom{8}{6}, (81)\binom{8}{1}, and (81)\binom{8}{1}. Adding 1+(72)\binom{7}{2}+(73)\binom{7}{3}+(73)\binom{7}{3}+(74)\binom{7}{4}+(86)\binom{8}{6}+(81)\binom{8}{1}+(81)\binom{8}{1} gives us the answer 172\boxed{172}.