Originally Posted by

**Aaron1097** I'm having trouble with the following question;

"A biased coin is tossed until more heads then tails appear.

The coin is biased such that it lands on heads with probability 2/3 and tails with probability 1/3

What is the expected number of flips and the variance?"

Any help would be appreciated;

I don't know if there is a simple way to do this. I had look up some combinatorial stuff, and do some summations with Maple.

Here goes. The first time that you will toss more heads than tails, you will have made an odd number of tosses. Let's write this as $\displaystyle 2n+1$ with $\displaystyle n$ non-negative. If $\displaystyle p$ is the probability of tossing tail and $\displaystyle q$ that of head, you have tossed $\displaystyle n$ tails and $\displaystyle n+1$ heads, and the probability of that is

$\displaystyle {1\over 2n+1}\left({2n+1\atop n}\right)q^{n+1}p^n$.

The combinatorial factor in the beginning is the number of ways of tossing heads and tails with the number of heads exceeding the number of tails for the first time at toss $\displaystyle 2n+1$. I got this from the Ballot Theorem in William Feller, An Introduction to Probability Theory and Its Applications. Note that

$\displaystyle \sum_{n=0}^\infty{1\over 2n+1}\left({2n+1\atop n}\right)q^{n+1}p^n$

is only equal to 1 if $\displaystyle q>1/2$. Otherwise there is a finite probability that the number of heads will never exceed the number of tails.

The expected number of tosses is now equal to

$\displaystyle \sum_{n=0}^\infty\left({2n+1\atop n}\right)q^{n+1}p^n={2q\over\sqrt{1-4pq}(1+\sqrt{1-4pq})}.$

With $\displaystyle q=2/3$ and $\displaystyle p=1/3$ this becomes equal to 3. For the variance we need

$\displaystyle \sum_{n=0}^\infty(2n+1)\left({2n+1\atop n}\right)q^{n+1}p^n={2q(4pq+\sqrt{1-4pq})\over(1-4pq)^{3/2}(1+\sqrt{1-4pq})},$

which equals 33 with $\displaystyle q=2/3$ and $\displaystyle p=1/3$. The variance is then $\displaystyle 33-3^2=24$.