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 \Sigma(x - a) and \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 x, 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 x - a,
\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 a.
\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.
\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: a represents a constant in the above equations.

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

1. For n values of the variable x, it is given that

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


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


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

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

Let’s write out all the information we have been given,
n = \textcolor{#2192ff}{40}\ \ \ \ \ \ \ \ \Sigma(x - c)^{2} = \textcolor{#0f0}{3\ 099.2}\ \ \ \ \ \ \ \ \sigma_{x} = \textcolor{red}{3.2}To find \Sigma(x - c) we have to first find \overline{x - c}. To do that we will use the idea that,
\sigma_{x} = \sigma_{x - c}Therefore,
\sigma_{x - c} = \textcolor{red}{3.2}Let’s use the formula for standard deviation of x - c,
\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,
\sigma_{x - c}^{2} = \frac{\Sigma(x - c)^{2}}{n} - (\overline{x - c})^{2}Make \overline{x - c} the subject of the formula,
(\overline{x - c})^{2} = \frac{\Sigma(x - c)^{2}}{n} - \sigma_{x - c}^{2}\overline{x - c} = \sqrt{\frac{\Sigma(x - c)^{2}}{n} - \sigma_{x - c}^{2}}Substitute into the formula,
\overline{x - c} = \sqrt{\frac{\textcolor{#0f0}{3\ 099.2}}{\textcolor{#2192ff}{40}} - (\textcolor{red}{3.2})^{2}}\overline{x - c} = 8.2Now that we have \overline{x - c}, let’s find \Sigma(x - c),
\overline{x - c} = \frac{\Sigma(x - c)}{n}Make \Sigma(x - c) the subject of the formula,
\Sigma(x - c) = n\left(\overline{x - c}\right)Substitute into the formula,
\Sigma(x - c) = 40\left(8.2\right)\Sigma(x - c) = 328Therefore, the final answer is,
\Sigma(x - c) = 328(b) Given that c = 50, find the mean of these values of x.

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

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


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


(a) Given that the mean of these 40 values of x is 34, find the value of k.

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

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