[Math] Expected value of negative binomial distribution

negative binomialprobability

With $k$ representing number of successes of trials, $r$ is the number of failures, and $p$ is probability of successes. I derivated the expected value of negative binomial distribution like this:

$$
\mu_x =\sum^\infty_{k=0} {k{k+r-1 \choose k}p^k(1-p)^r}\\
=\sum^\infty_{k=1}{\frac{(k-1+r)!}{(k-1)!(r-1)!}p^{k}(1-p)^r}\\
=rp\sum^\infty_{k=1}{\frac{(k-1+r)!}{(k-1)!r!}p^{k-1}(1-p)^r}\\
suppose\ n=k+r-1,then:{\sum^\infty_{n=r}{\frac{n!}{(n-r)!r!}p^{n-r}(1-p)^r}=(p+(1-p))^n=1},\\
\mu_x=rp
$$

why is not same as: $ \mu_x=\frac{rp}{1-p} $,where am I wrong?

Best Answer

You have the wrong series closed form.   Where $\lvert p\rvert <1$

$$\begin{align}\sum\limits_{\color{red}r=0}^{\color{blue}n} \binom{n}{r} p^{n-r}(1-p)^r ~=~& (p+(1-p))^n ~=~ 1 \\[1ex] ~\neq~& \\[1ex] \sum\limits_{\color{blue}n=\color{red}r}^\infty \binom{n}{r} p^{n-r}(1-p)^r ~=~ & \dfrac 1{1-p}\end{align}$$

Although they have the same term, the series are not the same thing at all.   Notice what the variable is used as the series index and which is a bound on that index in each case.

Related Question