Solution 1
For each Bauman string of length 5 in which the first and last
letters are both A, the second and fourth letters are not A. For such Bauman strings, either the third letter is A, or the third letter is not A. Case 1: The third letter is A. In this case, the string is of the form AAA. There are 4 choices for the second letter (B,C,D, or E) and 4 choices for the fourth letter, and so there are 4×4=16 such Bauman strings. Case 2: The third letter is not A. In this case, the string is of the form AxA, where the third letter x is B,C,D, or E, and so there are 4 choices for the third letter. The second letter must be different than the third letter and must not be A, and so there are 3 choices for the second letter. Similarly, there are 3 choices for the fourth letter, and so there are 4×3×3=36 such Bauman strings. In total, the number of Bauman strings of length 5 in which the first and last letters are both A is 16+36=52. Solution 2 For each Bauman string of length 5 in which the first and last letters are both A, either the second and fourth letters are the same, or they are different. Case 1: The second and fourth letters are the same. In this case, the string is of the form AxxA. There are 4 choices for the second letter (B,C,D, or E) and 1 choice for the fourth letter since it is the same as the second letter. The third letter must be different than the second and fourth letters (which are the same) and so there are 4 choices for the third letter. Thus, there are 4×1×4=16 such Bauman strings. Case 2: The second and fourth letters are different. In this case, the string is of the form AxyA, where x and y represent different letters. There are 4 choices for the second letter (B,C,D, or E) and 3 choices for the fourth letter (it is different than the second letter and not A). The third letter must be different than the second and fourth letters (which are different) and so there are 3 choices for the third letter. Thus, there are 4×3×3=36 such Bauman strings. In total, the number of Bauman strings of length 5 in which the first and last letters are both A is 16+36=52. Solution 1 We may determine the number of Bauman strings of length 6 that contain more than one B indirectly. That is, we may subtract the number of Bauman strings that contain 0 B’s and the number of Bauman strings that contain exactly 1 B from the total number of Bauman strings of length 6. For a Bauman string of length 6 (with no restrictions), there are 5 choices for the first letter and 4 choices for each of the remaining letters, and so there are a total of 5×45=5120 such strings. For a Bauman string of length 6 that contains 0 B’s, there are 4 choices for the first letter and 3 choices for each of the remaining letters, and so there are a total of 4×35=972 such strings. Next, we count the number of Bauman strings that contain exactly 1 B. If the first letter of the string is a B, then there are 4 choices for the second letter and 3 choices for each of the remaining four letters. Similarly, if the last letter is a B, then there are 4 choices for the letter adjacent to the B and 3 choices for each of the remaining four letters. Thus, there are 1×4×34=324 strings that begin with a B and 324 strings that end with a B. If the second letter of the string is a B, then there are 4 choices for the first letter, 4 choices for the third letter, and 3 choices for each of the fourth, fifth and sixth letters. Thus, there are 4×1×4×33=432 such strings. Similarly, if the third, fourth or fifth letter in the string is a B, then there are 432 such strings. In total, there are 5120−972−2×324−4×432=1772 Bauman strings of length 6 that contain more than one B. Solution 2 A Bauman string of length 6 cannot contain more than 3 B’s (confirm for yourself why this is true before proceeding). We may determine the number of Bauman strings of length 6 that contain more than one B directly. That is, we may count the number of strings that contain exactly 3 B’s and the number of strings that contain exactly 2 B’s. Thus, there are two cases to consider. Case 1: The Bauman string has exactly 3 B’s In this case, the string must take one of four possible forms: BBB, BBB, BBB, BBB. We begin by counting the number of strings of the form BBB. There are 4 choices for the second letter (A,C,D, or E), 4 choices for the fourth letter, and 4 choices for the sixth letter, and so there are 43=64 such strings. Similarly, there are 43=64 strings of the form BBB. It is worth noting that BBB and BBB have identical forms when one is read left to right and the
other right to left.
We may call such pairs of forms symmetric, and recognize that
under the same restrictions, symmetric forms have an equal number of
Bauman strings.
For strings of the form BBB, there are 4 choices for the second letter, 4 choices for the fourth letter, and 3 choices for the fifth letter (since the fifth letter must be different than B and different than the fourth letter, which is not B), and so 42×3=48 such strings. Since BBB is symmetric to BBB, there are similarly 42×3=48 strings of this form. Thus, there are 2×64+2×48=224 Bauman strings with exactly 3 B’s. Case 2: The Bauman string has exactly 2 B’s In this case, the string must take one of ten possible forms. Eight of these occur in one of the following four symmetric pairs BB and BB, BB and BB, BB and BB, BB and BB and the final two forms (which are not a symmetric pair) are BB and BB. We begin by counting the number of strings of the form BB. There are 4 choices for the second letter (A,C,D, or E), 4 choices for the fourth letter, 3 choices for each of the fifth and sixth letters, and so there are 42×32=144 such strings. Similarly, there are 42×32=144 strings for each of the next five forms listed above, $BB,BB,BB, \, BB, and }
BB. For strings of the form


