1

I need to maximize $U = BM$ with constraits:

$6B +3M = 60$, $B>0$ and $M>0$.

The Lagrange function is $L=U + \lambda (6B+3M-60) + KB + HM$.

So

$$\partial_{\lambda}L= 6B+3M-60=0$$ $$\partial_{K}L = B=0$$ $$\partial_{H}L = M=0$$ $$\partial_{M}L = \partial_{M} (BM) +\lambda(3+6\partial_{M}B)+K\partial_{M}B +H=((-0.5)M+B)-0.5K+H$$

where $B=\frac{60-3M}{6}$ so $\partial_{M}B = -\frac{1}{2}$. But I am confused here by constrait $B=0$ and $M=0$, they cannot be. How can I make sure $B$ and $M$ are non-negative?

hhh
  • 5,469

1 Answers1

2

Edit: I have finally figured out what you were trying to do. The method of Lagrange multipliers incorporates constraints that are equalities, not inequalities. What you tried to do was, in effect, tack on the extra conditions $B=0$ and $M=0$ to the problem, which makes it inconsistent. When you deal with inequalities you simply throw out whatever solutions to $\nabla\Lambda=0$ do not satisfy them.

A solution should go like the following (I have changed the numbers slightly so that it is not the same exact problem).


Problem. Maximize the function $U(B,M)=B\cdot M$ under the constraints $$g(B,M)=B+2M=20,\qquad B,M>0.$$

  • Step 1. The Lagrange function is $$\Lambda(B,M,\lambda)=U(B,M)+\lambda \cdot (g(B,M)-20)$$ $$=BM+\lambda(B+2M-20).$$

  • Step 2. Set $\nabla_{}\Lambda=0$: $$\nabla_{B,M,\lambda}\Lambda(B,M,\lambda)=(0,0,0),\text{ i.e.}$$ $$\frac{\partial\Lambda}{\partial B}=M+\lambda=0;$$ $$\frac{\partial\Lambda}{\partial M}=B+2\lambda=0;$$ $$\frac{\partial\Lambda}{\partial\lambda}=B+2M-20=0.$$

  • Step 3. Set $B=-2\lambda,M=-\lambda$, derived from the second and first equations above respectively, then substitute them into the third equation and solve for $\lambda$: $$(-2\lambda)+2(-\lambda)-20=0$$ $$\implies \lambda=-5.$$

  • Step 4: Plug in $\lambda=-5$ into $B$ and $M$'s expressions from last step to find $B=10$ and $M=5$.

  • Step 5: Check the work. The answer gives two positive values that satisfy the original linear constraint. It gives a maximum value of $U(10,5)=50$, whereas $U$ at the endpoints $B=0$ and $M=0$ simply evaluate to $0$, much lower than $50$, therefore the answer is correct.

anon
  • 151,657
  • what about in a situation where you get negative values for $B$ and $M$? Yes, this is the point I have not understood. I have seen people considering all equalities and inequalities similarly. How do you handle the inequalities? Do you introduce slack variable and change the inequalies to equalities (a bit like in Simplex)? – hhh Oct 02 '11 at 02:17
  • @hhh: Like I said, in the general situation, if you find any solutions to $\nabla\Lambda=0$ that do not satisfy the inequalities (here, any solutions where either $B$ or $M$ or both are nonpositive), you simply throw them out and forget about them. – anon Oct 02 '11 at 02:20
  • Yes but then you need to somehow approach the problem from the negative values. Suppose you have just $B$ and $M$ with negative values and you need to find some points with some constraits. If I have understood right there are many ways then to approach to problem: A) inner thing approach, you approach from inside the costraited thing B) outside thing approach, you approach from the outside. (Sorry I do not know the technical names in English). I am uncertain how to do deal with thsi kind of situation, use Simplex with slack variables? Or can I still use Lagrange multipliers? – hhh Oct 02 '11 at 02:27
  • Suppose situation Lagrange multipliers do not give any possible value. How do you know whether some values exist? Which method you use then? – hhh Oct 02 '11 at 02:29
  • 1
    @hhh: Within the scope of the method of Lagrange multipliers, if the only solutions to $\nabla\Lambda=0$ are ones that don't satisfy the inequalities, then there is no extrema strictly inside the region bounded by the inequalities. Therefore (a) if the inequalities are all strict (as is the case here), there is no solution, or (b) if all of the inequalities are nonstrict, you can use the simplex method (as I understand it, at least; that sort of optimization is outside my present knowledge). – anon Oct 02 '11 at 02:38
  • Your implication "Therefore..." is wrong. Let $B>5$ (strict inequality). Solution to the question problem is $B=5$ and $M=10$ when $B,M>0$. Now, it cannot be the solution if $B>5$. Is the next best alternative $B=6$ and $M=8$? It depends on the characteristic of the constraits! For linear/affine/convex restrictions, the next $B=6$ and $M=8$ is the solution but not generally, one needs to consider extreme points and then check. And notice that not all methods even return optimal point like the inside gradient method. Not sure whether Simplex but I know it can be used with ineqs, $O(S)=e^{x}$. – hhh Oct 02 '11 at 02:50
  • 1
    @hhh: No, my implication is correct inside the correctly understood setting. Within the method of Lagrange multipliers, $B$ and $M$ are continuous variables and therefore the objective function $U(B,M)$ might not have any maximum or minimum, but rather a supremum or infimum. Inside a discrete mathematics / linear programming type setting, $B$ and $M$ are discrete variables so the implication doesn't apply. – anon Oct 02 '11 at 02:59
  • does the term "maximize" mean "to find out the maximum" or "to find out the supremum"? "(a) if the inequalities are all strict (as is the case here), there is no solution", confused by this statement. Some example? – hhh Oct 02 '11 at 05:08
  • 1
    @hhh: If you look at the function $f(x)=x$ with constraints $x>0$ & $x<5$ (strict inequalities), there is no maximum and no minimum - but the function has infinimum $0$ and supremum $5$. However, if you make the inequalities nonstrict ($x\ge0$, $x\le5$), the max/min exist and are respectively $0,5$. Likewise, if you restrict yourself to integer arguments (with strict inequalities again), $f(4)=4$ is the maximum and $f(1)=1$ is the minimum, but the method of Lagrange multipliers in the continuous setting doesn't apply to discrete optimization. – anon Oct 02 '11 at 05:26
  • 1
    And the way I understand it, maximize means finding the argument (input) corresponding to the maximum value the objective function takes (max output). So the first meaning you cite. – anon Oct 02 '11 at 05:32
  • Thank you, makes sense. Good points. – hhh Oct 02 '11 at 06:54