In my book, the following equation is given for variance:
$Var(X) = E(X^2) - \mu^2$
When asked to compute the variance of a fair 6-sided die, they do the following calculation for $E(X^2)$:
$E(X^2) = \frac{1}{6}(1^2 +2^2+3^2+4^2+5^2+6^2)$
I understand that $\{1,...6\}$ are the possible values r.v. $X$ can take on. But what allows them to just square all the individual values? I was trying to justify it this way:
$E(X^2) = E(\sum_{i=1}^nX_i^2 + \sum_{i\neq j}X_iX_j)$
$E(X^2) = \sum_{i=1}^n E(X_i^2) + \sum_{i\neq j}E(X_iX_j)$
However, it looks like in their solution, they have only considered the $\sum_{i=1}^n E(X_i^2)$ case.
It follows by definition of $E(X^n)$! That's for $\Omega=\lbrace 1,2,3,4,5,6\rbrace$ and $n=2$ $$E(X^2):=\int_{\Omega} X^2 dP=\sum_{\omega\in\Omega}\omega^2\cdot P(\lbrace{X=\omega}\rbrace)$$ and for the discret uniform distribution $P$ we have $P(\lbrace{X=\omega}\rbrace)=1/6$