| Line 25: |
Line 25: |
| | In this case, we put ten weights at the 11" mark and added it in ten times. But we could have hung one ''heavier'' weight at the 11" mark. That weight could be 2.5 or 8.6 or 16.184 times as much as the others. When we used ten weights, we could have written the calculation for the average this way: | | In this case, we put ten weights at the 11" mark and added it in ten times. But we could have hung one ''heavier'' weight at the 11" mark. That weight could be 2.5 or 8.6 or 16.184 times as much as the others. When we used ten weights, we could have written the calculation for the average this way: |
| | :(1·1 + 1·9 + 10·11) / (1 + 1 + 10) | | :(1·1 + 1·9 + 10·11) / (1 + 1 + 10) |
| − | When the weights are not integers, we do the calculation the same way. Instead of a sum, we use a weighted sum, in which each item is multiplied by a weighting factor; when we do the division, we divided by the sum of all the weights instead of the count of all the items. | + | When the weights are not integers, we do the calculation the same way. Instead of a sum, we use a ''weighted sum,'' in which each item is multiplied by a weighting factor; when we do the division, instead of dividing by the number of items, we divided by the ''sum of the weights.'' |
| − | An example of a case where a weighted average is appropriate: suppose I gas my car every Monday. Suppose that during one month price of gas is $2.00 per gallon the first week, $2.20 the second week, and $2.40 the third week, and $2.20 the fourth week. A newspaper report might say that the average price of gas for the month is the average of those four numbers:
| + | As an example of a case where a weighted average is appropriate: suppose I gas my car every Monday. Suppose that during one month price of gas is $2.00 per gallon the first week, $2.20 the second week, and $2.40 the third week, and $2.20 the fourth week. A newspaper report might say that the average price of gas for the month is the average of those four numbers: |
| | :($2.00 + $2.20 + $2.40 + $2.20) / 4 = $2.20. | | :($2.00 + $2.20 + $2.40 + $2.20) / 4 = $2.20. |
| | But the average price of the gas ''I bought'' depends on how much gas I buy each week. For me, the average price of gas is the price of gas each week ''weighted by'' the amount of gas I actually bought each week. | | But the average price of the gas ''I bought'' depends on how much gas I buy each week. For me, the average price of gas is the price of gas each week ''weighted by'' the amount of gas I actually bought each week. |