# Average number of tosses to reach a head with a biased coin

Given a biased coin with probability P of flipping to head position, how can I compute N, the average number of tosses for reaching a head?

I also need a formula for the reverse problem, computing P as a function of N (if I know the average number of tosses, how can I find the bias).

Edit: This can apparently be rephrased as computing the average number of Bernoulli trials with probability P to get a success. The result is N = 1/p according to this article.

-
This has to do with the geometric distribution: en.wikipedia.org/wiki/Geometric_distribution. – Hoda Feb 6 '14 at 19:17

You could have H, TH, TTH, ....

P(H) = p

P(TH) = qp where q = 1-p

P(TTH) = $q^2p$

...

Expected No of Tosses = $p+2pq+3pq^2+4pq^3+\cdots$

E = $p(1+2q+3q^2+4q^3+....)$

S = $(1+2q+3q^2+4q^3+....)$

qS = $q+2q^2+3q^3+....)$

S-qS = $1+q+q^2+q^3+\cdots$

S(1-q) = $\frac{1}{(1-q)}$

S = $\frac{1}{(1-q)^2}$

E =$\frac{p}{(1-q)^2}$

E = $\frac{1}{p}$

Now if somebody gives you E, you calculate p

Thanks

Satish

-

The distribution you are looking for is geometric distribution. The probability of reaching head in k-th tossing is: $$P\left\{ {X = k} \right\} = p{(1 - p)^{k - 1}}\,\,\,k = 1,2,..., + \infty$$

and the p is what you mentioned in your question.

Mean of this random variable is: $$E\left\{ X \right\} = \frac{1}{p}$$ So $N =\dfrac{1}{p}$.

With this relation the reverse problem has readily solved.

-