John has a string of paper where real numbers , for all , are written in a row. Show that for any given , he can cut the string of paper into pieces, between adjacent numbers, in such a way that sum of the numbers on each piece does not differ from another by more than 1.
, 2021
Solution
Denote the sums on each piece by
By abuse of notation will both denote the set of numbers enclosed by cuts and its sum, the meaning of which must be determined by the context.
We will start the following algorithm. During this algorithm we will move some elements to the neighbouring piece and construct new sequence of pieces . Empty pieces may appear.
(i) Find such that is the piece with the maximum sum of elements.
(ii) If we are done.
(iii) If , let be the pieces with minimum sum of elements nearest to (ties broken arbitrarily) and let be the next pieces to between and (it is non empty by the choice of ). Then either and then and we define by moving the last element from to , or , and then and is obtained by moving the first element of to . If then set and go to step (1). If then set and proceed to step (2).
Note that in step (3) each number is at most and no new pieces with sum is created. Indeed, , and for some since and . It is clear also that does not increase during the algorithm.
Note also that in step (3) the pieces may become empty. Then, in the next iteration of the algorithm, will be chosen since and in step (3) will become non empty (but one of its neighbours may become empty, etc.).
Claim. Step (3) is repeated at most times with being the same maximal pieces in and in .
Proof. Let be the number of elements in -th pieces. Then the number
takes positive integral values and is always less than . It is clear that this number decreases during the algorithm.
Thus after at most iteration of (3), the algorithm decreases the value of and so goes to (1). Consequently it decreases either the number of pieces with maximal sums or . As there are only finitely many ways to split the sum onto pieces, the algorithm eventually terminates at (2).