Maths4UBETA

Range, quartiles and raw-data variance

Use a centre and a spread together, distinguishing the middle half from squared deviations about the mean.

Try the quick check →
Lesson 1 of 5

Section 1 of 4 · Core · about 7 min

What do range and IQR measure?

A centre tells you where a dataset lies, but not how tightly its values cluster. The range uses the two extremes; the interquartile range describes the gap between the lower and upper quartiles:

range=max⁡(x)−min⁡(x),IQR=Q3−Q1.\text{range}=\max(x)-\min(x),\qquad\mathrm{IQR}=Q_3-Q_1.

Both use the original measurement units. Range responds directly to an extreme endpoint. IQR is less sensitive to changes far out in the tails, although changing the count or ordering can change the quartile positions.

The minimum is 4 and the maximum 30. The box is from 7 to 16 with the median at 11.

In order, the records are 4,6,7,9,10,12,14,16,18,304,6,7,9,10,12,14,16,18,30. The middle position in each half gives its quartile.

Q2=10+122=11,IQR=16−7=9,range=30−4=26.Q_2=\frac{10+12}2=11,\qquad\mathrm{IQR}=16-7=9,\qquad\mathrm{range}=30-4=26.

All ten observations belong to the two halves. Their middle values give Q1=7Q_1=7 and Q3=16Q_3=16, so IQR=9\mathrm{IQR}=9.

Worked example

Split an even list into equal halves

For the ordered data below, find the median, quartiles, range and IQR. Use the median-of-halves convention; with an even count, retain all observations in two equal halves.

4,6,7,9,10,12,14,16,18,30.4,6,7,9,10,12,14,16,18,30.

Then explain what changes if the final observation 3030 is replaced by 6060.

  1. There are ten observations. The median is the average of the values at positions 55 and 66:

    median=10+122=11.\text{median}=\frac{10+12}{2}=11.
  2. The lower half is 4,6,7,9,104,6,7,9,10; its middle value is 77. The upper half is 12,14,16,18,3012,14,16,18,30; its middle value is 1616. Thus

    Q1=7,Q3=16.Q_1=7,\qquad Q_3=16.
  3. range=30−4=26,IQR=16−7=9.\text{range}=30-4=26,\qquad\mathrm{IQR}=16-7=9.
  4. Replacing only the final value by 6060 gives range 60−4=5660-4=56. The median and both half-medians remain at the same unchanged records, so the IQR remains 99. This conclusion uses the unchanged order and count in this particular edit.

Your turn

Find the median, quartiles, range and IQR of

5,7,7,9,9,10,13,15,29.5,7,7,9,9,10,13,15,29.

Use the median-of-halves convention: for this odd count, exclude only the single overall middle observation when forming the two halves. Retain every other record, including equal values.

Enter an exact number, for example 3/2 or 2-sqrt(3).

Enter an exact number, for example 3/2 or 2-sqrt(3).

Enter an exact number, for example 3/2 or 2-sqrt(3).

Enter an exact number, for example 3/2 or 2-sqrt(3).

Enter an exact number, for example 3/2 or 2-sqrt(3).

The quartile interval describes central spread; with finite samples and ties, it need not contain exactly half the observed values. Grouped cumulative-frequency estimates use a separate interpolation method, not this raw-list convention.

Section 2 of 4 · Core · about 8 min

How do all observations contribute to variance?

For nn numerical observations with mean μ\mu, a deviation is x−μx-\mu. Positive and negative deviations sum to zero, so square them before adding:

D=∑(x−μ)2,σ2=Dn,σ=σ2.D=\sum(x-\mu)^2,\qquad\sigma^2=\frac{D}{n},\qquad\sigma=\sqrt{\sigma^2}.

DD is the centred sum of squares. Descriptive variance is its average over all nn records, using n>0n>0. Every observation contributes, including repeats and extremes.

Variance and SD cannot be negative. They are zero exactly when all observations have the same value; that value need not be zero. A single-observation dataset therefore has zero descriptive variance.

Worked example

Square deviations from the actual mean

