The mean, or expectation, of a discrete random variable X with probability distribution P(X=xi)=pi is defined as
E(X)=X=∑i=1nxipi=x1p1+x2p2+⋯+xnpn.
The mean is the probability-weighted average of the values X can take -- it represents the long-run average value of X over a very large number of repetitions of the experiment, and need not itself be a value X can actually take.
Variance and Standard Deviation
The variance of X measures how spread out the distribution is about the mean, and is defined as the expectation of the squared deviation from the mean:
Var(X)=E[(X−X)2]=∑i=1n(xi−X)2pi.
Exactly as with the variance of a data set, this expands algebraically into the far more convenient computational shortcut
Var(X)=E(X2)−[E(X)]2,where E(X2)=∑i=1nxi2pi.
The standard deviation of X is defined as the (positive) square root of the variance, σX=Var(X), and is expressed in the same units as X itself (whereas the variance is in squared units).
Worked Illustration
For X= number of tails in three coin tosses (distribution 81,83,83,81 for x=0,1,2,3, Section 6):