Coding Data: Linear Changes to the Mean and Standard Deviation | Applications and Interpretation IB Maths notes

Free preview: Coding Data: Linear Changes to the Mean and Standard Deviation

What Coding Is and Why It Helps

Analysis and approaches and Applications and interpretation: SL and HL (common content, SL 4.3)

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 and easier to work with.
  • Coding usually uses this form:

y=x−ab

๐Ÿ’ก In plain words

  • x is an original value and y is the coded value.
  • a is a number subtracted from every value (a shift).
  • b is a number every value is divided by (a scale).

Recipe: choosing and using a code

  1. Pick a near the smallest (or middle) value. Why: subtracting it leaves small numbers.
  2. Pick b as the common gap or step in the data (10, 0.5, 0.01...). Why: dividing by it leaves whole numbers.
  3. Code every value: subtract a first, then divide by b. Why: the order matters, just like in the formula.

๐Ÿ‘€ Watch me do it: code five masses: 1020, 1030, 1050, 1060, 1090 g

What I writeWhy I do it
Take a = 1000 and b = 10.Steps 1 and 2: all values are just over 1000, and they go up in 10s.
Subtract 1000: 20, 30, 50, 60, 90.Step 3, first the shift.
Divide by 10: the coded values are 2, 3, 5, 6, 9.Then the scale.
These are far easier to square and add.For example 92=81 instead of 10902.

โœ๏ธ YOUR TURN 1

Try this first:

Code the times 2.35, 2.40, 2.55, 2.30, 2.45 seconds using y=x−2.30.05.

Answer:

  • Subtract 2.3: 0.05, 0.10, 0.25, 0, 0.15.
  • Divide by 0.05: 1, 2, 5, 0, 3.

What Coding Does to the Mean

We've changed the numbers. So the coded mean is not the real mean. How do we get back?

  • Subtracting a from every value moves the whole data set down by a, so the mean moves down by a.
  • Dividing every value by b divides the mean by b.
  • So the mean follows exactly the same rule as the data:

y¯=x¯−ab⟺x¯=a+by¯

Why it is true

What I writeWhy I do it
∑y=∑x−ab=∑x−nabAdd up all n coded values. a is subtracted n times.
y¯=∑yn=∑xn−ab=x¯−abDivide by n.
x¯=a+by¯Rearrange: multiply by b, then add a.
  • Medians, quartiles and other positions follow the same rule too, because coding keeps the values in the same order.

๐Ÿ’ก Decode by reversing

To get back to x, rearrange the code: x=a+by. Then x¯=a+by¯. Doing the operations in reverse order (multiply by b, then add a) is the safest way to avoid slips.

๐Ÿ‘€ Watch me do it: decode the mean of the masses

What I writeWhy I do it
y¯=2+3+5+6+95=255=5The easy mean of the coded values.
x¯=1000+10×5=1050 gDecode: multiply by b, then add a.
Check: the masses add to 5250, and 5250÷5=1050.Same answer, the long way.

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 Collecting and summarising data (SL 4.1โ€“4.3)

  1. Populations, Samples and the Census: Why We Sample
  2. Random Sampling Methods: Simple Random, Systematic and Stratified
  3. Quota, Opportunity, Cluster and Self-Selected Samples, and Choosing a Method
  4. Types of Data and the Mean, Median and Mode
  5. Grouped Data: Estimating the Mean, Median, Quartiles and Percentiles
  6. Measuring Spread: Range, Interquartile Range, Variance and Standard Deviation
  7. Cumulative Frequency Diagrams and Box Plots
  8. Histograms, Frequency Density and the Shape of a Distribution
  9. Outliers, Cleaning Data and Choosing How to Present It
  10. Coding Data: Linear Changes to the Mean and Standard Deviation

What's inside for this topic

10 teacher notes, 72 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: Outliers, Cleaning Data and Choosing How to Present It

Coding Data: Linear Changes to the Mean and Standard Deviation on other exam boards

All Applications and Interpretation IB Maths topics ยท IB Maths