Mean and variance: where are the values, and how spread out are they?

Two sets of measurements can have the same average and very different spreads. Mean tells us where the values are centered; variance tells us how far they spread around that mean. These statistics apply to numbers such as waiting times, temperatures, or test scores. They do not require vectors or dimensions.

Our starting values are 2, 4, 6, 8. Treat these as the complete, equally weighted population for this exercise. You need only arithmetic, squares, and square roots; mean and median introduces the average.

Shift every value: does the spread move too?

The mean is the sum divided by the number of values:

μ=1n∑i=1nxi=2+4+6+84=5.\mu=\frac{1}{n}\sum_{i=1}^n x_i =\frac{2+4+6+8}{4}=5.

A deviation is a value minus the mean, xi−μx_i-\mu. For our values the deviations are −3,−1,1,3-3,-1,1,3.

Before running the experiment, predict the mean and deviations after adding 5 to every value. Will the distances from the new mean change? Write your prediction and reason.

Record the reference with Multiply every value by set to 1 and Then add to every value set to 0. Next change only the addition to 5 and record another run. The multiplier and number of records stay fixed.

Four fixed reference values: 2, 4, 6, 8. Transform each to a × x + b using the selected multiplier a and shift b. Treat these four equally weighted values as the complete population for this exercise: variance divides by 4, not 3. No sampling, model training, or vector dimensions.

0/16 runs. Each run keeps its own inputs and results. Work stays in this tab across reloads; download a report before closing it.

Write a prediction to record your reference.

Record the mean, variance, and standard deviation. Open Inspect calculated records and compare the deviations and squared deviations row by row. Explain the observed change before opening ours. Explore dataset opens the reference values; your report retains the actual values for every run.

Compare the shifted values

The new values are 7,9,11,137,9,11,13, with mean 10. Subtracting that new mean gives −3,−1,1,3-3,-1,1,3 again. The center moved by 5, but the distances around it stayed unchanged.

Variance remains 5 and standard deviation remains 5≈2.236\sqrt5\approx2.236. We will derive those numbers next.

Why square the deviations?

Adding the deviations gives −3−1+1+3=0-3-1+1+3=0. Positive and negative deviations cancel even though the values differ. Their average therefore cannot measure spread. One solution is to square each deviation before averaging:

σ2=1n∑i=1n(xi−μ)2.\sigma^2=\frac{1}{n}\sum_{i=1}^n(x_i-\mu)^2.

This is population variance, written σ2\sigma^2. For the reference:

ValueDeviation from 5Squared deviation
2−39
4−11
611
839
σ2=9+1+1+94=5,σ=5≈2.236.\sigma^2=\frac{9+1+1+9}{4}=5, \qquad \sigma=\sqrt5\approx2.236.

The square root of variance is standard deviation, σ\sigma. If the measurements are in minutes, variance is in minutes squared and standard deviation is in minutes. Standard deviation is the root mean square distance from the mean; it is not the mean absolute distance. For these values, the mean absolute distance is (3+1+1+3)/4=2(3+1+1+3)/4=2.

Variance is always nonnegative and is zero exactly when all values are identical. Larger deviations receive more weight because they are squared, explaining the sensitivity to extreme values seen in spread and outliers.

Stretch every value: what doubles?

Return to Reference settings and select the original run as your Comparison baseline. Predict what happens to the mean, variance, and standard deviation when you multiply every value by 2. Does each statistic double?

Keep the addition at 0 and change only the multiplier to 2. Record the run and compare the deviations before and after. Explain your evidence before reading the calculation.

Compare the doubled values

The values become 4,8,12,164,8,12,16, with mean 10. Deviations are −6,−2,2,6-6,-2,2,6: twice their original sizes. Their squares are four times as large:

σnew2=36+4+4+364=20.\sigma_{\text{new}}^2=\frac{36+4+4+36}{4}=20.

The mean doubles, variance quadruples, and standard deviation doubles to 20=25\sqrt{20}=2\sqrt5.

Notice that adding 5 and multiplying by 2 both produced mean 10. Their variances differ: 5 versus 20. A mean alone does not determine spread.

The general shift and scale rules

Let Y=aX+bY=aX+b: multiply every original value by aa, then add bb. The new mean is aμ+ba\mu+b. Subtracting it from a transformed value gives