Calculate the descriptive variance and standard deviation of the numerical observations 2,5,5,82,5,5,8, showing the deviations from their mean.

  1. μ=2+5+5+84=5.\mu=\frac{2+5+5+8}{4}=5.
  2. xxx−μx-\mu(x−μ)2(x-\mu)^2
    22−3-399
    550000
    550000
    883399

    The signed deviations add to zero, but their squares add to 1818. Both records equal to 55 remain in the count.

  3. D=18,σ2=184=92,σ=322.D=18,\qquad\sigma^2=\frac{18}{4}=\frac{9}{2},\qquad\sigma=\frac{3\sqrt{2}}{2}.

Your turn

Four signed measurement errors, in centimetres, are −4,−1,2,3-4,-1,2,3. Find their mean, descriptive variance and standard deviation. What would a descriptive SD of zero imply for any nonempty dataset?

Enter an exact number, for example 3/2 or 2-sqrt(3).

Enter an exact value or round to 3 significant figures.

Enter an exact value or round to 3 significant figures.

Meaning of zero standard deviation

For comparisons, explain both centre and spread in context. Mean and SD use all records; median and IQR describe the centre and spread with less sensitivity to extreme magnitudes. A smaller spread means more consistent observed values, not automatically a better outcome for every purpose.

Worked example

Compare observed spread in context

Two observed batches contain lengths intended to be 11 cm11\,\mathrm{cm}:

A:9,10,11,12,13,B:3,9,11,15,17.\mathrm{A}:9,10,11,12,13,\qquad \mathrm{B}:3,9,11,15,17.

Compare their mean lengths and standard deviations, and say what the comparison shows about these recorded batches.

  1. μA=555=11 cm,μB=555=11 cm.\mu_A=\frac{55}{5}=11\,\mathrm{cm},\qquad\mu_B=\frac{55}{5}=11\,\mathrm{cm}.

    The means alone do not distinguish their variation.

  2. DA=(−2)2+(−1)2+02+12+22=10,D_A=(-2)^2+(-1)^2+0^2+1^2+2^2=10,σA2=105=2 cm2,σA=2 cm.\sigma_A^2=\frac{10}{5}=2\,\mathrm{cm}^2,\qquad\sigma_A=\sqrt{2}\,\mathrm{cm}.
  3. DB=(−8)2+(−2)2+02+42+62=120,D_B=(-8)^2+(-2)^2+0^2+4^2+6^2=120,σB2=1205=24 cm2,σB=26 cm.\sigma_B^2=\frac{120}{5}=24\,\mathrm{cm}^2,\qquad\sigma_B=2\sqrt{6}\,\mathrm{cm}.
  4. Both recorded batch means equal the target. A has the smaller SD, so its observed lengths are more tightly grouped around that target. These small batches alone do not establish that future batches from A will always be more consistent.

Section 3 of 4 · Core · about 6 min

Can I find variance from totals alone?

Write T=∑xT=\sum x, Q=∑x2Q=\sum x^2, and μ=Tn\mu=\frac{T}{n}. Expanding the centred squares gives

D=∑(x−μ)2=Q−2μT+nμ2=Q−T2n.D=\sum(x-\mu)^2=Q-2\mu T+n\mu^2=Q-\frac{T^2}{n}.

Therefore either route gives the same descriptive variance:

σ2=Dn=Qn−(Tn)2.\sigma^2=\frac{D}{n}=\frac{Q}{n}-\left(\frac{T}{n}\right)^2.

Worked example

Use totals without reconstructing every record

Eight masses, in grams, have total T=80 gT=80\,\mathrm{g} and sum of squares Q=864 g2Q=864\,\mathrm{g}^2. Find the mean, centred sum of squares, descriptive variance and SD.

  1. μ=808=10 g.\mu=\frac{80}{8}=10\,\mathrm{g}.
  2. D=Q−T2n=864−8028=64 g2.D=Q-\frac{T^2}{n}=864-\frac{80^2}{8}=64\,\mathrm{g}^2.
  3. σ2=648=8 g2,σ=22 g.\sigma^2=\frac{64}{8}=8\,\mathrm{g}^2,\qquad\sigma=2\sqrt{2}\,\mathrm{g}.
  4. The equivalent direct formula gives the same result:

    σ2=8648−(808)2=108−100=8 g2.\sigma^2=\frac{864}{8}-\left(\frac{80}{8}\right)^2=108-100=8\,\mathrm{g}^2.

