I need to calculate the expectation of $X=$ the number of failures until the $r$-th success in an infinite series of Bernoulli experiments with $p$ the probability of success. ($q=1-p$ the probability of failure)
My solution:
I figured $$P(X=x)={x+r \choose x}q^xp^r$$ (is this correct?) and $x\geq 0$ (In other words, $X\sim Bin(x+r,q)$.
So by definition, $\Bbb EX=\sum_{x=0}^\infty x{x+r \choose x}q^xp^r$.
Trying to simplify this, I got to \begin{align*} \frac{qp^r}{r!}\sum_{x=0}^\infty (x+r)(x+r-1) \ldots (x+1)xq^{x-1} & =\frac{qp^r}{r!}\left(\sum_{x=0}^\infty q^{x+r}\right)^{(r+1)}\\ & =\frac{qp^r}{r!}\left(q^r\sum_{x=0}^\infty q^{x}\right)^{(r+1)}\\ & =\frac{qp^r}{r!}(\frac{q^r}{1-q})^{(r+1)} \end{align*}
$(r+1)$ denotes taking the $(r+1)^{th}$ derivative in respect to $q$.
Now what? How can I simplify that further? Is there a simpler way?
Let $N(r)$ be the expected number of trials until the $r^{th}$ success, and $p$ the probability of success. Make one trial. This gives:$$N(r)=1+(1-p)N(r)+pN(r-1)$$Where the $1$ is for the trial and the other terms represent failure and success.
It is trivial that $N(0)=0$ and rearranging the formula gives $N(r)=N(r-1)+\frac 1p$ whence $N(r)=\frac rp$. Now let $F(r)$ be the number of failures with $$F(r)=N(r)-r=\frac rp-r=\frac {r(1-p)}p$$