# Third Moment of Geometric Series?

$\sum_{x=1}^{\infty}x(1-p)^{x-1} = \frac{1}{p^2}$

$\sum_{x=1}^{\infty}x^2(1-p)^{x-1} = \frac{2-p}{p^3}$

$\sum_{x=1}^{\infty}x^3(1-p)^{x-1} =$ ... ?

The textbook gives the first 2 moments, but not the third one. I could not find the forumla on Google as well. I think it'll be useful in case I need to find $E(X^3)$ where $X$ is a geometric distribution.

• Just for reference: Generalizing the computations below, the $n$-th moment can be written in terms of Stirling numbers of the second kind. – Sangchul Lee Feb 27 '18 at 7:08

First, note that $$\sum_{k=0}^\infty k(1-p)^{k-1} = \sum_{k=1}^\infty k(1-p)^{k-1}$$ This allows us to perform a little trick to calculate the moments. For the first moment, we have: \begin{align} \sum_{k=1}^\infty k(1-p)^{k-1} &= \sum_{k=0}^\infty k(1-p)^{k-1}\\ &=\sum_{k=1}^\infty (k-1)(1-p)^{k-2} \\ &=\sum_{k=1}^\infty k(1-p)^{k-2} - \sum_{k=1}^\infty(1-p)^{k-2}\\ &= \frac{1}{1-p}\sum_{k=1}^\infty k(1-p)^{k-1}-\frac{1}{p(1-p)} \end{align} Rearranging, we obtain: $$-\frac{p}{1-p}\sum_{k=1}^\infty k(1-p)^{k-1} = -\frac{1}{p(1-p)}$$ $$\sum_{k=1}^\infty k(1-p)^{k-1}=\frac{1}{p^2}$$ We can use the same trick to calculate the third moment: \begin{align} \sum_{k=1}^\infty k^3(1-p)^{k-1} &= \sum_{k=0}^\infty k^3(1-p)^{k-1}\\ &= \sum_{k=1}^\infty (k-1)^3(1-p)^{k-2}\\ &= \sum_{k=1}^\infty k^3 (1-p)^{k-2} - 3\sum_{k=1}^\infty k^2(1-p)^{k-2} + 3\sum_{k=1}^\infty k(1-p)^{k-2} - \sum_{k=1}^\infty(1-p)^{k-2}\\ &=\frac{1}{1-p}\sum_{k=1}^\infty k^3(1-p)^{k-1} - \frac{3(2-p)}{p^3(1-p)}+\frac{3}{p^2(1-p)}-\frac{1}{p(1-p)} \end{align} Rearranging, we have: $$-\frac{p}{1-p}\sum_{k=1}^\infty k^3(1-p)^{k-1} = -\frac{p^2-6p+6}{p^3(1-p)}$$ $$\boxed{\sum_{k=1}^\infty k^3(1-p)^{k-1} = \frac{p^2-6p+6}{p^4}}$$


Lets $\ds{q = 1 - p}$:

\begin{align} \sum_{x = 1}^{\infty}x^{3}\pars{1 - p}^{x - 1} & = {1 \over q}\sum_{x = 0}^{\infty}x^{3}q^{x} = {1 \over q}\pars{q\,\partiald{}{q}}^{3}\sum_{x = 0}^{\infty}q^{x} = {1 \over q}\pars{q\,\partiald{}{q}}^{3}{1 \over 1 - q} \\[5mm] & = {1 \over q}\pars{q\,\partiald{}{q}}^{2}{q \over \pars{1 - q}^{2}} = {1 \over q}\,q\,\partiald{}{q}q\,\partiald{}{q}{q \over \pars{1 - q}^{2}} = \partiald{}{q}{q + q^{2} \over \pars{1 - q}^{3}} \\[5mm] & = {1 + 4q + q^{2} \over \pars{1 - q}^{4}} = {1 + 4\pars{1 - p} + \pars{1 - p}^{2} \over p^{4}} = \bbx{6 - 6p + p^{2} \over p^{4}} \end{align}

Using summation of series. $$S=\sum_{k=1}^\infty x^3(1-p)^{k-1}\\ -(1-p)S=-\sum_{k=1}^\infty (x-1)^3(1-p)^{k-1}$$ We add these two and get $$pS=\sum_{k=1}^\infty (x^3-(x-1)^3)(1-p)^{1-k} \\ =\sum_{k=1}^\infty (x^2+x(x-1)+(x-1)^2)(1-p)^{1-k} \\ =\sum_{k=1}^\infty x^2(1-p)^k+\sum_{k=1}^\infty (x-1)^2(1-p)^{1-k}+\sum_{k=1}^\infty x(x-1)(1-p)^{1-k}\\ =E(X^2)+(1-p)E(X^2) + K$$

$$K=\sum_{k=1}^\infty x(x-1)(1-p)^{1-k}=\sum_{k=1}^\infty x(x+1)(1-p)^{k} \\ (1-p)K=\sum_{k=1}^\infty x(x-1)(1-p)^k \\ K-(1-p)K=pK=\sum_{k=1}^\infty (x(x+1)-x(x-1))(1-p)^{k} \\ pK=\sum_{k=1}^\infty 2x(1-p)^{k}=2(1-p)E(X)$$

Therefore $$pS=E(X^2)+(1-p)E(X)^2+\frac{2(1-p)}{p}E(X) \\ = \frac{(2-p)^2}{p^3}+\frac{2(1-p)}{p^3}=\frac{p^2-6p+6}{p^3}$$

$$S=\frac{p^2-6p+6}{p^4}$$