Why is $E(X^2)$ not equal to the sum of $(x^2 \cdot P(x^2))$ instead of $x^2 \cdot P(x)$

73 Views Asked by At

Why is $E(X^2)$ not equal to the sum of $(x^2 \cdot P(x^2))$ instead of $x^2 \cdot P(x)$? I don't understand why you only substitute the first $X$ from the $E(X)$ formula and not the one inside the probability function?

2

There are 2 best solutions below

0
On

Let us say $X$ is a discrete random variable. Let $Y=X^2$. Then $$E(X^2) = E(Y) = \sum_y y \Pr(Y = y) = \sum_y y \Pr(X^2 = y).$$ Let $x = \sqrt{y}$. Then $y=x^2$ and we have, $$E(X^2) = \sum_x x^2 \Pr(X^2 = x^2)= \sum_x x^2 \Pr(X = x)=\sum x^2 P(x).$$

0
On

$f(X)=X^2$ is a 1-1 function, so the probability of event $x^2$ accruing is the same as the probability of event $x$ accruing: $$P[f(X)=f(x)]=P(X=x)$$ This must lead to: $$E[X^2]=\sum x^2P(x).$$