<p>Opportunity given, there can be cases where we have <em>both</em> <span class="math-container">$\lambda_j=0$</span> <em>and</em> <span class="math-container">$g_j(x^*) = c_j$</span>. This happens when the <em>unconstrained</em> optimum <span class="math-container">$x^*_u$</span> equals the constrained one. In such a case, while the constraint is satisfied with equality at the optimum, it is not really binding, in the sense that it does not affect the solution.</p>

CC BY-SA 4.0
2023-02-02T02:56:33.820Z
Why wouldn't we be able to have $\lambda > 0$ and $g_j(x) > 0$? Why would that be a problem?
cc88
CC BY-SA 4.0
2023-02-03T01:37:29.343Z
@cc88 Assume, towards a contradiction, that $x^*$ is the optimal value and that $\lambda^*_j >0$ and $g_j(x^*) > c_j$. This $x^*$ maximizes the Lagrangian. Does it maximize the objective function?
Alecos Papadopoulos
CC BY-SA 4.0
2023-02-02T02:15:04.523Z
2023-02-02T02:15:04.523Z
Alecos Papadopoulos
<p>Solving a non-linear programming (with inequality constraints) is about trial and error. You don't know a priori if a constraint is active. You consider all the possible cases satisfying your constraints and see if they optimize your objective function (maximize the utility function, for instance) .</p>
<p>Also <span class="math-container">$\lambda_j =0$</span> is not an equality constraint, it is just the multiplier attached to your constraint. You have a single distinct multiplier per each constraint.<span class="math-container">$\lambda_j =0$</span> if your constraint is NOT active. On the other hand, <span class="math-container">$\lambda_j &gt;0$</span> if your constraint is active</p>
<p>The simplest example you can consider is:</p>
<p>Say you want to max. <span class="math-container">$U=xy$</span> , <span class="math-container">$s.t.$</span></p>
<p><span class="math-container">$i)x+y\le 100$</span></p>
<p><span class="math-container">$ii) x,y \ge0$</span></p>
<p>You build up the Lagrangian:</p>
<p><span class="math-container">$L(x,y,\lambda)=xy+ \lambda(100-x-y)$</span></p>
<p>KT conditions:</p>
<p>i) <span class="math-container">$\frac{\partial L}{\partial x}=y-\lambda \le 0$</span> ; <span class="math-container">$x\ge 0$</span></p>
<p>Note that one between the partial derivative and <span class="math-container">$x$</span> must be zero. This is called complementary slackness and can be summarized as <span class="math-container">$x \frac{\partial L}{\partial x}=0$</span></p>
<p>ii) <span class="math-container">$\frac{\partial L}{\partial y}=x-\lambda \le 0$</span> ; <span class="math-container">$y\ge 0$</span>,</p>
<p>which can be summarized as <span class="math-container">$y \frac{\partial L}{\partial y}=0$</span></p>
<p>iii) <span class="math-container">$\frac{\partial L}{\partial \lambda}=100-x-y \ge 0$</span> ; <span class="math-container">$\lambda \ge 0$</span>,</p>
<p>which can be summerized as <span class="math-container">$\lambda \frac{\partial L}{\partial \lambda}=0$</span>, and this is exactly the CSC you wrote in your question.</p>
<p>As I said, you don't know a priori which constraint is binding. You must consider all the possible cases satisfying your constraint and see if these maximize the utility function. In our example, it does not make sense to assume that <span class="math-container">$x$</span> or <span class="math-container">$y$</span> are zero, because o.w. <span class="math-container">$U(x,y)=0$</span>. It does make sense to assume that <span class="math-container">$\frac{\partial L}{\partial x}=\frac{\partial L}{\partial y}=0$</span>, from complementary slackness. Thus, since <span class="math-container">$\frac{\partial L}{\partial x}=\frac{\partial L}{\partial y}$</span>, then, you get <span class="math-container">$y -\lambda = x - \lambda$</span>, which means <span class="math-container">$x=y$</span>, and since your wealth is <span class="math-container">$100$</span>, you realize that <span class="math-container">$x=y=50$</span></p>

