Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

2023_hw1sol

Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

EE364a, Winter 2022-2023 Prof. S.

Boyd

EE364a Homework 1 solutions


2.9 Voronoi sets and polyhedral decomposition. Let x0 , . . . , xK ∈ Rn . Consider the set of
points that are closer (in Euclidean norm) to x0 than the other xi , i.e.,

V = {x ∈ Rn | kx − x0 k2 ≤ kx − xi k2 , i = 1, . . . , K}.

V is called the Voronoi region around x0 with respect to x1 , . . . , xK .

(a) Show that V is a polyhedron. Express V in the form V = {x | Ax  b}.


(b) Conversely, given a polyhedron P with nonempty interior, show how to find
x0 , . . . , xK so that the polyhedron is the Voronoi region of x0 with respect to
x1 , . . . , xK .
(c) We can also consider the sets

Vk = {x ∈ Rn | kx − xk k2 ≤ kx − xi k2 , i 6= k}.

The set Vk consists of points in Rn for which the closest point in the set {x0 , . . . , xK }
is xk .
The sets V0 , . . . , VK give
SKa polyhedral decomposition of Rn . More precisely, the
sets Vk are polyhedra, k=0 Vk = Rn , and int Vi ∩ int Vj = ∅ for i 6= j, i.e., Vi
and Vj intersect at most along a boundary.
Suppose that P1 , . . . , Pm are polyhedra such that m n
S
i=1 Pi = R , and int Pi ∩
int Pj = ∅ for i 6= j. Can this polyhedral decomposition of Rn be described as
the Voronoi regions generated by an appropriate set of points?

Solution.

(a) x is closer to x0 than to xi if and only if

kx − x0 k2 ≤ kx − xi k2 ⇐⇒ (x − x0 )T (x − x0 ) ≤ (x − xi )T (x − xi )
⇐⇒ xT x − 2xT0 x + xT0 x0 ≤ xT x − 2xTi x + xTi xi
⇐⇒ 2(xi − x0 )T x ≤ xTi xi − xT0 x0 ,

which defines a halfspace. We can express V as V = {x | Ax  b} with


   
(x1 − x0 )T xT1 x1 − xT0 x0
 (x2 − x0 )T   xT x2 − xT x0 
 2 0
A = 2 .. , b = .. .
  
 
 .   . 
(xK − x0 )T T T
xK xK − x0 x0

1
(b) Conversely, suppose V = {x | Ax  b} with A ∈ RK×n and b ∈ RK . We can
pick any x0 ∈ {x | Ax ≺ b}, and then construct K points xi by taking the mirror
image of x0 with respect to the hyperplanes {x | aTi x = bi }. In other words, we
choose xi of the form xi = x0 + λai , where λ is chosen in such a way that the
distance of xi to the hyperplane defined by aTi x = bi is equal to the distance of
x0 to the hyperplane:
bi − aTi x0 = aTi xi − bi .
Solving for λ, we obtain λ = 2(bi − aTi x0 )/kai k22 , and

2(bi − aTi x0 )
xi = x0 + ai .
kai k22

(c) A polyhedral decomposition of Rn can not always be described as Voronoi regions


generated by a set of points {x1 , . . . , xm }. The figure shows a counterexample in
R2 .

P1
P̃1

P4 P3

P̃2
P2

H2 H1
R2 is decomposed into 4 polyhedra P1 , . . . , P4 by 2 hyperplanes H1 , H2 . Suppose
we arbitrarily pick x1 ∈ P1 and x2 ∈ P2 . x3 ∈ P3 must be the mirror image of x1
and x2 with respect to H2 and H1 , respectively. However, the mirror image of x1
with respect to H2 lies in P̃1 , and the mirror image of x2 with respect to H1 lies
in P̃2 , so it is impossible to find such an x3 .

2.12 Which of the following sets are convex?

(a) A slab, i.e., a set of the form {x ∈ Rn | α ≤ aT x ≤ β}.


(b) A rectangle, i.e., a set of the form {x ∈ Rn | αi ≤ xi ≤ βi , i = 1, . . . , n}. A
rectangle is sometimes called a hyperrectangle when n > 2.
(c) A wedge, i.e., {x ∈ Rn | aT1 x ≤ b1 , aT2 x ≤ b2 }.

2
(d) The set of points closer to a given point than a given set, i.e.,

{x | kx − x0 k2 ≤ kx − yk2 for all y ∈ S}

where S ⊆ Rn .
(e) The set of points closer to one set than another, i.e.,

{x | dist(x, S) ≤ dist(x, T )},

where S, T ⊆ Rn , and

dist(x, S) = inf{kx − zk2 | z ∈ S}.

Solution.

