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.
Suppose that we are given the following probability distribution for a random variable X.
We calculate E(X^2) as follows,
|Σ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)dx
where, the integration is taken over the entire range of X.
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