Quiz Day: Chapter 7 + Chapter 8

Two quizzes in one hour. Quiz IV = Ch 7 (convexity and duality). Quiz V = Ch 8 (linear programming and simplex).

20 MCQs each+1 right · −¼ wrong · 0 blankQ1–10: sentences from the notes, slightly bentQ11–20: notes examples, new numbers

Purple: the idea in plain words Blue: the exact statement Red: the lies he will put in the options Green: the example (expect new numbers) Gold: what he said in class

⬇ Download the printable PDF (A4, answer key at the back)

Printed version. Order: Ch 7 story → Mock Quiz IV → Ch 8 story → Mock Quiz V → last-10-minutes sheet → answer key with explanations (last pages). Interactive version: courses.rahuldevsharma.com/lno-quiz/

The game plan

How he builds a quiz (and how you beat it)

Your Quiz III paper and his official key show one rule: nothing comes from outside the notes. He takes a true sentence and writes three near-miss versions of it. Every wrong option is one of four tricks:

TrickExample of a bent sentence
Drop a condition"the Hessian test works on any convex set" (it needs an open one)
Swap one word"\(\{h\ge 0\}\) is convex when \(h\) is convex" (it needs concave)
Claim too much"unique", "strict", "attained", "for every basis"
Reverse an arrow"P infeasible \(\Rightarrow\) D unbounded"
Marking mathsIf you can rule out two options, guess between the other two: on average you gain \(\tfrac12 - \tfrac18 > 0\). If you can rule out nothing, leave it blank.
Scene 1 · Why this chapter exists

Convexity: when a local answer is the whole answer

In Chapter 6 a KKT point could be a maximum, a saddle point or a local minimum. You never knew which. Chapter 7 is about the problems where that worry goes away.

Plain wordsA convex set has no dents: the straight line between any two of its points stays inside. A convex function curves upward like a bowl. Minimise a bowl over a dent-free set and you can't get stuck in a small dip that isn't the real bottom.
Exact (notes 7.1) Convex set: \(x,y\in\Omega \Rightarrow tx+(1-t)y\in\Omega\) for all \(t\in[0,1]\).
Convex optimisation problem: minimise a convex function over a convex set.
The five notes examples and why each one is convex
ProblemWhy it's convex
LP: \(\min c^\top x,\ Ax\le b\)linear objective; the feasible set is an intersection of half-spaces
QP: \(\tfrac12x^\top Qx+c^\top x,\ Ax=b,\ x\ge0\)\(Q\succeq 0\) (positive semidefinite is enough)
Least squares \(\tfrac12\|Ax-b\|^2\)Hessian \(A^\top A\succeq0\), always, for any \(A\)
Negative entropy \(\sum x_i\log x_i\), \(\mathbf1^\top x=1,\ x\ge0\)\(\phi''(t)=1/t>0\); setting \(0\log 0:=0\) keeps it convex on \([0,\infty)\)
\(\min\|x\|_2\), \(Ax=b\)every norm is convex; the constraint is an affine equality
Lies he could write
  • "Least squares is convex only if \(A\) has full column rank" ✗ Full rank gives strict convexity (one minimiser). Plain convexity always holds.
  • "The QP needs \(Q\succ0\)" ✗ \(Q\succeq0\) is enough.
  • "Maximising entropy is a concave optimisation problem" ✗ He bans that phrase: it is minimising the convex negative entropy.
  • "\(\min\|x\|\) s.t. \(\|x\|=1\) is convex" ✗ A curved equality constraint is not affine. The unit circle has dents.
Prof"Use only the course's theorem forms." Never write "concave optimisation problem".
Scene 2 · Testing convexity

Two tests, and the small print that decides which one you may use

Here is a function with a saddle-shaped Hessian that is still perfectly convex. Exam setters love it.

Theorem 7.1.1 · first-order (tangent-line) test \(\Omega\) convex, \(f\) differentiable on an open set containing \(\Omega\). Then \[f \text{ convex on }\Omega \iff f(y)\ge f(x)+(y-x)^\top\nabla f(x)\quad\forall x,y\in\Omega.\] Picture: every tangent line (or plane) stays under the graph.
Theorem 7.1.2 · second-order (Hessian) test \(\Omega\) open and convex, \(f\in C^2(\Omega)\). Then \(f\) convex on \(\Omega \iff \nabla^2 f(x)\succeq0\) for every \(x\in\Omega\).
Remark 7.1.1 · the trap example \(f(x_1,x_2)=x_1^2-x_2^2\) on the line \(\Omega=\{(x_1,0)\}\). On that line \(f=x_1^2\), which is convex. But the full Hessian is \(\mathrm{diag}(2,-2)\), which is indefinite.
The Hessian test doesn't apply here because a line is not open. The first-order test still works. On thin sets, check curvature only along directions that stay inside the set.
along x₁ (inside Ω): x₁² — a bowl ✓ along x₂ (leaves Ω): −x₂² — ignore f = x₁² − x₂², Ω = the x₁-axis
Green: the only direction that counts on Ω. Red: a direction that leaves Ω, so its negative curvature doesn't matter.
Lies
  • "7.1.2 holds on every convex set" ✗ It needs open.
  • "\(f\) convex on the line \(\Rightarrow \nabla^2 f\succeq0\)" ✗ The example above shows it fails.
  • "7.1.1 needs \(\Omega\) open" ✗ Only \(f\) needs to be differentiable on an open set around \(\Omega\).
  • "\(\nabla^2f\succ0\) is needed" ✗ That is the test for strict convexity.
