# Average, variance and standard deviation

## The average

The average can be interpreted as the center of gravity of the probability function. The average tends to be closer to the most probable results of the random experiment.

The general expression of the average is: $$\mu = x_1 \cdot p_1 +x_2 \cdot p_2+x_3 \cdot p_3+ \ldots + x_n \cdot p_n=\sum_{i=1}^n x_i \cdot p_i$$

The average result of a dice is $x_i = i$ that is, $$x_1=1, x_2 = 2, \ldots , x_6=6$$ and $\displaystyle p=\frac{1}{6}$, so: $$\displaystyle \mu=\frac{1}{6} \cdot 1+\frac{1}{6} \cdot 2+\frac{1}{6} \cdot 3\frac{1}{6} \cdot 4+\frac{1}{6} \cdot 5+\frac{1}{6} \cdot 6=\frac{1}{6} \cdot 21=3.5$$

## The variance

The variance gives an idea of the variation of results with respect to the average value. The general expression of the variance is: $$\sigma^2 = \sum_{i=1}^n x_i^2 \cdot p_i-\mu^2$$

Compute the variance of the result from throwing a dice.

First, we compute the average: $$\displaystyle \mu=\frac{1}{6} \cdot 1+\frac{1}{6} \cdot 2+\frac{1}{6} \cdot 3\frac{1}{6} \cdot 4+\frac{1}{6} \cdot 5+\frac{1}{6} \cdot 6=\frac{1}{6} \cdot 21=3.5$$

And then, with $x_i=i$ that is $$x_1=1, x_2 = 2, \ldots , x_6=6$$ and $\displaystyle p=\frac{1}{6}$. We compute $$\sigma^2= \frac{1}{6} \cdot 1^2+\frac{1}{6} \cdot 2^2+\frac{1}{6} \cdot 3^2\frac{1}{6} \cdot 4^2+\frac{1}{6} \cdot 5^2+\frac{1}{6} \cdot 6^2-3.5^2=$$ $$=\frac{1}{6} \cdot 91 -12.25=2.91$$

## The standard deviation

The standard deviation is the square root of the variance, and it is expressed as follows: $$\sigma= \sqrt{\sum_{i=1}^n x_i^2 \cdot p_i-\mu^2}$$

In the previous example, $\sigma = \sqrt{2.91}=1.7$