BB, there are 4 choices for the first letter, 4 choices for the third letter, 4 choices for the fifth letter, and 3 choices for the sixth letter, and so there are


43×3=192suchstrings.SinceBBissymmetrictoBB,therearesimilarly43×3=192 strings of this form. Finally, there are


4×33=108stringsoftheformBB,and43×3=192stringsoftheformBB.Thus,thereare6×144+2×192+
108+192 =1548 Bauman strings with exactly 2


B’s.Intotal,thereare224+1548=1772 Bauman strings of length 6 that contain more than one


B. Solution 1 Consider all Bauman strings of length


nthatbeginwithC. There are 4 choices for each of the remaining


n-1letters,andsothereare4^{n-1} such Bauman strings. Each of these strings either ends with


D, or it does not end with


D. We call those that end with


D,d_n,andwedefine|d_n| to be the number of such strings. Similarly, we call those that do not end in


D,x_n,andwedefine|x_n| to be the number of such strings. For example,


d_1 represents the Bauman strings of length


1thatbeginwithCandendwithD, and since no such string exists, then


|d_1|=0.Similarly,x_1 represents the Bauman strings of length


1thatbeginwithCanddonotendwithD,andso|x_1|=1(thestringisC).Wemayconfirmthat4^{n-1}=|d_n|+|x_n|whenn=1,since4^{1-1}=|d_1|+|x_1|=0+1.Further,weknowthat|d_2|=1(thestringisCD),and|x_2|=3(thestringsareCA,CB,CE), and again confirm that


4^{2-1}=1+3. Next, consider the Bauman strings of length


nthatbeginwithCanddonotendwithD,thatis,x_n. Each of these strings could have a


D added to its end to form a Bauman string of length


n+1thatbeginswithCandendswithD,ord_{n+1}.SinceaddingaD to the end of every string


x_n gives all possible strings


d_{n+1},then|d_{n+1}| = |x_n|. From our earlier work, we may confirm that


|d_2|=|x_1|=1.Further,|x_{n+1}| = 4|d_n| +
3|x_n|. Why is this true? Every Bauman string of length


n+1thatbeginswithC and does not end with


D,thatisx_{n+1},iseitherastringd_nwithanA,B,C,orEaddedtoitsend,oritisastringx_n that has a choice of 3 letters added to its end (the letter added can not be


D and it can not be the last letter of


x_n,leaving3possibilities).Thenumberofstringsd_nthathaveA,B,C,orEaddedtoitsendis4|d_n|.Thenumberofstringsx_n that have a choice of 3 letters added to its end is


3|x_n|.Therefore,weconcludethat|x_{n+1}| =
4|d_n| + 3|x_n|. From our earlier work, we may confirm that


|x_2|=4|d_1|+3|x_1|=4(0)+3(1)=3. We use these two formulas


|d_{n+1}| =
|x_n|and|x_{n+1}| = 4|d_n| + 3|x_n|,whichareequivalentto|d_{n}| = |x_{n-1}|and|x_{n}| = 4|d_{n-1}| + 3|x_{n-1}|, to build the table below.


