What is the maximum value of the sum $\sum_{i=1}^L(\bar{x}-x_i)$, in this specific case.

263 Views Asked by At

Let $x_i$ be a positive real variable, with $i=1,2,...,K$. We denote by $\bar{x}$ the average value of the values $x_1, x_2,...,x_K$. Let $a=\min_i x_i$ and $b=\max_i x_i$, then $x_i \in [a,b]$.

My question: what is the maximum value of the sum

\begin{equation*} \sum_{i=1}^L (\bar{x}-x_i), \end{equation*}

for $L\le K$.

1

There are 1 best solutions below

0
On BEST ANSWER

Let me write $$ S(x):=\sum_{i=1}^L ( \bar x - x_i) = \sum_{i=1}^L (\sum_{j=1}^K K^{-1}x_j - x_i) = \sum_{i=1}^L (L/K-1)x_i + \sum_{i=L+1}^K K^{-1}x_i. $$ Thus, $S(x)$ is maximal if $x_i$, $i=1\dots L$ are at the lower bound, while $x_i$ are at the uppper bound $i=L+1\dots K$. Hence the maximum is $$ S_{max}=L(L/K-1)a + (K-L)/K b = \frac{K-L}{K}(-La + b). $$