Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Optimality and convexity practice

Original practice questions (PDF)

1. A quartic with two minimizers

Let f(x)=x4−2x2f(x)=x^4-2x^2 on ℝ\mathbb R. Find all critical points, classify them using the second derivative, and determine the global minimum and its minimizers.

Solution to exercise 1

The derivative 4x(x2−1)4x(x^2-1) vanishes at x=0,±1x=0,\ \pm1. The second derivative 12x2−412x^2-4 is negative at zero and positive at ±1\pm1, giving a local maximum and two local minima. Since f(x)=(x2−1)2−1f(x)=(x^2-1)^2-1, the global value is −1-1, attained at both −1-1 and 11.

2. A quadratic in two variables

Let f(x1,x2)=x12+x1x2+x22−3x1f(x_1,x_2)=x_1^2+x_1x_2+x_2^2-3x_1. Write and solve the first-order condition, compute the Hessian, and classify the critical point. Is it a global minimizer?

Solution to exercise 2

The equations 2x1+x2−3=02x_1+x_2-3=0 and x1+2x2=0x_1+2x_2=0 give (2,−1)(2,-1). The Hessian [2112]\begin{bmatrix}2&1\\1&2\end{bmatrix} has eigenvalues 11 and 33, so ff is strictly convex and the point is its unique global minimizer.

3. A saddle point

For f(x1,x2)=x12−x22f(x_1,x_2)=x_1^2-x_2^2, verify stationarity at (0,0)(0,0) and compute the Hessian and its eigenvalues. Is the Hessian positive semidefinite? Give a direction in which ff decreases from the origin.

Solution to exercise 3

The gradient (2x1,−2x2)(2x_1,-2x_2) vanishes at the origin. The Hessian is diag⁡(2,−2)\operatorname{diag}(2,-2), which is indefinite. Traveling in direction (0,1)(0,1) gives f(0,t)=−t2<0f(0,t)=-t^2<0 for t≠0t\ne0, so the origin is not a local minimum.

4. Three convex sets?

Consider S1={x∈ℝ2:x1+2x2≤4,x1,x2≥0},S2={x∈ℝ2:x1x2≥1,x1,x2>0},S3={x∈ℝ2:∥x∥2≤1}. \begin{aligned} S_1 &= \{x\in\mathbb R^2:x_1+2x_2\le4,\ x_1,x_2\ge0\},\\ S_2 &= \{x\in\mathbb R^2:x_1x_2\ge1,\ x_1,x_2>0\},\\ S_3 &= \{x\in\mathbb R^2:\|x\|_2\le1\}. \end{aligned} Prove that S1S_1 and S3S_3 are convex, and decide whether S2S_2 is convex.

Solution to exercise 4

The set S1S_1 is an intersection of halfspaces. The triangle inequality gives ∥θx+(1−θ)y∥2≤θ∥x∥2+(1−θ)∥y∥2≤1\|\theta x+(1-\theta)y\|_2\le \theta\|x\|_2+(1-\theta)\|y\|_2\le1 for points in S3S_3 and 0≤θ≤10\le\theta\le1. The set S2S_2 is the epigraph of u↦1/uu\mapsto 1/u on u>0u>0. That function has second derivative 2/u3>02/u^3>0. For any two points in its epigraph, the convex combination of their heights is therefore at least the reciprocal of the convex combination of their first coordinates.

5. Three convex functions?

On ℝ\mathbb R, let f(x)=max⁡{2x+1,−x+3}f(x)=\max\{2x+1,-x+3\}, g(x)=exg(x)=e^x, and h(x)=x3h(x)=x^3. Prove convexity of ff and gg, and decide whether hh is convex.

Solution to exercise 5

A pointwise maximum of affine functions is convex. The exponential is convex since g″(x)=ex>0g''(x)=e^x>0. The cubic has h″(x)=6x<0h''(x)=6x<0 for x<0x<0, so it is not convex on ℝ\mathbb R.

6. Composition and addition

Let f:ℝm→ℝf:\mathbb R^m\to\mathbb R be convex, A∈ℝm×nA\in\mathbb R^{m\times n}, and b∈ℝmb\in\mathbb R^m.

  1. Use the chord definition to prove that x↦f(Ax+b)x\mapsto f(Ax+b) is convex.
  2. Use this result to prove convexity of x↦∥Ax−b∥2x\mapsto\|Ax-b\|_2.
  3. Prove that a sum of two convex functions is convex.
