The expected value of x2 can be found by summing the product x2p(x) over all possible values of the random variable X. Thus the formula for the expected value of x2 is given as,
E(X^2) = \sum x^2p(x)where, p(x) is the probabilty mass function for the discrete ransom variable X and the summation is taken over all values of X.
Example:
Suppose that we are given the following probability distribution for a random variable X.
X | P(X) |
0 | 0.25 |
1 | 0.5 |
2 | 0.25 |
We calculate E(X^2) as follows,
X | X2 | P(X) | X2P(X) |
0 | 0 | 0.25 | 0 |
1 | 1 | 0.5 | 0.5 |
2 | 4 | 0.25 | 1 |
ΣX2P(X) = 1.5 |
Since we see that ΣX2P(X) = 1.5 from the above table we conclude that E(X^2) = 1.5
For Continuous Random Variables:
If the variable X is continuous with pdf f(x) , then we can calculate it using the formula,
E(X^2) = \int x^2f(x)dxwhere, the integration is taken over the entire range of X.
Remark:
The value of E(X2) is not equal to [E(X)]2. In fact, E(X2) is always greater than or equal to [E(X)]2