The expectation of a random variable, E(X), is the average of possible values weighted by their probabilities. Formally, it can be defined in two ways:
Domain definition: E(X)=∑ω∈ΩX(ω)P(ω).
Range definition: E(X)=∑xxP(X=x).
Expectation has nice properties of linearity: E(X+Y)=E(X)+E(Y) and E(aX+b)=aE(x)+b.