# Finding $\mathbb{E}[Y^2]$ (Negative Binomial Distribution)

Suppose $Y \sim \text{NegBin}(n, p)$. Then $$\mathbb{E}[Y^2] = \sum_{y=0}^{\infty}y^2\binom{r+y-1}{y}p^rq^y$$ where $q = 1 - p$. Now since the $y = 0$ term adds nothing, \begin{align} \mathbb{E}[Y^2] &= \sum_{y=1}^{\infty}y^2\binom{r+y-1}{y}p^rq^y \\ &= \sum_{y=1}^{\infty}yr\binom{r+y-1}{y-1}p^rq^y \tag{1}\\ &= r\sum_{y=1}^{\infty}y\binom{r+y-1}{y-1}p^rq^y \text{.} \end{align} $(1)$ is true because $$y\binom{r+y-1}{y} = \dfrac{(r+y-1)!}{(y-1)!(r-1)!} = \dfrac{r}{r}\left(\dfrac{(r+y-1)!}{(y-1)!(r-1)!}\right) = r\binom{r+y-1}{y-1}\text{.}$$ Set $z = y - 1$. Then \begin{align} \mathbb{E}[Y^2] &= r\sum_{z=0}^{\infty}(z+1)\binom{r+z}{z}p^rq^{z+1} = r\sum_{z=0}^{\infty}z\binom{r+z}{z}p^rq^{z+1} + r\sum_{z=0}^{\infty}\binom{r+z}{z}p^rq^{z+1}\text{.} \end{align} I showed already that $$\mathbb{E}[Y] = r\sum_{z=0}^{\infty}z\binom{r+z}{z}p^rq^{z+1} = \dfrac{rq}{p}\text{.}$$ I'm not sure how to find $$r\sum_{z=0}^{\infty}\binom{r+z}{z}p^rq^{z+1}$$ after many tries. I believe it should be equal to $$\dfrac{qr(qr+q)}{p^2}$$ but I'm really not seeing it.

## 1 Answer

Using the binomial series, we get \begin{align*} r\sum_{z=0}^{\infty}\binom{r+z}{z}p^rq^{z+1}&= rp^rq\sum_{z=0}^\infty \binom{z+r}{z}q^z\\ &=\frac{rp^rq}{(1-q)^{r+1}}\\ &=\frac{rp^rq}{p^{r+1}}\\ &=\frac{rq}{p} \end{align*}

• Where did I mess up in my algebra? Obviously this doesn't match what I thought it should be. $\mathbb{E}[Y^2]$ should end up being $\dfrac{rq(1+rq)}{p^2}$. – Clarinetist Jan 19 '16 at 20:59
• @Clarinetist I didn't look at it, I just looked for your specific question which was this. If I notice anything, I will notify you. – Em. Jan 19 '16 at 21:01
• @Clarinetist Also, do you have to do it this way? If you can, you can use results from a geometric distribution and arrive at these things quicker – Em. Jan 19 '16 at 21:03
• At this point in the text, the geometric distribution and MGFs have not been introduced yet (which would make things MANY times easier). – Clarinetist Jan 19 '16 at 21:03
• @Clarinetist So you have to grind it this way huh. That's strange. – Em. Jan 19 '16 at 21:06