Coded Totals and Combining Two Data Sets | Cambridge A Level Maths notes

Free preview: Coded Totals and Combining Two Data Sets

Coded Totals: Σ(x − a) and Σ(x − a)²

9709 Paper 5: Probability & Statistics 1

Let's start with a problem. Squaring and adding numbers like 1020, 1030 and 1090 by hand is slow and easy to get wrong. 10902=1188100, and you need five of those. Can we make the numbers smaller first, and still get the right mean and standard deviation at the end?

  • Coding means changing every data value by the same simple rule, usually to make the numbers smaller.
  • In this course the code is almost always a shift: subtract the same number a from every value.
  • Questions then give you the coded totals Σ(x − a) and Σ(x − a)² instead of Σx and Σx².
  • Your job is to get the mean and standard deviation of the original x values from these totals.

What happens to the mean

  • Subtracting a from every value moves the whole data set down by a.
  • So the mean of the values x − a is the mean of x, minus a.
  • To get back, add a on again:

x¯=a+∑(x−a)n

What happens to the spread

  • Every value moves by the same amount, so the gaps between values do not change.
  • So the standard deviation of x − a is exactly the standard deviation of x.
  • Use the usual formula with x − a in place of x:

σ2=∑(x−a)2n−(∑(x−a)n)2

💡 In plain words

  • The mean needs a added back on. The standard deviation does not.
  • The bracket squared at the end is the square of the coded mean, not of the real mean.
  • Here's the trap: do not write x¯2 (the real mean squared) in the variance formula with coded totals.

Recipe: mean and standard deviation from coded totals

  1. Find the coded mean ∑(x−a)n. Why: it is the mean of the shifted values.
  2. Add a back on to get x¯. Why: the shift moved the mean down by a.
  3. Variance: ∑(x−a)2n minus the coded mean squared. Why: the same formula, with x − a in place of x.
  4. Square root for σ, and do not add a. Why: a shift never changes spread.

👀 Watch me do it: five masses 1020, 1030, 1050, 1060, 1090 g, with a = 1000

What I writeWhy I do it
Subtract 1000: 20, 30, 50, 60, 90a is just below every value, so the numbers left are small.
Σ(x − 1000) = 250, Σ(x − 1000)² = 400 + 900 + 2500 + 3600 + 8100 = 15 500The coded totals: easy to square and add.
x¯=1000+2505=1050 gSteps 1 and 2: coded mean 50, then add a back on.
σ2=155005−502=3100−2500=600Step 3: square the coded mean, 50, not 1050.
σ=600=24.5 g (3 s.f.)Step 4. The 1000 came back for the mean but played no part in the standard deviation.

📝 Here's the trap

  • Wrong: σ2=155005−10502. That gives a huge negative number, and a variance can never be negative.
  • Right: subtract the square of the coded mean, 502. Coded totals go with the coded mean.

Unlock the full note: start 7 days free.

Log in or subscribe to read the rest of this note. Members also get the AI tutor, practice quizzes, mock exams and flashcards for this topic.

Log in · Subscribe · Start free trial

All notes in Representation of data (5.1)

  1. Stem-and-Leaf Diagrams, Including Back-to-Back
  2. Types of Data and the Mean, Median and Mode
  3. Grouped Data: Estimating the Mean, Median, Quartiles and Percentiles
  4. Measuring Spread: Range, Interquartile Range, Variance and Standard Deviation
  5. Cumulative Frequency Diagrams and Box Plots
  6. Histograms, Frequency Density and the Shape of a Distribution
  7. Coded Totals and Combining Two Data Sets
  8. Outliers and Choosing How to Present Data

What's inside for this topic

8 teacher notes, 157 practice questions, 40 flashcards, 2 quizzes.

Get the full notes, every practice question, flashcards, quizzes and mock papers.

Start your free 7-day trial

Questions? Chat with us on WhatsApp · Try one live lesson

Previous note: Histograms, Frequency Density and the Shape of a Distribution Next note: Outliers and Choosing How to Present Data

All Cambridge A Level Maths topics · A Level Maths