The expected value can be found through the distribution list, and the variance has a formula:
D(X)=E[X-E(X)]^2
=E{X^2-2XE(X)+[E(X)]^2}
=E(X^2)-2[E(X)]^2+[E(X)]^2
=E(X^2)-[E(X)]^2
Extended data:
For continuous random variable X, if its definition domain is (a, b) and the probability density function is f(x), the formula for calculating the variance of continuous random variable X is:
D(X)=(x-μ)^2 f(x) dx
Variance describes the dispersion degree between the value of random variable and its mathematical expectation. (The greater the standard deviation and variance, the greater the dispersion)
If the values of x are concentrated, the variance D(X) is small, and if the values of x are scattered, the variance D(X) is large.
Therefore, D(X) is a quantity to describe the dispersion degree of X and a scale to measure the dispersion degree of X..
Baidu encyclopedia-variance