LearnViz CompSci
Home / Learn / Math for Computing / Variance and Standard Deviation

Beginner Topic 15 of 51 Math for Computing

Variance and Standard Deviation

Measures of spread around the mean.

How it works

Variance measures how spread out values are around the mean, defined as the average squared deviation, E[(X minus mean) squared], and the standard deviation is its square root, in the same units as the data. For a sample, dividing by n minus 1 instead of n, Bessel's correction, gives an unbiased estimate of the population variance. Variances of independent variables add, and scaling a variable by c scales the variance by c squared. Covariance and correlation extend the idea to pairs of variables.

Where it is used

Quantifying risk and volatility in finance, measuring noise and consistency in experiments and performance measurements, standardizing features with z-scores and defining confidence intervals use these measures.

Common pitfall

Computing variance with the naive formula E[X squared] minus mean squared suffers catastrophic cancellation in floating point; use Welford's algorithm. Standard deviation is sensitive to outliers. Population versus sample formulas are often confused. Interpreting standard deviation assumes roughly symmetric distributions; look at the shape as well.

Where it fits in the course

Variance and Standard Deviation is topic 15 of 51 in Math for Computing, rated Beginner. It follows Mean, Median and Mode. The next topic is Combinatorial Probability.

Practice and explore

How to study this topic

  1. Read the explanation above and restate the definition in your own words.
  2. Open the interactive lesson and answer its mini quiz.
  3. Read the common pitfall, then write a short example that avoids it.
  4. Check your understanding in the Math for Computing quiz, and revisit the topic if you miss a question.

Frequently asked questions

What is Variance and Standard Deviation?
Measures of spread around the mean. It belongs to Math for Computing and is a beginner-level topic.
Where do people use Variance and Standard Deviation?
Quantifying risk and volatility in finance, measuring noise and consistency in experiments and performance measurements, standardizing features with z-scores and defining confidence intervals use these measures.
What is the most common mistake with Variance and Standard Deviation?
Computing variance with the naive formula E[X squared] minus mean squared suffers catastrophic cancellation in floating point; use Welford's algorithm.
What should I learn before this topic?
Start with Mean, Median and Mode, the topic just before it in Math for Computing.
How can I practice it?
Answer the mini quiz in the interactive lesson, then take the Math for Computing quiz.
Is Variance and Standard Deviation hard to learn?
It is a Beginner topic, so it works as an entry point. If the terms are new, read the explanation twice and try the visualizer before the quiz.
How long does it take to learn Variance and Standard Deviation?
Most learners can read the explanation and finish the interactive lesson in under an hour. Fluency comes from applying the idea, so plan a few short practice sessions with the quiz.
Which topics are related to Variance and Standard Deviation?
Mean, Median and Mode, Combinatorial Probability, Expected Value are closely connected. The full list is in the related topics section of this page.
What should I study after Variance and Standard Deviation?
Continue with Combinatorial Probability, the next topic in Math for Computing.

Related topics