Mean, variance, and standard deviation
Chanwoo Song 9 min read
In Korea, the elementary school math curriculum does not cover probability theory or statistics in depth. But through its ‘Data and Possibility’ strand, students build a foundation by presenting data in tables and graphs and learning the concept of the ‘average’.
Later, in middle and high school math, students study it systematically in the ‘Probability and Statistics’ course. It is an important field, one that continues to be taught in university mathematics as well.
In this post, I will cover what could be called the first step in probability and statistics: mean, variance, and standard deviation.
Mean
Variance and standard deviation may not feel familiar, but we come across the concept of the ‘average’ all the time in daily life: ‘average grade’, ‘the average of …’.
According to the dictionary, the mean, or average, is defined as follows.
「1」 Making the quality or quantity of several things uniform and even.
「2」 『Mathematics』 A number that holds the middle value of several numbers or of quantities of the same kind. There are the arithmetic mean, the geometric mean, the harmonic mean and others, but the term generally refers to the arithmetic mean. ≒ yeondeung, jungsu, mean value, mean number, mean figure.
- Standard Korean Language Dictionary, National Institute of Korean Language
The mean we usually talk about is said to refer to the ‘arithmetic mean’.
In this post, I will cover only the arithmetic mean. I will cover the geometric mean and the harmonic mean in other posts.
Representative values, the values that represent a set of data, include mean, median, mode, quartiles, percentiles, trimmed mean and so on.
Of these, the ‘mean’ is the most commonly used representative value.
The mean (arithmetic mean) is the sum of all the data values divided by the number of values. It can be written as a formula as follows.

In probability and statistics classes, you have probably seen μ (mu) and x̄ (x bar) used as symbols for the mean. μ is the mean of a population (the population mean), and x̄ is the mean of a sample drawn from the population (the sample mean).
Here, anyone who has studied ‘random variables’
‘The expected value is the mean.’
has probably heard this said.
The expected value is the value that the average of the results gets closer and closer to as the same random experiment is repeated many times under the same conditions.
I will cover the ‘expected value’ in more detail in the next post, on ‘random variables’.
For example, consider a game where you toss a fair coin and receive ₩1,000 if it lands heads and ₩0 if it lands tails. Heads and tails each have a 50% chance. After a few tosses, you may have received only ₩0, or only ₩1,000. But if you repeat this experiment enough times, the average amount you win per toss settles near ₩500. At first you do not know how much you will get, but if you toss the coin many more times, you can expect to get ₩500 on average. Calculating the expected value also shows that you can expect ₩500.

The graph above shows the average over 100,000 trials run in Python using a random function.
In other words, just as the “average” comes to ₩500 when ₩1,000 and ₩0 each come up with a probability of one half, you can think of the expected value as ‘the mean of a random variable’.
Variance
In daily life, we often say that something is ‘well dispersed’. Put simply, ‘dispersed’ here means something like ‘spread out evenly’. For example, suppose we have the following test scores (0 to 100 points) for 10 students each in Class A and Class B.
- Class A: 78, 79, 80, 80, 81, 82, 79, 81, 80, 80
- Class B: 50, 60, 70, 80, 90, 90, 95, 100, 85, 80
Just by looking, you can see that Class A's scores are mostly around 80. Class B's scores, on the other hand, are hard to describe as sitting near any particular score.
Here is what I think ‘variance’ means: given another data set like Class B's, it is a measure that shows in numbers which class is more evenly distributed.
「3」 『Mathematics』 The arithmetic mean of the values obtained by squaring the deviations, where a deviation is the difference between a statistical value and the mean. When the variance is small, the data cluster around the mean. When it is large, many of the data lie far from the mean.
- Standard Korean Language Dictionary, National Institute of Korean Language
To understand the mathematical definition of ‘variance’, you need to understand that it is the mean of the values you get by taking the difference between each value and the mean, the ‘deviation’, and squaring it.
‘Deviation’ is found by first getting the ‘mean’ of the data and then taking the difference between each data value and the mean. As a formula, it looks like this.

Square these, add them all together, and divide by the number of data points (n), that is, take the mean, and you get the ‘variance’. As a formula, it looks like this.

