Squar­ing instead of ignor­ing signs

In the last les­son we got rid of neg­a­tive signs by tak­ing absolute val­ues. There is a neater way: square the devi­a­tions. Aver­age those squares and you have the vari­ance; take its square root and you have the stan­dard devi­a­tion, the mea­sure of spread you will meet most often. We will com­pute both for raw data, fre­quency tables and grouped data, learn a short-cut that keeps the arith­metic small, use the coef­fi­cient of vari­a­tion to decide which of two series is more con­sis­tent, and fin­ish with mixed prac­tice.

Vari­ance and stan­dard devi­a­tion

σ2=1n∑(xi−xˉ)2=1n∑xi2−xˉ2,σ=σ2.\displaystyle \sigma^2 = \frac{1}{n}\sum (x_i - \bar x)^2 = \frac{1}{n}\sum x_i^2 - \bar x^2, \qquad \sigma = \sqrt{\sigma^2}.

When the data come with fre­quen­cies, σ2=1N∑fi(xi−xˉ)2=1N∑fixi2−xˉ2\displaystyle \sigma^2 = \tfrac{1}{N}\sum f_i(x_i - \bar x)^2 = \tfrac{1}{N}\sum f_i x_i^2 - \bar x^2.

The short-cut (step-devi­a­tion) method. Choose a con­ve­nient AA and let yi=xi−Ah\displaystyle y_i = \tfrac{x_i - A}{h} with class width hh. Then xˉ=A+hyˉ\bar x = A + h\bar y and σx=h σy\sigma_x = h\,\sigma_y. Two facts make this work. Shift­ing every value by the same con­stant leaves σ\sigma unchanged, and mul­ti­ply­ing every value by kk mul­ti­plies σ\sigma by ∣k∣\lvert k \rvert.

Exam­ple 1. Data 6,8,10,12,146, 8, 10, 12, 14: xˉ=10\bar x = 10, the squared devi­a­tions are 16,4,0,4,1616, 4, 0, 4, 16, and so σ2=8\sigma^2 = 8, σ=22\sigma = 2\sqrt{2}.

Number line with the data 6, 8, 10, 12, 14 and the mean 10; above each point a square shows its squared deviation, 16, 4, 0, 4, 16, and the variance is (16 + 4 + 0 + 4 + 16)/5 = 8.
Exam­ple 1: the squared devi­a­tions aver­age to a vari­ance of 8

Exam­ple 2. Take the first 1010 nat­ural num­bers. Here xˉ=5.5\bar x = 5.5, 110∑x2=38.5\displaystyle \tfrac{1}{10}\sum x^2 = 38.5, σ2=38.5−30.25=8.25\sigma^2 = 38.5 - 30.25 = 8.25. In gen­eral, for 1,…,n1, \ldots, n you get σ2=n2−112\displaystyle \sigma^2 = \tfrac{n^2 - 1}{12}.

Exam­ple 3.

Class 00–1010 1010–2020 2020–3030 3030–4040 4040–5050
ff 44 66 1010 66 44

The mid­points run 55–4545. Tak­ing A=25A = 25 and h=10h = 10 gives y=−2,−1,0,1,2y = -2, -1, 0, 1, 2. N=30N = 30, ∑fy=0\displaystyle \sum fy = 0, ∑fy2=16+6+0+6+16=44\displaystyle \sum fy^2 = 16 + 6 + 0 + 6 + 16 = 44. xˉ=25\bar x = 25, σy2=4430\displaystyle \sigma_y^2 = \tfrac{44}{30}, σx=102215≈12.11\displaystyle \sigma_x = 10\sqrt{\tfrac{22}{15}} \approx 12.11.

Histogram of the classes 0-10 to 40-50 with frequencies 4, 6, 10, 6, 4, symmetric about the dashed mean line at 25; the step values y = -2 to 2 are shown under the classes.
Exam­ple 3: the grouped data, sym­met­ric about the mean 25

Com­par­ing vari­abil­ity

The coef­fi­cient of vari­a­tion CV=σxˉ×100\displaystyle \text{CV} = \tfrac{\sigma}{\bar x} \times 100 mea­sures spread rel­a­tive to the size of the val­ues. Whichever series has the smaller CV is the more con­sis­tent one.

Exam­ple 4. Two bats­men: A aver­ages 4848 runs with σ=12\sigma = 12; B aver­ages 4040 with σ=8\sigma = 8. Their CVs are A 25%25\% and B 20%20\%. So B is the more con­sis­tent bats­man, even though A scores more.

Exam­ple 5. Five obser­va­tions have mean 66 and vari­ance 88; three of them are 2,6,82, 6, 8. The other two, aa and bb, sat­isfy a+b=30−16=14a + b = 30 - 16 = 14 and a2+b2=5(8+36)−(4+36+64)=116a^2 + b^2 = 5(8 + 36) - (4 + 36 + 64) = 116, so ab=196−1162=40\displaystyle ab = \tfrac{196 - 116}{2} = 40: a,b=4,10a, b = 4, 10.

