# What is the expected number of tosses of a biased coin to get the $n^{th}$ head?

What is the expected number of tosses of a biased coin to get the $$n^{th}$$ head?

So my reasoning is as follow: Let $$X_n$$ be the number of tosses to get the $$n^{th}$$ head and let $$p$$ be the probability of getting head in a single toss. If the first toss is head, then $$E[X_n]=p(1+E[X_{n-1}])+(1-p)(1+E[X_n])\Rightarrow E[X_n]=\frac{1}{p}+E[X_{n-1}]$$. As $$E[X_1]=\frac{1}{p}$$, the recurrence gives $$E[X_n]=\frac{n}{p}$$.

• You sort of gloss over why $E[X_1]=1/p,$ but you have $E[X_1]=p (1+E[X_0])+(1-p)(1+E[X_1]).$ But $E[X_0]=0,$ so this is $E[X_1]=p+(1-p)(1+E[X_1])$ or $pE[X_1]=1$ or $E[X_1]=1/p.$ – Thomas Andrews Jul 3 '19 at 14:52
• This is one of the four ways of looking at the negative binomial distribution: Wikipedia has another, with mean $\frac{pr}{1-p}$ where $r=n$ and where Wikipedia's $1-p$ is your $p$ and where you add an additional $n$ by counting the heads as well as tails, but apart from that is the same – Henry Jul 3 '19 at 14:58

Your answer is correct. You might want to argue why $$E[X_1]=\frac{1}{p}.$$
The result is the expected time $$E[X_1]$$ times $$n,$$ because you just sum the expected time between the $$i$$th heads and the $$i+1$$th head. The value will be $$nE[X_1].$$