Maths Olympiad Prep

Track / Stage 4 / 144 of 340 #1044 of 2604

Problem 1044

AMC 12 late, AIME early
Combinatorics Difficulty 4.7 Find the answer HMMT February · United States

A particular coin can land on heads (H), on tails (T), or in the middle (M), each with probability 13\frac{1}{3}. Find the expected number of flips necessary to observe the contiguous sequence HMMTHMMT...HMMT, where the sequence HMMT is repeated 2016 times.

A number or a short expression. Fractions can be typed as 3/2, and spacing doesn't matter.

Next problem →

Official solution

Solution:

Let E0E_{0} be the expected number of flips needed. Let E1E_{1} be the expected number more of flips needed if the first flip landed on H. Let E2E_{2} be the expected number more if the first two landed on HM. In general, let EkE_{k} be the expected number more of flips needed if the first kk flips landed on the first kk values of the sequence HMMTHMMT...HMMT.

We have
Ei={1+13Ei+1+13E1+13E0i≢0( mod 4)1+13Ei+1+23E0i≡0( mod 4) E_{i} = \left\{ \begin{array}{lll} 1 + \frac{1}{3} E_{i+1} + \frac{1}{3} E_{1} + \frac{1}{3} E_{0} & i \not\equiv 0 & (\bmod 4) \\ 1 + \frac{1}{3} E_{i+1} + \frac{2}{3} E_{0} & i \equiv 0 & (\bmod 4) \end{array} \right.

Using this relation for i=0i=0 gives us E1=E0−3E_{1} = E_{0} - 3. Let Fi=13iEiF_{i} = \frac{1}{3^{i}} E_{i}. By simple algebraic manipulations we have
Fi+1−Fi={−23i+1⋅E0i≢0( mod 4)−13i−23i+1⋅E0i≡0( mod 4) F_{i+1} - F_{i} = \left\{ \begin{array}{lll} -\frac{2}{3^{i+1}} \cdot E_{0} & i \not\equiv 0 & (\bmod 4) \\ -\frac{1}{3^{i}} - \frac{2}{3^{i+1}} \cdot E_{0} & i \equiv 0 & (\bmod 4) \end{array} \right.

We clearly have F2016⋅4=0F_{2016 \cdot 4} = 0 and F0=E0F_{0} = E_{0}. So adding up the above relations for i=0i=0 to i=2016⋅4−1i=2016 \cdot 4 - 1 gives
−E0=−2E0∑i=12016⋅413i−∑k=02015134k=E0(132016⋅4−1)−1−132016⋅48081 \begin{aligned} -E_{0} & = -2 E_{0} \sum_{i=1}^{2016 \cdot 4} \frac{1}{3^{i}} - \sum_{k=0}^{2015} \frac{1}{3^{4k}} \\ & = E_{0}\left(\frac{1}{3^{2016 \cdot 4}} - 1\right) - \frac{1 - \frac{1}{3^{2016 \cdot 4}}}{\frac{80}{81}} \end{aligned}
so E0=38068−8180E_{0} = \frac{3^{8068} - 81}{80}.

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty, ordering) added by this project.