M9 · Chapter 6 · Duality, LP and simplex
Lagrangian, dual function, weak/strong duality, LP duality, basic feasible solutions and the simplex method (lectures 27 Oct, 3 Nov, 12 Nov). Full theory: M6.
Each stop = a concept card (plain words → picture → symbols) followed by questions that start trivial and end tricky. Answer before opening the explanation. Levels: L1 term L2 use L3 trap L4 exam. His notation: $\mathcal L=f-\sum\lambda_ig_i+\sum\mu_jh_j$ (rules $g_i\ge0$), $t(\lambda,\mu)=\min_x\mathcal L$; LP canonical form $\min c^\top x$, $Ax=b$, $x\ge0$. The simplex method was taught on 12 Nov (not recorded); the steps here follow the 2021 lectures L23–L24 (M6 §F).
1. The Lagrangian: putting prices on the rules
In plain words: A constrained problem says “minimise $f$, but you must obey rules”. Instead of forbidding rule-breaking, charge a price for how far a rule is from being satisfied, and then let $x$ roam freely. If the prices are chosen well the free minimiser behaves like the constrained one.
Words and symbols on this stop: $f(x)$ = the cost we minimise; $g_i(x)\ge0$ = an inequality rule (satisfied when $g_i\ge0$; the number $g_i(x)$ is the “room left”); $h_j(x)=0$ = an equality rule; $\lambda_i$ = price on rule $g_i$ (called a multiplier, must be $\ge0$); $\mu_j$ = price on rule $h_j$ (can be any sign); $\mathcal L$ = the Lagrangian, the cost plus the priced rules.
Precisely: his form: $\mathcal L(x,\lambda,\mu)=f(x)-\sum_i\lambda_ig_i(x)+\sum_j\mu_jh_j(x)$ with $\lambda\ge0$, $\mu$ free. For feasible $x$ and $\lambda\ge0$: $\mathcal L(x,\lambda,\mu)\le f(x)$.
In his Lagrangian $\mathcal L=f-\sum\lambda_ig_i+\sum\mu_jh_j$ for rules $g_i(x)\ge0$, the multipliers $\lambda_i$ of the inequality rules must satisfy $\lambda_i\ge0$.
Explanation
True. $\lambda_i$ is a price for using up room, and prices of room are non-negative. With $\lambda_i\ge0$ and $g_i(x)\ge0$ the term $-\lambda_ig_i(x)$ is $\le0$, which is exactly what makes $\mathcal L\le f$ at feasible points (the engine of weak duality, Stop 3). See M6 §A.
For $\min x^2$ s.t. $x-1\ge0$, his Lagrangian is
- (a) $x^2-\lambda(x-1)$
- (b) $x^2+\lambda(x-1)$
- (c) $x^2-\lambda(x+1)$
- (d) $\lambda(x-1)-x^2$
Explanation
(a). Take $f=x^2$, $g=x-1$ and plug into $f-\lambda g$. (b) has the wrong sign: for $x\ge1$ it is $\ge f$, so it would not be a lower bound. (c) uses the wrong rule ($x+1$ instead of $x-1$). (d) is $-\mathcal L$ with $\lambda g$ also flipped: nonsense.
Same problem, $\lambda=2$. What is $\mathcal L(3,2)$, and how does it compare with $f(3)=9$?
- (a) $5$, below $f(3)$
- (b) $13$, above $f(3)$
- (c) $9$, equal to $f(3)$
- (d) $1$, below $f(3)$
Explanation
(a). $\mathcal L(3,2)=3^2-2(3-1)=9-4=5\le9$. The room is $g(3)=2$, the price is 2 per unit, so $4$ is subtracted. (b) adds the penalty instead of subtracting it. (c) ignores the rule term. (d) is $\mathcal L(1,2)=1$, the value at $x=1$, not at $x=3$.
The multiplier $\mu_j$ of an equality rule $h_j(x)=0$ must also satisfy $\mu_j\ge0$.
Explanation
False. An equality can be violated in both directions ($h_j\gt 0$ or $h_j\lt 0$), so its price may need either sign; $\mu_j$ is free. Only inequalities $g_i\ge0$ (one-sided) get $\lambda_i\ge0$. Counterexample: $\min x^2$ s.t. $x-1=0$, $\mathcal L=x^2+\mu(x-1)$: $\mathcal L'=0$ at $x=1$ needs $2+\mu=0$, so the right price is $\mu^*=-2\lt 0$. See M6 §A.
2. The dual function $t(\lambda,\mu)$: domain and concavity
In plain words: For a fixed set of prices, ask: what is the cheapest total cost if $x$ may ignore the rules completely? That number is the dual function. Sometimes the answer is “as low as you like” ($-\infty$): those prices are useless and are outside the domain.
Words and symbols on this stop: $t(\lambda,\mu)=\min_{x\in\mathbb R^d}\mathcal L(x,\lambda,\mu)$ = the dual function; domain = the $(\lambda,\mu)$ where $t\gt -\infty$; concave = the graph bends downward (like $-x^2$), i.e. $-t$ is convex; dual feasible = $\lambda\ge0$ and in the domain; $M\succ0$: all eigenvalues $\gt 0$ (bends up in every direction); $M\succeq0$: all $\ge0$; $\mathrm{range}(M)$: all vectors $Mz$; Hessian: matrix of second derivatives (here the matrix $M$ of the quadratic).
Precisely: Two rules cover almost every exam question. Rule 1 (linear in $x$): $\min_x a^\top x+\text{const}=\text{const}$ if $a=0$, else $-\infty$. Rule 2 (quadratic): $\min_x\frac12x^\top Mx+v^\top x=-\frac12v^\top M^{-1}v$ if $M\succ0$; $-\infty$ if $M$ has a negative eigenvalue; if $M\succeq0$ is singular it is finite only when $v\in\mathrm{range}(M)$. $t$ is always concave.
The dual function $t(\lambda,\mu)=\min_x\mathcal L(x,\lambda,\mu)$ is a minimum over every $x\in\mathbb R^d$, feasible or not.
Explanation
True. That is the whole point: removing the constraints turns it into an unconstrained minimisation, which we can solve with Rule 1 or 2. The rules only enter through the prices $\lambda,\mu$. See M6 §A.
Let $\min x^2+y^2$ s.t. $x+y-1\ge0$. Mark all correct statements.
- (a) $t(\lambda)=\lambda-\frac{\lambda^2}{2}$
- (b) the domain of $t$ is all real $\lambda$
- (c) $t(1)=\frac12$
- (d) $t(2)=2$
Explanation
(a), (b), (c). $\mathcal L=x^2+y^2-\lambda(x+y-1)$ has Hessian $2I\succ0$, so a minimum exists for every $\lambda$ (domain: all of $\mathbb R$, (b) true). Setting the gradient to 0: $x=y=\lambda/2$; value $\frac{\lambda^2}{4}+\frac{\lambda^2}{4}-\lambda(\lambda-1)=\lambda-\frac{\lambda^2}{2}$ (a). $t(1)=1-\frac12=\frac12$ (c). (d) is false: $t(2)=2-2=0$. (Dual feasibility additionally asks $\lambda\ge0$; $t$ itself is defined for all $\lambda$.) See M6 §A.
For $\min 3x$ s.t. $x-1\ge0$, the dual function is finite only at $\lambda=3$, where $t(3)=3$; for every other $\lambda$, $t=-\infty$.
Explanation
True. $\mathcal L=3x-\lambda(x-1)=(3-\lambda)x+\lambda$ is linear in $x$ (Rule 1). If $3-\lambda\ne0$, push $x\to\pm\infty$ the right way and the value falls to $-\infty$. Only $\lambda=3$ kills the $x$-term, leaving the constant $\lambda=3$. So an LP's dual constraint “coefficient of $x$ is 0” appears as an equality (here $\lambda=3$). This is exactly how every LP dual in Stop 6 is built.
The dual function $t$ is concave only when the primal problem is convex.
Explanation
False. $t$ is the lowest of straight lines in $(\lambda,\mu)$ (see the picture), hence concave always, even for non-convex $f$ or non-convex constraints. Example: the ball problem with $Q=\mathrm{diag}(3,-2,1)$ (defined in 2.5 below: $\min\frac12x^\top Qx$ s.t. $\|x\|^2\le1$) is non-convex, yet $t(\lambda)=-\lambda$ is a straight line (concave). What convexity buys is a zero gap (Stop 4), not concavity. See M6 §A.
$\min\frac12x^\top Qx$ s.t. $\|x\|^2\le1$ (so $g=1-\|x\|^2\ge0$), $Q=\mathrm{diag}(3,-2,1)$. The domain of $t(\lambda)$ is
- (a) $\lambda\ge0$
- (b) $\lambda\ge1$
- (c) $\lambda\gt 1$
- (d) $\lambda\ge2$
Explanation
(b). $\mathcal L=\frac12x^\top Qx-\lambda(1-\|x\|^2)=\frac12x^\top(Q+2\lambda I)x-\lambda$. Rule 2 with no linear term: finite iff $Q+2\lambda I\succeq0$, eigenvalues $3+2\lambda,\ 2\lambda-2,\ 1+2\lambda$, so $\lambda\ge1$. (c) is the classic trap: at $\lambda=1$ the matrix $\mathrm{diag}(5,0,3)$ is only PSD, but with no linear term the minimum is $0$ at $x=0$, so $t(1)=-1$ is finite; the domain is closed. (a): at $\lambda=0$, $\mathcal L=\frac12x^\top Qx\to-\infty$ along $e_2$. (d) is too strict. This is 2021 final P2 Q4; $t(\lambda)=-\lambda$ on this domain. M6 §C.
$\min x^2-y^2+2(x+y)$ s.t. $h=x^2+y^2-1=0$, with $\mathcal L=f+\mu h$. The domain of $t(\mu)$ is
- (a) $\mu\ge1$
- (b) $\mu\gt 1$
- (c) $\mu\ge-1$
- (d) all real $\mu$
Explanation
(b). $\mathcal L=(1+\mu)x^2+2x+(\mu-1)y^2+2y-\mu$: two separate 1-D quadratics. Each is bounded below only if its $x^2$ (resp. $y^2$) coefficient is $\gt 0$ (if the coefficient is 0 a leftover linear term $2x$ or $2y$ still gives $-\infty$). So $1+\mu\gt 0$ and $\mu-1\gt 0$: $\mu\gt 1$, open. (a) includes $\mu=1$, where the $y$-part is just $2y$: $-\infty$. (c) $\mu=0$ gives $-y^2$: $-\infty$. (d) is false. Then $x=-\frac1{1+\mu}$, $y=-\frac1{\mu-1}$, $t(\mu)=-\frac1{1+\mu}-\frac1{\mu-1}-\mu$, max at $\mu^*=\sqrt{2+\sqrt5}\approx2.058$, $d^*\approx-3.330$ (2020 final P2 Q2; M6 §C).
3. Weak duality and the gap estimate
In plain words: Every price vector gives a lower bound on the best possible cost: any feasible $x$ pays at least what the relaxed (free) minimum pays. The dual problem looks for the best lower bound. A feasible $x$ gives an upper bound. Sandwich the unknown optimum between the two.
Words and symbols on this stop: $p^*$ = optimal primal value $\min f$ over feasible $x$; $d^*=\max t(\lambda,\mu)$ over dual feasible points; $\bar x$ = any feasible point (a guess); gap = $p^*-d^*\ge0$; duality gap estimate = $f(\bar x)-t(\lambda,\mu)$.
Precisely: Weak duality: for every feasible $x$ and every dual feasible $(\lambda,\mu)$: $t(\lambda,\mu)\le\mathcal L(x,\lambda,\mu)=f(x)-\sum\lambda_ig_i(x)\le f(x)$. Hence $d^*\le p^*$ and $f(\bar x)-p^*\le f(\bar x)-t(\lambda,\mu)$. No convexity needed.
Weak duality says $d^*\le p^*$: the best dual value never exceeds the optimal primal value.
Explanation
True. That is its statement: every dual value is a lower bound on $f$ over the feasible set, so the largest of them, $d^*$, is still a lower bound on the smallest $f$, namely $p^*$. M6 §B.
For $\min x^2+y^2$ s.t. $x+y\ge1$ you know $t(\tfrac12)=0.375$ and that $\bar x=(1,0)$ is feasible. The best certified bound on $f(\bar x)-p^*$ (without knowing $p^*$) is
- (a) $\le0.375$
- (b) $\le0.625$
- (c) $\le1.375$
- (d) $\le0.5$
Explanation
(b). $f(\bar x)=1$, $t=0.375$: $f(\bar x)-p^*\le f(\bar x)-t=0.625$. (a) is $t$ itself, not a gap. (c) adds instead of subtracts. (d) is the actual error ($1-0.5$), true but you cannot certify it without already knowing $p^*$; the question asks what the data give.
A dual feasible point has dual value $-1$, and a primal feasible $\bar x$ has $f(\bar x)=0.5$. Then $f(\bar x)-f(x^*)\le1.5$.
Explanation
True. Weak duality: $-1\le f(x^*)$, so $f(\bar x)-f(x^*)\le0.5-(-1)=1.5$. Note that nothing is claimed about convexity. M6 practice T1.
Weak duality remains valid even if some inequality multiplier is allowed to be negative, say $\lambda=-2$, as long as $t(\lambda)$ is finite.
Explanation
False. The step $-\lambda_ig_i(x)\le0$ needs $\lambda_i\ge0$. Counterexample: $\min x^2$ s.t. $1-x\ge0$ (so $p^*=0$ at $x=0$). With $\lambda=-2$: $\mathcal L=x^2+2(1-x)=x^2-2x+2$, minimum $1$ at $x=1$. So $t(-2)=1\gt p^*=0$: not a lower bound. That is why dual feasible includes $\lambda\ge0$.
A (not necessarily convex) problem has a feasible $\bar x$ with $f(\bar x)=3$ and a dual feasible point with $t=2$. Mark all statements that must hold.
- (a) $2\le p^*\le3$
- (b) $d^*\ge2$
- (c) $f(\bar x)-p^*\le1$
- (d) $d^*=p^*$
Explanation
(a), (b), (c). $t=2$ is a lower bound: $p^*\ge2$; $\bar x$ is feasible: $p^*\le3$ (a). $d^*=\max t\ge2$ (b). The gap estimate gives $f(\bar x)-p^*\le3-2=1$ (c). (d) is not forced: $d^*=2$, $p^*=3$ is consistent with everything given; zero gap needs strong duality (Stop 4), which needs more (convexity + Slater, or LP).
4. Strong duality, Slater, complementary slackness, recovering $x$
In plain words: Usually the best lower bound is exactly the optimum: no gap. Then the two problems say the same thing, the optimal prices only charge for rules that are actually tight, and the minimiser of the priced problem points to the optimal $x$.
Words and symbols on this stop: strong duality = $d^*=p^*$; Slater's condition = some $x$ satisfies every non-linear inequality strictly ($g_i(x)\gt 0$); complementary slackness = $\lambda_i^*g_i(x^*)=0$ for each $i$ (a price is positive only on a tight rule); $x^*$, $(\lambda^*,\mu^*)$ = optimal primal and dual points; convex problem: convex $f$, concave $g_i$, linear $h_j$; KKT conditions: stationarity, feasibility, $\lambda\ge0$, $\lambda_ig_i=0$ (Ch 5).
Precisely: Strong duality holds for: LPs whenever one side has a finite optimum; convex problems with Slater's condition; and also some non-convex ones (a quadratic on a ball or sphere): prove it by exhibiting a feasible $x$ with $f(x)=d^*$. If it holds then $\lambda_i^*g_i(x^*)=0$, and $x^*$ minimises $\mathcal L(\cdot,\lambda^*,\mu^*)$ (the KKT conditions). To recover $x$: minimise $\mathcal L$ at the optimal prices, then keep the minimiser that is feasible and obeys complementary slackness.
Strong duality means $d^*=p^*$: the best dual value equals the optimal primal value (zero gap).
Explanation
True. That is the definition; weak duality only gives $d^*\le p^*$. M6 §B.
For $\min x^2+y^2$ s.t. $x+y\ge1$ the dual optimum is $\lambda^*=1$ (from $t=\lambda-\lambda^2/2$). Minimising $\mathcal L(\cdot,1)$ recovers $x^*=$
- (a) $(\frac12,\frac12)$
- (b) $(1,0)$
- (c) $(1,1)$
- (d) $(0,0)$
Explanation
(a). $\mathcal L(x,y,1)=x^2+y^2-(x+y-1)$ has gradient $(2x-1,2y-1)=0$: $(\frac12,\frac12)$, feasible with $g=0$ (tight, consistent with $\lambda^*=1\gt 0$), $f=\frac12=d^*$. (b) is feasible but is not the minimiser of $\mathcal L$. (c) is feasible but not minimal. (d) minimises $\mathcal L$ at $\lambda=0$ (wrong price) and is infeasible.
If strong duality holds and the rule $g_i\ge0$ is not tight at $x^*$ ($g_i(x^*)\gt 0$), then $\lambda_i^*=0$.
Explanation
True. Complementary slackness: $\lambda_i^*g_i(x^*)=0$. With $g_i(x^*)\gt 0$ the factor $\lambda_i^*$ must vanish: you do not pay for room you do not use. Derivation: $f(x^*)=t^*\le\mathcal L(x^*,\lambda^*)=f(x^*)-\sum\lambda_i^*g_i(x^*)\le f(x^*)$ forces every $\lambda_i^*g_i(x^*)=0$ (each term $\ge0$). M6 §B.
If strong duality holds then the primal and the dual problems are both feasible.
Explanation
True (his key). Equal finite optimal values mean a feasible $x^*$ and a dual feasible point achieving them. (If both sides were infeasible one could say “$\infty=\infty$”, but he reads strong duality as equal finite values.) M6 practice T3.
Ball problem, $Q=\mathrm{diag}(3,-2,1)$: the dual optimum is $\lambda^*=1$, $d^*=-1$. Minimising $\mathcal L(x,1)=\frac12x^\top\mathrm{diag}(5,0,3)x-1$, what is the correct way to get the primal solution?
- (a) $x^*=0$, the only minimiser of $\mathcal L$
- (b) every $(0,s,0)$, $s\in\mathbb R$, minimises $\mathcal L$, so all of them are primal optimal
- (c) the minimisers are $(0,s,0)$; only $s=\pm1$ is feasible and keeps complementary slackness, so $x^*=(0,\pm1,0)$
- (d) $x^*$ cannot be recovered from the dual
Explanation
(c). $\mathcal L(x,1)=\frac52x_1^2+\frac32x_3^2-1$: minimisers are all $(0,s,0)$ (the zero eigenvalue leaves $x_2$ free). The minimiser set of $\mathcal L$ is not automatically feasible or optimal: we need feasibility $\|x\|^2\le1$ and, since $\lambda^*=1\gt 0$, tightness $\|x\|^2=1$: $s=\pm1$, and $f=\frac12(-2)=-1=d^*$. (a) $x=0$ is a minimiser but has $f=0\ne d^*$ and breaks complementary slackness. (b) $s=5$ is infeasible. (d) false. This is 2021 final P2 Q4 (zero gap although non-convex).
Mark all correct statements.
- (a) An LP with a finite optimal value has $d^*=p^*$ without any Slater condition.
- (b) If strong duality holds with optimal $x^*$ and $(\lambda^*,\mu^*)$, then $x^*$ minimises $\mathcal L(\cdot,\lambda^*,\mu^*)$ over all $x$.
- (c) Slater's condition is necessary for $d^*=p^*$.
- (d) For $\min x$ s.t. $-x^2\ge0$ (only $x=0$ is feasible; convex, no strictly feasible point) $d^*=p^*=0$, but no price $\lambda$ attains $d^*$.
Explanation
(a), (b), (d). (a) LP duality theorem (Stop 6). (b) $f(x^*)=t^*\le\mathcal L(x^*,\lambda^*,\mu^*)\le f(x^*)$, so $\mathcal L$ at $x^*$ equals its minimum $t^*$. (c) is false: Slater is sufficient, not necessary (every LP, and the ball problem above, have zero gap without it). (d) is true: $\mathcal L=x+\lambda x^2$, $t(\lambda)=-\frac1{4\lambda}$ for $\lambda\gt 0$, so $d^*=\sup t=0=p^*$ but $t(\lambda)\lt 0$ for every $\lambda$: the sup is not attained (it shows what failing Slater can break). M6 §B.
5. LP canonical form and conversions
In plain words: A linear program (LP) minimises a straight-line cost over a region cut out by straight-line rules. To compare LPs and run simplex we first rewrite every rule as an equation with only non-negative unknowns: add a variable that measures the unused room (slack) or the excess (surplus).
Words and symbols on this stop: $c\in\mathbb R^d$ = costs; $x\in\mathbb R^d$ = unknowns; $A$ = the $m\times d$ rule matrix (rank $m$: the $m$ rows are independent); $b\in\mathbb R^m$ = right-hand sides; canonical form (his name, others say standard form) = $\min c^\top x$ s.t. $Ax=b$, $x\ge0$; slack $s\ge0$ added to a $\le$ rule; surplus $s\ge0$ subtracted from a $\ge$ rule.
Precisely: Canonical form: $\min c^\top x$ s.t. $Ax=b$, $x\ge0$. Conversions: $a^\top x\le\beta\to a^\top x+s=\beta$; $a^\top x\ge\beta\to a^\top x-s=\beta$ ($s\ge0$); free $x_j=u_j-v_j$, $u_j,v_j\ge0$; $\max c^\top x=-\min(-c^\top x)$ (same optimal $x$, value negated).
In his canonical form every rule is an equation $Ax=b$ and every unknown is non-negative, $x\ge0$.
Explanation
True. $\min c^\top x$ s.t. $Ax=b$, $x\ge0$ with $A$ of size $m\times d$ and rank $m$. Every LP can be rewritten like this (picture above). M6 §D.
$\min x_1+x_2$ s.t. $x_1+2x_2\le4$, $x_2\le1$, $x\ge0$. Mark all true statements about its canonical form.
- (a) it has $d=4$ unknowns $(x_1,x_2,s_1,s_2)$
- (b) it has $m=2$ equations
- (c) $A=\begin{pmatrix}1&2&1&0\\0&1&0&1\end{pmatrix}$ has rank 2
- (d) a free-variable split is needed
Explanation
(a), (b), (c). Two $\le$ rules need two slacks: unknowns $x_1,x_2,s_1,s_2$; equations $x_1+2x_2+s_1=4$, $x_2+s_2=1$; the last two columns form $I_2$, so rank 2. (d) is false: $x\ge0$ is already given, nothing is free. $c=(1,1,0,0)$, $b=(4,1)$ (2020 final P2 Q3(a); M6 practice P1).
Writing a free variable as $x=u-v$ with $u,v\ge0$ gives a unique pair $(u,v)$ for each value of $x$.
Explanation
False. $x=1$ is $(u,v)=(1,0)$, also $(2,1)$, also $(5,4)$: add the same amount to both. The split is a valid representation, not a unique one (the simplex method never keeps both $u_j,v_j$ basic and positive, so no harm is done). Also remember that $x_j$ itself is gone, only $u_j-v_j$ matters.
$\max2x_1-x_2$ s.t. $x_1+x_2\ge3$, $x_1-x_2\le1$, $x_1\ge0$, $x_2$ free. In the canonical form of the equivalent min problem the number of unknowns and equations are
- (a) 3 unknowns, 2 equations
- (b) 4 unknowns, 2 equations
- (c) 5 unknowns, 2 equations
- (d) 5 unknowns, 4 equations
Explanation
(c). Objective $\to\min-2x_1+x_2$. Unknowns: $x_1$; $u,v$ for $x_2=u-v$ (2 more); a surplus for the $\ge$ rule; a slack for the $\le$ rule: $1+2+1+1=5$. Equations: one per rule, 2: $x_1+u-v-s_1=3$, $x_1-u+v+s_2=1$. (a) forgot the slacks, (b) forgot the free split, (d) counts $x_1\ge0$ as extra equations (non-negativity stays as $x\ge0$, not an equation).
6. LP dual pairs, the correspondence table, the duality theorem
In plain words: Pricing the rules of an LP gives another LP, the dual. Instead of choosing amounts $x$ it chooses prices $\mu$ (one per rule) to make the lower bound as large as possible. For LPs the best lower bound meets the optimum whenever the optimum is finite.
Words and symbols on this stop: $\mu$ (or $y$) = the dual variables, one per primal rule; $A^\top$ = the transpose of $A$ (rows and columns swapped); unbounded = cost can be pushed to $-\infty$ for a min ($+\infty$ for a max); infeasible = no point obeys all the rules; optimal below always means a finite optimal value.
Precisely: $\min c^\top x$ s.t. $Ax=b$, $x\ge0$ $\ \leftrightarrow\ $ $\max b^\top\mu$ s.t. $A^\top\mu\le c$ ($\mu$ free). $\min c^\top x$ s.t. $Ax\ge b$, $x\ge0$ $\leftrightarrow$ $\max b^\top y$ s.t. $A^\top y\le c$, $y\ge0$. Table (min ↔ max): equality ↔ free variable; $\ge$ rule ↔ variable $\ge0$; variable $\ge0$ ↔ $\le$ rule; free variable ↔ equality. Duality theorem: if either problem has a finite optimum so does the other, with equal values; primal unbounded ⇒ dual infeasible and vice versa; both may be infeasible.
The dual of $\min c^\top x$ s.t. $Ax=b$, $x\ge0$ has one free variable (sign unrestricted) for each equality $Ax=b$.
Explanation
True. Table row 1: equality ↔ free variable. The dual is $\max b^\top\mu$ s.t. $A^\top\mu\le c$, with $\mu\in\mathbb R^m$ free. Reason: an equality can be violated either way, so its price can have either sign (Stop 1). M6 §D.
The dual of $\min c^\top x$ s.t. $Ax=b$, $x\ge0$ ($A$ is $m\times d$) is
- (a) $\max b^\top\mu$ s.t. $A^\top\mu\le c$
- (b) $\max b^\top\mu$ s.t. $A\mu\le c$
- (c) $\min b^\top\mu$ s.t. $A^\top\mu\ge c$
- (d) $\max b^\top\mu$ s.t. $A^\top\mu=c$, $\mu\ge0$
Explanation
(a). take $h=b-Ax$, so that $+\mu^\top h=-\mu^\top(Ax-b)$. $\mathcal L=c^\top x-\mu^\top(Ax-b)-\lambda^\top x=(c-A^\top\mu-\lambda)^\top x+b^\top\mu$ with $\lambda\ge0$; finite iff $c-A^\top\mu=\lambda\ge0$. (b) does not even typecheck ($A$ is $m\times d$, $\mu\in\mathbb R^m$): you need $A^\top$ (the 2025 key's $A$ for $A^\top$ is the same slip). (c) turns the problem into a min with the wrong inequality. (d) is the dual of $\min c^\top x$ s.t. $Ax\ge b$ with $x$ free: a different problem.
If the dual LP is infeasible, then the primal LP is unbounded.
Explanation
False. Both can be infeasible. Example: $\min-x_1-x_2$ s.t. $x_1-x_2=1$, $-x_1+x_2=1$, $x\ge0$ is infeasible (add the two equations: $0=2$). Its dual $\max\mu_1+\mu_2$ s.t. $\mu_1-\mu_2\le-1$, $\mu_2-\mu_1\le-1$ is infeasible (add: $0\le-2$). The true statement: primal unbounded ⇒ dual infeasible; and “dual infeasible ⇒ primal unbounded” holds only if the primal is feasible. M6 §D.
Linear programming problems always have a global minimum.
Explanation
False. An LP can be infeasible (no points) or unbounded ($\min -x$ s.t. $x\ge0$). It has a minimum exactly when the optimal value is finite. 2025 Q5 below is an unbounded LP. M6 practice T4.
Mark all (primal status, dual status) combinations that can occur for a pair of dual LPs.
- (a) primal has a finite optimum, dual is unbounded
- (b) primal is unbounded, dual is infeasible
- (c) both are infeasible
- (d) primal is infeasible, dual is unbounded
Explanation
(b), (c), (d). (a) is impossible: a finite primal optimum forces a finite dual optimum with equal value (duality theorem). (b) and (d) are the two directions of “unbounded ⇒ other side infeasible” (weak duality: an unbounded side leaves no room for a bound). (c) was shown by the example in the previous trap question. These three cells plus “both optimal” are exactly the ✓ cells of the picture.
7. Basic feasible solutions, corners, and the Fundamental Theorem of LP
In plain words: An LP’s feasible region is a polygon (in higher dimensions a polytope) with flat sides and sharp corners. The best point of a straight-line cost is always at a corner. Algebraically a corner is a basic feasible solution: pick $m$ independent columns of $A$, set all other unknowns to $0$, solve for those $m$.
Words and symbols on this stop: $B$ = the $m\times m$ matrix of the chosen columns (the basis), $N$ = the other columns; $x_B=B^{-1}b$ (basic unknowns), $x_N=0$; basic solution = $(x_B,0)$; BFS = basic solution with $x_B\ge0$; degenerate = some basic unknown equals $0$; extreme point = a feasible point that is not the midpoint of two other feasible points.
Precisely: BFS ⇔ extreme point. At most $\binom dm$ basic solutions. Fundamental Theorem of LP: (i) if a feasible point exists, a BFS exists; (ii) if an optimal point exists, an optimal BFS exists.
A basic feasible solution of $\{Ax=b,\ x\ge0\}$ is a corner (extreme point) of the feasible set.
Explanation
True. BFS and extreme point are the same thing in two languages: algebraic (basis columns, $x_N=0$) and geometric (a point that is not strictly between two other feasible points). M6 §E.
For $A=\begin{pmatrix}1&1&1&0\\0&1&0&1\end{pmatrix}$, $b=(4,3)$, unknowns $(x_1,x_2,s_1,s_2)$: mark all bases that give a BFS.
- (a) $\{x_1,s_2\}$
- (b) $\{x_1,s_1\}$
- (c) $\{x_2,s_1\}$
- (d) $\{x_2,s_2\}$
Explanation
(a), (c). $\{x_1,s_2\}$: columns $(1,0),(0,1)$: $x_1=4,s_2=3$, BFS $(4,0,0,3)$. $\{x_2,s_1\}$: $x_2=3$, $s_1=4-3=1$: BFS $(0,3,1,0)$. (b) is not even a basis: both columns are $(1,0)$, dependent. (d): $x_2=4$ from row 1, then $s_2=3-4=-1\lt 0$: a basic solution $(0,4,0,-1)$ but not feasible. The whole list: 6 column pairs, 5 are bases, 4 give BFS. M6 §E.
If an LP has an optimal solution, it has an optimal basic feasible solution.
Explanation
True. Fundamental Theorem of LP (ii). It is why simplex only needs to walk along corners. (It does not say every optimal point is a BFS: an optimal edge has interior points that are not corners.)
Every basic solution is feasible.
Explanation
False. A basic solution only needs $x_B=B^{-1}b$; feasibility also needs $x_B\ge0$. Counterexample in the picture: basis $\{x_2,s_2\}$ gives $(0,4,0,-1)$. M6 §E.
For $x_1+x_2-x_3-3x_4+6x_5=2$, $x_2+x_3+5x_4+6x_5=2$, the point $x_1=x_3=x_4=0$, $x_2=8$, $x_5=-1$ is
- (a) a basic solution
- (b) a basic feasible solution
- (c) not a basic solution
- (d) feasible
Explanation
(c). It does satisfy both equations ($8-6=2$ each), but its non-zero entries sit in columns $x_2:(1,1)$ and $x_5:(6,6)$, which are parallel (dependent), so no basis produces it: not basic. Hence (a), (b) are false. It is also infeasible since $x_5=-1\lt 0$, so (d) is false. (His key not printed; this is my working, same as M6/MT3 unit 06.)
An LP has optimal solutions at $A=(1,0,0,2)$ and $B=(0,1,0,3)$. It also has an optimal solution at
- (a) $(3,0,0,3)$
- (b) $(\frac12,\frac12,0,\frac52)$
- (c) $(1,2,0,3)$
- (d) none of these
Explanation
(b). The optimal set of an LP is convex: it is the intersection of the feasible set with a cost level set. So the midpoint $\frac12A+\frac12B=(\frac12,\frac12,0,\frac52)$ is optimal. (a) and (c) are not on the segment $AB$ (they need not even be feasible). (d) is wrong because (b) works. M6 §E, MT3 unit 06.
8. The simplex method: reduced costs, ratio test, termination, the dual from the basis
In plain words: Start at a corner. Ask each neighbouring direction: does the cost go down if I increase this non-basic unknown? If none does, stop: you are optimal. If one does, move along that edge until another unknown would turn negative (the first one to hit 0 leaves), arriving at the next corner. Repeat.
Words and symbols on this stop: $r_j=c_j-c_B^\top B^{-1}a_j$ = reduced cost of the non-basic unknown $j$ (cost change per unit increase of $x_j$); $\hat b=B^{-1}b$; $\hat a_l=B^{-1}a_l$ (column $l$ written in the basis); entering unknown $l$ (a non-basic that will become basic), leaving unknown (a basic that becomes 0); $\alpha$ = how far we move; ratio test = the rule that picks the leaving unknown; $\mu^\top=c_B^\top B^{-1}$ = the dual vector read off the basis.
Precisely: Optimality: all $r_j\ge0$ ⇒ the BFS is optimal. Pivot: entering $l$ with $r_l\lt 0$; $x_B=\hat b-\alpha\hat a_l$; $\bar\alpha=\min\{\hat b_i/\hat a_{il}:\hat a_{il}\gt 0\}$ attained at row $k$ (that basic unknown leaves). If no $\hat a_{il}\gt 0$ the LP is unbounded. If $\bar\alpha=0$ the pivot is degenerate (cost unchanged; the basis changes only). Without degeneracy the cost strictly drops, no BFS repeats, and there are finitely many, so the method terminates. At the end $\mu^\top=c_B^\top B^{-1}$ is dual optimal.
The simplex method moves from one basic feasible solution to a neighbouring one, never increasing the cost.
Explanation
True. Each pivot swaps one basic unknown for one non-basic one (neighbouring corner), and the cost changes by $\bar\alpha\,r_l\le0$. M6 §F.
The reduced cost of a non-basic unknown $j$ is
- (a) $c_j-c_B^\top B^{-1}a_j$
- (b) $c_B^\top B^{-1}a_j-c_j$
- (c) $c_j-c_N^\top B^{-1}a_j$
- (d) $c_j-a_j^\top B^{-1}c_B$
Explanation
(a). Substituting $x_B=\hat b-B^{-1}Nx_N$ into $c^\top x$ gives $c_B^\top\hat b+\sum_{j\in N}(c_j-c_B^\top B^{-1}a_j)x_j$: the coefficient of $x_j$ is $r_j$. (b) has the opposite sign, which would reverse the optimality test. (c) uses non-basic costs $c_N$, which have nothing to do with the basic variables that must compensate. (d) writes $a_j^\top B^{-1}c_B$, which is not equal to $c_B^\top B^{-1}a_j$ in general ($B^{-1}$ is not symmetric; the transpose would be $a_j^\top B^{-\top}c_B$).
For $\min-x_1-2x_2$ s.t. $x_1+x_2\le4$, $x_2\le3$, $x\ge0$, starting at the slack basis (origin): the reduced costs of $x_1,x_2$ are $-1,-2$, so $x_2$ enters; the ratio test ($4/1$ and $3/1$) makes $s_2$ leave, and the cost drops from $0$ to $-6$.
Explanation
True. At $B=I$ (slack columns) $\mu=c_B^\top B^{-1}=0$, so $r_j=c_j$: $(-1,-2)$; pick the most negative, $x_2$. $\hat b=(4,3)$, $\hat a_2=(1,1)$: ratios $4$ and $3$, minimum $3$ in row 2, the row of $s_2$. New point $(0,3,1,0)$, cost $\alpha r_2=3\cdot(-2)=-6$. M6 §F, hand run.
The entering column in the current basis is $\hat a_l=(2,0,-1)$ and the current basic values are $\hat b=(6,4,5)$. The leaving row (ratio test) is
- (a) row 1
- (b) row 2
- (c) row 3
- (d) none: the LP is unbounded
Explanation
(a). Only rows with $\hat a_{il}>0$ count: row 1 only, ratio $6/2=3$. Row 2 has a zero entry (it never reaches 0 as $\alpha$ grows: no limit). Row 3 has a negative entry (that basic value grows, no limit); the quotient $5/(-1)=-5$ is a tempting “smallest ratio” but meaningless. (d) would need no positive entry at all, i.e. $\hat a_l\le0$. Unbounded needs every entry of $B^{-1}a_l\le0$.
The BFS recovered from the simplex algorithm may not be a KKT point.
Explanation
False. At termination all $r_j\ge0$. With $\mu^\top=c_B^\top B^{-1}$ and $\lambda=c-A^\top\mu$ (which is $0$ on basic unknowns and $r_N\ge0$ on non-basic) we get $\lambda\ge0$, $\lambda^\top x=0$ (complementary slackness) and $c=A^\top\mu+\lambda$: the KKT conditions. So the BFS returned is a KKT point. M6 practice T5.
At a BFS with basis $B$ at which all reduced costs are $\ge0$ (simplex has stopped), mark all correct statements.
- (a) $\mu^\top=c_B^\top B^{-1}$ satisfies $A^\top\mu\le c$ (dual feasible)
- (b) $b^\top\mu=c^\top x$ for this BFS $x$, so strong duality holds
- (c) the vector $c_B^\top B^{-1}$ is dual feasible at every BFS, not only optimal ones
- (d) the dual solution is $\mu=B^{-1}c_B$ (written exactly like that)
Explanation
(a), (b). $A^\top\mu\le c$ is the statement $c_j-\mu^\top a_j\ge0$ for all $j$: zero on basic columns, $=r_j\ge0$ on the rest. And $b^\top\mu=c_B^\top B^{-1}b=c_B^\top x_B=c^\top x$. (c) false: at the slack basis of the running example $\mu=0$ but $A^\top\mu=0\not\le c=(-1,-2,0,0)$; dual feasibility is exactly optimality. (d) false: $\mu^\top=c_B^\top B^{-1}$, i.e. $\mu=B^{-\top}c_B$. In the running example at the optimum $B^{-1}c_B=(1,-2)$ violates $A^\top\mu\le c$, while the right $\mu=(-1,-1)$ gives $b^\top\mu=-7$. (MT3 2025 Q5 writes $\mu=B^{-1}c_B$: slip.) M6 §F traps.
The rigorous version
- Lagrangian and dual function. For $\min f(x)$ s.t. $g_i(x)\ge0$, $h_j(x)=0$: $\mathcal L(x,\lambda,\mu)=f(x)-\sum_i\lambda_ig_i(x)+\sum_j\mu_jh_j(x)$, $t(\lambda,\mu)=\min_{x\in\mathbb R^d}\mathcal L(x,\lambda,\mu)$ (may be $-\infty$); domain $=\{t\gt -\infty\}$; dual: $\max t(\lambda,\mu)$ s.t. $\lambda\ge0$, $(\lambda,\mu)\in$ domain. $t$ is concave.
- Rule 1 / Rule 2. $\min_x a^\top x+\gamma=\gamma$ if $a=0$, $-\infty$ otherwise. $\min_x\frac12x^\top Mx+v^\top x=-\frac12v^\top M^{-1}v$ for $M\succ0$; $-\infty$ if $M$ has a negative eigenvalue; for singular $M\succeq0$ finite iff $v\in\mathrm{range}(M)$.
- Weak duality. $x$ feasible, $\lambda\ge0$: $t(\lambda,\mu)\le\mathcal L(x,\lambda,\mu)\le f(x)$. So $d^*\le p^*$ and $f(\bar x)-p^*\le f(\bar x)-t(\lambda,\mu)$.
- Strong duality. Holds for LPs with a finite optimum; for convex problems satisfying Slater (some $x$ with $g_i(x)\gt 0$ for all non-linear $g_i$); for some non-convex quadratics on a ball/sphere. Then $\lambda_i^*g_i(x^*)=0$ and $x^*\in\arg\min_x\mathcal L(x,\lambda^*,\mu^*)$.
- Canonical form. $\min c^\top x$ s.t. $Ax=b$, $x\ge0$, $A\in\mathbb R^{m\times d}$, rank $m$. Dual: $\max b^\top\mu$ s.t. $A^\top\mu\le c$ ($\mu$ free). For $Ax\ge b$, $x\ge0$: $\max b^\top y$ s.t. $A^\top y\le c$, $y\ge0$.
- Duality theorem of LP. (i) A finite optimum on one side ⇒ finite optimum on the other, equal values. (ii) Primal unbounded ⇒ dual infeasible; dual unbounded ⇒ primal infeasible. (iii) Both may be infeasible.
- BFS and FTLP. $B$ = $m$ independent columns, $x_B=B^{-1}b$, $x_N=0$; BFS iff $x_B\ge0$; BFS = extreme point; at most $\binom dm$. (i) Feasible ⇒ a BFS exists. (ii) Optimal exists ⇒ an optimal BFS exists.
- Simplex. $r_j=c_j-c_B^\top B^{-1}a_j$; all $r_j\ge0$ ⇒ optimal. Entering $l$ with $r_l\lt 0$; direction $u=(-B^{-1}a_l,\ e_l)$ in $(x_B,x_N)$; $\bar\alpha=\min\{\hat b_i/\hat a_{il}:\hat a_{il}\gt 0\}$; no positive entry ⇒ unbounded; $\bar\alpha=0$ degenerate; finite termination without degeneracy. Dual solution $\mu^\top=c_B^\top B^{-1}$ ($\mu=B^{-\top}c_B$), dual feasible iff all $r_j\ge0$; $b^\top\mu=c^\top x$.
Depth: M6 §A–F; MT3 units 05 (duality) and 06 (LP); the exam recipe is M6 §G.
Final mixed round (exam level)
$\min x_1-x_2$ s.t. $2x_1+5x_2\ge10$, $x_1+x_2\ge1$, $x\ge0$. The dual is $\max b^\top y$ s.t. $A^\top y\le c$, $y\ge0$, i.e. $2y_1+y_2\le1$, $5y_1+y_2\le-1$. Then
- (a) the dual is infeasible, hence the primal is unbounded
- (b) the dual is infeasible, hence the primal is infeasible
- (c) the dual is unbounded, so the primal has optimal value $0$
- (d) the primal is bounded with optimum at $(0,2)$
Explanation
(a). $5y_1+y_2\le-1$ is impossible for $y\ge0$: dual infeasible. The primal is feasible ($(0,2)$), and feasible + dual infeasible ⇒ unbounded: $x=(0,s)$, $s\ge2$ has value $-s\to-\infty$. (b) would need the primal to be infeasible; it is not. (c) the dual is empty, not unbounded. (d) $(0,2)$ is feasible with value $-2$, but larger $s$ is better. His key writes the dual rows with $A$ instead of $A^\top$ ($2y_1+5y_2\le1$, $y_1+y_2\le-1$): same conclusion. M6 §D.
$\min-2x_1+6x_2$ s.t. $x_1\ge x_2$, $-x_1+3x_2\ge5$, $x\ge0$ has
- (a) a unique solution
- (b) an unbounded solution
- (c) a non-unique solution
Explanation
(c). $-x_1+3x_2\ge5$ gives $-2x_1+6x_2=2(-x_1+3x_2)\ge10$, with equality along the whole ray $x_1=3x_2-5$, $x_2\ge\frac52$ (where $x_1\ge x_2$ holds): e.g. $(2.5,2.5)$, $(4,3)$, $(7,4)$ all give $10$. So the minimum is finite, $=10$, attained on a ray: not unique, not unbounded. (My working; no printed key.)
$\max5x_1+2x_2$ s.t. $x_1+x_2\le3$, $2x_1+3x_2\ge5$, $x\ge0$. An optimal primal–dual pair is
- (a) $x=(3,1)$, $y=(4,1)$
- (b) $x=(4,1)$, $y=(1,0)$
- (c) $x=(3,0)$, $y=(5,0)$
- (d) none of these
Explanation
(c). $x=(3,0)$ is feasible with value $15$. The dual $\min3y_1-5y_2$ s.t. $y_1-2y_2\ge5$, $y_1-3y_2\ge2$, $y\ge0$ has $y=(5,0)$ feasible with value $15$: equal values, so both optimal (weak duality: no feasible pair can beat it). (a) $x=(3,1)$ has $x_1+x_2=4\gt 3$: infeasible; (b) $(4,1)$ likewise. (d) is wrong because (c) works. (My working.)
The optimal value of the dual of $\max2x_1+x_2+3x_3$ s.t. $x_1-x_2+x_3\ge5$, $x\ge0$ is
- (a) $-1$
- (b) $-3$
- (c) none of the above
- (d) $-5$
Explanation
(c). The primal is unbounded ($x_1\to\infty$ keeps the rule satisfied and raises the objective), so the dual is infeasible: it has no optimal value, in particular none of $-1,-3,-5$. Check: the dual rules read $y\ge2$, $-y\ge1$, $y\ge3$ with $y\le0$, impossible. (My working.)
$x^*$ is a KKT point of $\min c^\top x$ s.t. $Ax=b$, $x\ge0$ and is a BFS with basis $B$. A dual feasible point is
- (a) $\mu=B^{-1}c_B$
- (b) $\mu^\top=c_B^\top B^{-1}$, i.e. $\mu=B^{-\top}c_B$
- (c) $\mu=B\,c_B$
- (d) $\mu=c_N$
Explanation
(b). KKT gives $c=A^\top\mu+\lambda$, $\lambda\ge0$, $\lambda_B=0$ (complementary slackness on the positive basic unknowns): $c_B=B^\top\mu$, so $\mu=B^{-\top}c_B$, and $c_N-N^\top\mu=\lambda_N\ge0$ gives dual feasibility; then $b^\top\mu=c^\top x^*$ (strong duality). His key writes $\mu^\top=B^{-1}c_B$, a transposition slip: the correct row vector is $c_B^\top B^{-1}$. (a) is exactly the slip in his MT3 2025 key: $B^{-1}c_B\ne B^{-\top}c_B$ in general; (c), (d) are the wrong objects. M6 §F.
$\min x_1+x_2$ s.t. $x_1+2x_2\le4$, $x_2\le1$, $x\ge0$. Take the BFS with basis $\{x_1,x_2\}$, i.e. $(2,1,0,0)$. One simplex pivot:
- (a) $s_1$ enters, $x_1$ leaves
- (b) $s_2$ enters, $x_2$ leaves
- (c) $s_1$ enters, $x_2$ leaves
- (d) it is already optimal
Explanation
(a). $B=\begin{pmatrix}1&2\\0&1\end{pmatrix}$, $B^{-1}=\begin{pmatrix}1&-2\\0&1\end{pmatrix}$, $\mu^\top=c_B^\top B^{-1}=(1,-1)$. Reduced costs: $r_{s_1}=0-1=-1\lt 0$, $r_{s_2}=0-(-1)=1\ge0$. So $s_1$ enters (and (d) is false). $\hat a=B^{-1}e_1=(1,0)$, $\hat b=(2,1)$: only row 1 qualifies, ratio $2$: the basic unknown of row 1, $x_1$, leaves; new BFS $(0,1,2,0)$ cost $1$. (b) $s_2$ has $r\ge0$, it would raise the cost. (c) row 2 has $\hat a_{21}=0$, no limit. M6 practice P1.
$\min c^\top x$ s.t. $a^\top x\le3$, $x\in\mathbb R^d$, with $c=a+v$, $v\ne0$, $v^\top a=0$. Then
- (a) the LP is unbounded, e.g. along $x=-sv$, $s\to\infty$
- (b) the optimal value is $-3$
- (c) the dual $\max_{\lambda\ge0}-3\lambda$ s.t. $c=-\lambda a$ has optimum $0$
- (d) the optimum is at $x=\frac3{\|a\|^2}a$
Explanation
(a). $x=-sv$ is feasible ($a^\top x=0\le3$) and $c^\top x=-s\|v\|^2\to-\infty$. The dual needs $c=-\lambda a$, but $c=a+v$ is not a multiple of $a$ ($v\ne0$, $v\perp a$), so the dual is infeasible, consistent with an unbounded primal. (b) and (d) are the case $c=-a$ (value $-3$ at $x=\frac3{\|a\|^2}a$). (c) a $\max$ over the empty set is not 0. M6 §D.
The dual of a quadratic programming problem is another quadratic program.
Explanation
True (his key). Rule 2 turns a quadratic Lagrangian into a concave quadratic in the multipliers, e.g. MT3 2026 Q6: $t(\mu)=b^\top\mu-\frac12\|h+A^\top\mu\|^2$; with a singular Hessian an extra linear equality appears, still a QP. M6 practice T2.