Exercise 3.3.12. Given the subspace spanned by the two vectors and find the following:

a) a set of basis vectors for

b) the matrix that projects onto

c) the vector in that has the minimum distance to the vector in

Answer: a) The subspace is the column space for the matrix

for which the vectors and are the columns. The orthogonal complement corresponds to the left nullspace , so we can find a basis for by solving the system of equations corresponding to :

in matrix form or

expressed as a system of equations.

The matrix is already in echelon form, with and as basic variables and and as free variables. Setting and we have and . Setting and we again have and . So two solutions to are and and these form a basis for .

b) Since is the column space for the matrix above, the projection matrix onto is . We have

Since is a diagonal matrix its inverse is simply

We then have

c) The vector in closest to the vector is simply the projection of onto . But since is in it is orthogonal to all vectors in and its projection onto is the zero vector.

This can also be seen by explicitly doing the matrix multiplication:

UPDATE: Corrected a typo in the statement of question (b).

NOTE: This continues a series of posts containing worked out exercises from the (out of print) book Linear Algebra and Its Applications, Third Edition by Gilbert Strang.

If you find these posts useful I encourage you to also check out the more current Linear Algebra and Its Applications, Fourth Edition, Dr Strang’s introductory textbook Introduction to Linear Algebra, Fifth Edition and the accompanying free online course, and Dr Strang’s other books.