(axi+b)−(aμ+b)=a(xi−μ).(ax_i+b)-(a\mu+b)=a(x_i-\mu).

The shift cancels; the multiplier remains. Squaring and averaging establishes

Mean⁡(aX+b)=aMean⁡(X)+b,\operatorname{Mean}(aX+b)=a\operatorname{Mean}(X)+b, Var⁡(aX+b)=a2Var⁡(X),SD⁡(aX+b)=∣a∣SD⁡(X).\operatorname{Var}(aX+b)=a^2\operatorname{Var}(X), \qquad \operatorname{SD}(aX+b)=|a|\operatorname{SD}(X).

These identities explain every finite dataset with equal weights, not just our four examples. With probability weights, the same reasoning uses a probability-weighted average, called expectation, E[X]E[X], and variance E[(X−E[X])2]E[(X-E[X])^2].

The absolute value in the standard-deviation rule matters: a negative multiplier reverses the values’ order but cannot produce negative spread.

Population variance or sample variance?

Here our four values are the whole population we chose to describe, so we divide by n=4n=4. If they were an independent random sample used to estimate a larger population’s variance, the usual unbiased estimator is

s2=1n−1∑i=1n(xi−xˉ)2.s^2=\frac{1}{n-1}\sum_{i=1}^n(x_i-\bar x)^2.

The sample mean xˉ\bar x is estimated from those same observations. The deviations must sum to zero, leaving n−1n-1 freely varying deviations; the correction gives an unbiased variance estimator under the sampling assumptions. For these numbers, sample variance would be 20/3≈6.66720/3\approx6.667, not 5. Its square root is sample standard deviation, which is not itself generally unbiased.

Always state what you are describing or estimating and which denominator you use. The dataset explorer’s generic summaries use sample standard deviation; this note’s evidence table explicitly uses population variance and population standard deviation.

Design your own location-and-spread test

Choose a target mean that you can reach with the available controls. First choose an addition that moves the reference mean to that target while keeping variance unchanged. Write a prediction, run it, and explain the deviations.

Then choose a different multiplier and try to reach the same target mean with a different variance. Plan two one-change comparisons: reference → your chosen multiplier with addition 0 → the same multiplier with your chosen addition. Record the intermediate run as well as the endpoint, and select the matching baseline each time. If the controls cannot express your chosen values, use the formulas on paper.

What evidence would refute your claim that a shift preserves spread? Compare actual deviations, not just the displayed mean.

Check your design

For this reference, every proposed transformation must satisfy

μnew=5a+b,σnew2=5a2.\mu_{\text{new}}=5a+b,\qquad \sigma_{\text{new}}^2=5a^2.

Choose your target mm, then solve b=m−5ab=m-5a. Different multipliers with different absolute values give different variances even at the same mean. A shift that changed any deviation from its corresponding mean would contradict the shift-invariance claim.

Transfer: what does normalization do?

Predict what happens if the multiplier is −1-1, then separately if it is 0, with addition 0 in both cases. Test each against the original reference and explain why one preserves spread while the other removes it.

On paper, consider the transformation

zi=xi−μσ,σ>0.z_i=\frac{x_i-\mu}{\sigma},\qquad \sigma>0.

Use the shift and scale rules to predict its mean and variance before opening the answer. What if you divide by σ\sigma without subtracting μ\mu?

Check the boundary cases and normalization

Multiplier −1-1 gives mean −5-5, variance 5, and standard deviation 5\sqrt5. Multiplier 0 gives four zeros, so both mean and variance are zero.

Subtracting μ\mu centers the values at zero without changing variance. Dividing by σ\sigma then gives variance σ2/σ2=1\sigma^2/\sigma^2=1 and standard deviation 1. Together these operations are called standardization.

Dividing alone also gives unit variance, but leaves mean μ/σ\mu/\sigma. For our values that mean is 5\sqrt5, not zero. Variance normalization and centering are separate operations. If σ=0\sigma=0, the division is undefined; constant values need separate handling.

Download a report with your prediction, matched comparisons, and explanation. These general rules also explain scaling training data and the dimension factor in attention. Those are applications of variance, not part of its definition.

Continue

Previous: Spread and outliers · Next: Sampling from distributions · All statistics notes