Maths4UBETA

Coded totals, origins and scale changes

Recover original spread from coding, and handle translations, negative scales and a second reference correctly.

Try the quick check →
Lesson 2 of 5

Section 1 of 5 · Core · about 6 min

How do translated totals give the original spread?

Coding writes every original observation on a simpler scale. For a translation u=x−cu=x-c, define Su=∑uS_u=\sum u, Qu=∑u2Q_u=\sum u^2, and use the positive count nn:

uˉ=Sun,σu2=Qun−(Sun)2.\bar{u}=\frac{S_u}{n},\qquad\sigma_u^2=\frac{Q_u}{n}-\left(\frac{S_u}{n}\right)^2.

These are descriptive summaries, using divisor nn. The inverse rule is x=c+ux=c+u, so

xˉ=c+uˉ,σx2=σu2,σx=σu.\bar{x}=c+\bar{u},\qquad\sigma_x^2=\sigma_u^2,\qquad\sigma_x=\sigma_u.

Worked example

Translate the origin and retain the coded mean

The six numerical observations are 36,40,42,42,46,4636,40,42,42,46,46. Code them using u=x−40u=x-40, then use the coded totals to find their original mean, descriptive variance and SD.

  1. u: −4,0,2,2,6,6,Su=∑u=12,Qu=∑u2=96.u:\ -4,0,2,2,6,6,\qquad S_u=\sum u=12,\qquad Q_u=\sum u^2=96.
  2. uˉ=126=2,σu2=966−22=12.\bar{u}=\frac{12}{6}=2,\qquad\sigma_u^2=\frac{96}{6}-2^2=12.
  3. xˉ=40+2=42,σx2=12,σx=23.\bar{x}=40+2=42,\qquad\sigma_x^2=12,\qquad\sigma_x=2\sqrt{3}.
  4. The chosen origin is 4040, while the actual mean is 4242. Subtracting the origin did not make the coded mean zero.

Your turn

Five masses xx, in grams, are coded by u=x−60u=x-60. Their coded totals are ∑u=−10\sum u=-10 and ∑u2=50\sum u^2=50. Find the original 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 value or round to 3 significant figures.

Section 2 of 5 · Core · about 7 min

What changes under a scale or sign reversal?

For u=x−abu=\frac{x-a}{b}, require b≠0b\ne0 and first write the inverse x=a+bux=a+bu. Then

xˉ=a+buˉ,σx2=b2σu2,σx=∣b∣σu,\bar{x}=a+b\bar{u},\qquad\sigma_x^2=b^2\sigma_u^2,\qquad\sigma_x=|b|\sigma_u,rangex=∣b∣rangeu,IQRx=∣b∣IQRu.\text{range}_x=|b|\text{range}_u,\qquad\mathrm{IQR}_x=|b|\mathrm{IQR}_u.

The mean uses the signed scale. Spread measures use its magnitude, or its square for variance. With b>0b>0, order is preserved. With b<0b<0, order reverses and the lower and upper quartiles swap roles:

Q1,x=a+bQ3,u,Q3,x=a+bQ1,u(b<0).Q_{1,x}=a+bQ_{3,u},\qquad Q_{3,x}=a+bQ_{1,u}\qquad(b<0).

Use the same stated quartile convention on both scales. Translation alone leaves range and IQR unchanged as well as variance and SD.

RuleValuesMeanVariance
xx36, 40, 42, 42, 46, 464212
u=x−402u=\frac{x-40}{2}−2, 0, 1, 1, 3, 313
v=x−442v=\frac{x-44}{2}−4, −2, −1, −1, 1, 1-13
w=x−40−2w=\frac{x-40}{-2}2, 0, −1, −1, −3, −3-13
xˉ=40+2(1)=44+2(−1)=40+(−2)(−1)=42.\bar x=40+2(1)=44+2(-1)=40+(-2)(-1)=42.σx2=22(3)=(−2)2(3)=12.\sigma_x^2=2^2(3)=(-2)^2(3)=12.

Changing the origin shifts every code. A negative scale reverses their order without changing any original record.

Different origins and either nonzero scale sign can encode the same six original records. Correct inversion restores original mean 4242 and variance 1212.

Worked example

Decode positive and negative scales