CC BY-SA 4.0
2023-02-01T20:31:37.110Z
+1  Good example to illustrate KKT and CS conditions.  However I suggest that your reference to "assumptions" could be misleading.  It would be more accurate to say that you consider the possible cases identified via the conditions and choose the case which yields the highest value of $U$?  For example the condition $x \frac{\partial L}{\partial x}=0$ leads to the possible case $x=0$ but you reject that case because it implies $U=0$.
Adam Bailey
CC BY-SA 4.0
2023-02-01T22:02:20.120Z
Thanks for the advice, you are right !
Tony
CC BY-SA 4.0
2023-02-02T02:09:01.743Z
+1 I get the logic, but why "one between the partial derivative and x must be zero"? Also, in iii) did you mean $\frac{\partial L}{\partial \lambda}=100-x-y \leq 0$
cc88
CC BY-SA 4.0
2023-02-02T09:01:44.213Z
Because you are maximising the lagrangian function. A necessary condition to find an optimum is that its first derivative must yield zero. If  this corresponds to an interior point, then $x>0$. You could also find a situation where the first derivative is zero at the boundary, where $x=0$. Finally, it might be that the first derivative yields zero for negative values of $x$. You rule out this situation and pick a point where the first derivative is negative but $x$ is zero. About point iii), I restated  that $x$ plus $y$ can’t exceed total wealth(in the example prices are 1)
Tony
CC BY-SA 4.0
2023-02-01T11:36:34.433Z
2023-02-01T22:21:30.113Z
2023-02-01T22:21:30.113Z
Tony
<p>Complementary slackness condition (CSC) state that
<span class="math-container">$\lambda_j[g_j(x) − c_j] = 0 \hspace{5pt} \text{for} \hspace{5pt} j = 1, ..., m.$</span> Therefore, every constraint either needs to be an equality constraint (<span class="math-container">$\lambda_j=0$</span>) or we need to have an active constraint (<span class="math-container">$g_j(x) − c_j = 0$</span>). What if we have a passive constraint? Why would that prevent us from finding the optimum point? In that case, couldn't we just ignore that constraint and find the optimum without it because it doesn't affect our optimal point? If yes, wouldn't that make CSC irrelevant?</p>

CC BY-SA 4.0
2023-01-30T21:07:54.990Z
Why should $\lambda_j=0$ correspond to an "equality constraint"?
Michael Greinecker
CC BY-SA 4.0
2023-01-30T21:46:39.317Z
So if $\lambda_j=0$, then we can say that the constraint $j$ has no effect on the quantity optimized, correct? In that case, constraint $j$ would be a passive constraint, correct? Still, then CSC simply means that 'constraint must be passive or active' which makes no difference. What is the case where CSC wouldn't be satisfied then? Feel free to write it as an answer, I will mark it as a solution.
cc88
CC BY-SA 4.0
2023-01-31T03:01:15.877Z
Hi: I vaguely remember there being a theorem which says that optimality has to occur at an extreme point. Extreme points I think are defined as points where the constraints are active. This would explain why you need complementary slackness.
mark leeds
CC BY-SA 4.0
2023-01-31T14:23:09.363Z
The matter is that you don't know in advance if a constraint (in a feasible point) is active or not. If you know in advance that a constraint is not binding, you could ignore it.
BakerStreet
CC BY-SA 4.0
2023-02-02T02:14:34.093Z
What do you mean by a "passive" constraint? A non-binding one? Or something else?
Alecos Papadopoulos
CC BY-SA 4.0
2023-02-02T02:54:33.933Z
@AlecosPapadopoulos Yes, a non-binding one.
cc88
<mathematical-economics><consumer-theory><optimization>
Why do we need Complementary Slackness Condition for Karush-Kuhn-Tucker Conditions
cc88
# Why do we need Complementary Slackness Condition for Karush-Kuhn-Tucker Conditions

(Asked by: username_0 on 2023-01-30)

Complementary slackness condition (CSC) state that
$\lambda\_j[g\_j(x) − c\_j] = 0 \hspace{5pt} \text{for} \hspace{5pt} j = 1, ..., m.$ Therefore, every constraint either needs to be an equality constraint ($\lambda\_j=0$) or we need to have an active constraint ($g\_j(x) − c\_j = 0$). What if we have a passive constraint? Why would that prevent us from finding the optimum point? In that case, couldn't we just ignore that constraint and find the optimum without it because it doesn't affect our optimal point? If yes, wouldn't that make CSC irrelevant?

**Tags:** mathematical-economics, consumer-theory, optimization

> **Comments:**
> **username_1**: Why should $\lambda_j=0$ correspond to an "equality constraint"?  
> **username_0**: So if $\lambda_j=0$, then we can say that the constraint $j$ has no effect on the quantity optimized, correct? In that case, constraint $j$ would be a passive constraint, correct? Still, then CSC simply means that 'constraint must be passive or active' which makes no difference. What is the case where CSC wouldn't be satisfied then? Feel free to write it as an answer, I will mark it as a solution.  
> **username_2**: Hi: I vaguely remember there being a theorem which says that optimality has to occur at an extreme point. Extreme points I think are defined as points where the constraints are active. This would explain why you need complementary slackness.  
> **username_3**: The matter is that you don't know in advance if a constraint (in a feasible point) is active or not. If you know in advance that a constraint is not binding, you could ignore it.  
> **username_4**: What do you mean by a "passive" constraint? A non-binding one? Or something else?  
> **username_0**: @AlecosPapadopoulos Yes, a non-binding one.  

