Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Assume a coin has a probability p to get a head H. Suppose a coin is tossed until the partern T,T appear in the last 2 tosses. Once he got T,T then the game is finished. What is the expected number of flips is expected for the game?

I tried to find out the distribution of $N$ where $N$ stands for the expected value of the no. of tosses before getting T,T, but i don't know what kind of distribution is that, seems need another apporaches

share|cite|improve this question
up vote 3 down vote accepted

The distribution is not needed. Call $n$ the expected number of tosses needed to reach TT and $m$ the expected number of tosses needed to reach TT starting from T. Conditioning on the value of the first toss, one gets $n=1+(1-p)m+pn$ and $m=1+pn+(1-p)0$. Which yields $$ n=\frac{2-p}{(1-p)^2}=\frac1{1-p}+\frac1{(1-p)^2}. $$ Sanity checks: $n=2$ for $p=0$ (why?), $n\to\infty$ when $p\to1$ (why?) and the function $p\mapsto n$ is nondecreasing (why?).

share|cite|improve this answer
Hmm, wouldn't this be the same problem? But this is yielding a different result. – Stefan Hansen Nov 3 '12 at 14:13
@StefanHansen Here the probability of Heads is $p$ and he looks for TT, in the other example, he looks for $HH$ for which heads has prob $p$. Substitute $q=1-p$ in the above to get what you have on the other page. – Jean-Sébastien Nov 3 '12 at 14:26
@Jean-Sébastien: Thank you for the clarification. – Stefan Hansen Nov 4 '12 at 11:07
i have a question, why $m=(1-p)+pn$ why it isn't correct? As i have p probability has to restart and 1-p probability to have an expectation of 1. Thx – Mathematics Nov 7 '12 at 23:36
If one needs to restart, the duration is 1+n, not n. This happens with probability p hence m = (1-p)1 + p(1+n) = 1 + pn. – Did Nov 7 '12 at 23:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.