The six coded observations uu are −2,0,1,1,3,3-2,0,1,1,3,3, with x=40+2ux=40+2u. Find the original mean, variance, range and IQR. Use median-of-halves quartiles, retaining all six observations in two equal halves. Then check the quartiles using the alternative code v=−uv=-u, so x=40−2vx=40-2v.

  1. Su=6,Qu=24,uˉ=1,σu2=246−12=3.S_u=6,\qquad Q_u=24,\qquad\bar{u}=1,\qquad\sigma_u^2=\frac{24}{6}-1^2=3.
  2. xˉ=40+2(1)=42,σx2=22(3)=12.\bar{x}=40+2(1)=42,\qquad\sigma_x^2=2^2(3)=12.
  3. The coded range is 3−(−2)=53-(-2)=5. The halves (−2,0,1)(-2,0,1) and (1,3,3)(1,3,3) have medians 00 and 33, so their IQR is 33.

    rangex=2(5)=10,IQRx=2(3)=6.\text{range}_x=2(5)=10,\qquad\mathrm{IQR}_x=2(3)=6.
  4. The negative code in increasing order is

    v: −3,−3,−1,−1,0,2.v:\ -3,-3,-1,-1,0,2.

    Its half-medians are Q1,v=−3Q_{1,v}=-3 and Q3,v=0Q_{3,v}=0. Because x=40−2vx=40-2v reverses order,

    Q1,x=40−2Q3,v=40,Q3,x=40−2Q1,v=46.Q_{1,x}=40-2Q_{3,v}=40,\qquad Q_{3,x}=40-2Q_{1,v}=46.
  5. The original IQR is again 46−40=646-40=6. This code has mean −1-1 and variance 33, which restore original mean 4242 and variance 1212 through the same inverse rule.

Your turn

Four numerical lengths xx, in centimetres, are coded by u=x−18−3u=\frac{x-18}{-3}. The ordered coded observations are −1,3,3,3-1,3,3,3. Find the original mean, descriptive variance, SD, range and IQR. For quartiles, use medians of the lower and upper halves, retaining all four records.

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 number, for example 3/2 or 2-sqrt(3).

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

Section 3 of 5 · Core · about 6 min

How do I move from one origin to another?

Write Dc=∑(x−c)D_c=\sum(x-c) and Ec=∑(x−c)2E_c=\sum(x-c)^2. If the new origin is dd, let h=d−ch=d-c. Since x−d=(x−c)−hx-d=(x-c)-h,

Dd=Dc−nh,Ed=Ec−2hDc+nh2.D_d=D_c-nh,\qquad E_d=E_c-2hD_c+nh^2.

The coded sums change, but the original mean and variance agree:

xˉ=c+Dcn=d+Ddn,\bar{x}=c+\frac{D_c}{n}=d+\frac{D_d}{n},σx2=Ecn−(Dcn)2=Edn−(Ddn)2.\sigma_x^2=\frac{E_c}{n}-\left(\frac{D_c}{n}\right)^2=\frac{E_d}{n}-\left(\frac{D_d}{n}\right)^2.

Worked example

Recover the count while changing origins

The same numerical dataset has unknown positive integer count nn and satisfies

D25=∑(x−25)=15,E25=∑(x−25)2=65,D29=−5.D_{25}=\sum(x-25)=15,\qquad E_{25}=\sum(x-25)^2=65,\qquad D_{29}=-5.

Find nn, E29E_{29}, the original mean and descriptive variance.

  1. The new origin is four greater, so each coded value falls by 44:

    −5=15−4n⟹n=5.-5=15-4n\Longrightarrow n=5.
  2. E29=65−2(4)(15)+5(42)=25.E_{29}=65-2(4)(15)+5(4^2)=25.
  3. xˉ=29+−55=28,σx2=255−(−55)2=4.\bar{x}=29+\frac{-5}{5}=28,\qquad\sigma_x^2=\frac{25}{5}-\left(\frac{-5}{5}\right)^2=4.
  4. The first origin confirms the result:

    25+155=28,655−(155)2=4.25+\frac{15}{5}=28,\qquad\frac{65}{5}-\left(\frac{15}{5}\right)^2=4.

    The count is a positive integer, and both origins describe the same original summaries.

Your turn

The same numerical observations satisfy

