Checking a weighted-average result against its value range
With nonnegative weights and a positive total, a weighted average always lies between the smallest and largest value, which makes the range a quick sanity check.
Why the average cannot leave the range
A weighted average divides the sum of value times weight by the sum of weights. Each value contributes in proportion to its share of the total weight, and those shares are nonnegative and add to 1. The result is therefore a blend of the entered values. A blend of numbers cannot be smaller than the smallest one or larger than the largest one. If the average of values between 10 and 20 comes out at 25, something went wrong in the data or the entry, and the range check catches it before anyone relies on the number.
The default pair: 10 and 20 with weights 1 and 3
The Weighted average calculator with values 10 and 20 and weights 1 and 3 returns a weighted mean of 17.5 and a total weight of 4. By hand, 10 times 1 plus 20 times 3 is 70, and 70 divided by 4 is 17.5. The result lies between 10 and 20, as expected. It is closer to 20 because that value carries three quarters of the weight. The point sits 2.5 below 20 and 7.5 above 10, a ratio of 1 to 3, the same as the weights in reverse.
The boundary case
With weights 1 and 0, the second value contributes nothing. The calculator returns 10 with a total weight of 1. The average reaches the edge of the range, and only when all the positive weight sits on one value. Any positive weight on the larger value pulls the result strictly inside. A zero weight is allowed as long as the total weight is positive, and it is one way to switch a value off without removing it from the list. If all weights are zero, the division is by zero and the average is undefined.
A grade-style example with three values
Suppose an illustrative course has scores of 80, 90 and 70 with weights 30, 20 and 50. The weighted sum is 2,400 plus 1,800 plus 3,500, or 7,700, and the weights total 100, so the average is 77. The range is 70 to 90, and 77 lies inside it, closer to the 70 that carries half of the weight. Note that the weights did not have to be fractions that add to 1. Percent weights summing to 100 work, and so do counts or any positive numbers, because the division by the total normalizes them.
Another example with unequal counts
Values 5, 15 and 25 with weights 2, 2 and 1 give a weighted sum of 10 plus 30 plus 25, which is 65, over a total weight of 5. The average is 13, inside the range from 5 to 25. A plain average of those three values would be 15, so the heavier weights on the smaller values moved the result down by 2. When weights are counts, such as the number of readings behind each average, the weighted result is the average over all readings pooled together, which is why averaging averages without weights can mislead.
What a result outside the range tells you
If the output falls outside the minimum and maximum, check the inputs in order. A value may have been typed into the weight list, the lists may have different lengths, or a weight may have been negative. Spreadsheet exports are a frequent source of trouble: a stray thousands separator, a percent sign or a blank row can shift one list against the other, so that a weight is paired with the wrong value. Print the pairs side by side before trusting the output, and count both lists so that the number of values equals the number of weights. The tool rejects negative weights, and with them the guarantee changes: a negative weight can push the result beyond the endpoints, so the range check would no longer apply. A sign slip in the weight list is exactly the kind of input error the range check is designed to catch.
Pooling group averages
Weights are what make it correct to combine averages from groups of different sizes. Suppose, as an illustration, one class of 20 students has an average of 70 and another class of 30 students has an average of 80. A plain average of 70 and 80 is 75, but the second class has more students and should count for more. Using the class sizes as weights gives 70 times 20 plus 80 times 30, which is 1,400 plus 2,400, or 3,800, divided by 50, which is 76. The pooled average is the average over all 50 students, and it sits between 70 and 80, closer to 80 because that group is larger.
Weights that are negative or sum to zero
Negative weights define a different algebraic expression, which can extrapolate beyond the data, and they have no meaning as shares of a whole. This tool rejects them, so a request containing one produces no average. A total weight of zero is also unusable. Two weights of 1 and -1, for instance, would sum to zero and force a division by zero. Keep every weight at zero or above and make sure at least one is positive, and the range property holds without exception.
What the check does not prove
Landing inside the range is a necessary condition, and it is far from sufficient. An average of 17.5 between 10 and 20 could still be wrong if the weights were assigned to the wrong values, if they were swapped, or if the weights themselves were poorly chosen. In a gradebook, the right weights come from the syllabus. In a portfolio, they come from holdings. The range check detects entry errors that push the answer out of bounds, and it leaves the choice of weights to the person who knows the situation. A useful second check is to compare the weighted result with the plain average of the same values. When the heavier weights sit on the larger values, the weighted result should be higher than the plain average, and when they sit on the smaller values, lower. In the 5, 15 and 25 example, the heavy weights are on 5 and 15, so the weighted result of 13 falls below the plain average of 15. If the direction of the difference contradicts the weights you meant to assign, the lists are probably out of order relative to each other.
Reproduce the checks
Interior weighted result
Open the Weighted average calculator and enter:
- Values
10,20- Weights
1,3
Expected output:
Weighted average
17.5Total weight
4Both weights are positive.
Boundary weighted result
Open the Weighted average calculator and enter:
- Values
10,20- Weights
1,0
Expected output:
Weighted average
10Total weight
1Only the minimum value has positive weight.
References and implementation scope
The examples describe the behavior of the linked Computandum tools. A successful local check does not establish that another application accepts the same format or applies the same limits.