Your turn

Four masses, in grams, have total T=28 gT=28\,\mathrm{g} and sum of squares Q=220 g2Q=220\,\mathrm{g}^2. Find the mean, centred sum of squares and descriptive variance. A separate proposal has the same count and total but Q=190 g2Q=190\,\mathrm{g}^2. Could those proposed exact totals describe real observations?

Enter an exact number, for example 3/2 or 2-sqrt(3).

Enter an exact number, for example 3/2 or 2-sqrt(3).

Enter an exact number, for example 3/2 or 2-sqrt(3).

Feasibility of the separate proposal

Section 4 of 4 · Further applications · about 7 min

Why does the mean give the smallest squared-distance total?

Keep the observations fixed and choose any real reference aa. Write S(a)=∑(x−a)2S(a)=\sum(x-a)^2. Using x−a=(x−μ)+(μ−a)x-a=(x-\mu)+(\mu-a), the cross term disappears because ∑(x−μ)=0\sum(x-\mu)=0. This gives

S(a)=∑(x−μ)2+n(a−μ)2=D+n(a−μ)2.S(a)=\sum(x-\mu)^2+n(a-\mu)^2=D+n(a-\mu)^2.

The extra square is non-negative and vanishes only at a=μa=\mu. Thus the minimum sum of squares is D=nσ2D=n\sigma^2, while the minimum average squared distance is σ2\sigma^2. Neither is zero unless all original observations are equal.

The two outside observations are three units from five. The two central observations are at the mean.

xix_ixi−5x_i-5(xi−5)2(x_i-5)^2
2-39
500
500
839
Total018
σ2=184=92,σ=322.\sigma^2=\frac{18}{4}=\frac92,\qquad \sigma=\frac{3\sqrt2}{2}.

For example, the squared distance total about a=2a=2 is 5454. Dividing that total by four gives 272\frac{27}{2}, which is larger than the variance. The two observations equal to 55 count separately.

For 2,5,5,82,5,5,8, S(a)=18+4(a−5)2S(a)=18+4(a-5)^2. Its minimum is 1818 at a=5a=5, while the data variance remains 92\frac{9}{2}.

Worked example

The best reference leaves the original spread

The fixed observations are 2,5,5,82,5,5,8. Compare their sum of squared distances from a=2a=2 with the smallest possible sum over all real reference values aa. State the original descriptive variance.

  1. The actual mean is 55, and its centred sum of squares is

    D=(2−5)2+(5−5)2+(5−5)2+(8−5)2=18.D=(2-5)^2+(5-5)^2+(5-5)^2+(8-5)^2=18.
  2. S(a)=18+4(a−5)2.S(a)=18+4(a-5)^2.
  3. S(2)=18+4(2−5)2=54.S(2)=18+4(2-5)^2=54.

    Directly, the squared distances are 0,9,9,360,9,9,36, which also total 5454.

  4. The square term is non-negative, so S(a)S(a) has minimum 1818, only at a=5a=5. The variance of the original observations is always

    σ2=184=92.\sigma^2=\frac{18}{4}=\frac{9}{2}.
  5. The value S(2)4=272\frac{S(2)}{4}=\frac{27}{2} is an average squared distance from the reference 22, not the original variance. Choosing the best reference does not turn the remaining spread into zero.

Your turn

The fixed observations are 1,3,7,91,3,7,9. Define S(a)=∑(x−a)2S(a)=\sum(x-a)^2, where aa is any real reference value. Find the reference that minimises SS, the minimum value, the original descriptive variance, and every real aa for which S(a)=56S(a)=56.

Enter an exact number, for example 3/2 or 2-sqrt(3).

Enter an exact number, for example 3/2 or 2-sqrt(3).

Enter an exact number, for example 3/2 or 2-sqrt(3).

