3
$\begingroup$

I have coin, and want to get 2 heads exactly. I will throw it until this condition is met.

What is expected number of tries for this condition?

I know that it would be $\sum\limits_{n=2}^\infty P(X=n)n=0.5^n \cdot n\cdot(n-1)$ however I don't have an idea how to solve that sum because we didn't learn how to. I have knowledge just how to solve geometrical and arithmetical progression's sum. Maybe it's possible to get expected value using Poisson distribution?

  • 0
    "I am throwing, throwing and I get one head, I am throwing throwing then I get second head and I stop." That is the second model. Two heads in succession means keep going if you see, for example, HTTHTTTHTHTHTTTT etc because you have not yet seen two H _one after another_ as in HTTHTTTTHTHTHTTTTTTHH.2011-12-13

2 Answers 2

7

Your analysis is right. The probability that $X=n$ is indeed $(n-1)(0.5)^n$. This is because we need to have exactly $1$ head in the first $n-1$ tosses (probability $(n-1)(0.5)^{n-1}$) and then a head (probability $0.5$). So the required expectation is $\sum_{n=2}^\infty (n)(n-1)(0.5)^n. \qquad (\ast) $

To get a closed form for this, note that (if $|x|<1$) then $\frac{1}{1-x}=1+x+x^2+x^3+x^4+x^5+\cdots.$ Differentiate both sides with respect to $x$, twice. We get $\frac{1}{(1-x)^2}=1+2x+3x^2+4x^3+5x^4+\cdots,$ and then $\frac{2}{(1-x)^3}=2+(3)(2)x+(4)(3)x^2+(5)(4)x^3+ \cdots.$ Put $x=0.5$. We get $16=2+(3)(2)(0.5)^1 +(4)(3)(0.5)^2+ (5)(4)(0.5)^3+\cdots. \qquad(\ast\ast)$ To make the right-hand side of $(\ast\ast)$ equal to $(\ast)$, we need to multiply by $(0.5)^2$. So our expectation is $(16)(0.5)^2$, which is $4$.

There are better (meaning more probabilistic) ways of tackling the problem. For example, let $X_1$ be the waiting time, that is, number of tosses, until the first success (head), and let $X_2$ be the waiting time between the first success and the second. Then $X=X_1+X_2$, and therefore $E(X)=E(X_1)+E(X_2)$. The random variables $X_1$ and $X_2$ each have geometric distribution with parameter $p=1/2$. The expectation of a geometric distribution with parameter $p \ne 0$ may be something you have already seen: it is $\frac{1}{p}$. Note that the same idea works with essentially no change if $X$ is the number of tosses until, say, the $17$-th head.

  • 1
    What a wonderful answer.2011-12-13
2

The probability that it will take exactly $n$ throws is the probability of getting exactly one head in the first $n-1$ throws, times the probability of getting heads on the $n$th throw, so it's $((n-1)/2^{n-1})(1/2)$, which is $(n-1)/2^n$. So the expected number of throws is $\sum_{n=2}^{\infty}n(n-1)/2^n$. Series similar to this one have come up many times on this site. See, for example, Generalizing $\sum \limits_{n=1}^{\infty }n^{2}/x^{n}$ to $\sum \limits_{n=1}^{\infty }n^{p}/x^{n}$

  • 0
    @Didier, we must be talking past each other. "$P$ implies $Q$" follows trivially from "$P$ if and only if $Q$," no matter what $P$ is and no matter what $Q$ is. There is nothing to explain (except for why, in this case, $P$ if and only if $Q$ - but I've already disposed of that twice).2011-12-15