If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

## Statistics and probability

### Unit 3: Lesson 5

Variance and standard deviation of a sample

# Population and sample standard deviation review

## Population and sample standard deviation

Standard deviation measures the spread of a data distribution. It measures the typical distance between each data point and the mean.
The formula we use for standard deviation depends on whether the data is being considered a population of its own, or the data is a sample representing a larger population.
• If the data is being considered a population on its own, we divide by the number of data points, N.
• If the data is a sample from a larger population, we divide by one fewer than the number of data points in the sample, n, minus, 1.
Population standard deviation:
sigma, equals, square root of, start fraction, sum, left parenthesis, x, start subscript, i, end subscript, minus, mu, right parenthesis, squared, divided by, N, end fraction, end square root
Sample standard deviation:
s, start subscript, x, end subscript, equals, square root of, start fraction, sum, left parenthesis, x, start subscript, i, end subscript, minus, x, with, \bar, on top, right parenthesis, squared, divided by, n, minus, 1, end fraction, end square root
The steps in each formula are all the same except for one—we divide by one less than the number of data points when dealing with sample data.
We'll go through each formula step by step in the examples below.
Why we divide by n, minus, 1 is a pretty complex concept. If you want to learn more about the intuition behind this topic, check out this video.

### Population standard deviation

Here's the formula again for population standard deviation:
sigma, equals, square root of, start fraction, sum, left parenthesis, x, start subscript, i, end subscript, minus, mu, right parenthesis, squared, divided by, N, end fraction, end square root
Here's how to calculate population standard deviation:
Step 1: Calculate the mean of the data—this is mu in the formula.
Step 2: Subtract the mean from each data point. These differences are called deviations. Data points below the mean will have negative deviations, and data points above the mean will have positive deviations.
Step 3: Square each deviation to make it positive.
Step 4: Add the squared deviations together.
Step 5: Divide the sum by the number of data points in the population. The result is called the variance.
Step 6: Take the square root of the variance to get the standard deviation.

### Example: Population standard deviation

Four friends were comparing their scores on a recent essay.
Calculate the standard deviation of their scores:
6, 2, 3, 1
Step 1: Find the mean.
mu, equals, start fraction, 6, plus, 2, plus, 3, plus, 1, divided by, 4, end fraction, equals, start fraction, 12, divided by, 4, end fraction, equals, 3
The mean is 3 points.
Step 2: Subtract the mean from each score.
Score: x, start subscript, i, end subscriptDeviation: left parenthesis, x, start subscript, i, end subscript, minus, mu, right parenthesis
66, minus, 3, equals, 3
22, minus, 3, equals, minus, 1
33, minus, 3, equals, 0
11, minus, 3, equals, minus, 2
Step 3: Square each deviation.
Score: x, start subscript, i, end subscriptDeviation: left parenthesis, x, start subscript, i, end subscript, minus, mu, right parenthesisSquared deviation: left parenthesis, x, start subscript, i, end subscript, minus, mu, right parenthesis, squared
66, minus, 3, equals, 3left parenthesis, 3, right parenthesis, squared, equals, 9
22, minus, 3, equals, minus, 1left parenthesis, minus, 1, right parenthesis, squared, equals, 1
33, minus, 3, equals, 0left parenthesis, 0, right parenthesis, squared, equals, 0
11, minus, 3, equals, minus, 2left parenthesis, minus, 2, right parenthesis, squared, equals, 4
Step 4: Add the squared deviations.
9, plus, 1, plus, 0, plus, 4, equals, 14
Step 5: Divide the sum by the number of scores.
start fraction, 14, divided by, 4, end fraction, equals, 3, point, 5
Step 6: Take the square root of the result from Step 5.
square root of, 3, point, 5, end square root, approximately equals, 1, point, 87
The standard deviation is approximately 1, point, 87.
Want to practice some problems like this? Check out this exercise on standard deviation of a population.

### Sample standard deviation

Here's the formula again for sample standard deviation:
s, start subscript, x, end subscript, equals, square root of, start fraction, sum, left parenthesis, x, start subscript, i, end subscript, minus, x, with, \bar, on top, right parenthesis, squared, divided by, n, minus, 1, end fraction, end square root
Here's how to calculate sample standard deviation:
Step 1: Calculate the mean of the data—this is x, with, \bar, on top in the formula.
Step 2: Subtract the mean from each data point. These differences are called deviations. Data points below the mean will have negative deviations, and data points above the mean will have positive deviations.
Step 3: Square each deviation to make it positive.
Step 4: Add the squared deviations together.
Step 5: Divide the sum by one less than the number of data points in the sample. The result is called the variance.
Step 6: Take the square root of the variance to get the standard deviation.

