Problem:
Given real numbers , prove that you can find integers , such that and the sum of any subset of the original numbers differs from the sum of the corresponding by at most .
Solution
Solution:
We can take all to lie in the range and all to be or . The largest positive value of the sum of for any subset is achieved by taking the subset of those for which . Similarly, the largest negative value is achieved by taking those for which . So the worst subset will be one of those two.
If , then we cannot have and if the set of is to minimise the maximum sum, because swapping them would reduce the sum of 's with and the sum of 's with . So if we order the 's so that , then a best set of 's is for some , and for . [If some of the are equal, then we can find equally good sets of 's that do not have this form, but we cannot get a lower maximum sum by departing from this form.]
Let , and . As we increase the sums increase and the sums decrease, so for some we must have , . Either or must correspond to the optimum choice of 's to minimise the maximum sum.
Now assume that the 's form a maximal set, in other words they are chosen so that the minimum is as large as possible. We show first that in this case . Suppose . Then we could increase each of by . This would leave unaffected, but slightly increase and slightly reduce . For small this does not change the value of , but increases the smaller of and , thus increasing the minimum and contradicting the maximality of the original 's. Similarly, if , we could decrease each of by , thus slightly increasing and reducing .
Suppose not all of are equal. Take so that . Now increase each of by and reduce each of by , with and sufficiently small that we do not upset the ordering or change the value of , and with their relative sizes chosen so that is increased. is also increased, so we contradict the maximality of the 's. Hence all are equal. Similarly, we show that all of are equal. For if not we can increase slightly and reduce slightly to get a contradiction.
So we have established that all the 's must be equal. Suppose is odd and that all the 's equal . Then for the optimum we have , hence and the maximum difference is . This is maximised by taking , , and is .
If is even , then for the optimum we have , so , and the maximum difference is . However, in this case we cannot take , because that would give which is non-integral, so we take or , both of which give a maximum difference of .