For any series`(x_1, ..., x_n)` of real numbers, we define its arithmetic mean by the formula : `bar x= 1/n sum_(i=1)^n x_i`
So to calculate the average of several values, we add all the values and divide the result by the number of values.

To calculate the weighted average of a statistical series defined by giving the pairs `(x_i;n_i)`, where `x_i` is the value of the characteristic under study and `n_i` is the number of that value, `i in NN`, `1<=i<=p`,
we use the formula : `bar x= (sum_(i=1)^n x_i*n_i)/(sum_(i=1)^n n_i)=(n_1*x_1+n_2*x_2+...+x_p)/(n_1+n_2+...+n_p)`