Sample Variance

Sample variance measures how spread out data points are around the mean, using n-1 instead of n to account for sample uncertainty.

s2=1n1(xixˉ)2s^2 = \frac{1}{n-1}\sum (x_i - \bar{x})^2

Solve a problem with Sample Variance

Type the problem. The solver will use Sample Variance where Sample Variance is the right tool, and tell you when it is not.

Drag one in or paste from the clipboard. JPEG, PNG or WebP. You get the transcription to check before anything is solved.

How to get a better answer
  • Paste the whole problem, including the instruction word — "simplify", "solve for x" and "factor" lead to three different answers.
  • Say what you have already tried. "I got x = 4 and the book says 2" turns a solution into a diagnosis.
  • Set the level in the settings button. A calculus shortcut is not a better answer if you have not met derivatives yet.
  • For a photo, get the whole problem in frame and hold the page flat — you get the transcription to fix before anything is solved.

What each symbol means

What Sample Variance takes
ss
xˉ\bar{x}
xix_i
nn
Sample Variance
SymbolMeaning
ssThe sample variance itself, measured in the square of the data's original units.
xˉ\bar{x}The sample mean, the average of all the data points in your sample.
xix_iEach individual data point in the sample; the subscript ii just labels which one.
nnThe number of observations in your sample; using n1n-1 instead of nn accounts for the fact that you're working with a sample, not the entire population.

When to use it

When you have a sample of data and want to quantify how much variation exists around the average.

Level

Usually taught in: Statistics · Appears on: AP Statistics

Worked examples

1. Find sample variance of small integer test scores

Problem

Find the sample variance of the test scores 8, 10, 7, 9, 11.
  1. xˉ=8+10+7+9+115=455=9\bar{x} = \frac{8 + 10 + 7 + 9 + 11}{5} = \frac{45}{5} = 9

    First, calculate the sample mean by adding all values and dividing by n=5n = 5.

  2. (xixˉ):1,1,2,0,2(x_i - \bar{x}): -1, 1, -2, 0, 2

    Find how much each score differs from the mean of 9.

  3. (xixˉ)2:1,1,4,0,4(x_i - \bar{x})^2: 1, 1, 4, 0, 4

    Square each deviation to eliminate negatives and emphasize larger distances from the mean.

  4. (xixˉ)2=1+1+4+0+4=10\sum (x_i - \bar{x})^2 = 1 + 1 + 4 + 0 + 4 = 10

    Add up all the squared deviations.

  5. s2=1051=104=2.5s^2 = \frac{10}{5-1} = \frac{10}{4} = 2.5

    Divide by n1=4n - 1 = 4, not by n=5n = 5, because this is a sample.

Answer: s2=2.5s^2 = 2.5

The sample variance of 2.5 tells us that, on average, each score deviates from the mean by about 2.51.58\sqrt{2.5} \approx 1.58 points. Using n1n-1 instead of nn gives an unbiased estimate of the population variance.

2. Find sample variance with negative values

Problem

Find the sample variance of the data set 2,0,3,1,5-2, 0, 3, -1, 5.
  1. xˉ=2+0+3+(1)+55=55=1\bar{x} = \frac{-2 + 0 + 3 + (-1) + 5}{5} = \frac{5}{5} = 1

    Calculate the sample mean by summing all values; negative numbers contribute to the sum just like positive ones.

  2. (xixˉ):3,1,2,2,4(x_i - \bar{x}): -3, -1, 2, -2, 4

    Find each value's deviation from the mean of 1.

  3. (xixˉ)2:9,1,4,4,16(x_i - \bar{x})^2: 9, 1, 4, 4, 16

    Square each deviation; this step is critical because squaring ensures negative deviations contribute positively to variance.

  4. (xixˉ)2=9+1+4+4+16=34\sum (x_i - \bar{x})^2 = 9 + 1 + 4 + 4 + 16 = 34

    Add all the squared deviations.

  5. s2=3451=344=8.5s^2 = \frac{34}{5-1} = \frac{34}{4} = 8.5

    Divide by n1=4n - 1 = 4 to get the sample variance.

Answer: s2=8.5s^2 = 8.5

Negative values in your data are handled correctly because deviations (both negative and positive) get squared before summing. This ensures all distances from the mean contribute equally to variance.

3. Find sample variance of video game level scores

Problem

A player scores 145, 162, 158, 175, and 140 points on five consecutive game levels. Find the sample variance of these scores.
  1. xˉ=145+162+158+175+1405=7805=156\bar{x} = \frac{145 + 162 + 158 + 175 + 140}{5} = \frac{780}{5} = 156

    Calculate the average score across the five levels.

  2. (xixˉ):11,6,2,19,16(x_i - \bar{x}): -11, 6, 2, 19, -16

    Find each level's deviation from the average of 156 points.

  3. (xixˉ)2:121,36,4,361,256(x_i - \bar{x})^2: 121, 36, 4, 361, 256

    Square each deviation to measure spread in squared points.

  4. (xixˉ)2=121+36+4+361+256=778\sum (x_i - \bar{x})^2 = 121 + 36 + 4 + 361 + 256 = 778

    Add all the squared deviations.

  5. s2=77851=7784=194.5s^2 = \frac{778}{5-1} = \frac{778}{4} = 194.5

    Divide by n1=4n - 1 = 4 because these five scores represent a sample of the player's skill, not every possible performance.

