You are on page 1of 9

EE103/CME103: Introduction to Matrix Methods S.

Boyd
October 27 2016

Midterm Exam

This is an in-class 80 minute midterm.


You may not use any books, notes, or computer programs (e.g., Julia). Throughout this exam
we use standard mathematical notation; in particular, we do not use (and you may not use)
notation from any computer language, or from any strange or non-standard mathematical
dialect (e.g., physics).
You will write your exam answers directly in this exam. You should use scratch paper (which
you will not turn in) to do your rough work.
The first two problems are multiple choice. For these problems simply circle the appropriate
response or responses. You do not need to give any justification for your answers to these
questions. We will give partial credit for multiple choice problems left with no answer. If we
can’t tell which response or responses you are selecting, we will give zero credit.
For all other questions, your answer must be written between the lines below the problem.
We won’t read anything outside the lines.
All problems have equal weight. Some are easy. Others, not so much.

Name:

SUNetID: @stanford.edu

(For EE103 staff only)

Problem Score Problem Score


1 /12 6 /12
2 /12 7 /12
3 /12 8 /12
4 /12 9 /12
5 /12 10 /12
Total /120

1
1. The function φ : R3 → R satisfies

φ(1, 1, 0) = −1, φ(−1, 1, 1) = 1, φ(1, −1, −1) = 1.

Choose one of the following by circling it. You do not need to justify your answer.

• φ must be linear.
• φ might be linear.
• φ cannot be linear.

2. Block matrix. Assuming the matrix


 
I AT
K=
A 0

makes sense, which of the following statements must be true? (‘Must be true’ means
that it follows with no additional assumptions.) Circle the correct answer for each
statement. You do not need to justify your answer.

(a) K is square. Must be true. Might not be true.


(b) A is square or wide. Must be true. Might not be true.
(c) The rows of A are linearly independent. Must be true. Might not be true.
T
(d) K is symmetric, i.e., K = K. Must be true. Might not be true.
(e) The identity and zero submatrices in K have the same dimensions.
Must be true. Might not be true.
(f) The zero submatrix is square. Must be true. Might not be true.

2
3. A particular computer (Boyd’s laptop) takes about 0.2 seconds to multiply two 1500 ×
1500 matrices. About how long would you guess the computer would take to multiply
two 3000 × 3000 matrices? Give your prediction (i.e., the time in seconds), and your
(very brief) reasoning.

4. Suppose ψ : R2 → R is an affine function, with ψ(1, 0) = 1, ψ(1, −2) = 2.

(a) What can you say about ψ(1, −1)? Either give the value of ψ(1, −1), or state
that it cannot be determined.

(b) What can you say about ψ(2, −2)? Either give the value of ψ(2, −2), or state
that it cannot be determined.

You do not need to justify your answers.

3
5. Equilibrium point for linear dynamical system. Consider a time-invariant linear dy-
namical system with offset, xt+1 = Axt + c, where xt is the state n-vector. We say
that a vector z is an equilibrium point of the linear dynamical system if x1 = z implies
x2 = z, x3 = z, . . . . (In words: If the system starts in state z, it stays in state z.)
Find a matrix F and vector g for which the set of linear equations F z = g characterizes
equilibrium points. (This means: if z is an equilibrium point, then F z = g; conversely
if F z = g, then z is an equilibrium point.) Express F and g in terms of A, c, any
standard matrices or vectors (e.g., I, 1, or 0), and matrix and vector operations.
Remark. Equilibrium points often have interesting interpretations. For example, if
the linear dynamical system describes the population dynamics of a country, with
the vector c denoting immigration (emigration when entries of c are negative), an
equilibrium point is a population distribution that does not change, year to year. In
other words, immigration exactly cancels the changes in population distribution caused
by aging, births, and deaths.

4
6. Norm of linear combination of orthonormal vectors. Suppose {a1 , . . . , ak } is an or-
thonormal set of n-vectors, and x = β1 a1 + · · · + βk ak , where β1 , . . . , βk are scalars.
Express kxk in terms of β = (β1 , . . . , βk ).

7. Columns of difference matrix. The difference matrix is the (n − 1) × n matrix

−1 ···
 
1 0 0 0 0
 0 −1 1 ··· 0 0 0 
.. ..
 
 . . 
D= .
 
.. ..

 . . 

 0 0 0 · · · −1 1 0 
0 0 0 ··· 0 −1 1

We let d1 , . . . , dn denote its columns. Circle one of the following two options and give
the appropriate answer below.

• The columns of D are linearly independent. If you choose this option, show why
the columns are linearly independent.
• The columns of D are linearly dependent. If you choose this option, give specific
coefficients β1 , . . . , βn , not all zero, for which β1 d1 + · · · + βn dn = 0.

5
8. Student-course matrix. The Stanford registrar has the complete list of courses taken
by each graduating student over several graduating classes. This data is represented
by an m × n matrix C, with Cij = 1 if student i took class j, and Cij = 0 otherwise,
for i = 1, . . . , m and j = 1, . . . , n. (Thus, there are m students in the data set, and n
different courses. For simplicity, we ignore the possibility that in some circumstances
a student can take a course multiple times.)
Answer each of the questions below in English, with no equations, references to matrices
or vectors, and so on. (You can refer to student i and course j, though.)

(a) What is (C T C)kl ?

(b) What is (CC T )rs ?

(c) What is (C T 1)p ?

6
(Problem 8 continued.)
(d) Suppose you cluster the columns of C T using k-means, with k = 50 (say). What
do you think the results might look like? (Your response can be a bit vague, but
not more than one or two sentences.)

(e) (Continuation of part (d).) Suppose z1 is the cluster representative for group 1.
What does (z1 )143 = 0.01 mean?

7
9. Cross-product. The cross product of two 3-vectors a = (a1 , a2 , a3 ) and x = (x1 , x2 , x3 )
is defined as the vector  
a2 x 3 − a3 x 2
a × x =  a3 x 1 − a1 x 3  .
a1 x 2 − a2 x 1
The cross product comes up in physics, for example in electricity and magnetism, and
in dynamics of mechanical systems like robots or satellites. (You do not need to know
this.)
Assume a is fixed. Show that the function f (x) = a × x is a linear function of x, by
giving a matrix A that satisfies f (x) = Ax for all x. (You can just give A; you do not
need to verify that a × x = Ax for all x.)

8
10. (a) How are x and Ax related, where A is the 5 × 5 matrix
 
0 0 0 0 1
 1 0 0 0 0 
 
A=  0 1 0 0 0 .

 0 0 1 0 0 
0 0 0 1 0

Your answer should be in English.

(b) What is A5 ? (You can just give the matrix.) Hint. The answer should make
sense, given your answer to part (a).

You might also like