Scene 3 · Building feasible sets

Which constraints keep the feasible set dent-free?

Memory hook: "≤ goes with convex, ≥ goes with concave, = only with affine."

Theorem 7.2.1 (\(\Omega\) convex, \(h:\Omega\to\mathbb R\)) (a) \(h\) affine \(\Rightarrow \{h=0\}\) convex.
(b) \(h\) convex \(\Rightarrow \{h\le0\}\) convex.
(c) \(h\) concave \(\Rightarrow \{h\ge0\}\) convex.
Any intersection of such sets is convex (Cor. 7.2.2).
Why (b) in one lineIf \(h(x)\le0\) and \(h(y)\le0\), convexity gives \(h(tx+(1-t)y)\le t h(x)+(1-t)h(y)\le 0\). The average of two non-positive numbers is non-positive.
x² ≤ 1 : one piece ✓ x² ≥ 1 : two pieces ✗ Same convex h = x² − 1, opposite inequality ≤ keeps it convex; ≥ with a convex h breaks it
Green: the allowed pairing (convex h with ≤). Red: the forbidden one (convex h with ≥).
Remark 7.2.1 · "affine" vs "convex"On all of \(\mathbb R^n\), the zero set of an affine \(h\) is an affine set (a whole line or plane). Inside a box it is only convex: \(\Omega=[0,1]^2\), \(h=x_1\) gives the segment \(\{0\}\times[0,1]\). A segment is convex but not affine.
Lies
  • "\(\{h\ge0\}\) convex for \(h\) convex" ✗ \(x^2\ge1\) has two pieces.
  • "\(\{h=0\}\) convex for \(h\) convex" ✗ \(x_1^2+x_2^2=1\) is a circle.
  • "These conditions are necessary" ✗ \(\{x^3\le0\}\) is convex even though \(x^3\) isn't.
  • "\(\{h=0\}\cap\Omega\) is always affine" ✗ Inside a box you get a segment.
Prof"≥ with concave … very important."
Scene 4 · The superpower

Local = global, with a six-line proof

Say you sit at a local minimum but some far point \(y\) is lower. Walk a tiny step toward \(y\): by convexity you go downhill straight away. Then you weren't at a local minimum. That's the whole proof.

