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
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/
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:
| Trick | Example 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" |
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.
Convex optimisation problem: minimise a convex function over a convex set.
| Problem | Why 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 |
- "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.
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.
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.
- "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.
Which constraints keep the feasible set dent-free?
Memory hook: "≤ goes with convex, ≥ goes with concave, = only with affine."
(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).
- "\(\{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.
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.
3. \(f(z_\alpha)\le \alpha f(y)+(1-\alpha)f(x^\star)\) (convex function).
4. So \(f(z_\alpha)
6. So \(x^\star\) is global. No derivatives were used.
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.
- "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\).
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.
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)\).
Non-convex program: a CQ makes KKT necessary, but KKT alone is not sufficient.
- "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.
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.
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".
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.
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.
\(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\).
Remark 7.3.1: this holds even when the primal is non-convex.
- "\(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\).
The dual always gives a floor
Two short steps, no convexity needed: every dual value sits below every primal value.
Strong duality means \(p^\star=d^\star\). It is a different thing from attainment (Scene 6).
- "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.
When does a KKT pair exist? (7.4.1) And how do you get \(x^\star\) back? (7.4.2)
Moreover, any primal optimum paired with any dual optimum is a KKT pair.
(⇐) \(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).
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\).
- "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.
One strictly-inside point buys you strong duality
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.
\(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.
- "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.
Linear programs: KKT with no LICQ, and a dual with a twist
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\}\).
(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 \ D | D optimal | D unbounded | D infeasible |
|---|---|---|---|
| P optimal | ✓ equal values | ✗ | ✗ |
| P unbounded | ✗ | ✗ | ✓ |
| P infeasible | ✗ | ✓ | ✓ possible! |
- "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.
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.
Every LP can wear the same uniform
| You have | Do 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. |
- "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\).
Pick \(m\) columns, zero the rest, solve
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.
\(\{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.
- "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" ✗
Two theorems that justify the whole method
(ii) If an optimal solution exists, an optimal BFS exists.
- "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" ✗
Four conditions hold by construction. Only one needs checking.
- "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" ✗
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?
\(\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.
- "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.
What each step of the simplex means
| Step | What you do | What it means |
|---|---|---|
| 0 Start | find \(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 Enter | pick \(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 Pivot | swap the leaving column for \(a_q\) | move to the neighbouring corner (or stay put if \(\theta=0\)) |
When a step has length zero
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.
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.
- "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.
Phase I: a helper problem that can never be 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\).
- "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" ✗
Reading every number in the table
- "the bottom-right entry is \(z_0\)" ✗ It is \(-z_0\).
- "the RHS column holds the reduced costs" ✗ It holds the basic values.
The worked example and its dual certificate
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\).
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 test | needs Ω open. The first-order test only needs differentiability on an open set around Ω. |
| Convex feasible sets | affine =, convex ≤, concave ≥. They are sufficient, not necessary. |
| Local = global | no derivatives used; minimisers form a convex set; unique only if strict. |
| KKT in a convex program | sufficient 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. |
| q | concave because L is affine in y; inf over all x; u free; never +∞; true even for non-convex primals. |
| Weak duality | d* ≤ p*, no convexity needed. |
| 7.4.1 | KKT pair ⇔ zero gap + both attained. No strictness, no CQ, no uniqueness. |
| 7.4.2 | a unique minimiser of L(·, ȳ) is the optimum. Strictly convex f suffices. |
| Slater | one point, strict for all g_j ⇒ zero gap + dual attained (not primal). |
| LP dual | max bᵀλ, Aᵀλ ≤ c, λ free. Both can be infeasible. Never reverse "unbounded ⇒ infeasible". |
| Jacobian | h = 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 solution | x_N = 0, x_B = B⁻¹b; can be negative. BFS = also ≥ 0. Degenerate = a basic variable is 0. |
| 8.2.1 | feasible ⇒ a BFS exists; optimum exists ⇒ an optimal BFS exists (some, not every). |
| 8.2.2 | extreme point ⇔ BFS (degenerate ones too; one point can have several bases). |
| Formulas | Bᵀλ = c_B; μ_N = c_N − Nᵀλ; u = B⁻¹a_q. |
| Optimal | μ_N ≥ 0 (not >), valid even when degenerate. |
| Ratio test | min 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. |
| Bland | smallest index enters (μ < 0); smallest index wins ties when leaving. Prevents cycling. |
| Phase I | never unbounded; w > 0 ⇒ infeasible; must end at a BFS. |
| Tableau | bottom-right = −z₀; RHS = basic values; cost row = reduced costs. |
| Certificate | μ = c − Aᵀλ ≥ 0 and bᵀλ = cᵀx*. |