n|d_n|=|x_{n-1}||x_n|=4|d_{n-1}| + 3|x_{n-1}|1|d_1|=0|x_1|=12|d_2|=1|x_2|=33|d_3|=|x_{2}|=3|x_3|=4|d_{2}| +
3|x_{2}|=4(1)+3(3)=134|d_4|=|x_{3}|=13|x_4|=4|d_{3}| +
3|x_{3}|=4(3)+3(13)=515|d_5|=51|x_5|=4(13)+3(51)=2056|d_6|=205|x_6|=4(51)+3(205)=8197|d_7|=819|x_7|=4(205)+3(819)=32778|d_8|=3277|x_8|=4(819)+3(3277)=13\,1079|d_9|=13\,107|x_9|=4(3277)+3(13\,107)=52\,42910|d_{10}|=52\,429 not needed Therefore, the number of Bauman strings of length


10 in which the first letter is


C and the last letter is


Dis52 429.Solution2LetS_{n} be the set of Bauman strings of length


n in which the first letter is


C and the last letter is


D.Further,wedefine|S_{n}| to be the number of such strings. For example,


S_2=\{CD\}andso|S_{2}|=1,andS_3=\{CAD, CBD, CED\}andso|S_{3}|=3.EachstringinS_{10}isoftheformCDorCT_8DwhereT_8 is a Bauman string of length 8 that does not begin with


C and does not end with


D.Therefore,|S_{10}|=|T_8|. The number of such strings,


|T_8|,isequalto−−+the total number of Bauman strings of length 8the number of Bauman strings of length 8 that begin with Cthe number of Bauman strings of length 8 that end with Dthe number of Bauman strings of length 8 that begin with C and end with D In the above, we note that strings beginning with


C include those that end with


D, as well as others. Similarly, strings that end with


D include those that begin with


C, as well as others. Since we have subtracted the number of strings that begin with


CandendwithD twice from the total, we conclude by adding the number of such strings. For a Bauman string of length 8, there are 5 choices for the first letter and 4 choices for each of the remaining 7 letters. Thus, the total number of Bauman strings of length 8 is equal to


5×47. For a Bauman string of length 8 that begins with


C, there is 1 choice for the first letter and 4 choices for each of the remaining 7 letters. Thus, the total number of Bauman strings of length 8 that begin with


Cisequalto1×47. Also, the total number of Bauman strings of length 8 that end with


Disequalto1×47. The number of Bauman strings of length 8 that begin with


CandendwithDisequalto |S_8|.Therefore,weget∣S10∣=∣T8∣=5×47−1×47−1×47+∣S8∣=3×47+∣S8∣ and so the number of Bauman strings of length 10 that begin with


CandendwithD is dependent on the number of Bauman strings of length 8 that begin with


Candendwith D. At this point, we could repeat the process above to determine


|S_8|, however it may be more efficient to generalize the work above to determine a formula for


|S_n|.Forintegersn≥3,eachstringinS_{n}isoftheformCT_{n-2}DwhereT_{n-2}isaBaumanstringoflengthn-2 that does not begin with


C and does not end with


D. The number of such strings,


|T_{n-2}|,isequalto−−+the total number of Bauman strings of length n−2the number of Bauman strings of length n−2 that begin with Cthe number of Bauman strings of length n−2 that end with Dthe number of Bauman strings of length n−2 that begin with C and end with DForaBaumanstringoflengthn-2, there are 5 choices for the first letter and 4 choices for each of the remaining


n-3 letters. Thus, the total number of Bauman strings of length


n-2isequalto5×4n−3.ForaBaumanstringoflengthn-2thatbeginswithC, there is 1 choice for the first letter and 4 choices for each of the remaining


n-3 letters. Thus, the total number of Bauman strings of length


n-2thatbeginwithCisequalto1×4n−3. Also, the total number of Bauman strings of length


n-2thatendwithDisequalto1×4n−3. The number of Bauman strings of length


n-2thatbeginwithCandendwithDisequalto |S_{n-2}|.Therefore,weget∣Sn∣=∣Tn−2∣=5×4n−3−1×4n−3−1×4n−3+∣Sn−2∣=3×4n−3+∣Sn−2∣, for integers n≥3. Using this recursive formula and the fact that


|S_2|=1,weget∣S4∣∣S6∣∣S8∣∣S10∣====3×44−3+∣S4−2∣3×46−3+∣S6−2∣3×48−3+∣S8−2∣3×410−3+∣S10−2∣====3×4+∣S2∣3×43+∣S4∣3×45+∣S6∣3×47+∣S8∣====13205327752429 The number of Bauman strings of length


10 in which the first letter is


C and the last letter is


D$ is 52 429.