∑(x−14)=6,∑(x−14)2=46,∑(x−10)=30.\sum(x-14)=6,\qquad\sum(x-14)^2=46,\qquad\sum(x-10)=30.

Find their count, the sum of squares about origin 1010, the original mean and descriptive variance.

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.

Section 4 of 5 · Core · about 6 min

How do I restore the original total and sum of squares?

From x=a+bux=a+bu, sum the expression and its full square:

T=∑x=na+bSu,T=\sum x=na+bS_u,Q=∑x2=na2+2abSu+b2Qu.Q=\sum x^2=na^2+2abS_u+b^2Q_u.

The middle term comes from the product of the shift and coded part. After restoring TT and QQ, use

xˉ=Tn,∑(x−xˉ)2=Q−T2n,σx2=Qn−xˉ 2.\bar{x}=\frac{T}{n},\qquad\sum(x-\bar{x})^2=Q-\frac{T^2}{n},\qquad\sigma_x^2=\frac{Q}{n}-\bar{x}^{\,2}.
∑x=6(40)+2(6)=252,xˉ=2526=42.\sum x=6(40)+2(6)=252,\qquad\bar x=\frac{252}{6}=42.∑x2=na2+2ab∑u+b2∑u2.\sum x^2=na^2+2ab\sum u+b^2\sum u^2.
TermWorkingValue
Origin6(40)26(40)^29600
Cross term2(40)(2)(6)2(40)(2)(6)960
Scaled squares22(24)2^2(24)96
σx2=106566−422=12.\sigma_x^2=\frac{10656}{6}-42^2=12.

With origin 4444 and scale 22, the new code sums are ∑v=−6\sum v=-6 and ∑v2=24\sum v^2=24. The same total is 11616−1056+96=1065611616-1056+96=10656. The cross term can be negative.

For a=40a=40, b=2b=2, n=6n=6, Su=6S_u=6, Qu=24Q_u=24, the three contributions are 9600+960+96=106569600+960+96=10656.

Worked example

Reconstruct all three parts of the raw square

For six numerical observations, u=x−402u=\frac{x-40}{2}, Su=6S_u=6 and Qu=24Q_u=24. Recover the original total TT, sum of squares QQ, centred sum of squares and descriptive variance.

  1. x=40+2u,T=6(40)+2(6)=252.x=40+2u,\qquad T=6(40)+2(6)=252.
  2. x2=402+2(40)(2u)+(2u)2.x^2=40^2+2(40)(2u)+(2u)^2.

    Summing gives all three contributions:

    Q=6(402)+2(40)(2)(6)+22(24)=9600+960+96=10656.Q=6(40^2)+2(40)(2)(6)+2^2(24)=9600+960+96=10656.
  3. xˉ=2526=42.\bar{x}=\frac{252}{6}=42.
  4. ∑(x−xˉ)2=10656−25226=72,σx2=726=12.\sum(x-\bar{x})^2=10656-\frac{252^2}{6}=72,\qquad\sigma_x^2=\frac{72}{6}=12.
  5. The cross term 960960 is essential. It disappears only when its factors make it zero; it is not optional because the calculation uses coded data.

Your turn

Three numerical observations are coded by u=x−8−2u=\frac{x-8}{-2}, with ∑u=−3\sum u=-3 and ∑u2=9\sum u^2=9. Find the original total, original sum of squares and descriptive variance.

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).

Section 5 of 5 · Further applications · about 7 min

Can mean and SD identify a calibration?

For a forward rule y=px+qy=px+q, use

yˉ=pxˉ+q,σy=∣p∣σx.\bar{y}=p\bar{x}+q,\qquad\sigma_y=|p|\sigma_x.

If both SDs are positive, find ∣p∣=σyσx|p|=\frac{\sigma_y}{\sigma_x}, retain both possible signs, then calculate q=yˉ−pxˉq=\bar{y}-p\bar{x} for each. Keep each scale paired with its own shift, and apply any stated order restriction.

Worked example

Retain both possible calibration signs

