$$ E[X^2] = 1^2 \cdot \frac{1}{6} + 2^2 \cdot \frac{1}{6} + 3^2\cdot\frac{1}{6}+4^2\cdot\frac{1}{6}+5^2\cdot\frac{1}{6}+6^2\cdot\frac{1}{6} $$

where $X$ is the result of a die roll.

How come this expansion?

  • $\begingroup$ This is called the second moment of $X$. Does the Wikipedia page help? Have a look at the Uses and application section. Particularly, it is useful for calculating the Variance. $\endgroup$ Jan 11, 2015 at 13:05
  • $\begingroup$ Kind of. So I would need to evaluate the moment generating function or so? Anyway, then for example evaluating $E[X^3]$ would require some work I guess. $\endgroup$
    – TMOTTM
    Jan 11, 2015 at 13:12
  • $\begingroup$ The expected value for discrete random variables is just the sum of the products of the outcome times its probability... $\endgroup$
    – mfnx
    May 11, 2022 at 22:36

2 Answers 2


There are various ways to justify it.

For example, it follows from the definition of expectation and the law of the unconscious statistician.

Or consider the case $Y=X^2$ and computing $E(Y)$.


Here's another way to compute $E[X^2]$.

If you know how to compute $E[X]$ and $Var(X)$ for a dice roll, then you can work out $E[X^2]$ using this equivalence of variance: $Var(X) = E[X^2] - (E[X])^2$.

While this is not a general answer (see @Glen_b), this equivalence comes in handy pretty often.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.