$X\in\text{Bin}(n,p)$. Determine $\mathrm{E}X^{4}$ with help of moment generating function

48 Views Asked by At

These theorems and example is from the book $\textit{An Intermediate Course in Probability}$, by Allan Gut.

$X$ is a random variable with binomial distribution.

$\psi_{X}$ is the moment generating function of $X,\quad q=1-p$.

$\psi_{X}(t)=\mathrm{E}e^{tX}$,

provided there exist $h>0$, such that the expectation exists and is finite for $|t|<h$.

From the Taylor expansion of the exponential function yields

$e^{tX}=1+\sum_{n=1}^{\infty}\frac{t^{n}X^{n}}{n!}\quad \text{for}\quad |t|<h$.

Taking expectations termwise

$\psi_{X}(t)=\mathrm{E}e^{tX}=1+\sum_{n=1}^{\infty}\frac{t^{n}}{n!}\mathrm{E}X^{n}\quad \text{for}\quad |t|<h$.

Here we se that that $\mathrm{E}X^{n}$ is given by the coefficient of $\frac{t^{n}}{n!}$.

$\psi_{X}(t)=(q+pe^{t})^{n}=(q+p\sum_{k=0}^{\infty}\frac{t^{k}}{k!})^{n}\ =(1+pt+p\frac{t^{2}}{2!}+\cdots)^{n}\ =1+np+\binom{n}{2}p^{2}t^{2}+np\frac{t^{2}}{2}+\cdots\\ =1+npt+(n(n-1)p^{2}+np)\frac{t^{2}}{2}+\cdots$

For example

$\mathrm{E}X^{2}=n(n-1)p^{2}+np$

When calculating $\mathrm{E}X^{4}$ the same way, we get

$\mathrm{E}X^{4}\cdot \frac{t^{4}}{4!}=np\frac{t^{4}}{4!}+\binom{n}{2}(p\frac{t^{2}}{2!})(p\frac{t^{2}}{2!})\\ +\binom{n}{3}(pt)(pt)(p\frac{t^{2}}{2!})+\binom{n}{4}(pt)(pt)(pt)(pt)\\ =np\frac{t^{4}}{24}+\binom{n}{2}p^{2}\frac{t^{4}}{4}+\binom{n}{3}p^{3}\frac{t^{4}}{2}+\binom{n}{4}p^{4}t^{4}\\ =\frac{t^{4}}{4!}(np+\binom{n}{2}6p^{2}+\binom{n}{3}12p^{3}+\binom{n}{4}24p^{4})$

$\mathrm{E}X^{4}=np+\binom{n}{2}6p^{2}+\binom{n}{3}12p^{3}+\binom{n}{4}24p^{4}$

But when $\mathrm{E}X^{4}$ is calculated using

$k^{4}=k(k-1)(k-2)(k-3)+6k(k-1)(k-2)+7k^{2}-6k$

$\mathrm{E}X^{4}=\sum_{k=0}^{n}k(k-1)(k-2)(k-3)\binom{n}{k}p^{k}(1-p)^{n-k}+6\sum_{k=0}^{n}k(k-1)(k-2)\binom{n}{k}p^{k}(1-p)^{n-k}\\ +7\mathrm{E}X^{2}-6\mathrm{E}X\\ =\sum_{k=0}^{n}k(k-1)(k-2)(k-3)\frac{n!}{(n-k)!k!}p^{k}(1-p)^{n-k}\\ +6\sum_{k=0}^{n}k(k-1)(k-2)\frac{n!}{(n-k)!k!}p^{k}(1-p)^{n-k}\\ +7\mathrm{E}X^{2}-6\mathrm{E}X\\ =p^{4}n(n-1)(n-2)(n-3)\sum_{k=4}^{n}\frac{(n-4)!}{((n-4)-(k-4))!(k-4)!}p^{k-4}(1-p)^{n-k}\\ +6p^{3}n(n-1)(n-2)\sum_{k=3}^{n}\frac{(n-3)!}{((n-3)-(k-3))!(k-3)!}p^{k-3}(1-p)^{n-3}\\ +7\mathrm{E}X^{2}-6\mathrm{E}X\\ =p^{4}n(n-1)(n-2)(n-3)+6p^{3}n(n-1)(n-2)+7(n(n-1)p^{2}+np)-6(np)\\ =\binom{n}{4}4!p^{4}+\binom{n}{3}3!\cdot 6p^{3}+\binom{n}{2}2!7p^{2}+np\\ =\binom{n}{4}24p^{4}+\binom{n}{3}36p^{3}+\binom{n}{2}14p^{2}+np\\$

$np+\binom{n}{2}6p^{2}+\binom{n}{3}12p^{3}+\binom{n}{4}24p^{4}\neq \binom{n}{4}24p^{4}+\binom{n}{3}36p^{3}+\binom{n}{2}14p^{2}+np $

Why are the two answers so different? Have I made a computational error?

1

There are 1 best solutions below

1
On BEST ANSWER

As noted in the OP, we have $$\psi_X(t)=\left(1+pt+p\frac{t^{2}}{2!}+\cdots\right)^{n}.$$ The next step, where we multiply out these series and identify coefficients term-by term, is the key one and I'll focus my attention here:

  • $t^0$: We take only the $1$'s from each series, so the coefficient is $1^n=1$.
  • $t^1$: We take $1$ from all but one of the series, and the linear $pt$ from the last. There are $n$ ways to do this, so the coefficient is $n\cdot (p)(1)^n=np$.
  • $t^2$: We now have two choices. On one hand, we can take $1$ from all but one of the series and $pt^2/2$ from the last one; this can be done in $n$ different ways. Or, we can take $1$ from all but two of the series and $pt$ from the two remaining; this can be done in $\binom{n}{2}$ ways. Hence the overall coefficient is $n\cdot (p/2)(1)^{n-1}+\binom{n}{2}\cdot (p)^2(1)^{n-2}=\frac12 np+\binom{n}{2}p^2.$

Skipping to the relevant $t^4$ case, we have a few options.

  1. Take $1$ from all but one of the series and $p(t^4/4!)$ from the last, which can be done in $n$ different ways.
  2. Take $1$ from all but two of the series and $p(t^2/2!)$ from the other two, which can be done in $\binom{n}{2}$ different ways.
  3. Take $1$ from all but two of the series, $p(t^3/3!)$ from one of the two remaining, and $p(t/1!)$ from the last. Since the order matters, this can be done in $n(n-1)=2\binom{n}{2}$ ways.
  4. Take $1$ from all but three of the series, $p(t^2/2!)$ from one of the three remaining, and $p(t^1/1!)$ from each of the last two. This can be done in $3\binom{n}{3}$ ways.
  5. Take $1$ from all but four of the series, and $p(t^1/1!)$ from each of othe four remaining. This can be done in $\binom{n}{4}$ ways.

Totaling this up and multiplying by 4! overall, we get the coefficient of $t^4$ as

$$n\cdot p+\binom{n}{2}(4!)p^2(t^2/2)^2+2\binom{n}{2}(4!)p^2(t^3/6)(t)+3\binom{n}{3}(4!)p^3(t^2/2)(t)^2+\binom{n}{4}4! p^4(t)^4$$ which simplifies to

$$np+14p^2\binom{n}{2}+36p^3\binom{n}{3}+24p^4\binom{n}{4}$$ in agreement with your second result.