(a) A slab is an intersection of two halfspaces, hence it is a convex set (and a poly-
hedron).
(b) As in part (a), a rectangle is a convex set and a polyhedron because it is a finite
intersection of halfspaces.
(c) A wedge is an intersection of two halfspaces, so it is convex set. It is also a
polyhedron. It is a cone if b1 = 0 and b2 = 0.
(d) This set is convex because it can be expressed as
\
{x | kx − x0 k2 ≤ kx − yk2},
y∈S

i.e., an intersection of halfspaces. (For fixed y, the set

{x | kx − x0 k2 ≤ kx − yk2}

is a halfspace; see exercise ).


(e) In general this set is not convex, as the following example in R shows. With
S = {−1, 1} and T = {0}, we have

{x | dist(x, S) ≤ dist(x, T )} = {x ∈ R | x ≤ −1/2 or x ≥ 1/2}

which clearly is not convex.

2.15 Some sets of probability distributions. Let x be a real-valued random variable with
prob(x = ai ) = pi , i = 1, . . . , n, where a1 < a2 < · · · < an . Of course p ∈ Rn lies in
the standard probability simplex P = {p | 1T p = 1, p  0}. Which of the following
conditions are convex in p? (That is, for which of the following conditions is the set of
p ∈ P that satisfy the condition convex?)

3
Pn≤ E f (x) ≤ β, where E f (x) is the expected value of f (x), i.e., E f (x) =
(a) α
i=1 pi f (ai ). (The function f : R → R is given.)
(b) prob(x > α) ≤ β.
(c) E |x3 | ≤ α E |x|.
(d) E x2 ≤ α.
(e) E x2 ≥ α.
(f) var(x) ≤ α, where var(x) = E(x − E x)2 is the variance of x.
(g) var(x) ≥ α.
(h) quartile(x) ≥ α, where quartile(x) = inf{β | prob(x ≤ β) ≥ 0.25}.
(i) quartile(x) ≤ α.

Solution.
Pn We first note that the constraints pi ≥ 0, i = 1, . . . , n, define halfspaces,
and i=1 pi = 1 defines a hyperplane, so P is a polyhedron.
The first five constraints are, in fact, linear inequalities in the probabilities pi .

(a) E f (x) = ni=1 pi f (ai ), so the constraint is equivalent to two linear inequalities
P

n
X
α≤ pi f (ai ) ≤ β.
i=1
P
(b) prob(x ≥ α) = i: ai ≥α pi , so the constraint is equivalent to a linear inequality
X
pi ≤ β.
i: ai ≥α

(c) The constraint is equivalent to a linear inequality


n
X
pi (|a3i | − α|ai |) ≤ 0.
i=1

(d) The constraint is equivalent to a linear inequality


n
X
pi a2i ≤ α.
i=1

(e) The constraint is equivalent to a linear inequality


n
X
pi a2i ≥ α.
i=1

The first five constraints therefore define convex sets.

4
(f) The constraint
n
X n
X
2 2
var(x) = E x − (E x) = pi a2i −( pi ai )2 ≤ α
i=1 i=1

is not convex in general. As a counterexample, we can take n = 2, a1 = 0, a2 = 1,


and α = 1/5. p = (1, 0) and p = (0, 1) are two points that satisfy var(x) ≤ α,
but the convex combination p = (1/2, 1/2) does not.
(g) This constraint is equivalent to
n
X n
X
pi a2i −( pi ai )2 = bT p − pT Ap ≥ α,
i=1 i=1

where bi = a2i and A = aaT . We write this as

pT Ap − bT p + α ≤ 0.

This defines a convex set, since the matrix aaT is positive semidefinite.

Let us denote quartile(x) = f (p) to emphasize it is a function of p. The figure


illustrates the definition. It shows the cumulative distribution for a distribution p with
f (p) = a2 .
y

pn

p2

p1

x
a1 a2 an

(h) The constraint f (p) ≥ α is equivalent to

prob(x ≤ β) < 0.25 for all β < α.

If α ≤ a1 , this is always true. Otherwise, define k = max{i | ai < α}. This is a


fixed integer, independent of p. The constraint f (p) ≥ α holds if and only if
k
X
prob(x ≤ ak ) = pi < 0.25.
i=1

This is a strict linear inequality in p, which defines an open halfspace.

5
(i) The constraint f (p) ≤ α is equivalent to

prob(x ≤ β) ≥ 0.25 for all β ≥ α.

Here, let us define k = max{i | ai ≤ α}. Again, this is a fixed integer, independent
of p. The constraint f (p) ≤ α holds if and only if
k
X
prob(x ≤ ak ) = pi ≥ 0.25.
i=1

If α < a1 , then no p satisfies f (p) ≤ α, which means that the set is empty. Thus,
the constraint f (p) ≤ α is a linear inequality on p.

A1.1 Convex optimization. Are the following statements true or false?

(a) Least squares is a special case of convex optimization.


