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.

### Course: Statistics and probability>Unit 3

Lesson 4: Variance and standard deviation of a population

# Statistics: Alternate variance formulas

Sal explains a different variance formula and why it works! For a population, the variance is calculated as σ² = ( Σ (x-μ)² ) / N. Another equivalent formula is σ² = ( (Σ x²) / N ) - μ². If we need to calculate variance by hand, this alternate formula is easier to work with. Created by Sal Khan.

## Want to join the conversation?

• how does this work for sample variance? do you just subtract 1 from n?
• CAUTION !! As it is stated by sal this formula of variance only works for Population data only, not for sample data. The above formula is not a generalized one hence subtracting 1 from n wont yield the result of sample variance. You can simplify the sample variance as done in video you 'll get it. Thanks
• Around Sal references the Calculus playlist--I'm not even CLOSE to that playlist yet. Am I watching these videos too soon? It seems like the Statistics playlist is showing up really early on my practice map and I may not have the skills to successfully accomplish the unit. Do you think this could be true? I did okay up through standard deviation, but z-scores, empirical rule and some references are throwing me off!
• This is like a side tour, sightseeing in a cool neighborhood. You don't need to move into the calculus house to work in statistics. For example, I think the formula for the Standard Deviation of a uniform distribution is (b-a)/sqrt(12). I wanted to know, Why 12? I asked Doctor Math and he (Doctor Anthony) gave me an explanation that I (frankly) didn't understand, but trust. I don't need to know where the 12 came from to use the formula, but I find it comforting to know that someone knows.
• around where did 1 come from, next to the Sum?
• Firstly, it's grabbed from the "∑( … μ²)" above.
Salman moved μ² to the left of ∑ by dividing it away (to multiply it onto the left side).
∑(μ²) = μ²∑(1),
Because μ² ÷ μ² = 1, and it's only the xᵢ stuff that can't be divided away to the left side. Got that now? =)
• Variance is the single most used formula in Machine learning in supervised learning lessons. Thanks Sal ! You're giving me greater intuition of the topics making me a better engineer.!
• Can someone please let me know how does this work out for sample variance? Do we need to use (N-1) instead of N in the denominator and carry out the simplifications accordingly?
• I re-derived it for sample variances, and I tested my solutions against the problems section. This works if you already have a mean:

∑(x_i)^2 / (N-1) - (N/(N-1)) x̄^2

It's nice, and not much more complicated than the simple one he came up with in the video. Basically, divide the first term by (N-1) instead of N, and multiply the mean by the sample size, then divide by the sample size minus one.

For a Raw Scores method (you don't have a mean first), this works:

(N*∑(x_i)^2 - (∑(x_i)^2 ) / N*(N-1)

or

∑(x_i)^2 / (N-1) - (∑(x_i)^2 / N*(N-1)
• If i hear "mew" again im going to scream.
• where do I find chebyshev's theorem help?