Calculating the expected value $\mathrm{E}\left[X(X-1)\right]$ [basic general question]

40 Views Asked by At

A beginner's question here: working out the variance of $X$ given a binomial distribution, I need to calculate $\mathrm{E}\left[X(X-1)\right].$ The solution sheet I have begins with (and I've seen this in various places)

$$\mathrm{E}\left[X(X-1)\right] =\sum_{k=0}^{n}k(k-1)\binom{n}{k}p^k(1-p)^{n-k} $$

My issue is that since (in the present case) \begin{align*} \mathrm{E}(X)&= \sum_{k=0}^n k \cdot \mathrm{P}^X\big(\{k\}\big)\\ &=\sum_{k=0}^{n}k\binom{n}{k}p^k(1-p)^{n-k}\\ \text{doesn't that imply}&\\[2ex] \mathrm{P}^X\big(\{k\}\big)&=\mathrm{P}^X\big(\{k(k-1)\}\big)\text{?} \end{align*}

Could someone please tell me what I'm missing? Shouldn't I be trying to evaluate $\mathrm{P}\big((X=k(k-1))\big)$ ?

1

There are 1 best solutions below

0
On BEST ANSWER

One way of find $EX(X-1)$ is to find the pmf of $Y=X(X-1)$ and the find its expectation. This is what you are thinking of. But this is not necessary. We also have the formula $Ef(X)=\sum f(k) P(X=k)$. So, taking $f(x)=x(x-1)$, we can write $EX(X-1)=\sum k(k-1) P(X=k)=\sum k(k-1) \binom {n} {k} p^{k} (1-p)^{n-k}$.