5.1.7 Coded Data

In this topic we will learn how to:

  • calculate and use the mean and standard deviation of a set of data, given coded totals Σ(xa)\Sigma(x - a) and Σ(xa)2\Sigma(x - a)^{2} and use such totals in solving problems which may involve up to two data sets

When we substract a certain number from each value of xx, in the data set, we get coded totals. This is usually done to simplify the numbers in the data set. Coding does not change the standard deviation or variation of the original data set. It just helps to simplify the calculations.

Here are some general rules to help in solving questions involving coding. Where the coded data set is xax - a,
xa=xa\overline{x - a} = \overline{x} - aThis means that the mean of the coded data is equal to the mean of the original data minus the constant aa.
σx=σxa\sigma_{x} = \sigma_{x - a}This means that the standard deviation of the original data is the same as the standard deviation of the coded data.
σx2=σxa2\sigma_{x}^{2} = \sigma_{x - a}^{2}This means that the variance of the original data is the same as the variance of the coded data.

Note: aa represents a constant in the above equations.

Let’s walk through some past paper questions on coding.

1. For nn values of the variable xx, it is given that

Σ(x200)=446    Σx=6 846\Sigma (x - 200) = \textcolor{#2192ff}{446} \ \ \ \ \Sigma x = \textcolor{#0f0}{6\ 846}


Find the value of nn. (9709/52/M/J/22 number 1)


Let’s write out the formula for mean for xx values, and the formula for mean for x200x - 200 values,
x=Σxn        x200=Σ(x200)n\overline{x} = \frac{\Sigma x}{n}\ \ \ \ \ \ \ \ \overline{x - 200} = \frac{\Sigma(x - 200)}{n}Use the following rule in the second equation,
xa=xa\overline{x - a} = \overline{x} - ax200=x200\overline{x - 200} = \overline{x} - 200x200=Σ(x200)n\overline{x - 200} = \frac{\Sigma(x - 200)}{n}x200=Σ(x200)n\overline{x} - 200 = \frac{\Sigma(x - 200)}{n}Make x\overline{x} the subject of the formula,
x=Σ(x200)n+200\overline{x}= \frac{\Sigma(x - 200)}{n} + 200Now you’ll notice that we have two equations that we can equate together,
x=Σxn        x=Σ(x200)n+200\overline{x} = \frac{\Sigma x}{n}\ \ \ \ \ \ \ \ \overline{x}= \frac{\Sigma(x - 200)}{n} + 200First let’s substitute in the values of Σx\Sigma x and Σ(x200)\Sigma(x - 200) to make things clearer,
x=6 846n        x=446n+200\overline{x} = \frac{\textcolor{#0f0}{6\ 846}}{n}\ \ \ \ \ \ \ \ \overline{x}= \frac{\textcolor{#2192ff}{446}}{n} + 200Equate the two equations together,
6 846n=446n+200\frac{6\ 846}{n} = \frac{446}{n} + 200Multiply through by nn to get rid of the denominator,
6 846=446+200n6\ 846 = 446 + 200nMake nn the subject of the formula,
200n=6 846446200n = 6\ 846 - 446200n=6 400200n = 6\ 400n=32n = 32Therefore, the final answer is,
n=32n = 322. For 4040 values of the variable xx, it is given that Σ(xc)2=3 099.2\Sigma(x - c)^{2} = 3\ 099.2, where cc is a constant. The standard deviation of these values is 3.23.2. (9709/62/F/M/19 number 2)

(a) Find the value of Σ(xc)\Sigma(x - c).

Let’s write out all the information we have been given,
n=40        Σ(xc)2=3 099.2        σx=3.2n = \textcolor{#2192ff}{40}\ \ \ \ \ \ \ \ \Sigma(x - c)^{2} = \textcolor{#0f0}{3\ 099.2}\ \ \ \ \ \ \ \ \sigma_{x} = \textcolor{red}{3.2}To find Σ(xc)\Sigma(x - c) we have to first find xc\overline{x - c}. To do that we will use the idea that,
σx=σxc\sigma_{x} = \sigma_{x - c}Therefore,
σxc=3.2\sigma_{x - c} = \textcolor{red}{3.2}Let’s use the formula for standard deviation of xcx - c,
σxc=Σ(xc)2n(xc)2\sigma_{x - c} = \sqrt{\frac{\Sigma(x - c)^{2}}{n} - (\overline{x - c})^{2}}Square both sides, to get rid of the square root sign,
σxc2=Σ(xc)2n(xc)2\sigma_{x - c}^{2} = \frac{\Sigma(x - c)^{2}}{n} - (\overline{x - c})^{2}Make xc\overline{x - c} the subject of the formula,
(xc)2=Σ(xc)2nσxc2(\overline{x - c})^{2} = \frac{\Sigma(x - c)^{2}}{n} - \sigma_{x - c}^{2}xc=Σ(xc)2nσxc2\overline{x - c} = \sqrt{\frac{\Sigma(x - c)^{2}}{n} - \sigma_{x - c}^{2}}Substitute into the formula,
xc=3 099.240(3.2)2\overline{x - c} = \sqrt{\frac{\textcolor{#0f0}{3\ 099.2}}{\textcolor{#2192ff}{40}} - (\textcolor{red}{3.2})^{2}}xc=8.2\overline{x - c} = 8.2Now that we have xc\overline{x - c}, let’s find Σ(xc)\Sigma(x - c),
xc=Σ(xc)n\overline{x - c} = \frac{\Sigma(x - c)}{n}Make Σ(xc)\Sigma(x - c) the subject of the formula,
Σ(xc)=n(xc)\Sigma(x - c) = n\left(\overline{x - c}\right)Substitute into the formula,
Σ(xc)=40(8.2)\Sigma(x - c) = 40\left(8.2\right)Σ(xc)=328\Sigma(x - c) = 328Therefore, the final answer is,
Σ(xc)=328\Sigma(x - c) = 328(b) Given that c=50c = 50, find the mean of these values of xx.

To find the mean, we will use the idea that,
(xc)=xc(\overline{x - c}) = \overline{x} - cMake x\overline{x} the subject of the formula,
x=(xc)+c\overline{x} = \left(\overline{x - c}\right) + cSubstitute into the formula,
x=8.2+50\overline{x} = 8.2 + 50x=58.2\overline{x} = 58.2Therefore, the final answer is,
x=58.2\overline{x} = 58.23. A summary of 4040 values of xx gives the following information:

Σ(xk)=520,    Σ(xk)2=960\Sigma(x - k) = 520, \ \ \ \ \Sigma(x - k)^{2} = 960


where kk is constant. (9709/51/O/N/21 number 2)


(a) Given that the mean of these 4040 values of xx is 3434, find the value of kk.

Let’s write out all the information we have been given,
n=40        Σ(xk)=520        Σ(xk)2=960        x=34n = 40\ \ \ \ \ \ \ \ \Sigma(x - k) = 520\ \ \ \ \ \ \ \ \Sigma(x - k)^{2} = 960\ \ \ \ \ \ \ \ \overline{x} = 34Let’s use the formula for xk\overline{x - k} to evaluate kk,
xk=Σ(xk)n\overline{x - k} = \frac{\Sigma(x - k)}{n}Use the idea that,
xk=xk\overline{x - k} = \overline{x} - kxk=Σ(xk)n\overline{x - k} = \frac{\Sigma(x - k)}{n}xk=Σ(xk)n\overline{x} - k = \frac{\Sigma(x - k)}{n}Make kk the subject of the formula,
k=xΣ(xk)nk = \overline{x} - \frac{\Sigma(x - k)}{n}Substitute into the formula,
k=3452040k = 34 - \frac{520}{40}k=21k = 21Therefore, the final answer is,
k=21k = 21(b) Find the variance of these 4040 values of xx.

Let’s start by finding the variance of xkx - k,
σxk2=Σ(xk)2n(xk)2\sigma_{x - k}^{2} = \frac{\Sigma(x - k)^{2}}{n} - (\overline{x - k})^{2}We have all the values apart from xk\overline{x - k}, so let’s evaluate xk\overline{x - k},
xk=xk\overline{x - k} = \overline{x} - kxk=3421\overline{x - k} = 34 - 21xk=13\overline{x - k} = 13Now let’s substitute into the formula,
σxk2=Σ(xk)2n(xk)2\sigma_{x - k}^{2} = \frac{\Sigma(x - k)^{2}}{n} - (\overline{x - k})^{2}σxk2=9 64040(13)2\sigma_{x - k}^{2} = \frac{9\ 640}{40} - (13)^{2}σxk2=72\sigma_{x - k}^{2} = 72To get the variance of the 4040 values of xx we will use the idea that,
σx2=σxk2\sigma_{x}^{2} = \sigma_{x - k}^{2}Therefore, the final answer is,
σx2=72\sigma_{x}^{2} = 72