Give the complete set: {1, 4} for separate values, (1, 5] for an interval, U for union or empty for no real solutions. Use sqrt(...) for exact roots.

Moving the reference changes the distances being measured; it leaves the records and their variance fixed. For a prescribed sum of squares, solve the resulting squared equation completely. If an additional interval or integer restriction on aa is stated, apply it to every resulting value.

Worked examples

Practise the method

Core practice

Question 1 of 4

0 / 4 checked in this collection

Question list

Core practice

Fresh variants

Exam-style

All raw-data moments

3 marks

For 1, 3, 4, 6, 6, give the exact mean, descriptive variance and SD.

Enter an exact number, for example 3/2 or 2-sqrt(3).

Enter an exact number, for example 3/2 or 2-sqrt(3).

Enter an exact number, for example 3/2 or 2-sqrt(3).

Full answer-format guide

Exact numbers: 3/2, sqrt(5), 2-sqrt(3), pi/6, 3*pi/2. Sets: {1,4}. Intervals: (3,5]; a round bracket excludes the endpoint. Infinity: inf; union: U; no solutions: empty. Separate coordinate pairs or triples with semicolons. Expressions: 2x^2+3x-1; equations: x^2=3x+1 or the polynomial equal to zero. Factors: x-1 ; x+2. Parameter fraction: numerator ; denominator. List integer answers individually.

Review the method

Progress stays in this browser. Create an account to save it or sign in.

Extra practice from this lesson

Square the deviations before averaging

Five lengths, in centimetres, are 3,5,5,7,103,5,5,7,10. Find the mean, the sum of signed deviations from that mean, the descriptive variance and the standard deviation.

Enter an exact number, for example 3/2 or 2-sqrt(3).

Enter an exact number, for example 3/2 or 2-sqrt(3).

Enter an exact value or round to 3 significant figures.

Enter an exact value or round to 3 significant figures.

Use both halves of an even-sized list

The ordered observations are 2,3,4,5,5,8,10,12,13,252,3,4,5,5,8,10,12,13,25. Use medians of the lower and upper halves for quartiles, retaining all ten observations. Find Q1Q_1, the median, Q3Q_3, IQR and range. Then replace only 2525 by 100100. Find the new range and decide how the IQR changes.

Enter an exact number, for example 3/2 or 2-sqrt(3).

Enter an exact value or round to 3 significant figures.

Enter an exact number, for example 3/2 or 2-sqrt(3).

Enter an exact number, for example 3/2 or 2-sqrt(3).

Enter an exact number, for example 3/2 or 2-sqrt(3).

Enter an exact number, for example 3/2 or 2-sqrt(3).

IQR after replacement

Exclude one middle position, not every equal value

The ordered observations are 4,6,6,7,8,8,9,12,304,6,6,7,8,8,9,12,30. Use medians of halves, excluding only the single overall middle observation because the count is odd. Find the median, both quartiles and the IQR.

Enter an exact number, for example 3/2 or 2-sqrt(3).

Enter an exact number, for example 3/2 or 2-sqrt(3).

Enter an exact value or round to 3 significant figures.

Enter an exact value or round to 3 significant figures.

Recover a centred sum from moment totals

Eight measurements, in grams, have ∑x=96\sum x=96 and ∑x2=1248\sum x^2=1248. Find their mean, sum of squared deviations from the mean, descriptive variance and standard deviation.

Enter an exact number, for example 3/2 or 2-sqrt(3).

Enter an exact number, for example 3/2 or 2-sqrt(3).

Enter an exact number, for example 3/2 or 2-sqrt(3).

Enter an exact value or round to 3 significant figures.

Check whether the summary totals are possible

A report claims that six real observations have ∑x=42\sum x=42 and ∑x2=280\sum x^2=280. Calculate the variance implied by these totals, the smallest possible sum of squares for six observations with total 4242, and decide whether the report is consistent.

Enter an exact value or round to 3 significant figures.

Enter an exact number, for example 3/2 or 2-sqrt(3).

Are the stated totals possible?

Apply it · original exam-style problems

Show your working on paper and compare it with the worked solution and marking guidance.

