Upper & Lower Contour Sets
Upper & Lower Contour Sets
Upper & Lower Contour Sets
(LEC# 7)
Contents
2. Linear Algebra
2.1.
Preliminary: Level Sets, upper and lower contour sets and Gradient vectors
2.2.
Vectors as arrows.
2.3.
Vector operations
2.4.
10
2. Linear Algebra
2.1. Preliminary: Level Sets, upper and lower contour sets and Gradient vectors
Before we proceed with linear algebra, we need some concepts that well use to illustrate a key
linear algebra concept.
You all presumably know what contour lines are on a map: lines joining up the points on the map
that are at the same height above sea level. Same thing in math, except slightly different terms.
Three terms that you need to know:
(1) Level set: A level set of a function f consists of all of the points in the domain of f at
which the function takes a certain value. In other words, take any two points that belong to
the same level set of a function f : this means that f assigns the same value to both points.
(LEC# 7)
3
2.5
2
1.5
1
0.5
0
-0.5
-1
5
4
3
1
2
3
4
5
Pick the first level set in the picture: suppose that the height of the function for every point on the
level set is . Notice that for every point above and to the right of this level set, the value of the
ARE211, Fall2012
x2
upper contour set
epigraph
hypograph
x
x1
Figure 2. The graphs of one function and the level sets of another
function at this point is larger than . Hence the set of points above and to the right of this level
set is the upper contour set of the function corresponding to the value .
The following is a source of endless confusion for everybody: compare the two curves in Fig. 2. The
two curves are identical except for the labels. The interpretation of the curves is entirely different.
(1) On the left, we have the graph of a function of one variable; area NE of the line is the area
above the graph, called the epigraph of the function; area SW of the line is the area below
the graph, called the hypograph of the function;
(2) On the right, we have the level set of a function of two variables; area NE of the line is
an upper contour set of the function; area SW of the line is an lower contour set of the
function. In this case, the two-dimensional picture represents the domain of the function;
the height of the function isnt drawn.
Where are the upper contour sets located in the left panel of the figure? Ans: pick on the vertical
axis. Find x on the horizontal axis thats mapped to that point . The interval [0, x ] is the upper
contour set corresponding to .
(LEC# 7)
What are the level sets of a single variable function with no flat spots? Ans: A discrete
(i.e., separated) set of points.
What are the level sets of a concave single variable function with no flat spots? How many
points can be in a level set? Ans: At most two.
Now consider a function f of two variables that has a strict local maximum at x (i.e., f is
strictly higher at x than on a nbd). What can you say about the level set of the function
through x ? Ans: The point x must be an isolated point of the level set. Not necessarily
the unique point, but certainly isolated.
Gradient vectors: When economists draw level sets through a point, they frequently attach arrows
to the level sets. These arrows are pictorial representation of the gradient vector, i.e., the slope of
ARE211, Fall2012
50
40
30
20
10
0
10
8
10
6
8
6
4
4
2
0
Example: f (x) = 2x1 x2 , evaluated at (2, 1), i.e., f (2, 1) = (2x2 , 2x1 ) = (2, 4). Draw the level set
through (2, 1), draw the gradient through the origin, lift it up and place its base at (2, 1). Generally,
the gradient of a function with n arguments is a point in Rn , and for this reason, you often see the
gradient vector drawn in the domain of the function, e.g., for functions in R2 , you often draw the
gradient vector in the horizontal plane.
The gradient vector points in the direction of steepest ascent: Consider Fig. 3. Let x denote the
point in the domain where the first straight line touches the circle. The graph represents a nice
symmetric mountain which you are currently about to scale. You are currently at the point x.
Youre a macho kind of person and you want to go up the mountain in the steepest way possible.
Ask yourself the question, looking at the figure. What direction from x is the steepest way up?
(LEC# 7)
Answer is: the direction perpendicular to the straight line. Draw an arrow pointing in this direction.
Now the gradient vector of f at x is an arrow pointing in precisely the direction youve drawn.
The following things about the gradient vector are useful to know:
its length is a measure of the steepness of the function at that point (i.e., the steeper the
function, the longer is the arrow.)
as weve seen it is perpendicular to the level set at the point x
it points inside the upper contour set. Note Well: It could point into the upper
contour set, but then pass thru the level set and go into the lower contour set!
as weve seen, it points in the direction of steepest ascent of the function.
When we get to constrained optimization, well talk a lot more about this vector.
Write vectors as arrows but the real vector is the location of the tip of the arrow. Important
that in visual applications, we often draw vectors that dont have their base at the origin. E.g., the
gradient vector at x is always drawn with its base at the point x. Strictly speaking, you have to
translate it back to the origin to interpret it as a vector.
Note well that all of the following definitions assume implicitly that the vectors concerned all live in the same space, i.e., you cant add, subtract or multiply vectors
unless they have the same number of elements.
ARE211, Fall2012
Row and column vectors: doesnt make any difference whether the vector is written as a row or a
column vector. Purely a matter of convenience.
For the purposes of this section, the norm of a vector is its Euclidean length: measure the arrow
qP
n
2
with a ruler.1 Written ||x|| =
k=1 xk . Note that ||x|| = d2 (x, 0).
Adding and subtracting vectors. Intuitive what the sum of two vectors looks like. A little trickier
to figure out what the difference between two vectors looks like, but you should try to figure out
the picture.
Take the positive weighted sum of two vectors: v1 + (1 )v2 . Draw it.
The inner product of two vectors x, y Rn is the sum of the products of the components. That is,
xy =
Pn
k=1 xk yk .
When I think of the inner product of x and y, I think of x as a row vector and
It is hard to visualize what x y looks like. Look at a picture of x and y and say whether x y is
positive, negative, zero. Answer is given by the angle between the two vectors.
(LEC# 7)
x
b
c
Theorem: a u = ||a|| ||u ||cos(), where is the angle between a and u. Note the beauty of cos:
doesnt matter whether you look at the big angle between the vectors or the little one, get the same
answer!
In Fig. 4, rank the inner products x a, x b and x c. Answer: all the vectors are the same
length, so that the only thing that determines the inner product is the angle between them. Hence
x a > x b > x c.
Application: a fact that well learn soon is that for small vectors dx, f (x+dx) f (x)+f (x)dx.
Just believe this for the moment.
Draw x in the domain and dx, then add them to get x + dx. Now think about f (x + dx):
is it bigger or smaller than f (x)?
First answer is graphical. (See Fig. 5.) Assume the domain is R2 , draw x and a level set
through x. Now draw 3 small vectors dx starting from x.
ARE211, Fall2012
50
40
30
20
10
0
10
8
10
6
8
6
4
4
2
0
10
(LEC# 7)
0.5dx H(x)dx. Well see later that while for the red dx, the f term is zero, the last
term is negative, hence this dx points into the lower contour set
Now
observe
that you
get
the same
answer
when you
that
f (x + dx) f (x) + f (x) dx and apply the cos formula to f (x) dx. Answer depends on the angle between f (x) and dx.
if angle is acute, then f (x + dx) > f (x).
if angle is 90 , then f (x + dx) = f (x). (Well, not exactly, but then we only said that
f (x + dx) was approximately equal to f (x) + f (x) dx.)
if angle is obtuse, then f (x + dx) < f (x).
This verifies that the gradient of a function at x points into the upper contour set of the
function at x, and that the gradient is perpendicular to the level set.
Defn: x Rn is a linear combination of a set of m vectors {v1 , ...vk , ...vm } in Rn if there exists a
vector t Rm such that x =
Pm
k=1 tk v
k;
Example: If v1 , v2 R2 point in the same (or opposite) direction, then the linear combinations
of these vectors all lie on the same line. If not, then any point in R2 can be written as a linear
combination of v1 and v2 .
Pn
k=1 tk v
k.
ARE211, Fall2012
11
Defn: The nonnegative (positive) cone defined by a set of vectors {v1 , ...vk ..., vm } is the set of all
nonnegative (positive) linear combinations of these vectors.
Note that
(1) if you have two vectors in R2 that arent collinear, the difference between the nonnegative
cone and the positive cone is that the edges of the cone arent included in the positive
cone but are included in the nonnegative cone.
(2) if you have two vectors in R2 that are collinear, with a negative coefficient i.e., you have the
vectors x and x, with < 0, then the positive and the nonnegative cones are identical
and consist of the entire line through these vectors
Convex combinations: whats the difference between one of these and a linear combination? Ans:
the set of convex combinations of two vectors is the line segment between them, which is a subset of
the nonnegative cone defined by these two vectors. The set of convex combinations of three vectors
is a triangle embedded in a plane.
Defn: x Rn is a convex combination of a set of vectors {v1 , ...vk ..., vm } if there exists a vector
t Rm
+ such that
Pm
k=1 tk
= 1 and x =
Pm
k=1 tk v
k.
Friendly but not quite correct defn: a set of vectors {v1 , ...vk ..., vm }, vk Rn , is a linear independent
set if no one of them can be written as a linear combination of all the others.
12
(LEC# 7)
Unfriendly but correct defn: a set of vectors {v1 , ...vk ..., vm } is a linear independent set if for all
t Rm ,
Pm
k=1 tk v
= 0 implies t = 0.
Defn: a set of vectors {v1 , ..., vm } is a linear dependent set if it is not a linear independent set.
The only difference between my friendly defn and the unfriendly formal definition is that the set
{0} is linear independent by my definition and linear dependent by the formal definition. To see
that it is linear independent according to my definition, note that if 0 is the only element of the
set, then, trivially, you cant write 0 as a lin comb of other vectors in the set, because there arent
any other vectors in the set. To see that it is linear dependent by the formal definition, let t = 1,
and note that t 0 = 0, but t 6= 0. So the test for linear independence fails. Its a useful exercise
to check that the two definitions are equivalent for any set of vectors other than the singleton set
zero.
Note that the empty set is a linear independent set, since it trivially satisfies the definition of linear
independence.
Examples:
Can you construct a linear independent set of vectors in which one of the vectors is zero?
Whats the largest set of linearly independent 2-vectors you can have?
Whats the largest set of linearly independent 3-vectors you can have?