QUESTION: An unfair coin lands heads with probability $\frac{1}{17}$ and tails with probability $\frac{16}{17}$ . Matt flips the coin repeatedly until he flips at least one head and at least one tail. What is the expected number of times that Matt flips the coin?
MY ANSWER: Assume that $E_h$ is the expected number of moves left after a head turns up and $E_t$ is the expected number of moves left after a tail turns up.. If $E$ denotes the total number of turns Matt has to toss, we can set up relations like - $$$$ $E=$ $\big($a head turns up$\big)$and$\big($number of moves left until a tail turns up$\big)$ OR $\big($a tail turns up$\big)$and$\big($number of moves left until a head turns up$\big)$ $$\implies E=\frac{1}{17}E_t+\frac{16}{17}E_h$$ Similarly, $E_t=$ if head turns up then sequence is over (since according to our assumption the previous flip was a tail) OR if tail turns up then we start over again.. $$\implies E_t=\frac{1}{17}+\frac{16}{17}E_t$$ Just like this $E_h=$ if a tail turns up then the sequence is over (since the last flip was a head) OR if a head turns up, we start over again.. $$\implies E_h=\frac{16}{17}+\frac{1}{17}E_h$$ Solving the equations we get $E_h$ and $E_t$ both to be $1$.. Which yields $E$ to be $1$.. But this is clearly wrong! $$$$
I do not understand where is my reasoning wrong? I have presented my logic in clear words before you.. Can someone please correct me..
Also, is/are there different way/ways to solve this sum? If so, it will be very much helpful if you introduce me to it/them.. Thank You so much..
You're on the right track, but the precise meaning of your definitions of your quantities $\ E_h\ $ and $\ E_t\ $ isn't very clear, and you've forgotten to count the toss needed to get to your first head or tail. Your $\ E_h\ $ needs to be the expected number of tosses needed to get a tail given that the first toss is a head, and your $\ E_t\ $ the expected number of tosses needed to get a head given that the first toss is a tail. That these quantities are somewhat confusingly labelled presumably explains why you got the labels reversed in your equation for $\ E\ $, which should be $$ E=1+\frac{1}{17}E_h+\frac{16}{17}E_t\ . $$ Similarly, your equations for $\ E_h\ $ and $\ E_t\ $ should be $$ E_h=\frac{16}{17}+\frac{1}{17}\left(E_h +1\right)\\ E_t=\frac{1}{17}+\frac{16}{17}\left(E_t +1\right)\ . $$ These give you $\ E_h= \frac{17}{16}\ $, $\ E_t=17\ $, and therefore $\ E=17\frac{1}{16}\ $, as Henno Brandsma obtained in his answer.