---

## 2 answers

### Answer by username_5 on 2023-02-01. Score: 8 | Accepted answer

Solving a non-linear programming (with inequality constraints) is about trial and error. You don't know a priori if a constraint is active. You consider all the possible cases satisfying your constraints and see if they optimize your objective function (maximize the utility function, for instance) .

Also $\lambda\_j =0$ is not an equality constraint, it is just the multiplier attached to your constraint. You have a single distinct multiplier per each constraint.$\lambda\_j =0$ if your constraint is NOT active. On the other hand, $\lambda\_j >0$ if your constraint is active

The simplest example you can consider is:

Say you want to max. $U=xy$ , $s.t.$

$i)x+y\le 100$

$ii) x,y \ge0$

You build up the Lagrangian:

$L(x,y,\lambda)=xy+ \lambda(100-x-y)$

KT conditions:

i) $\frac{\partial L}{\partial x}=y-\lambda \le 0$ ; $x\ge 0$

Note that one between the partial derivative and $x$ must be zero. This is called complementary slackness and can be summarized as $x \frac{\partial L}{\partial x}=0$

ii) $\frac{\partial L}{\partial y}=x-\lambda \le 0$ ; $y\ge 0$,

which can be summarized as $y \frac{\partial L}{\partial y}=0$

iii) $\frac{\partial L}{\partial \lambda}=100-x-y \ge 0$ ; $\lambda \ge 0$,

which can be summerized as $\lambda \frac{\partial L}{\partial \lambda}=0$, and this is exactly the CSC you wrote in your question.

As I said, you don't know a priori which constraint is binding. You must consider all the possible cases satisfying your constraint and see if these maximize the utility function. In our example, it does not make sense to assume that $x$ or $y$ are zero, because o.w. $U(x,y)=0$. It does make sense to assume that $\frac{\partial L}{\partial x}=\frac{\partial L}{\partial y}=0$, from complementary slackness. Thus, since $\frac{\partial L}{\partial x}=\frac{\partial L}{\partial y}$, then, you get $y -\lambda = x - \lambda$, which means $x=y$, and since your wealth is $100$, you realize that $x=y=50$

> **Comments:**
> **username_6**: +1  Good example to illustrate KKT and CS conditions.  However I suggest that your reference to "assumptions" could be misleading.  It would be more accurate to say that you consider the possible cases identified via the conditions and choose the case which yields the highest value of $U$?  For example the condition $x \frac{\partial L}{\partial x}=0$ leads to the possible case $x=0$ but you reject that case because it implies $U=0$.  
> **username_5**: Thanks for the advice, you are right !  
> **username_0**: +1 I get the logic, but why "one between the partial derivative and x must be zero"? Also, in iii) did you mean $\frac{\partial L}{\partial \lambda}=100-x-y \leq 0$  
> **username_5**: Because you are maximising the lagrangian function. A necessary condition to find an optimum is that its first derivative must yield zero. If  this corresponds to an interior point, then $x>0$. You could also find a situation where the first derivative is zero at the boundary, where $x=0$. Finally, it might be that the first derivative yields zero for negative values of $x$. You rule out this situation and pick a point where the first derivative is negative but $x$ is zero. About point iii), I restated  that $x$ plus $y$ can’t exceed total wealth(in the example prices are 1)  

---

### Answer by username_4 on 2023-02-02. Score: 2

Opportunity given, there can be cases where we have *both* $\lambda\_j=0$ *and* $g\_j(x^\*) = c\_j$. This happens when the *unconstrained* optimum $x^\*\_u$ equals the constrained one. In such a case, while the constraint is satisfied with equality at the optimum, it is not really binding, in the sense that it does not affect the solution.

> **Comments:**
> **username_0**: Why wouldn't we be able to have $\lambda > 0$ and $g_j(x) > 0$? Why would that be a problem?  
> **username_4**: @username_0 Assume, towards a contradiction, that $x^*$ is the optimal value and that $\lambda^*_j >0$ and $g_j(x^*) > c_j$. This $x^*$ maximizes the Lagrangian. Does it maximize the objective function?  

---