Solution to exercise 6

For 0≤θ≤10\le\theta\le1, the affine map sends θx+(1−θ)y\theta x+(1-\theta)y to θ(Ax+b)+(1−θ)(Ay+b)\theta(Ax+b)+(1-\theta)(Ay+b). Applying the convexity inequality for ff gives the first result. The Euclidean norm is convex by the triangle inequality, so take f(z)=∥z∥2f(z)=\|z\|_2 and use the shift −b-b. Adding the two chord inequalities proves convexity of a sum.

7. Jensen’s inequality

State Jensen’s inequality. Verify it for f(t)=t2f(t)=t^2 and XX taking values 0 and 2 with equal probabilities, and for f(t)=etf(t)=e^t and XX uniform on [0,1][0,1].

Solution to exercise 7

For convex ff, f(𝔼[X])≤𝔼[f(X)]f(\mathbb E[X])\le\mathbb E[f(X)] when the expectations are defined. The two-point distribution gives f(𝔼[X])=1f(\mathbb E[X])=1 and 𝔼[X2]=2\mathbb E[X^2]=2. If the PDF’s first distribution is read as continuous uniform on [0,2][0,2], its second moment is 4/34/3, so Jensen still holds. The uniform distribution gives e𝔼[X]=e1/2e^{\mathbb E[X]}=e^{1/2} and 𝔼[eX]=∫01etdt=e−1>e1/2\mathbb E[e^X]=\int_0^1 e^t\,dt=e-1>e^{1/2}, with strict inequality from strict convexity.

8. Subgradients of norms and maxima

  1. Compute ∂|x|\partial |x| at x=0x=0.
  2. Give a subgradient of ∥x∥1\|x\|_1 at x=(1,0,−2)x=(1,0,-2).
  3. For f(x)=max⁡{a1⊺x+b1,a2⊺x+b2}f(x)=\max\{a_1^\intercal x+b_1,a_2^\intercal x+b_2\}, describe ∂f(x)\partial f(x) when the first term is uniquely active and when both terms are active.
Solution to exercise 8

At zero the absolute value has subdifferential [−1,1][-1,1]. For the ℓ1\ell_1 norm, any vector (1,u,−1)(1,u,-1) with u∈[−1,1]u\in[-1,1] is a subgradient, so (1,0,−1)(1,0,-1) works. For the maximum, the subdifferential is the convex hull of the active slopes. It is {a1}\{a_1\} in the first case and conv⁡{a1,a2}\operatorname{conv}\{a_1,a_2\} in the second.

9. First-order certificates of global optimality

  1. Prove that ∇f(x⋆)=0\nabla f(x^\star)=0 is sufficient for a global minimum of a differentiable convex function on ℝn\mathbb R^n.
  2. For f(x)=12x⊺Qx+q⊺xf(x)=\tfrac12x^\intercal Qx+q^\intercal x with Q≽0Q\succeq0, characterize the minimizers and give a condition for uniqueness.
  3. Apply the result to Q=[2112]Q=\begin{bmatrix}2&1\\1&2\end{bmatrix} and q=(−3,0)q=(-3,0).
Solution to exercise 9

The supporting inequality gives f(y)≥f(x⋆)+∇f(x⋆)⊺(y−x⋆)=f(x⋆)f(y)\ge f(x^\star)+\nabla f(x^\star)^\intercal(y-x^\star)=f(x^\star). For the quadratic, the minimizers solve Qx=−qQx=-q. If a solution x⋆x^\star exists, the solution set is x⋆+ker⁡Qx^\star+\ker Q, with a unique minimizer when Q≻0Q\succ0. If qq is outside the range of QQ, a null-space direction gives unbounded descent. In the given example, solving the two equations gives (2,−1)(2,-1).

10. A subgradient certificate

Let f(x)=|x|+(x−1)2f(x)=|x|+(x-1)^2. Compute ∂f(x)\partial f(x) for x<0x<0, x=0x=0, and x>0x>0. Find a point where the subdifferential contains zero and justify global optimality.

Solution to exercise 10

The subdifferentials are {2x−3}\{2x-3\}, [−3,−1][-3,-1], and {2x−1}\{2x-1\}, respectively. Thus x⋆=1/2x^\star=1/2 has 0∈∂f(x⋆)0\in\partial f(x^\star). The subgradient inequality with g=0g=0 certifies a global minimum.