Member-only story

5 Different Kinds Of Average

# And when to use which

Liu Zuo Lin
3 min readSep 25, 2023

1) Mean

This is the average we usually talk about.

mean = sum of numbers / number of numbers

For instance, in [3, 4, 5, 4], the mean would be (3+4+5+4)/4 = 4.

2) Median

When we use the mean, and there is an extreme value, the mean becomes pretty damn skewed. For instance, the mean of [1,1,1,2,100] is 21, which isn’t too reflective of the distribution (due to an extreme value 100).

Median = middle value when all values are sorted

Given [1,100,1,2,1], we get [1,1,1,2,100] when we sort it. And the middle value 1 is the median.. which is arguably more representative than the mean.

Given [1,1,4,5,7,100] which has 6 numbers, we take the MEAN of the middle 2 numbers, which means that our median is 4.5. Still pretty representative of the distribution.

It’s probably a good idea to use the median in place of the mean when there are extreme values that could screw with the mean.

3) Mode

Mode = value that occurs the most

--

--

Liu Zuo Lin
Liu Zuo Lin

Written by Liu Zuo Lin

SWE @ Meta | [Ebook] 101 Things I Never Knew About Python: https://payhip.com/b/vywcf

Responses (2)