(b) By and large, convex optimization problems can be solved efficiently.
(c) Almost any problem you’d like to solve in practice is convex.
(d) Convex optimization problems are attractive because they always have a unique
solution.

Solution.

(a) True.
(b) True.
(c) False. Most optimization problems that people solve are not convex. Nevertheless,
many problems of interest can be solved via convex optimization.
(d) False. They do not always have a unique solution, and even when they do, this
is not of primary importance.

A1.2 Device sizing. In a device sizing problem the goal is to minimize power consumption
subject to the total area not exceeding 50, as well as some timing and manufacturing
constraints. Four candidate designs meet the timing and manufacturing constraints,
and have power and area listed in the table below.

Design Power Area


A 10 50
B 8 55
C 10 45
D 11 50

Are the statements below true or false?

(a) Design B is better than design A.

6
(b) Design C is better than design A.
(c) Design D cannot be optimal.

Solution.

(a) False. Device B is infeasible while device A is feasible.


(b) False. Both are feasible and achieve the same objective value, so they are equally
good.
(c) True. Design A is also feasible and achieves a better objective value (lower power
consumption).

A2.7 Dual cones in R2 . Describe the dual cone for each of the following cones.

(a) K = {0}.
(b) K = R2 .
(c) K = {(x1 , x2 ) | |x1 | ≤ x2 }.
(d) K = {(x1 , x2 ) | x1 + x2 = 0}.

Solution.

(a) K ∗ = R2 . To see this:

K ∗ = {y | y T x ≥ 0 for all x ∈ K}
= {y | y T 0 ≥ 0}
= R2 .

(b) K ∗ = {0}. To see this, we need to identify the values of y ∈ R2 for which y T x ≥ 0
for all x ∈ R2 . But given any y 6= 0, consider the choice x = −y, for which we
have y T x = −kyk22 < 0. So the only possible choice is y = 0 (which indeed satisfies
y T x ≥ 0 for all x ∈ R2 ).
(c) K ∗ = K. (This cone is self-dual.)
(d) K ∗ = {(x1 , x2 ) | x1 − x2 = 0}. Here K is a line, and K ∗ is the line orthogonal to
it.

A2.8 Convexity of some sets. Determine if each set below is convex.

(a) {(x, y) ∈ R2++ | x/y ≤ 1}


(b) {(x, y) ∈ R2++ | x/y ≥ 1}
(c) {(x, y) ∈ R2+ | xy ≤ 1}
(d) {(x, y) ∈ R2+ | xy ≥ 1}

Solution.

7
(a) Convex. The given set is {(x, y) ∈ R2++ | x − y ≤ 0}, which is the intersection of
the positive orthant with a halfspace, thus convex.
(b) Convex. The given set is {(x, y) ∈ R2++ | x − y ≥ 0}, which is the intersection of
the positive orthant with a halfspace, thus convex.
(c) Not convex. The points (1/2, 2) and (2, 1/2) are in the given set, but their average,
(5/4, 5/4), is not.

(d) Convex. The given set is {(x, y) ∈ R2+ | xy ≥ 1}, which is the 1-superlevel set
of the geometric mean, a concave function.

A2.13 Minimal and minimum elements. Consider the set S = {(0, 2), (1, 1), (2, 3), (1, 2), (4, 0)}.
Are the following statements true or false?

(a) (0, 2) is the minimum element of S.


(b) (0, 2) is a minimal element of S.
(c) (2, 3) is a minimal element of S.
(d) (1, 1) is a minimal element of S.

Here, minimum and minimal are with respect to the nonnegative orthant K = R2+ .
Solution.

/ (0, 2) + R2+ ∪

(a) False. As shown in the figure below, for (1, 1) ∈ S, (1, 1) ∈
(0, 2) − R2+ . This implies that (0, 2) is incomparable to (1, 1) and thus (0, 2) is


not the minimum element of S.


y

(0, 2) + R2+

(2, 3)
(0, 2) (1, 2)
(1, 1) x
(4, 0)

(0, 2) − R2+

8
(b) True. (0, 2) − R2+ ∩ S = (0, 2). So, (0, 2) is a minimal element.


(2, 3)
(0, 2) (1, 2)
(1, 1) x
(4, 0)

(0, 2) − R2+

(c) False. (2, 3) − R2+ ∩ S = {(2, 3), (0, 2), (1, 2), (1, 1)}. So (2, 3) is not a minimal


element. x
y

(2, 3)
(0, 2) (1, 2)
(1, 1) x
(4, 0)

(2, 3) − R2+

9
(d) True. (1, 1) − R2+ ∩

x S = (1, 1). So, (1, 1) is a minimal element.
y

(2, 3)
(0, 2) (1, 2)
(1, 1) x
(4, 0)

(1, 1) − R2+

10

You might also like