HW2 Sol
HW2 Sol
(a) x1 + x2 + x3
x4 x6
(b) x2 + 2 + 6
(c) x2 + x + x + x4 + x5 + x6
3 4
1
Solution:
(a) The dimension of x and of y are 3. Thus, n is 3.
(b) 2x − y = (−1, 2, 5)>
(c) x> y = 10
√ √ √
(d) kx − yk = −22 + 02 + 22 = 8=2 2
(e) kx − yk1 = | − 2| + |0| + |2| = 4
(f) kx − yk∞ = max{2, 0, 2} = 2
(g) x> Ay = 27
3. State whether each of the following sets is convex or not. Explain your
reasoning.
(a) X = {(x1 , x2 ) ∈ R2 | x21 + x22 ≥ 1}.
(b) X = {x ∈ R | x2 = 2}.
x2
(c) X = {(x1 , x2 ) | (x1 −1) ≤ 1, x1 ≥ 1}.
Solution:
X = {(x1 , x2 ) : x2 ≤ x1 − 1, x1 > 1} =
= {(x1 , x2 ) : x2 ≤ x1 − 1} ∩ {(x1 , x2 ) : x1 > 1}
Since both of the two sets are defined using only linear constraints
they are convex, and hence X is convex as intercept of two convex
sets.
Method 2: Again we will use the fact that:
X = {(x1 , x2 ) : x2 ≤ x1 − 1, x1 > 1}
We will show that this set is convex using the definition. Let a =
(a1 , a2 ), b = (b1 , b2 ) ∈ X. That means:
2
a1 , b1 > 1
a2 ≤ a1 − 1
b2 ≤ b1 − 1
c1 > 1
c2 ≤ c1 − 1
We have
Hence c ∈ X, and thus set X is convex. We will show that this set is
convex using the definition. Let a = (a1 , a2 ), b = (b1 , b2 ) ∈ X. That
means:
a1 , b1 > 1
a2 ≤ a1 − 1
b2 ≤ b1 − 1
c1 > 1
c2 ≤ c1 − 1
We have
3
From a1 , b1 > 1 we have:
Figure 2: Set X
We can see that set X is convex.
4. State whether the following problems are convex programs or not. Explain
your reasoning.
(a) min{x21 + 2x22 : x1 ≤ 0, x2 ≤ 0}.
(b) min{x1 · x2 : x21 + x22 ≤ 1}.
Pn xi Pn
(c) min{ i=1 i!i : i=1 xi ≥ 5}.
Solution:
(a) This is a convex program. The feasible region R2− is a convex set. The
objective f (x1 , x2 ) = x21 + 2x22 is a convex function over R2− because
it is sum of two convex functions g(x1 , x2 ) = x21 and h(x1 , x2 ) = 2x22 .
Alternatively it can be shown
that function is convex by calculating
2 0
its Hessian ∇2 f = 0.
0 4
4
(b) This is not a convex program. The feasible region f (x1 , x2 ) : x21 +
x22 ≤ 1 is a ball, and thus a convex set. However objective
function
0 1
x1 ẋ2 is not convex because its Hessian ∇2 f = is not positive
1 0
semidefinite.
Pn is a not a convex program. The feasible region {(x1 , ...., xn ) :
(c) This
i=1 xi ≥ 5}. is a half space and thus a convex set. The objective
Pn xi
function f (x1 , ...., xn ) = i=1 i!i is a not a convex function because
it not always a positive sum of convex functions.
Forexample, when
0 0 0
n = 3 the objective function has ∇2 f = 0 1 0 . This matrix
0 0 x3
does not always have non-negative eigenvalues subject to the x1 +
x2 + x3 ≥ 5 constraint.