Answer: s2=194.5s^2 = 194.5

A variance of 194.5 points squared indicates significant variation in the player's performance across levels. The standard deviation (194.513.9\sqrt{194.5} \approx 13.9 points) gives a more intuitive measure of typical deviation from the 156-point average.

Common mistakes

Where Sample Variance usually goes wrong
Answer came out wrong
Writing s2=1n(xixˉ)2s^2 = \frac{1}{n}\sum (x_i - \bar{x})^2 by dividing by nn instead of n1n-1.
Always use s2=1n1(xixˉ)2s^2 = \frac{1}{n-1}\sum (x_i - \bar{x})^2 for sample variance; only divide by nn when calculating population variance.
Writing s2=1n1(xixˉ)s^2 = \frac{1}{n-1}\sum (x_i - \bar{x}) without squaring the deviations.
Always square each deviation before summing: s2=1n1(xixˉ)2s^2 = \frac{1}{n-1}\sum (x_i - \bar{x})^2.
Saying 'the spread is s2=194.5s^2 = 194.5 points' as if variance were in the original units.
Report s=s2s = \sqrt{s^2} (sample standard deviation) when discussing spread in original units, or always clarify that s2s^2 is in squared units.
The mistakeWhy it is wrongThe fix
Writing s2=1n(xixˉ)2s^2 = \frac{1}{n}\sum (x_i - \bar{x})^2 by dividing by nn instead of n1n-1.Dividing by nn instead of n1n-1 underestimates the true population variance because the sample mean is closer to the data points than the actual population mean would be.Always use s2=1n1(xixˉ)2s^2 = \frac{1}{n-1}\sum (x_i - \bar{x})^2 for sample variance; only divide by nn when calculating population variance.
Writing s2=1n1(xixˉ)s^2 = \frac{1}{n-1}\sum (x_i - \bar{x}) without squaring the deviations.The deviations (xixˉ)(x_i - \bar{x}) sum to exactly zero by definition, so skipping the squaring step yields zero as the variance, which is meaningless.Always square each deviation before summing: s2=1n1(xixˉ)2s^2 = \frac{1}{n-1}\sum (x_i - \bar{x})^2.
Saying 'the spread is s2=194.5s^2 = 194.5 points' as if variance were in the original units.Sample variance is in squared units, so describing it as a distance or spread in the original units is misleading; the correct spread measure is s=194.513.9s = \sqrt{194.5} \approx 13.9 points.Report s=s2s = \sqrt{s^2} (sample standard deviation) when discussing spread in original units, or always clarify that s2s^2 is in squared units.

Tips and when to use something else

  • Bessel's correction: dividing by n1n-1 instead of nn is called Bessel's correction; it accounts for the fact that the sample mean was calculated from the same data, making deviations slightly smaller than they would be from the true population mean.
  • The sum-to-zero trap: if your sum of deviations (xixˉ)(x_i - \bar{x}) equals zero without squaring, you've made an error; deviations always sum to zero before squaring.
  • Use standard deviation for readability: sample variance s2s^2 is in squared units and hard to interpret; take the square root to get sample standard deviation ss, which is in the same units as your data.
  • Population versus sample: if your data is the entire population (not a sample), use population variance with nn in the denominator instead; most real-world data is a sample.

Frequently asked questions

Why do we divide by n-1 instead of n?
When you calculate a sample mean xˉ\bar{x} from your data, you use up one degree of freedom. Dividing by n1n-1 (Bessel's correction) corrects for this, giving an unbiased estimate of the population variance. If you divided by nn, your sample variance would systematically underestimate the true population variance.
What's the difference between sample variance and population variance?
Sample variance divides by n1n-1 and is used when your data is a sample drawn from a larger population. Population variance divides by nn and is used when your data represents the entire population. In practice, you almost always have a sample, so sample variance is more common in real applications.
Can sample variance be negative?
No. Sample variance is always non-negative because it is the sum of squared deviations (which are always positive or zero) divided by a positive number. The only way s2=0s^2 = 0 is if all data points are identical.
Should I report s² or s when describing spread?
Report s2s^2 if the question specifically asks for variance. For describing how spread out the data is, report ss (sample standard deviation, the square root of variance) because it is in the same units as your original data and is far more interpretable.

Need a different method?

The full solver is not scoped to one formula — type any problem and it will pick the method.

Open the math solver

Reviewed 2026-09-18