Calculating the Mean Average

Calculating the Mean Average

Definition

  • The mean is a method of calculating the average of a set of numbers.
  • To calculate the mean, find the sum of the numbers and then divide by the count.

Example

  • Find the mean of the following numbers: [4, 7, 10]
sum = 4 + 7 + 10 = 21 
count = 3 
mean = 21 / 3 = 7

Mathematical Definition

The formal equation of calculating the mean average.
LaTeX formula:\overline{x} = (\frac{1}{n})\sum_{i=1}^{n}(x_{i})

Code (Python)

import numpy

values = [4, 7, 10]

mean = numpy.average(values)
print(mean)

Notes

  • There are other types of mean, this one is called the 'Arithmetic Mean'.
  • It is also called the 'Mathematical Expectation' and the 'Average'.