Cor­rect­ing a mis­take. Sup­pose a wrong value ww was recorded in place of the right value rr in data of size nn. Do not start again from scratch. Instead, cor­rect ∑x=∑x−w+r\displaystyle \sum x = \sum x - w + r and cor­rect ∑x2=∑x2−w2+r2\displaystyle \sum x^2 = \sum x^2 - w^2 + r^2, and then recom­pute.

Mixed prac­tice

  1. Find the mean and vari­ance of 2,4,6,8,10,122, 4, 6, 8, 10, 12.
  2. Find the vari­ance of the first nn even nat­ural num­bers.
  3. Find the mean and stan­dard devi­a­tion:
xix_i 44 88 1111 1717 2020 2424 3232
fif_i 33 55 99 55 44 33 11
  1. Find the mean and stan­dard devi­a­tion by the short-cut method:
Class 3030–4040 4040–5050 5050–6060 6060–7070 7070–8080 8080–9090 9090–100100
ff 33 77 1212 1515 88 33 22
  1. Two plants' daily out­put: plant P mean 6363, σ=9\sigma = 9; plant Q mean 5454, σ=7.2\sigma = 7.2. Which is more con­sis­tent?
  2. The mean and stan­dard devi­a­tion of 2525 obser­va­tions are 1212 and 33. One obser­va­tion was recorded as 99 instead of 1414. Find the cor­rect mean and stan­dard devi­a­tion.
  3. If each obser­va­tion is mul­ti­plied by 33 and then increased by 55, how do the mean and stan­dard devi­a­tion change?
  4. The mean and vari­ance of 77 obser­va­tions are 88 and 1616. Five of them are 2,4,10,12,142, 4, 10, 12, 14. Find the other two.
  5. Show that the vari­ance of a set of equal num­bers is 00, and con­versely.
  6. Com­pute the mean devi­a­tion about the mean and the stan­dard devi­a­tion of 3,5,7,9,113, 5, 7, 9, 11. Which is larger?

Answers to check against

Show answers
  1. xˉ=7\bar x = 7; σ2=25+9+1+1+9+256=353\displaystyle \sigma^2 = \tfrac{25 + 9 + 1 + 1 + 9 + 25}{6} = \tfrac{35}{3}.
  2. 2×2 \times the first nn nat­u­rals: 4⋅n2−112=n2−13\displaystyle 4 \cdot \tfrac{n^2 - 1}{12} = \tfrac{n^2 - 1}{3}.
  3. N=30N = 30, ∑fx=420\displaystyle \sum fx = 420, xˉ=14\bar x = 14; ∑fx2=7254\displaystyle \sum fx^2 = 7254; σ2=241.8−196=45.8\sigma^2 = 241.8 - 196 = 45.8, σ≈6.77\sigma \approx 6.77.
  4. A=65A = 65, h=10h = 10: y=−3,…,3y = -3, \ldots, 3; N=50N = 50; ∑fy=−9−14−12+0+8+6+6=−15\displaystyle \sum fy = -9 - 14 - 12 + 0 + 8 + 6 + 6 = -15; ∑fy2=27+28+12+0+8+12+18=105\displaystyle \sum fy^2 = 27 + 28 + 12 + 0 + 8 + 12 + 18 = 105. xˉ=65−3=62\bar x = 65 - 3 = 62; σy2=2.1−0.09=2.01\sigma_y^2 = 2.1 - 0.09 = 2.01; σ≈14.18\sigma \approx 14.18.
  5. CV: P 14.29%14.29\%, Q 13.33%13.33\%, so Q is more con­sis­tent.
  6. ∑x=300→305\displaystyle \sum x = 300 \to 305, mean 12.212.2; ∑x2=25(9+144)=3825→3825−81+196=3940\displaystyle \sum x^2 = 25(9 + 144) = 3825 \to 3825 - 81 + 196 = 3940; σ2=157.6−148.84=8.76\sigma^2 = 157.6 - 148.84 = 8.76, σ≈2.96\sigma \approx 2.96.
  7. Mean becomes 3xˉ+53\bar x + 5; stan­dard devi­a­tion 3σ3\sigma.
  8. a+b=14a + b = 14; ∑x2=7(16+64)=560\displaystyle \sum x^2 = 7(16 + 64) = 560; known squares 4+16+100+144+196=4604 + 16 + 100 + 144 + 196 = 460; a2+b2=100a^2 + b^2 = 100: a,b=6,8a, b = 6, 8.
  9. σ2=1n∑(xi−xˉ)2=0\displaystyle \sigma^2 = \tfrac{1}{n}\sum (x_i - \bar x)^2 = 0 exactly when every xi=xˉx_i = \bar x.
  10. MD =4+2+0+2+45=2.4\displaystyle = \tfrac{4 + 2 + 0 + 2 + 4}{5} = 2.4; σ=8≈2.83\sigma = \sqrt{8} \approx 2.83, which is the larger.