# The 3rd raw moment of a binomial distribution

What is the 3rd raw moment (that is, $E\{X^3\}$) of a Binomial distribution with parameters $n$ and $p$?

I am getting $n(n-1)(n-2)p^3 + 3n(n-1)p^2 + np$. Is it correct?

• I am getting n(n-1)(n-2)p^3 + 3n(n-1)p^2 + np. Is it correct ? Oct 12, 2015 at 17:07
• Yes, it is correct. Oct 13, 2015 at 5:48

For such a distribution, it is best to compute the probability generating function (PGF) rather than MGF. That is to say, $$P_X(t) = \operatorname{E}[t^X] = \sum_{x=0}^n t^x \binom{n}{x} p^x (1-p)^{n-x} = \sum_{x=0}^n \binom{n}{x} (pt)^x (1-p)^{n-x} = (pt+1-p)^n,$$ the last equality being a consequence of the binomial theorem. From here, we observe/recall that $$\left[\frac{dP}{dt}\right]_{t=1} = \operatorname{E}\left[X t^{X-1}\right]_{t=1} = \operatorname{E}[X],$$ and similarly $$\left[\frac{d^2P}{dt^2}\right]_{t=1} = \operatorname{E}[X(X-1)],$$ and in general, $$\left[\frac{d^k P}{dt^k}\right]_{t=1} = \operatorname{E}[X(X-1)\cdots(X-k+1)].$$ Therefore, for $k = 1, 2, 3$, we get $$\operatorname{E}[X] = \frac{d}{dt}\left[(pt+1-p)^n\right]_{t=1} = np,$$ $$\operatorname{E}[X(X-1)] = \frac{d^2}{dt^2}\left[(pt+1-p)^n\right]_{t=1} = n(n-1)p^2,$$ $$\operatorname{E}[X(X-1)(X-2)] = n(n-1)(n-2)p^3,$$ and indeed in the general case, $$\operatorname{E}[X(X-1)\ldots(X-k+1)] = n(n-1)\ldots(n-k+1)p^k.$$ Therefore, $$\operatorname{E}[X^3] = (n(n-1)(n-2)p^3) + 3(n(n-1)p^2) + np.$$

We start by calculating the moment generating function $M_X(t)=E(e^{tX})$, which is $$\sum_0^n e^{tk}\binom{n}{k} p^kq^{n-k},$$ where $q$ is an abbreviation for $1-p$.

If we note that $e^{tk}p^k=(e^t p)^k$, we recognize the sum as $(e^{tp}+q)^n$.

Now use the fact that $E(X^3)$ is the third derivative of $M_X(t)$ at $t=0$. The calculation is a little unpleasant, but mechanical.

Use the fact that $x^3=x(x-1)(x-2) + 3x(x-1) + x$ and then sum up to get at your answer.

Write $X=\sum_{i=1}^n X_i$ where $X_i$ are identifier random variables which are equal to 1 with probability $p$ and are 0 otherwise. Now \begin{align} E[X^3]&=E\left[\left(\sum_{i=1}^n X_i\right)^3\right]\\ &=3! \binom n 3 E[X_iX_jX_k]+2\times3\binom n 2 E[X_iX_j]+\binom n 1 E[X_i], \end{align} where $1\le i,j,k\le n$ are some distinct integers. Hence $$E[X^3]=3! \binom n 3 p^3+2\times3\binom n 2 p^2+\binom n 1 p.$$

Yes, it is correct.use the expectation values of first and second powers of the random variable, binomial to derive the third moment.Thus it will be reduced to a matter of relating some finite telescopic sums.