Input observations have mean 88 and SD 33. A calibration y=px+qy=px+q must give mean 2020 and SD 66. Find all parameter pairs (p,q)(p,q), then select the pair that preserves the order of unequal inputs.

  1. σy=∣p∣σx⟹6=3∣p∣⟹p=2 or p=−2.\sigma_y=|p|\sigma_x\Longrightarrow6=3|p|\Longrightarrow p=2\text{ or }p=-2.
  2. 20=8p+q⟹q=20−8p.20=8p+q\Longrightarrow q=20-8p.
  3. For p=2p=2, q=4q=4; for p=−2p=-2, q=36q=36. Thus

    (p,q)=(2,4) or (−2,36).(p,q)=(2,4)\text{ or }(-2,36).
  4. Both produce the required mean and SD. Preserving the order of unequal inputs requires p>0p>0, so it selects (2,4)(2,4). The negative choice reverses that order.

Zero spread must be checked without dividing by it:

Input SDTarget SDForward-rule conclusion
σx>0\sigma_x>0σy=0\sigma_y=0p=0p=0, with q=yˉq=\bar{y}. Possible only if a constant forward rule is allowed.
σx=0\sigma_x=0σy>0\sigma_y>0Impossible: equal inputs cannot produce unequal outputs under one fixed rule.
σx=0\sigma_x=0σy=0\sigma_y=0The mean condition q=yˉ−pxˉq=\bar{y}-p\bar{x} remains. It does not identify a unique scale.

A forward rule may allow p=0p=0, producing constant outputs. Invertible coding requires a nonzero scale; it cannot restore original inputs after all values have collapsed to one output. In the last table row, retain only nonzero scales if invertibility is required.

Your turn

A forward calibration y=px+qy=px+q is allowed to use p=0p=0. First, every input equals 44, and the required outputs must all equal 1313. Which family of rules works? Separately, inputs have mean 44 and positive SD 22, and the target output has mean 1313 and SD 00. Find (p,q)(p,q) for that second case and decide whether it is invertible.

All rules for the constant-input case

Enter each pair in the order shown. Separate complete pairs with commas or semicolons.

Is the second rule invertible?

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

Spread survives an origin shift

3 marks

For u=x−100u=x-100, n=6, ∑u=9\sum u=9, ∑u2=39\sum u^2=39. Find the original mean, variance and SD exactly.

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

A convenient origin need not be the mean

Eight lengths xx, in centimetres, are coded by u=x−250u=x-250. Their coded totals are ∑u=−12\sum u=-12 and ∑u2=60\sum u^2=60. Find the original mean, descriptive variance and standard deviation.

Enter an exact value or round to 3 significant figures.

Enter an exact value or round to 3 significant figures.

Enter an exact value or round to 3 significant figures.

Undo a negative scale for every spread measure

Lengths xx, in centimetres, are coded by u=60−x3u=\frac{60-x}{3}. For five coded records, ∑u=10\sum u=10, ∑u2=30\sum u^2=30, the coded range is 44, and the coded IQR is 33. Find the original mean, descriptive variance, SD, range and 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 number, for example 3/2 or 2-sqrt(3).

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

Move to a lower reference value

For six numerical observations, D40=∑(x−40)=−12D_{40}=\sum(x-40)=-12 and E40=∑(x−40)2=54E_{40}=\sum(x-40)^2=54. Find D35D_{35}, E35E_{35}, the original mean and the descriptive variance. Explain why changing the reference does not change the variance.

Enter the value on its own or write d = … . Fractions and exact square roots are accepted.

Enter the value on its own or write e = … . Fractions and exact square roots are accepted.

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

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

Keep the signed cross term

Four masses xx, in grams, are coded by u=x−15−2u=\frac{x-15}{-2}. The coded totals are ∑u=−2\sum u=-2 and ∑u2=14\sum u^2=14. Recover ∑x\sum x, ∑x2\sum x^2, the original mean and the descriptive variance.

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).

Recover a count and verify the second origin

The same numerical observations have D12=24D_{12}=24, D16=−8D_{16}=-8 and E12=104E_{12}=104, where Dc=∑(x−c)D_c=\sum(x-c) and Ec=∑(x−c)2E_c=\sum(x-c)^2. Find the count, original mean, descriptive variance and E16E_{16}. Separately, could D12=24D_{12}=24 and D16=−10D_{16}=-10 describe any finite dataset?

Enter the value on its own or write n = … . Fractions and exact square roots are accepted.

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).

Is the separate count proposal feasible?

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

Retain both calibrations before using the ordering 7 marks

