I am relatively very new to probability distribution and after understanding the concept of Expected value of a discrete random variable,I am trying to understand the variance of the same here is an extract from my book:
$Var(X) = E[(X - E(X))^2] = \sum_{\text{all }X} (X - E(X))^2 P_x(X) = E(X^2) - (E(X))^2$
What my question is that I don't understand this simplification.Any pointers in this regard will be highly appreciated.