### Example: Sample standard deviation

A sample of 4 students was taken to see how many pencils they were carrying.
Calculate the sample standard deviation of their responses:
2, 2, 5, 7
Step 1: Find the mean.
x, with, \bar, on top, equals, start fraction, 2, plus, 2, plus, 5, plus, 7, divided by, 4, end fraction, equals, start fraction, 16, divided by, 4, end fraction, equals, 4
The sample mean is 4 pencils.
Step 2: Subtract the mean from each score.
Pencils: x, start subscript, i, end subscriptDeviation: left parenthesis, x, start subscript, i, end subscript, minus, mu, right parenthesis
22, minus, 4, equals, minus, 2
22, minus, 4, equals, minus, 2
55, minus, 4, equals, 1
77, minus, 4, equals, 3
Step 3: Square each deviation.
Pencils: x, start subscript, i, end subscriptDeviation: left parenthesis, x, start subscript, i, end subscript, minus, x, with, \bar, on top, right parenthesisSquared deviation: left parenthesis, x, start subscript, i, end subscript, minus, x, with, \bar, on top, right parenthesis, squared
22, minus, 4, equals, minus, 2left parenthesis, minus, 2, right parenthesis, squared, equals, 4
22, minus, 4, equals, minus, 2left parenthesis, minus, 2, right parenthesis, squared, equals, 4
55, minus, 4, equals, 1left parenthesis, 1, right parenthesis, squared, equals, 1
77, minus, 4, equals, 3left parenthesis, 3, right parenthesis, squared, equals, 9
Step 4: Add the squared deviations.
4, plus, 4, plus, 1, plus, 9, equals, 18
Step 5: Divide the sum by one less than the number of data points.
start fraction, 18, divided by, 4, minus, 1, end fraction, equals, start fraction, 18, divided by, 3, end fraction, equals, 6
Step 6: Take the square root of the result from Step 5.
square root of, 6, end square root, approximately equals, 2, point, 45
The sample standard deviation is approximately 2, point, 45.
Want to practice some problems like this? Check out this exercise on sample and population standard deviation.

## Want to join the conversation?

• how to identify that the problem is sample problem or population
problem?
• Great question! It depends on why you are calculating the standard deviation. In the case of sampling, you are randomly selecting a set of data points for the purpose of estimating the true values for mean, standard deviation, etc. In the case of a population problem you are collecting data points from 100% of the subjects you wish to study.
• Why standard deviation is a better measure of the diversity in age than the mean?
• I'll try to give you a quick example that I hope will clarify this. If you picked three people with ages 49, 50, 51, and then other three people with ages 15, 50, 85, you can understand easily that the ages are more "diverse" in the second case. In the first case people are all around 50, while in the second you have a young, a middle-aged, and an old person.

However, in both cases the average is 50! The average cannot pick on this diversity, and in fact it doesn't measure diversity at all, only central tendency. On the other hand, the standard deviation turns out to be 0.8, and 28.6 respectively, and correctly assigns greater "diversity" to the second case. Hope this helps!
• Why do we have to substract 1 from the total number of indiduals when we're dealing with a sample instead of a population? I know how to calculate the sample standard deviation, but I want to know the underlying reason why the formula has that tiny variation
• If the sample has about 70% or 80% of the population, should I still use the "n-1" rules?? Or i just divided by n?
• this is why I hate both love and hate stats. how can you effectively tell whether you need to use a sample or the whole population? (this seems to the be the most asked question)
• You have to look at the hints in the question. With popn. you will usually see words like all, true, or whole. For sample, words will be like a representative, sample, this group, etc.
• Can i know what the difference between the (∑(x-μ)^2)/N formula and [∑x^2-((∑x)^2)/N]N this formula. How can i know which one im suppose to use ?
• How do I find the standard deviation if I am only given the sample size and the sample mean?
• The population mean of GDP/cap (in thousands) is $18.79 with a standard deviation of$12.83. Use the normal distribution to estimate the number of countries with