Exercise
We can use the gambling interpretation given in Exercise to find the expected number of tosses required to reach pattern B when we start with pattern A. To be a meaningful problem, we assume that pattern A does not have pattern B as a subpattern. Let [math]E_A(T^B)[/math] be the expected time to reach pattern B starting with pattern A. We use our gambling scheme and assume that the first k coin tosses produced the pattern A. During this time, the gamblers made an amount AB.
The total amount the gamblers will have made when the pattern B occurs is BB. Thus, the amount that the gamblers made after the pattern A has occurred is BB - AB. Again by the fair game argument, [math]E_A(T^B)[/math] = BB-AB.
For example, suppose that we start with pattern A = HT and are trying to get the pattern B = HTH. Then we saw in Exercise that AB = 4 and BB = 10 so [math]E_A(T^B)[/math] = BB-AB=6.
Verify that this gambling interpretation leads to the correct answer for all starting states in the examples that you worked in Exercise.