Theorem 7.2.3 · proof in 6 steps (a favourite for guided-proof questions) 1. Suppose \(f(y) 2. \(z_\alpha=\alpha y+(1-\alpha)x^\star\in\Omega\) (convex set).
3. \(f(z_\alpha)\le \alpha f(y)+(1-\alpha)f(x^\star)\) (convex function).
4. So \(f(z_\alpha) 5. For small \(\alpha\), \(z_\alpha\) is as close to \(x^\star\) as you like. That contradicts \(x^\star\) being a local minimum.
6. So \(x^\star\) is global. No derivatives were used.
Theorem 7.2.4 · the "no uphill-free direction" test \(f\) differentiable on an open set \(\supseteq\Omega\) and convex on \(\Omega\). Then \(x^\star\) is a global minimiser \(\iff (y-x^\star)^\top\nabla f(x^\star)\ge0\ \ \forall y\in\Omega\).
No constraint qualification needed. This is the geometric condition, not KKT.
Cor 7.2.5: all such points have the same value. Cor 7.2.6: the set of minimisers is convex.
Lies
  • "7.2.3 needs \(f\) differentiable" ✗
  • "7.2.4 needs LICQ or Slater" ✗ Those are needed for KKT multipliers to exist, not for this test.
  • "A convex problem has a unique minimiser" ✗ It can have a whole segment of them. Uniqueness needs strict convexity.
  • "Exactly two minimisers" ✗ Impossible: the minimisers form a convex set, so two means infinitely many.
  • "Step 5 holds for every \(\alpha\)" ✗ It needs small \(\alpha\).
Scene 5 · KKT gets promoted

In a convex program, KKT is enough

Chapter 6: KKT only gave candidates. Chapter 7: if the problem is convex, any KKT point is a global minimum. No second-order check needed.

Setting (7.2.7–7.2.8)\(\min f\) s.t. \(h(x)=0,\ g(x)\le0\); \(f,g_j\) differentiable and convex on \(\mathbb R^n\), \(h\) affine. \(L=f+\lambda^\top h+\mu^\top g\).
Theorem 7.2.8 · every feasible KKT point is a GLOBAL minimiser Take any feasible \(y\) and let \(d=y-x^\star\).
S1 \(f(y)\ge f(x^\star)+d^\top\nabla f(x^\star)\) (convex f)
S2 substitute \(\nabla f=-J_h\lambda^\star-\sum_{j\,\text{active}}\mu_j^\star\nabla g_j\) (stationarity; inactive \(\mu_j=0\))
S3 \(h\) affine, \(Ad=0\Rightarrow d^\top J_h=0\) (this step needs \(h\) affine)
S4 \(0\ge g_j(y)\ge g_j(x^\star)+d^\top\nabla g_j=d^\top\nabla g_j\), multiplied by \(\mu_j^\star\ge0\) (active, so \(g_j(x^\star)=0\))
S5 so \(f(y)\ge f(x^\star)\).
Theorem 7.2.7 · bonus fact about the HessianAt a KKT point of such a program (\(C^2\)): \(\nabla^2_{xx}L\succeq0\) on all of \(\mathbb R^n\), not just on the critical cone. Reason: \(\nabla^2 h_i=0\) (affine), \(\nabla^2 f,\nabla^2 g_j\succeq0\), \(\mu^\star\ge0\). The sign of \(\lambda^\star\) never matters.
Remark 7.2.2 · the two-way summary Convex program: KKT is sufficient. Necessity needs a CQ (e.g. Slater).
Non-convex program: a CQ makes KKT necessary, but KKT alone is not sufficient.
Jacobian convention (stated in the notes)\(J_h=[\nabla h_1\ \cdots\ \nabla h_m]\), with gradients as columns. For \(h=Ax+b\): \(J_h=A^\top\), and the stationarity term is \(J_h\lambda=A^\top\lambda\), not \(J_h^\top\lambda\).
Lies
  • "7.2.8 needs LICQ or Slater" ✗ No CQ is needed for sufficiency.
  • "…gives a strict or unique minimiser" ✗ It gives a global one, not necessarily unique.
  • "\(h\) convex is enough" ✗ S3 needs \(h\) affine.
  • "\(\nabla^2L\succeq0\) only on the critical cone" ✗ It holds everywhere. And "\(\succ0\) so SOSC always holds" ✗ (an LP has \(\nabla^2L=0\)).
  • "For a convex program every minimiser is a KKT point" ✗ See the next scene.
Scene 6 · The villain

A convex problem whose optimum has no KKT multiplier

Both functions are strictly convex, the answer is obvious, and KKT still fails. This example shows up in at least three questions.

Example 7.2.1 · \(\min (x-1)^2\) s.t. \(x^2\le 0\) The only feasible point is \(x=0\), so \(x^\star=0\) and \(p^\star=1\).
Stationarity at 0: \(2(0-1)+\mu\cdot 2\cdot 0=-2\neq0\) for every \(\mu\). No multiplier exists.
Why? Slater fails: no point has \(x^2<0\). Lesson from the notes: "strict convexity cannot replace a constraint qualification".
Example 7.4.1 · its dual \(q(\mu)=\inf_x\,(x-1)^2+\mu x^2\). Set the derivative to zero: \(x=\frac1{1+\mu}\), which gives \(q(\mu)=\frac{\mu}{1+\mu}\).
As \(\mu\to\infty\), \(q\to1\), but \(q(\mu)<1\) for every finite \(\mu\). So \(d^\star=p^\star=1\) (zero gap), yet the dual sup is never attained.
μ → 0 1 p* = d* = 1 (never touched) q(μ) = μ/(1+μ)
Blue: the dual function, always rising. Red dashed: its limit 1. Zero gap, but no μ reaches it, so there is no dual optimum and no KKT multiplier.
How it comes back with new numbers\(\min(x-a)^2,\ x^2\le0\): \(p^\star=a^2\), inner minimiser \(\frac{a}{1+\mu}\), \(q(\mu)=\frac{a^2\mu}{1+\mu}\). Same story: zero gap, not attained, no KKT, no Slater.
Scene 7 · The dual function

Price the constraints and let \(x\) roam free

Instead of forcing \(x\) to obey the constraints, charge a price for breaking them. Then let \(x\) go anywhere in \(\mathbb R^n\) and find the cheapest total.

Definitions (7.3) \(L(x,y)=f+u^\top h+v^\top g\), with \(y=(u,v)\). In the dual, \(u\) is free and \(v\ge0\).
\(q(y)=\inf_{x\in\mathbb R^n}L(x,y)\): the infimum is over the whole space, not the feasible set.
\(\mathbb D=\{y:q(y)>-\infty\}\). \(q\) can't be \(+\infty\) (all functions are finite).
Dual problem: maximise \(q\) over \(y\in\mathbb D,\ v\ge0\).
Properties\(q\) is concave and \(\mathbb D\) is convex. Why: for fixed \(x\), \(L\) is affine in \(y\), and an infimum of affine functions is concave.
Remark 7.3.1: this holds even when the primal is non-convex.
Prof's shortcut"The infimum is finite iff the coefficients of \(x\) vanish." (for terms linear in \(x\)). That is how every LP dual gets its constraints.
Lies
  • "\(q\) is concave because \(f,g\) are convex" ✗ The reason is that \(L\) is affine in \(y\).
  • "the inf is over the feasible set" ✗
  • "\(u\ge0\)" ✗ Equality multipliers are free.
  • "\(q\) is differentiable" ✗ The notes never claim this.
  • "\(\mathbb D\) is all of \(\mathbb R^{m+p}\)" ✗ For an LP, \(q=-\infty\) unless \(A^\top\lambda+\mu=c\).
Scene 8 · Weak duality

The dual always gives a floor

Two short steps, no convexity needed: every dual value sits below every primal value.

ProofTake a feasible \(\bar x\) and \(\bar v\ge0\): \[q(\bar y)\le L(\bar x,\bar y)=f(\bar x)+\bar u^\top\underbrace{h(\bar x)}_{=0}+\underbrace{\bar v^\top g(\bar x)}_{\le0}\le f(\bar x).\] The first \(\le\) is the definition of the inf. The second uses only feasibility and \(\bar v\ge0\). So \(d^\star\le p^\star\). No convexity.
Values\(p^\star=\inf\{f(x):x \text{ feasible}\}\), \(d^\star=\sup\{q(y):v\ge0\}\). These are inf and sup, not min and max.
Strong duality means \(p^\star=d^\star\). It is a different thing from attainment (Scene 6).
Prof"Minimum is defined only when it's attained."
Lies
  • "weak duality needs convexity" ✗
  • "step 2 uses complementary slackness" ✗ It uses only feasibility and \(v\ge0\).
  • "strong duality follows from the definition of the dual" ✗
  • "\(p^\star=d^\star\Rightarrow\) both attained" ✗ See the villain.
Scene 9 · The central theorem

When does a KKT pair exist? (7.4.1) And how do you get \(x^\star\) back? (7.4.2)

Theorem 7.4.1 (\(f,g_j\) differentiable convex, \(h\) affine) A KKT pair exists \(\iff\) \(p^\star=d^\star\in\mathbb R\) and both optimal values are attained.
Moreover, any primal optimum paired with any dual optimum is a KKT pair.
Proof idea (⇒) \(L(\cdot,y^\star)\) is convex and stationary at \(x^\star\), so \(x^\star\) minimises it: \(q(y^\star)=L(x^\star,y^\star)=f(x^\star)\). That squeezes \(q(y^\star)\le d^\star\le p^\star\le f(x^\star)\) into equalities.
(⇐) \(q(y^\star)\le L(x^\star,y^\star)\le f(x^\star)\) with equal ends. The first equality gives \(\nabla_xL=0\). The second gives \(\sum v_j^\star g_j=0\), and since every term is \(\le0\), each one is 0 (complementary slackness).
Remark 7.4.1Needs no strict convexity, no extra CQ, no uniqueness. In (⇐), zero gap and attainment are assumptions. They don't follow from convexity.
Corollary 7.4.2 · getting \(x^\star\) back from the dual If a KKT pair exists, \(\bar y\) is any dual optimum, and \(L(\cdot,\bar y)\) has a unique minimiser \(\bar x\), then \(\bar x\) is the primal optimum. No feasibility or complementary-slackness checks are needed.
A sufficient condition for uniqueness: \(f\) strictly convex. The constraints don't need to be strictly convex.
If the minimiser isn't unique: pick a minimiser \(\tilde x\) that is feasible and satisfies \(\bar v_jg_j(\tilde x)=0\).
Lies
  • "KKT pair \(\iff p^\star=d^\star\)" ✗ Attainment is missing.
  • "7.4.1 needs Slater" ✗
  • "Any minimiser of \(L(\cdot,y^\star)\) is optimal" ✗ Only when it is unique.
  • "Uniqueness needs every \(g_j\) strictly convex" ✗ Strictly convex \(f\) is enough.
Scene 10 · Slater

One strictly-inside point buys you strong duality

Theorem 7.4.3 (stated without proof)\(f,g_j\) convex, \(h\) affine, and one single point \(x^0\) with \(h(x^0)=0\) and \(g_j(x^0)<0\) for every \(j\). If \(p^\star\) is finite, then \(p^\star=d^\star\) and the dual optimum is attained.
Primal attainment is NOT guaranteed.
Consequence: with Slater, a primal optimum that exists, and differentiability, a feasible point is optimal iff it has KKT multipliers.
Prof"One point … for all inequality constraints … not independent point."
Example 7.4.2 · \(\min x\) s.t. \(-x\le0\) Slater point: \(x=1\). \(L=(1-\mu)x\), so \(q(1)=0\) and \(q(\mu)=-\infty\) otherwise. \(\mu^\star=1\).
\(L(\cdot,1)\equiv0\): every \(x\) minimises it. \(x=-1\) is infeasible; \(x=1\) is feasible but fails complementary slackness; only \(x=0\) is optimal.
This doesn't contradict 7.4.2: the minimiser isn't unique, so 7.4.2 doesn't apply.
Lies
  • "Slater ⇒ a primal optimum exists" ✗
  • "a separate Slater point for each \(g_j\)" ✗ It must be one point for all of them.
  • "Slater is necessary for zero gap" ✗ The villain has zero gap without Slater.
  • "Slater makes any Lagrangian minimiser optimal" ✗ Example 7.4.2 shows otherwise.
Scene 11 · LP through the Ch 7 lens

Linear programs: KKT with no LICQ, and a dual with a twist

Standard form and tangent cone\(\min c^\top x,\ Ax=b,\ x\ge0\). Writing it this way does not guarantee a feasible or bounded problem (\(\min -x\) on \(x\ge0\) is unbounded).
At a feasible \(x^\star\), with \(I_0=\{i:x_i^\star=0\}\): \(\ \mathcal T(x^\star)=\{d: Ad=0,\ d_i\ge0 \text{ for } i\in I_0\}\).
LP KKT (necessary by Farkas, NO rank or LICQ needed) \[A^\top\lambda^\star+\mu^\star=c,\quad Ax^\star=b,\quad x^\star\ge0,\quad \mu^\star\ge0,\quad (\mu^\star)^\top x^\star=0,\quad \lambda^\star\text{ free.}\] Sufficiency in one line: \(c^\top\bar x=b^\top\lambda^\star+\bar x^\top\mu^\star\ge b^\top\lambda^\star=c^\top x^\star\).
LP dual\(L=(c-A^\top\lambda-\mu)^\top x+b^\top\lambda\). The inf over \(x\) is finite only if the coefficient of \(x\) vanishes: \[\text{(D)}\quad \max\ b^\top\lambda\ \ \text{s.t.}\ \ A^\top\lambda\le c,\quad \lambda \text{ free}.\] Weak duality: \(c^\top x-b^\top\lambda=\mu^\top x\ge0\).
Theorem 7.6.1 + Remark 7.6.1(i) If one has an optimal solution, so does the other, with equal values.
(ii) If one is unbounded, the other is infeasible.
Do NOT reverse (ii). Both can be infeasible, and an infeasible primal can have an unbounded dual.
P \ DD optimalD unboundedD infeasible
P optimal✓ equal values✗✗
P unbounded✗✗✓
P infeasible✗✓✓ possible!
Prof"\(d\) infeasible doesn't imply \(p\) unbounded." "Many students make that mistake."
Lies
  • "LP KKT needs \(A\) of full row rank" ✗
  • "\(\lambda^\star\ge0\)" ✗ It is free.
  • "the dual constraint is \(A^\top\lambda\ge c\)" ✗ It is \(\le\).
  • "\(\mathcal T\) requires \(d_i\ge0\) for all \(i\)" ✗ Only where \(x_i^\star=0\).
  • "P infeasible ⇒ D unbounded" ✗

Mock Quiz IV · Chapter 7

20 questions, 30 minutes, the real marking. Click an option to lock it in. The explanation shows every wrong option's flaw. "Leave blank" scores 0.

The big picture

Linear programming in one breath

If an LP has an optimum, one of its corners is optimal. The simplex method walks from corner to corner, always downhill, until no edge goes down any more.

What he said about Ch 8 questions (lec 2, 1:07)"I'm not going to ask entire simplex algorithm, but concepts involved in each step. What is the meaning of … why you call it unbounded? … what is the feasible direction … You don't have to memorize the simplex algorithm entirely."
So Quiz V testsThe meaning of each step, plus small calculations that use a single step: convert to standard form, list the basic solutions, compute a reduced cost, do a ratio test, read a tableau, decide optimal / unbounded / infeasible.
x₁x₂ start z=0 pivot 1: z=−7.5 pivot 2: z=−9 ★ optimal z=−8
Worked example from the slides: \(\min -3x_1-2x_2\). Blue: \(x_1+x_2=4\) (\(s_1=0\)). Red: \(2x_1+x_2=5\) (\(s_2=0\)). Green: feasible set. Orange arrows: the simplex path along the edges. Dots: corners (BFSs).
Card 1 · Standard form

Every LP can wear the same uniform

Standard form (8.1)\(\min c^\top x\) s.t. \(Ax=b,\ x\ge0\), \(A\in\mathbb R^{m\times n}\).
You haveDo this
\(Ax\le b\)add a slack: \(Ax+y=b,\ y\ge0\) → \([A\ \ I]\)
\(Ax\ge b\)subtract a surplus: \(Ax-y=b,\ y\ge0\) → \([A\ \ -I]\)
\(x_j\) free\(x_j=x_j^+-x_j^-\), both \(\ge0\) (the split isn't unique)
\(x_j\ge\ell_j\)shift: \(x_j=\ell_j+v_j,\ v_j\ge0\). This adds a constant to the cost.
upper bound \(x_j\le u_j\)an extra \(\le\) row with a slack
\(\max c^\top x\)\(\min -c^\top x\); the optimal values differ by a sign
\(b_i<0\)multiply the row by \(-1\). An inequality flips.
Worked: \(x_1-x_2\le -2\)Right-hand side negative → multiply by −1 and flip: \(-x_1+x_2\ge2\) → subtract a surplus: \(-x_1+x_2-y=2\).
Lies
  • "surplus: add \(+y\)" ✗ Subtract it.
  • "slack variables change the feasible \(x\)" ✗
  • "a free variable can't be put in standard form" ✗ Split it.
  • "standard form is unique" ✗
  • "\(b_i<0\): multiply by −1 and keep \(\le\)" ✗ It becomes \(\ge\).
Card 2 · Basic solutions

Pick \(m\) columns, zero the rest, solve

Plain wordsYou have \(m\) equations and \(n>m\) unknowns. Choose \(m\) "lucky" variables (the basis), set all the others to 0, and solve the square system. The result is a basic solution. If it also has no negative entries, it is a BFS: a corner of the feasible set.
Definitions (rank \(A=m\)) Basic solution: choose \(B\) = \(m\) independent columns; \(x_N=0\), \(x_B=B^{-1}b\). It can have negative entries.
BFS: basic and \(x\ge0\), i.e. \(B^{-1}b\ge0\).
Degenerate: at least one basic variable equals 0.
There are at most \(\binom{n}{m}\) bases.
Prof"Basic and non-basic is not the property of the problem; it's the property of the current state of your algorithm." "Basic variables may be zero … that's one thing you have to remember."
Worked: \(A=\begin{pmatrix}1&0&1\\0&1&1\end{pmatrix}\), \(b=(2,1)\) \(\{1,2\}\): \((2,1,0)\) feasible
\(\{1,3\}\): \(x_3=1,\ x_1=1\) → \((1,0,1)\) feasible
\(\{2,3\}\): \(x_3=2,\ x_2=-1\) → infeasible. So there are 2 BFSs.

Now take \(b=(1,1)\): \(\{1,3\}\) and \(\{2,3\}\) both give \((0,0,1)\). That point is a degenerate BFS (a basic variable is 0) and has two bases.
Lies
  • "basic variables are positive" ✗ They can be 0, or negative if the solution is infeasible.
  • "degenerate = a nonbasic variable is 0" ✗ Nonbasic variables are always 0.
  • "each \(A\) has a unique basis" ✗
Cards 3–4 · Why only corners matter

Two theorems that justify the whole method

Theorem 8.2.1 (rank \(A=m\))(i) If a feasible solution exists, a BFS exists.
(ii) If an optimal solution exists, an optimal BFS exists.
Proof idea: shrink the supportTake a feasible \(\bar x\) with support \(S=\{i:\bar x_i>0\}\). If those columns are dependent, there is \(y\ne0\) on \(S\) with \(Ay=0\). Slide \(\bar x-\varepsilon y\) until one more component hits 0 (\(\varepsilon^\star=\min_{y_i>0}\bar x_i/y_i\)). Repeat until the columns are independent. For (ii), optimality forces \(c^\top y=0\), so the cost never changes while you slide.
Theorem 8.2.2\(x\) is an extreme point (not strictly between two other feasible points) \(\iff\) \(x\) is a BFS. This holds for degenerate BFSs too.
Lies
  • "every optimal solution is a BFS" ✗ Only some optimum is. If two corners are optimal, the points between them are optimal but not basic.
  • "feasible ⇒ an optimal BFS exists" ✗ The LP could be unbounded.
  • "at most \(m\) positive entries ⇒ BFS" ✗ The slides say this "alone is insufficient"; the columns must be independent.
  • "only non-degenerate BFSs are extreme" ✗ and "each extreme point has exactly one basis" ✗
Card 5 · Simplex is just KKT

Four conditions hold by construction. Only one needs checking.

LP KKT (prof: "worth memorizing")\[A^\top\lambda+\mu=c,\quad Ax=b,\quad x\ge0,\quad \mu\ge0,\quad \mu^\top x=0\quad(\lambda\text{ free})\]
Candidate from a basis \(A=[B\ N]\)Impose \(x_N=0\), \(\mu_B=0\) (complementary slackness for free). Then: \[x_B=B^{-1}b,\qquad \lambda=B^{-\top}c_B,\qquad \mu_N=c_N-N^\top\lambda\ \ \text{(reduced costs)}.\] BFS ⇒ \(B^{-1}b\ge0\). The only thing left to check is \(\mu_N\ge0\). If it holds, the BFS is optimal, even if it is degenerate.
Why the sign test proves optimalityFor any feasible \(x'\): \(c^\top x'-c^\top\bar x=\mu_N^\top x'_N\ge0\) (both factors are \(\ge0\)). Also \(c^\top\bar x=b^\top\lambda\): the primal and dual values are equal.
Prof"All four of them you are taking care by construction. Only fifth will be remaining each step. If the fifth fails, you change."
Lies
  • "optimal needs \(\mu_N>0\)" ✗ \(\ge0\) is enough. A zero entry hints at alternative optima.
  • "\(\lambda\ge0\) is required" ✗ It is free.
  • "\(\lambda=B^{-1}c_B\)" ✗ It is \(B^{-\top}c_B\), i.e. solve \(B^\top\lambda=c_B\).
  • "the test only works at non-degenerate BFSs" ✗
Cards 6–7 · Walking an edge

The reduced cost is the slope; the ratio test is the brake

Push one nonbasic variable \(x_q\) up from 0. The basic variables have to adjust to keep \(Ax=b\). How fast does the cost change, and how far can you go before something hits 0?

The edgeLet \(u=B^{-1}a_q\). Then \(x_B(t)=\bar x_B-u\,t\) and \(x_q=t\). The cost changes as \[c^\top x(t)=c^\top\bar x+\mu_q\,t.\] \(\mu_q<0\): downhill (a feasible descent direction at a non-degenerate BFS). \(\mu_q=0\): flat (alternative optima may exist).
Minimum-ratio testStay feasible: \(\bar x_B-ut\ge0\). Rows with \(u_i\le0\) never block you. \[\theta=\min_{i:\,u_i>0}\frac{(\bar x_B)_i}{u_i}.\] The basic variable in the row that attains the minimum leaves; \(x_q\) enters with value \(\theta\). The cost changes by \(\mu_q\theta\).
UnboundedIf \(\mu_q<0\) and \(u\le0\): nothing ever blocks the walk, and the cost goes to \(-\infty\). One such column is enough to prove the LP is unbounded.
Worked: \(\min x_1+x_2-2x_3\), \(x_1+x_3=2,\ x_2+x_3=3\) Basis \((x_1,x_2)\): \(B=I\), \(\bar x=(2,3,0)\), cost 5, \(\lambda=c_B=(1,1)\).
\(\mu_3=-2-(1\cdot1+1\cdot1)=\mathbf{-4}\). (If you forget that \(x_1,x_2\) also move, you'd wrongly say −2.)
\(u=(1,1)\), ratios \(2/1,\ 3/1\) → \(\theta=2\), \(x_1\) leaves. New point \((0,1,2)\), cost \(5+(-4)(2)=-3\).
New basis \((x_3,x_2)\): \(\lambda=(-3,1)\), \(\mu_1=1-(-3)=4\ge0\) → optimal.
Prof"When you bring in new non-basic … whatever was non-zero has to adjust. Remember that."
Lies
  • "increasing \(x_q\) leaves \(x_B\) unchanged" ✗ and "the direction is \(d=e_q\)" ✗
  • "take ratios over all rows" ✗ Only rows with \(u_i>0\). And "the maximum ratio" ✗ It is the minimum.
  • "unbounded if \(u\ge0\)" ✗ It is \(u\le0\).
  • "\(\theta>0\) always" ✗ At a degenerate BFS, \(\theta\) can be 0.
Card 8 · His favourite question

What each step of the simplex means

StepWhat you doWhat it means
0 Startfind \(B\) with \(B^{-1}b\ge0\) (Phase I if needed)stand on a corner
1 Price\(B^\top\lambda=c_B\), \(\mu_j=c_j-a_j^\top\lambda\)KKT holds except possibly \(\mu_N\ge0\). If all \(\mu_j\ge0\): optimal, with \(\lambda\) as the certificate.
2 Enterpick \(q\) with \(\mu_q<0\); solve \(Bu=a_q\)the edge along \(x_q\) goes downhill. If \(u\le0\): unbounded ray.
3 Ratio\(\theta=\min_{u_i>0}\bar x_i/u_i\)walk until the first basic variable hits 0
4 Pivotswap the leaving column for \(a_q\)move to the neighbouring corner (or stay put if \(\theta=0\))
Exactly two ways to stop\(\mu_N\ge0\) → optimal BFS. \(\mu_q<0\) with \(u\le0\) → unbounded below.
Card 9 · Degeneracy

When a step has length zero

Ties create degeneracy\(\min -x_3\), \(x_1+x_3=1,\ x_2+x_3=1\). Basis \((x_1,x_2)\), \(\bar x=(1,1,0)\). \(x_3\) enters: \(u=(1,1)\), ratios \(\{1,1\}\), a tie! New point \((0,0,1)\). One of \(x_1,x_2\) leaves; the other stays basic at value 0. Under Bland's rule, \(x_1\) leaves (smaller index).
Negative reduced cost at an optimum\(\min x_1\), \(x_1+x_2=0\), \(x\ge0\). The only feasible point is \((0,0)\), so it is optimal. Basis \((x_1)\): \(\lambda=1\), \(\mu_2=0-1=-1<0\), \(u=1\), \(\theta=0\).
Lesson: at a degenerate BFS, \(\mu_q<0\) doesn't guarantee progress, and an optimal BFS can show a negative reduced cost for some basis.
Termination and Bland's ruleIf every BFS is non-degenerate, each pivot strictly lowers the cost, so no basis repeats, and there are finitely many bases ⇒ the method finishes.
Degeneracy (\(\theta=0\)) can make bases cycle.
Bland's rule: enter the variable with the smallest original index among \(\mu_j<0\). Break ratio-test ties by the smallest original index. This prevents cycling.
Lies
  • "Bland: enter the most negative reduced cost" ✗ That is Dantzig's rule.
  • "Bland prevents degeneracy" ✗ It prevents cycling.
  • "at an optimal BFS every reduced cost is ≥ 0 for every basis" ✗ See the example above.
Card 10 · Finding a first corner

Phase I: a helper problem that can never be unbounded

Case I: slack basisFrom \(A_0x\le b\) with \(b\ge0\), the slacks give \(B=I\), \(x=0\), \(y=b\). That is feasible straight away (degenerate if some \(b_i=0\), which is fine).
Case II: Phase I\(\min w=\mathbf 1^\top y\) s.t. \(Ax+y=b,\ x,y\ge0\) (with \(b\ge0\)). Start at \(x=0,\ y=b\). Since \(w\ge0\), it is never unbounded.
\(w^{(1)}>0\) ⇒ the original LP is infeasible. \(w^{(1)}=0\) ⇒ feasible.
Before Phase II: end Phase I at an optimal BFS, pivot out any artificial variables still basic at 0, drop the artificial columns, restore \(c\), and recompute \(\lambda,\mu_N\).
Why "basic" matters\(\min y\) s.t. \(x_1+x_2+y=1\): the point \((\tfrac12,\tfrac12,0)\) is optimal (\(w=0\)) but not basic. Phase I has to end at a BFS.
Worked: \(x_1+x_2=1,\ 2x_1+2x_2+x_3=1\)Directly: \(x_3=1-2(x_1+x_2)=1-2=-1<0\) → infeasible. Phase I gives \(w^{(1)}=\tfrac12>0\).
Lies
  • "Phase I can be unbounded" ✗
  • "\(w^{(1)}>0\) means unbounded" ✗ It means infeasible.
  • "\(w^{(1)}=0\) ⇒ every Phase I optimum is an original BFS" ✗
  • "reuse the Phase I cost row in Phase II" ✗
Card 11 · The tableau

Reading every number in the table

Canonical tableau \[\begin{array}{c|cc|c} & x_B & x_N & \text{RHS}\\\hline \text{rows} & I & B^{-1}N & B^{-1}b=\bar x_B\\\hline \text{cost} & 0 & r_N^\top & -z_0\end{array}\] \(r_N=\mu_N\) (reduced costs), \(z_0=c_B^\top B^{-1}b\). The bottom-right entry is \(-z_0\). The column of \(x_q\) inside \(B^{-1}N\) is \(u\).
Worked tableau \[\begin{array}{c|cc|cc|c} & x_3 & x_4 & x_1 & x_2 & \text{RHS}\\\hline x_3 & 1&0&2&1&6\\ x_4&0&1&1&3&9\\\hline \text{cost}&0&0&-1&-2&4\end{array}\] The current value is \(z_0=-4\) (not 4!). Bland → \(x_1\) enters (smallest index with \(r<0\), even though −2 is more negative). \(u=(2,1)\), ratios \(3,\ 9\) → \(x_3\) leaves, \(\theta=3\). New value \(-4+(-1)(3)=-7\).
Lies
  • "the bottom-right entry is \(z_0\)" ✗ It is \(-z_0\).
  • "the RHS column holds the reduced costs" ✗ It holds the basic values.
Card 12 · The finale

The worked example and its dual certificate

\(\min -3x_1-2x_2\), \(x_1+x_2+s_1=4\), \(2x_1+x_2+s_2=5\) Start: basis \((s_1,s_2)\), \(x=(0,0,4,5)\), \(z=0\). Reduced costs \(-3,-2\).
Pivot 1 (Bland: \(x_1\)): \(u=(1,2)\), ratios \(4,\ \tfrac52\) → \(\theta=\tfrac52\), \(s_2\) leaves, \(z=-7.5\).
Pivot 2: \(x_2\) has \(r=-\tfrac12\); \(u=(\tfrac12,\tfrac12)\), ratios \(3,5\) → \(\theta=3\), \(s_1\) leaves, \(z=-9\).
Final reduced costs \((1,1)\ge0\) → optimal \(x^\star=(1,3,0,0)\), \(z^\star=-9\).
Certificate: \(\lambda=(-1,-1)\), \(\mu=c-A^\top\lambda=(0,0,1,1)\ge0\), \(b^\top\lambda=-9\). So every feasible point has \(c^\top x=-9+s_1+s_2\ge-9\).
How to check a certificate in a quiz1) Solve \(B^\top\lambda=c_B\) using the basic columns. 2) Compute \(\mu=c-A^\top\lambda\) and check it is \(\ge0\). 3) Check \(b^\top\lambda=c^\top x^\star\). All three must pass.

Mock Quiz V · Chapter 8

Standard form throughout: \(\min c^\top x,\ Ax=b,\ x\ge0\), rank \(A=m\), \(\mu_j=c_j-a_j^\top\lambda\) with \(\lambda=B^{-\top}c_B\).

Last 10 minutes: Ch 7

Hessian testneeds Ω open. The first-order test only needs differentiability on an open set around Ω.
Convex feasible setsaffine =, convex ≤, concave ≥. They are sufficient, not necessary.
Local = globalno derivatives used; minimisers form a convex set; unique only if strict.
KKT in a convex programsufficient with no CQ; necessary only with a CQ (Slater).
∇²L at a KKT point⪰ 0 on all of ℝⁿ; λ's sign is irrelevant.
Villain(x−a)², x² ≤ 0: p* = a², q = a²μ/(1+μ), zero gap, not attained, no KKT, no Slater.
qconcave because L is affine in y; inf over all x; u free; never +∞; true even for non-convex primals.
Weak dualityd* ≤ p*, no convexity needed.
7.4.1KKT pair ⇔ zero gap + both attained. No strictness, no CQ, no uniqueness.
7.4.2a unique minimiser of L(·, ȳ) is the optimum. Strictly convex f suffices.
Slaterone point, strict for all g_j ⇒ zero gap + dual attained (not primal).
LP dualmax bᵀλ, Aᵀλ ≤ c, λ free. Both can be infeasible. Never reverse "unbounded ⇒ infeasible".
Jacobianh = Ax + b: J_h = Aᵀ, term Aᵀλ.

Last 10 minutes: Ch 8

Conversions≤ add slack; ≥ subtract surplus; free → x⁺ − x⁻; b < 0 → multiply by −1 and flip.
Basic solutionx_N = 0, x_B = B⁻¹b; can be negative. BFS = also ≥ 0. Degenerate = a basic variable is 0.
8.2.1feasible ⇒ a BFS exists; optimum exists ⇒ an optimal BFS exists (some, not every).
8.2.2extreme point ⇔ BFS (degenerate ones too; one point can have several bases).
FormulasBᵀλ = c_B; μ_N = c_N − Nᵀλ; u = B⁻¹a_q.
Optimalμ_N ≥ 0 (not >), valid even when degenerate.
Ratio testmin over u_i > 0 of x̄_i / u_i; that row leaves; cost changes by μ_q θ.
Unboundedμ_q < 0 and u ≤ 0 (one column is enough).
Degeneracyθ can be 0; a negative μ can appear at an optimum; cycling is possible.
Blandsmallest index enters (μ < 0); smallest index wins ties when leaving. Prevents cycling.
Phase Inever unbounded; w > 0 ⇒ infeasible; must end at a BFS.
Tableaubottom-right = −z₀; RHS = basic values; cost row = reduced costs.
Certificateμ = c − Aᵀλ ≥ 0 and bᵀλ = cᵀx*.

Answer key with explanations