Start after this lesson

An unchanged IQR can hide wider extremes 7 marks

Two machines aim to produce lengths of 1111 cm. Seven observed lengths from each machine are:

A: 8,9,10,11,12,13,148,9,10,11,12,13,14.
B: 2,9,10,11,12,13,202,9,10,11,12,13,20.

Use medians of halves, excluding the single overall median in each odd-sized list. Show that the means are equal and calculate their common IQR. Calculate both descriptive variances. Which observed batch is more consistent around the target, and what does the equal IQR fail to show here?

Hint

Compare each observation with the common mean 1111. The quartiles use the central values within each half, while variance uses all seven squared deviations.

Worked solution
  1. TA=TB=77,xˉA=xˉB=11 cm.T_A=T_B=77,\qquad \bar{x}_A=\bar{x}_B=11\ \text{cm}.
  2. Each lower half has median 99, and each upper half has median 1313. Both IQRs are 13−9=413-9=4 cm.

  3. VA=9+4+1+0+1+4+97=4 cm2.V_A=\frac{9+4+1+0+1+4+9}{7}=4\ \text{cm}^{2}.
  4. VB=81+4+1+0+1+4+817=1727 cm2.V_B=\frac{81+4+1+0+1+4+81}{7}=\frac{172}{7}\ \text{cm}^{2}.
  5. Batch A has smaller variance about the same target. Its range is 66 cm, compared with 1818 cm for B. The equal IQRs describe the same middle-half span but do not describe the different extremes.

  6. This comparison concerns the observed batches. It does not guarantee how every future item from either machine will behave.

Marking guidance
  • 1 mark: calculate the common mean from both totals.
  • 1 mark: apply the stated quartile convention and obtain the common IQR.
  • 1 mark: calculate A’s sum of squared deviations.
  • 1 mark: obtain A’s descriptive variance.
  • 1 mark: calculate B’s descriptive variance.
  • 1 mark: compare the observed batches in the target-length context.
  • 1 mark: explain what the IQR does not show and limit the conclusion to the observed data.
The best reference does not remove the data spread 7 marks

For the fixed numerical observations 2,6,9,112,6,9,11, define F(a)=∑(x−a)2F(a)=\sum(x-a)^2, where aa is any real reference value. Find the value of aa that minimises F(a)F(a), the minimum sum, and the descriptive variance of the observations. Find every real aa such that F(a)=82F(a)=82. Explain why the minimum sum is positive.

Hint

Find the actual mean and the centred sum of squares. Write F(a)F(a) as that minimum plus a non-negative square.

Worked solution
  1. xˉ=2+6+9+114=7,Q=4+36+81+121=242.\bar{x}=\frac{2+6+9+11}{4}=7,\qquad Q=4+36+81+121=242.
  2. ∑(x−7)2=242−4(72)=46.\sum(x-7)^2=242-4(7^2)=46.
  3. F(a)=46+4(a−7)2.F(a)=46+4(a-7)^2.
  4. The non-negative square vanishes only at a=7a=7. The minimum sum is 4646, and the descriptive variance is 464=232\frac{46}{4}=\frac{23}{2}.

  5. F(a)=82⟺4(a−7)2=36⟺a−7=±3.F(a)=82\Longleftrightarrow4(a-7)^2=36\Longleftrightarrow a-7=\pm3.
  6. a=4ora=10.a=4\quad\text{or}\quad a=10.
  7. The fixed observations are unequal, so no single reference can make every squared distance zero. Moving the reference changes F(a)F(a); it does not change the data’s actual mean or variance.

Marking guidance
  • 1 mark: obtain the mean and raw sum of squares.
  • 1 mark: calculate the centred sum.
  • 1 mark: use or derive the reference-point identity.
  • 1 mark: state the minimum sum and its reference value.
  • 1 mark: distinguish the minimum total from descriptive variance.
  • 1 mark: find both reference values satisfying the target.
  • 1 mark: explain the positive minimum using the fixed unequal observations.

Come back to what needs practice

Quick revision sheet (A4)

Your review plan starts after your first check.

Question bank and saved work