6
$\begingroup$

There are four lists, each with $100$ numbers in $[0,1]$. You want to perform as few swaps between pairs of numbers as possible, so that the difference between the sums of numbers in any two lists becomes at most $1$. What is the largest number of swaps that you may have to perform?

A worst case seems to be when two lists are all $1$ and the other two lists are all $0$, which needs $100$ swaps. A method for achieving the goal (difference $\le 1$) is that, as long as the goal is not met, we swap a largest number in a largest-sum list with a smallest number in a smallest-sum list. This always terminates because after the swap, both lists have a larger sum than the previous sum of the smaller-sum list. But does it always terminate after at most $100$ swaps?

$\endgroup$
8
  • $\begingroup$ When you say " so that the difference between the sums of numbers in any two lists becomes at most 1", do you mean the sums of the same rank ? $\endgroup$
    – Jean Marie
    Commented Nov 27, 2023 at 15:28
  • 1
    $\begingroup$ @JeanMarie (I believe that) It's the sum of all the numbers in the set. There is no inherent "ranking/ordering" of the set. $\endgroup$
    – Calvin Lin
    Commented Nov 27, 2023 at 16:51
  • $\begingroup$ Yes, Calvin Lin's understanding is right. $\endgroup$
    – user57012
    Commented Nov 27, 2023 at 23:27
  • $\begingroup$ Isn't this pretty trivial to prove? If we call A,B,C,D the sums of the 4 lists ordered from least to most, then (D-A) + (C-B) is at most 200. When this value is 2 or more, a swap will always decrease the value by 2, as you add 1 to A and subtract 1 from D, at each step $\endgroup$
    – Cruncher
    Commented Dec 11, 2023 at 14:50
  • $\begingroup$ @Cruncher the entries of the list are real numbers, not integers. $\endgroup$ Commented Dec 11, 2023 at 14:58

0

You must log in to answer this question.

Browse other questions tagged .