Skip to content
The Lumenary

Each worksheet prints cleanly on A4 or Letter. Answer keys are on a separate page.

The Lumenary · Advanced undergraduate

Optimisation

Name: ______________________

Date: ______________________

You will learn to

  • Formulate linear programs, solve them with the simplex method, and interpret the dual problem through weak and strong duality, complementary slackness and shadow prices
  • Prove that every local minimum of a convex function is a global minimum, and recognise convex sets and functions
  • Apply Lagrange multipliers and the KKT conditions, and prove that the KKT conditions are sufficient for convex problems
  • Implement gradient descent and prove its O(1/k)O(1/k) rate for convex functions with Lipschitz gradient; compare it with Newton's method
  • Treat least-squares data fitting as a convex optimisation problem
  1. 1.

    Maximise 2x+y2x + y subject to x+y≤4x + y \le 4, x≤3x \le 3, x,y≥0x, y \ge 0. What is the optimal value?

  2. 2.

    Which of these functions R→R\mathbb{R} \to \mathbb{R} are convex? (Choose all that apply.)

    • A.x2x^2
    • B.∣x∣|x|
    • C.exe^x
    • D.x3x^3
    • E.x4−x2x^4 - x^2
    • F.max⁡(x,0)\max(x, 0)
  3. 3.

    In the workshop problem (max⁡3x+5y\max 3x + 5y subject to x≤4x \le 4, 2y≤122y \le 12, 3x+2y≤183x + 2y \le 18, x,y≥0x, y \ge 0) the optimal dual solution is y=(0,32,1)y = (0, \tfrac32, 1). By how much does the maximum profit increase if workshop C gets one extra hour (so 3x+2y≤193x + 2y \le 19)?

  4. 4.

    In the proof of weak duality, cTx≤(ATy)Tx=yT(Ax)≤yTbc^{\mathsf T}x \le (A^{\mathsf T}y)^{\mathsf T}x = y^{\mathsf T}(Ax) \le y^{\mathsf T}b. Which hypotheses justify the last inequality yT(Ax)≤yTby^{\mathsf T}(Ax) \le y^{\mathsf T}b?

    • A.Ax≤bAx \le b and y≥0y \ge 0
    • B.x≥0x \ge 0 and ATy≥cA^{\mathsf T}y \ge c
    • C.Ax≤bAx \le b alone
    • D.Optimality of xx
  5. 5.

    Minimise (x−3)2+(y−1)2(x - 3)^2 + (y - 1)^2 subject to x+y≤2x + y \le 2. Which point is the minimiser?

    • A.(2,0)(2, 0)
    • B.(3,1)(3, 1)
    • C.(1,1)(1, 1)
    • D.(0,0)(0, 0)
  6. 6.

    The Lean theorem local_min_convex_global assumes hf : ConvexOn ℝ Set.univ f and hx : IsLocalMin f x and concludes f x ≤ f y. Which function and point show that the convexity hypothesis hf cannot be dropped?

    • A.f(x)=x3−3xf(x) = x^3 - 3x at x=1x = 1
    • B.f(x)=x2f(x) = x^2 at x=0x = 0
    • C.f(x)=x4−x2f(x) = x^4 - x^2 at x=1/2x = 1/\sqrt2
    • D.f(x)=exf(x) = e^x at x=0x = 0
  7. 7.

    Gradient descent with step 1/L1/L is run on a convex LL-smooth function with L=4L = 4, starting at distance ∥x0−x∗∥=3\|x_0 - x^*\| = 3 from a minimiser. Using Theorem 9, what is the smallest number of steps kk that guarantees f(xk)−f(x∗)≤0.01f(x_k) - f(x^*) \le 0.01?

  8. 8.

    Write gradient_descent(grad, x0, step, iters) that applies x↦x−step⋅grad(x)x \mapsto x - \text{step} \cdot \text{grad}(x) to a number x0 iters times and returns the final value. Then use it on f(x)=2(x−3)2f(x) = 2(x - 3)^2, whose gradient is 4(x−3)4(x - 3) (so L=4L = 4), and observe that steps below 2/L=0.52/L = 0.5 converge while larger steps diverge.

    Computational — Practice

Code: Apache-2.0 · Content: CC BY-SA 4.0