Professional Documents
Culture Documents
W X Y Z: Solution To The Quiz Scoring Problem
W X Y Z: Solution To The Quiz Scoring Problem
Now we show how to express W, X, Y, and Z in terms of A, B, C, and D, using only the
max and min functions, addition, subtraction, and integer multiplication.
W = max( A, B, C , D )
Z = min( A, B, C , D )
X = max( A, B, C ) + max( A, B, D ) + max( A, C , D ) + max( B, C , D ) − 3max( A, B, C , D )
Y = min( A, B, C ) + min( A, B, D ) + min( A, C , D ) + min( B, C , D ) − 3min( A, B, C , D )
Implementation: In every spreadsheet that I know of, max and min are binary functions
so that, for example, instead of MAX(A, B, C, D) you would need
MAX(MAX(A, B), MAX(C, D)).
Heuristics: To solve this I tried to find functions W, X, Y, and Z that would work for the
case when A ≥ B ≥ C ≥ D and would be symmetric in the four variables, that is they
would give the same value for any permutation of the variables. Once I got that idea, it
was pretty easy.
Generalization: The same method ought to work for the general case of n scores and
arbitrary weights, that is where the scores are a1 ,..., an and the weighted total is
n
x1 and xn , then x2 and xn −1 , and so forth, working from the outside to the middle.
However, for more than 4 scores the results would probably be too cumbersome for
practical use.