Skip to content

Mathematics · Ch 7 — Probability

Mean and Variance of a Random Variable

7

Mean and Variance of a Random Variable

Mean (Expectation) of a Random Variable

The mean, or expectation, of a discrete random variable XX with probability distribution P(X=xi)=piP(X=x_i)=p_i is defined as

E(X)=X‾=∑i=1nxi pi=x1p1+x2p2+⋯+xnpn.E(X) = \overline{X} = \sum_{i=1}^{n} x_i\,p_i = x_1p_1+x_2p_2+\cdots+x_np_n.

The mean is the probability-weighted average of the values XX can take -- it represents the long-run average value of XX over a very large number of repetitions of the experiment, and need not itself be a value XX can actually take.

Variance and Standard Deviation

The variance of XX 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.\operatorname{Var}(X) = E\big[(X-\overline{X})^2\big] = \sum_{i=1}^n (x_i-\overline{X})^2 p_i.

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.\operatorname{Var}(X) = E(X^2) - [E(X)]^2, \qquad \text{where } E(X^2)=\sum_{i=1}^n x_i^2p_i.

The standard deviation of XX is defined as the (positive) square root of the variance, σX=Var⁡(X)\sigma_X=\sqrt{\operatorname{Var}(X)}, and is expressed in the same units as XX itself (whereas the variance is in squared units).

Worked Illustration

For X=X= number of tails in three coin tosses (distribution 18,38,38,18\tfrac18,\tfrac38,\tfrac38,\tfrac18 for x=0,1,2,3x=0,1,2,3, Section 6):

E(X)=0 ⁣(18)+1 ⁣(38)+2 ⁣(38)+3 ⁣(18)=0+3+6+38=128=32.E(X) = 0\!\left(\frac18\right)+1\!\left(\frac38\right)+2\!\left(\frac38\right)+3\!\left(\frac18\right) = \frac{0+3+6+3}{8}=\frac{12}{8}=\frac32.

E(X2)=0 ⁣(18)+1 ⁣(38)+4 ⁣(38)+9 ⁣(18)=0+3+12+98=248=3.E(X^2) = 0\!\left(\frac18\right)+1\!\left(\frac38\right)+4\!\left(\frac38\right)+9\!\left(\frac18\right) = \frac{0+3+12+9}{8}=\frac{24}{8}=3.

Var⁡(X)=E(X2)−[E(X)]2=3−(32)2=3−94=34.\operatorname{Var}(X) = E(X^2)-[E(X)]^2 = 3-\left(\frac32\right)^2 = 3-\frac94=\frac34. …