For the discrete random variable x, its expected value (also called mathematical expectation) can be expressed as:
E(X)=∑xP(X=x)
Where x is the value of the random variable x, and P(X=x) is the probability that the random variable x takes the value of x.
For continuous random variable x, its expected value can be expressed as:
E(X)=∫xf(x)dx
Where f(x) is the probability density function of random variable x.
Expected value is a useful mathematical feature of random variables, which represents the center position of random variables in a statistical sense. It is the average of random variables, but not all random variables have expectations, because expectations only exist when certain conditions are met.