0

Let $a_i\geqslant 0$ for $i=1,\ldots,n$.

Show how to minimize $$\sum_{i=1}^n\frac 1 {a_i+x_i}$$ subject to $$\sum_{i=1}^n x_i = b$$ where $x_i\geqslant 0$ for $i=1,\ldots,n$ and $b>0$.

I'm stuck on how to do this problem.

Raul
  • 938
  • Are you familiar with Lagrange multipliers? – dfeuer Nov 07 '13 at 23:25
  • yes fairly, would you say thts all I need, is there an easier way? I guess i avoided lagrane multipliers as I saw a series rather than a typical function – Raul Nov 07 '13 at 23:26
  • For the question above, $a_{i}$ is not constrained in any way. Hence, there isn't an absolute minimum, for you can always choose a larger $a_{i}$. We only have an infimum of zero. Or are $a_{i}$ fixed? – Christopher K Nov 07 '13 at 23:28
  • I dunno. It's been sixteen years since I touched 'em, but they seem a pretty good thing to try first, no? Your series are finite. – dfeuer Nov 07 '13 at 23:29
  • 1
    @ChrisK, I think those are constants. – dfeuer Nov 07 '13 at 23:29
  • yh the ai's are constant – Raul Nov 07 '13 at 23:31
  • OK, that explains it. I'll leave it to you. Hint: $a_{i} + x_{i} = c$, where c is constant, $\forall; i$. – Christopher K Nov 07 '13 at 23:37
  • @ChrisK, that's not always possible, but it does seem intuitively likely that aiming for that goal is the way to go. – dfeuer Nov 07 '13 at 23:38
  • atm im doing the question with lagrange multipliers as suggested, Ill post if I have any particular problems, ive seen an example using lagrange multipliers so hopefully i can solve this :) – Raul Nov 07 '13 at 23:41
  • @dfeuer, I just took a cursory look to help Raul. Obviously, depending on the spread of $a_{i}$, i.e. if let's say without loss of generality that $a_{2}-a_{1} \geq b$, then this is not possible. – Christopher K Nov 07 '13 at 23:46
  • @ChrisK via lagrange multipliers, cant seem to find a set for the set of multipliers, did you use lagrange multipliers? in fact i think its "lamba" s.t. its zero or negative but not sure – Raul Nov 07 '13 at 23:55

3 Answers3

3

If we ignore the constraint that $x_i\ge0$ we can use standard Lagrangian methods but otherwise we must use Karush-Kuhn-Tucker. The objective function is convex and the constrain set is convex with a non-empty interior so we can use Kuhn-Tucker methods.

$$\mathcal{L}(x,\lambda)=\sum_{i=1}^{n}\dfrac{1}{a_i+x_i}+(\mu-\lambda_i) \cdot x_i$$

with $\lambda_i\ge 0$ and $\lambda_i\cdot x_i=0$ (complementary slackness condition). The first-order condition:

$$ \dfrac{-1}{(a_i+x_i)^2}=\lambda_i-\mu.$$ Thus if $x_i>0$ then $\lambda_i=0$ we must have $x_i=\dfrac{\sqrt{\mu}}{\mu}-a_i$ and $\mu>0$. Moreover, if $x_i>0$ for all $i$ we have $b=n\,\dfrac{\sqrt{\mu}}{\mu}-\sum\limits_{i=1}^{n} a_i$ and $x_i=\dfrac{b+\sum\limits_{j\neq i}a_j-(n-1)a_i}{n}$.

The above is the solution one gets by using standard Lagrangian methods but it clearly is not a feasible solution if $a_i$ is too high. The following procedure finds the optimal solution:

  1. Without loss of generality order the $a_i$: $a_1\le a_2\le a_3 \le ... \le a_n$.
  2. If $\frac{b+\sum\limits_{j\neq i}a_j-(n-1)a_n}{n}\ge 0$ then the above solution is the correct one, stop.
  3. Otherwise set $x_n=0$ and tentatively consider $x_i=\frac{b+\sum\limits_{j<n,j\neq i}a_j-(n-2)a_i}{n-1}$ for $i<n$.
  4. If $x_{n-1}\ge0$ then this is the solution, stop.
  5. Otherwise set $x_{n-1}=0$ and proceed in the same manner as in the previous steps.
1

As Chris K intuited, the best approach is to try to make $a_i+x_i$ constant, or, more precisely, to make $\min\{a_i+x_i\mid i=1,\dots,n\}$ as large as possible. Can you prove this without taking any derivatives?

Details

First, we should recognize that there must be a minimum: the set of all positive $x_1,\dots,x_n$ satisfying the constraint $\sum x_i=b$ is closed and bounded, hence compact, and the function $f(x_1,\dots,x_n)=\sum \frac 1 {a_i+x_i}$ is continuous, so by the extreme value theorem $f$ has a minimum.

Suppose that $x_i \ge 0$, $x_k>0$, and $a_i+x_i<a_k+x_k$. Let $\delta$ be real. Then $$\frac 1 {a_i+x_i+\delta}+\frac 1 {a_k+x_k-\delta}=\frac {a_i+x_i+a_k+x_k}{(a_i+x_i)(a_k+x_k)+\delta((a_k+x_k)-(a_i+x_i))-\delta^2}.$$

So as long as $0<\delta<\min \{x_k,(a_k+x_k)-(a_i+x_i)\}$, increasing $x_i$ by $\delta$ while decreasing $x_k$ by $\delta$ will reduce $f$, so $x_1,\dots,x_n$ don't minimize $f$. That is, any two terms in the minimizer are either equal or cannot be rebalanced to be closer to each other.

Sergio Parreiras's algorithm can then be seen as finding values of $x_i$s meeting this criterion.

dfeuer
  • 9,069
  • thanks for the alt proof which I can understand, I unfortunately have only learnt lagrange multipliers o well – Raul Nov 08 '13 at 01:42
0

Using the method of Lagrange multipliers:

To ensure $x_i\ge 0$, we can use the substitution $x_i=u_i^2$.

Let $L(\lambda,u_1,\ldots)=\sum \frac 1 {a_i+u_i^2}+\lambda \left(\sum u_i^2-b\right)$.

Then $${\partial \over \partial u_i} L(\lambda,x_1,\ldots)= \frac{-2u_i}{(a_i+u_i^2)^2}+2\lambda u_i,$$ which is $0$ when $$u_i=0 \text{ or } \lambda = \frac 1 {(a_i+u_i^2)^2}.$$

Restoring the original variables, we see that for each $i$, either $x_i=0$ or $\dfrac 1 {(a_i+x_i)^2}=\lambda$.

Perhaps you can finish this.

dfeuer
  • 9,069