Formula sheet

Variance (grouped)

Both forms σ² = Σf(x−x̄)²/Σf = Σfx²/Σf − x̄² are given on the SPM formula sheet. You must know to find x̄ first, to build an fx² column (frequency times the square of x), and that Σfx² means Σ(f·x²), square x first, then multiply by f.

Variance (grouped)
σ2 = Σf(x−x̄)2 / Σf = Σfx2/Σf − x̄2
Given in the exam

What the symbols mean

  1. σ² the variance of the grouped data, in the squared unit
  2. f the frequency of each value or class
  3. x each value, or the midpoint of each class interval
  4. x̄ the mean of the grouped data
  5. Σf the total frequency (total number of data)
  6. Σfx² the sum of every frequency × value² (that is, Σ(f·x²))

Given in the exam, or memorise?

Both forms σ² = Σf(x−x̄)²/Σf = Σfx²/Σf − x̄² are given on the SPM formula sheet. You must know to find x̄ first, to build an fx² column (frequency times the square of x), and that Σfx² means Σ(f·x²), square x first, then multiply by f.

Why it works

It is the ungrouped variance weighted by frequency: each squared deviation is counted f times because that value occurs f times.

  1. Find the grouped mean x̄ = Σfx / Σf first.
  2. For each row, square the deviation (x − x̄)² and multiply by the frequency f, then add to get Σf(x−x̄)².
  3. Divide by the total frequency Σf.
  4. Expanding gives the faster short form Σfx²/Σf − x̄², needing only the fx² column and the mean.

Worked example 1

A frequency table has x = 1, 2, 3, 4 with frequencies f = 2, 3, 4, 1. Find the variance.

  1. Total frequency: Σf = 2 + 3 + 4 + 1 = 10.
  2. Mean first: Σfx = (1×2)+(2×3)+(3×4)+(4×1) = 2+6+12+4 = 24, so x̄ = 24/10 = 2.4.
  3. Build Σfx²: (1²×2)+(2²×3)+(3²×4)+(4²×1) = 2+12+36+16 = 66.
  4. Apply the short form: σ² = Σfx²/Σf − x̄² = 66/10 − 2.4² = 6.6 − 5.76.

Worked example 2

Grouped data has class midpoints x = 5, 15, 25, 35 with frequencies f = 2, 4, 3, 1. Find the variance.

  1. Total frequency: Σf = 2 + 4 + 3 + 1 = 10.
  2. Mean: Σfx = (5×2)+(15×4)+(25×3)+(35×1) = 10+60+75+35 = 180, so x̄ = 180/10 = 18.
  3. Build Σfx²: (5²×2)+(15²×4)+(25²×3)+(35²×1) = 50+900+1875+1225 = 4050.
  4. Apply: σ² = Σfx²/Σf − x̄² = 4050/10 − 18² = 405 − 324.

Where students go wrong

  1. Reading Σfx² as (Σfx)² or as Σf × (Σx²), it means Σ(f·x²): square each x, multiply by its f, then add.
  2. Dropping the frequency weighting in the long form, you need Σf(x−x̄)², not just Σ(x−x̄)².
  3. Subtracting x̄ instead of x̄² in the short form, or dividing by the number of classes instead of Σf.

Use it with

Source:SPM: Format Pentaksiran mulai 2021, Matematik (1449)

Book a Trial ClassOne-hour paid trial · Same-day reply · from RM50/hr

Frequently asked questions

How do I build the fx² column correctly?

Work each row separately. First square the value or midpoint to get x², then multiply that by the frequency f.

So for x = 5, f = 2 you get 5² × 2 = 50. Add all these to get Σfx².

Never square the frequency, and never square after adding.

Do I still need the mean to find the grouped variance?

Yes. Both forms need x̄, so find the mean x̄ = Σfx / Σf first.

The short form then only needs Σfx² and x̄²: σ² = Σfx²/Σf − x̄². Keep the unrounded mean in your calculator so the subtraction stays accurate.

Is grouped variance calculated the same way as ungrouped?

It is the same principle with frequency weights. Where the ungrouped formula uses N and Σx², the grouped one uses Σf and Σfx², because each value repeats f times.

If every f were 1, the two formulas become identical, so treat grouped as the general case.

Book a Trial Class

Book a Trial Class
One-hour paid trial · Same-day replyfrom RM50/hr
Book a Trial Class