Using the score data above, the variances are as follows.
- Class A variance: 1.2
- Class B variance: 225.0
So the smaller the variance, the more evenly the data are distributed.
But the key point here is that it is the sum of the ‘squared’ deviations. It seems we could simply add up the differences, so why do we square them before adding?
First, the biggest problem is that the sum of the deviations is 0. If you want to check whether that is really true, take the score data above, find the deviations, and add them up. The mean of that data is 80. Find the deviations and add them all, and the total comes to 0.

To prove it mathematically, it goes as follows.




This shows that the sum of the deviations is 0.
Then, since all we need to solve is “the problem of negative and positive values canceling each other out”, it might seem at first that we could just add up the absolute values of the deviations. So why squares, of all things?
There are several reasons for this.
1. It is much easier to handle mathematically.
If you know differentiation, you will know that the absolute value function |x| has a cusp, so it is not differentiable everywhere. (It is not differentiable at x = 0.)
Later on, we will need to find the value that minimizes the sum of errors. Differentiation lets us find that minimum efficiently, so it matters that the function is differentiable.
Because many theories in probability and statistics are built around the ‘mean’, squared deviations naturally became the standard choice.
2. Properties that hold come along with it.
Later, when we deal with random variables, we will look at properties like the following.
- Var(aX + b) = a²Var(X)
- Var(X + Y) = Var(X) + Var(Y) (when the random variables X and Y are independent)
These relationships hold because we use ‘squared deviations’. As a result, variance is easy to calculate when working with sums of several random variables, and theories we will learn later, such as confidence intervals and hypothesis testing, can be developed systematically.
3. Large deviations are reflected more strongly.
Using squares means we can expect an ‘exponential’ kind of change.
When there are extreme values far from the mean, we can expect the variance to reflect them even more strongly.
Concepts derived for these reasons, such as Mean Squared Error (MSE), come up often. Once you get into statistics and machine learning, there is no end to these topics, so I recommend that anyone interested look them up and build on them.
Standard deviation
The standard deviation is something you will meet constantly as you study probability and statistics, so I hope you get the concept clear.
Simply put, the standard deviation is the square root of the variance.
『Mathematics』 A number that shows how widely data are dispersed. It is the positive square root of the variance. A small standard deviation means the degree of dispersion around the mean is small.
- Standard Korean Language Dictionary, National Institute of Korean Language
The standard deviation of a population is usually written σ (sigma), and that of a sample drawn from it is written s. Since variance is the square of the standard deviation, the variances are written σ² and s², respectively.
So why, when variance is already variance, do we define the ‘degree of spread’ again as something called the standard deviation?
First, part of the reason is to match the ‘units’ of the spread.
Variance is the sum of squared deviations. Squaring is the part to focus on here.
For example, suppose the squared deviation for a single data point is as follows. (Since this is score data, let's say the unit is ‘points’.)
(75 points – 80 points)² = (-5 points)² = 25 points² ?
In daily life we understand “it's so many points”, but have we ever seen anything like ‘so many points²’?
This is why we apply the square root: to bring the units back to something we can understand intuitively. Even in the example above, ‘the data are spread within about 5 points of the mean’ is easier to grasp than ‘there is a spread of 25 points²’.
The scale shrinks to something we can grasp intuitively, and the units are brought into line. That is why the standard deviation uses the square root of the variance.
Also, the ‘normal distribution’, which we will cover later, is generalized in terms of the standard deviation rather than the variance.
Even on simple reflection, using the standard deviation, which already has the square root applied, is more convenient than writing the square root of the variance in formulas.
Of course, we do not use the standard deviation just because it is convenient to write. In the normal distribution, it is σ (the standard deviation) that directly controls the ‘width of the distribution’.

I will go into more detail when we cover the normal distribution, but in a formula like the one above, too, it is σ (the standard deviation) that is used directly.
The standard deviation is a measure that tells us, when we look at the data as a whole, how widely they are spread around the mean.
Wrapping up
In the next post, I will cover ‘random variables’ and ‘expected value’, which I have mentioned many times above.