The numerical observations 3,3,11,113,3,11,11 are transformed by y=px+qy=px+q, where p,qp,q are real constants. The transformed mean is 1010 and its descriptive SD is 66. Find every ordered pair (p,q)(p,q). Additional information says that the larger original observations become the smaller transformed observations. Select the pair satisfying this condition, then find the transformed range and IQR, using medians of halves for the quartiles.

Hint

Find the original mean and SD. SD determines the magnitude of pp, while the mean determines qq for each sign. Reversed order selects the negative multiplier.

Worked solution
  1. xˉ=3+3+11+114=7,Vx=16+16+16+164=16,σx=4.\bar{x}=\frac{3+3+11+11}{4}=7,\qquad V_x=\frac{16+16+16+16}{4}=16,\qquad \sigma_x=4.
  2. 6=∣p∣(4)⟹p=±32.6=|p|(4)\quad\Longrightarrow\quad p=\pm\frac{3}{2}.
  3. q=10−7p.q=10-7p.

    For p=32p=\frac{3}{2}, q=−12q=-\frac{1}{2}; for p=−32p=-\frac{3}{2}, q=412q=\frac{41}{2}. Both give the required mean and SD.

  4. Reversed order requires p<0p\lt0, selecting

    (p,q)=(−32,412).(p,q)=\left(-\frac{3}{2},\frac{41}{2}\right).
  5. The original lower and upper quartiles are 33 and 1111, so both original range and IQR equal 88. Therefore

    Ry=32(8)=12,IQRy=32(8)=12.R_y=\frac{3}{2}(8)=12,\qquad \mathrm{IQR}_y=\frac{3}{2}(8)=12.
  6. Direct substitution gives transformed records 16,16,4,416,16,4,4. Their ordered form 4,4,16,164,4,16,16 has mean 1010, SD 66, range 1212 and IQR 1212, confirming all conditions.

Marking guidance
  • 1 mark: calculate the original mean and SD.
  • 1 mark: obtain both possible signs of the scale factor.
  • 1 mark: recover the matching shift for each sign.
  • 1 mark: verify both unrestricted calibration pairs.
  • 1 mark: use reversed order to select the negative scale.
  • 1 mark: calculate the transformed range.
  • 1 mark: calculate the transformed IQR with the stated quartile convention.
Check zero spread before dividing 6 marks

In this question y=px+qy=px+q is a forward transformation and p=0p=0 is allowed. First, the original list is 5,5,5,5,55,5,5,5,5. Describe all choices of p,qp,q giving transformed mean 1111 and SD 00. Could this same constant list instead be transformed to SD 33? In a separate case, the original list is 3,73,7: find p,qp,q giving transformed mean 1111 and SD 00, and decide whether this last transformation has an inverse on the two original values.

Hint

Use Vy=p2VxV_y=p^2V_x, which also holds for zero variance and zero multipliers. Do not divide by a zero original SD.

Worked solution
  1. For five copies of 55, every transformed observation is 5p+q5p+q. Its SD is zero for every real p,qp,q. To obtain mean 1111,

    5p+q=11⟹q=11−5p.5p+q=11\quad\Longrightarrow\quad q=11-5p.
  2. There are infinitely many such pairs. No transformation of this form can give positive SD to the constant list, because the outputs remain equal.

  3. For the separate list 3,73,7, the mean is 55 and variance is 44. Thus

    Vy=4p2=0⟹p=0.V_y=4p^2=0\quad\Longrightarrow\quad p=0.
  4. yˉ=5(0)+q=11⟹q=11.\bar{y}=5(0)+q=11\quad\Longrightarrow\quad q=11.
  5. The output list is 11,1111,11, so the requested mean and SD are correct. Both distinct inputs have the same output, and an inverse cannot recover which input was used.

  6. This forward transformation is permitted by the question. It would not be allowed as an invertible code requiring a nonzero scale.

Marking guidance
  • 1 mark: recognise that the constant original list stays constant.
  • 1 mark: derive the complete family of shifts and scales.
  • 1 mark: reject the positive-SD target for constant input.
  • 1 mark: use positive original variance to force a zero multiplier in the separate case.
  • 1 mark: obtain and verify the required shift.
  • 1 mark: explain the loss of an inverse and distinguish it from invertible coding.

Come back to what needs practice

Quick revision sheet (A4)

Your review plan starts after your first check.

Question bank and saved work