Computing formula for the variance
σ²
The variance from the mean of the squares and the mean itself: E(X²) minus the square of the mean.
σ²=4
σ² equals 29 minus 5 squared, equals 29 minus 25, equals 4
Den här sidan finns på svenska. Byt till svenska
Theorem — what does that mean?
The variance from the mean of the squares and the mean itself, without subtracting the mean from every value.
In Swedish: Beräkningsformeln för variansen
σ²
The variance from the mean of the squares and the mean itself: E(X²) minus the square of the mean.
σ²=4
σ² equals 29 minus 5 squared, equals 29 minus 25, equals 4
You are given
σ² = E(X²) − μ²
Holds for any random variable with a finite second moment. It is the definition σ² = E((X − μ)²) multiplied out: E(X² − 2μX + μ²) = E(X²) − 2μ·μ + μ² = E(X²) − μ².
E(X²) is the mean of the squared values and μ the mean. The variance page has the form that subtracts first.
A fair die: E(X) = 3.5 and E(X²) = (1 + 4 + 9 + 16 + 25 + 36)/6 = 91/6. So σ² = 91/6 − 3.5² = 91/6 − 49/4 = 35/12 ≈ 2.92.
If X = 3 with probability 1, E(X²) = 9 and μ² = 9, and the variance is 0. A variance is not negative and E(X²) is at least μ², so a negative result means an arithmetic slip.
For a sample, the divisor changes, as on the sample variance page.
| Solve for | Rearranged | With the numbers | Comes to |
|---|---|---|---|
| σ² | E(X²) | 29 | 4 |
| E(X²) | σ² | 4 | 29 |
Last reviewed October 11, 2026 ·How pages are reviewed
Statistics and probabilityAll formulas
Copy the code into your page where the formula card should appear. It loads from lovetocalc.com, so it stays current on its own — all we ask is that the credit line comes with it.