Expected number of coins tossed If probability of head for a coin toss is $p$, then what is the expected number of tosses required to get a head?
My answer: P(H) = $p$ (probability of one toss), P(TH)=$p^2$ (probability of two tosses), P(TTH) = $p^3$ and so on.
So, expected number of tosses = $E = 1*p+2*p^2+3*p^3+...+\infty $
$Ep = p^2 + 2p^3 +....+\infty$
$E(1-p)=p+p^2+p^3+...+\infty = \frac{p}{1-p}$
So, $E = \frac{p}{(1-p)^2}$
I have heard someone telling expectation in this case is $\frac{1}{p}$, but I could derive above. Please let me know if I am wrong anywhere.
 A: Your expression for $E$ is not quite right; getting the first head down the line implies getting tails beforehand. It should be
$$E=1(p)+2(1-p)p+3(1-p)^2p+\cdots$$
and when you work it out it should give $\frac1p$.
A: The probability that you need $m$ tosses to get a head (i.e. a head on the last toss and tails on other tosses) is $(1-p)^{m-1}p$ for $m>0$. The required expectation is$$\sum_{m=1}^\infty mp(1-p)^{m-1}=1/p$$The number of tosses needed to get a head follows geometric distribution.
A: Your way of proceeding is ok, let us go the same way and get the claimed answer, after a minor bug-fix, which is $P(\underbrace{T\dots T}_{n\text{ times}}H)=q^np$. (Well, please do not write the $\infty$ as a "final term" in the series.)
Start with the formula for $E$ from the OP, using $p$ as the probability for $H$, and the complementary $q=1-p$ for the probability of one $T$ in a simple experiment (one toss):
$$
\begin{aligned}
E &= 1\cdot P(H)+2\cdot P(TH)+3\cdot P(TTH)+4\cdot P(TTTH)+\dots
\\
&=p + 2qp +3q^2 p + 4q^3p+\dots
\\
&=p(1 + 2q+3q^2+4q^3+\dots)\ ,\text{ and after multiplicatioin by $q$}\\
qE &= p(q+2q^2+3q^3+4q^4+\dots)\ ,\text{ so in difference}\\
(1-q)E &= p(1 + q+ q^2+q^3+\dots)=p\cdot\frac 1{1-q}=p\cdot\frac 1p=1\ ,\text{ giving}
\\
E&=\frac 1{1-q}=\frac 1p\ .
\end{aligned}
$$
