Math 310: Hour Exam 2 (Solutions) Prof. S. Smith: Fri 14 Nov 2003

You must SHOW WORK to receive credit. WHEREVER you use a calculator, write “used calculator”.

Problem 1:

(a) Show why each of the functions L, M : R^{2} → R^{2} defined by L((x_{1}, x_{2})^{T} ) = (x_{2}, x_{1} + x_{2})^{T} and

M((x_{1}, x_{2})^{T} ) = (x_{2}, x_{1} + 1)^{T} is–or is NOT—a linear transformation.

L IS linear: (add) L((x_{1}, x_{2})^{T} + (y_{1}, y_{2})^{T} ) = L((x_{1} + y_{1}, x_{2} + y_{2})^{T} )

= (x_{2} + y_{2}, (x_{1} + y_{1}) + (x_{2} + y_{2}))^{T},

while L((x_{1}, x_{2})^{T} ) + L((y_{1}, y_{2})^{T} ) = (x_{2}, x_{1} + x_{2})^{T} + (y_{2}, y_{1} + y_{2})^{T}

= (x_{2} + y_{2}, (x_{1} + x_{2}) + (y_{1} + y_{2}))^{T} —same, using commutativity of addition.

(sc.mult.) L(c(x_{1}, x_{2})^{T} ) = L((cx_{1}, cx_{2})^{T} ) = (cx_{2}, cx_{1} + cx_{2})^{T},

while cL((x_{1}, x_{2})^{T} ) = c(x_{2}, x_{1} + x_{2})^{T} = (cx_{2}, c(x_{1} + x_{2}))^{T} —same, using distributive law.

...but M is NOT linear: (e.g., add:) (add) M((x_{1}, x_{2})^{T} + (y_{1}, y_{2})^{T} ) = M((x_{1} + y_{1}, x_{2} + y_{2})^{T} )

= (x_{2} + y_{2}, (x_{1} + y_{1}) + 1)^{T},

while M((x_{1}, x_{2})^{T} ) + L((y_{1}, y_{2})^{T} ) = (x_{2}, x_{1} + 1)^{T} + (y_{2}, y_{1} + 1)^{T}

= (x_{2} + y_{2}, x_{1} + y_{1} + 2)^{T}, NOT the same.

(b) Give the matrix representing (in the standard basis) the linear transformation L : R^{3} → R^{3} defined by L((x_{1}, x_{2}, x_{3})^{T} ) = (3x_{1} + 4x_{2} − 3x_{3}, 5x_{1} + 6x_{3}, 4x_{1} + 3x_{2} + 2x_{3})^{T}.

Apply L to that basis: put into columns, to get A = ( \begin{matrix}3 & 4 & −3 \\ 5 & 0 & 6 \\ 4 & 3 & 2 \end{matrix} )

Problem 2:

(a) Give the matrix representing the linear transformation L : R^{2} → R^{2} defined by L((x_{1}, x_{2})^{T} ) = (x_{2}, x_{1} − x_{2})^{T}, WITH RESPECT TO THE BASIS (1, 1)^{T}, (1, 2)^{T}.

(“directly”:) Apply L to this basis: L((1, 1)^{T} ) = (1, 0)^{T}; L((1, 2)^{T} ) = (2, −1)^{T}. Get their coordinates in that basis: (1, 0)^{T} = 2(1, 1)^{T} − 1(1, 2)^{T}; (2, −1)^{T} = 5(1, 1)^{T} − 3(1, 2)^{T}.

Put in columns, to get B = ( \begin{matrix}2 & 5 \\ −1 & −3 \end{matrix} ).

(or using “shortcut”:) matrix in standard basis (as in 1b) is A = ( \begin{matrix}0 & 1 \\ 1 & −1 \end{matrix} );

obtain B as S^{−1}AS using change of basis matrix [new]_{std} given by

S = ( \begin{matrix}1 & 1 \\ 1 & 2 \end{matrix} ), so S^{−1} = ( \begin{matrix}2 & −1 \\ −1 & 1 \end{matrix} )...

(b) Using the “usual” inner product in the space R^{2×2} of matrices (namely ⟨A, B⟩ = ∑_{i,j=1}^{2} A_{i,j}B_{i,j}),

find the vector projection of A = ( \begin{matrix}1 & 2 \\ 3 & 4 \end{matrix} ) in the direction of B = ( \begin{matrix}1 & 0 \\ 1 & 0 \end{matrix} )

Projection formula: \frac{⟨A,B⟩}{⟨B,B⟩}B = \frac{1·1+2·0+3·1+4·0}{1·1+0·0+1·1+0·0}B = \frac{1+3}{1+1}B = 2B = ( \begin{matrix}2 & 0 \\ 2 & 0 \end{matrix} )

Problem 3:

(a) Find the subspace of R^{3} orthogonal to the vectors (1, 2, 3)^{T} and (1, 4, 5)^{T}.

Write vectors as rows of A, and compute nullspace of A:

( \begin{matrix}1 & 2 & 3 \\ 1 & 4 & 5 \end{matrix} ) has rref ( \begin{matrix}1 & 0 & 1 \\ 0 & 1 & 1 \end{matrix} ), so solutions are α(1, 1, −1)^{T}.

(b) Find the coordinates of the vector (1, 2)^{T} in the orthonormal basis of R^{2} (for the usual dot product) given by (\frac{1}{\sqrt{2}}, \frac{1}{\sqrt{2}})^{T}, (\frac{1}{\sqrt{2}}, −\frac{1}{\sqrt{2}})^{T}.

Just take dot products with the basis, to get coordinates: (\frac{3}{\sqrt{2}}, −\frac{1}{\sqrt{2}})^{T}.

Problem 4:

(a) For the inconsistent system Ax = b given by: ( \begin{matrix}1 & 0 \\ 2 & 1 \\ −1 & 1 \end{matrix} ) ( \begin{matrix}x_{1} \\ x_{2} \end{matrix} ) = ( \begin{matrix}1 \\ 0 \\ 1 \end{matrix} ), find: all “least

squares solutions” x̂; the projection p of b in the column space of A; and the residual (error). Multiply A^{T} by the augmented matrix [A|b] to get normal equations

( \begin{matrix}1 & 2 & −1 \\ 0 & 1 & 1 \end{matrix} ) ( \begin{matrix}1 & 0 & 1 \\ 2 & 1 & 0 \\ −1 & 1 & 1 \end{matrix} ) = ( \begin{matrix}6 & 1 & 0 \\ 1 & 2 & 1 \end{matrix} ). Compute rref: ( \begin{matrix}1 & 0 & −\frac{1}{11} \\ 0 & 1 & \frac{6}{11} \end{matrix} ).

Thus x̂ = \frac{1}{11}(−1, 6)^{T}; so p = Ax̂ = ( \begin{matrix}1 & 0 \\ 2 & 1 \\ −1 & 1 \end{matrix} ) \frac{1}{11} ( \begin{matrix}−1 \\ 6 \end{matrix} ) = \frac{1}{11}(−1, 4, 7)^{T};

with residual vector r(x̂) = b − p = (1, 0, 1)^{T} − \frac{1}{11}(−1, 4, 7)^{T} = \frac{1}{11}(12, −4, 4)^{T} (of size \frac{4}{\sqrt{11}}).

(b) Find the projection of (3, 0, 0)^{T} in the subspace of R^{3} spanned by (1, −1, 1)^{T} and (1, 2, 1)^{T}. Could do least squares; but the two vectors are orthogonal, so sum of vector projections suffices: \frac{(3,0,0)^{T} ·(1,−1,1)^{T}}{(1,−1,1)^{T} ·(1,−1,1)^{T}} (1, −1, 1)^{T} + \frac{(3,0,0)^{T} ·(1,2,1)^{T}}{(1,2,1)^{T} ·(1,2,1)^{T}} (1, 2, 1)^{T} = \frac{3}{3}(1, −1, 1)^{T} + \frac{3}{6}(1, 2, 1)^{T} = \frac{1}{2}(3, 0, 3)^{T}

Problem 5:

(a) Let S be the subspace of R^{3} spanned by v_{1} = (1, 1, 0)^{T} and v_{2} = (1, 2, 2)^{T}. Use the Gram-Schmidt process to find an orthonormal basis for S; and give an orthonormal basis for S^{⊥}.

First get orthogonal: use q_{1} = v_{1} = (1, 1, 0)^{T} and then

q_{2} = v_{2} − \frac{v_{2}·q_{1}}{q_{1}·q_{1}} q_{1} = (1, 2, 2)^{T} − \frac{3}{2}(1, 1, 0)^{T} = \frac{1}{2}(−1, 1, 4)^{T}.

To make orthoNORMAL, divide by lengths to get u_{1} = \frac{1}{\sqrt{2}}(1, 1, 0)^{T} and u_{2} = \frac{1}{\sqrt{18}}(−1, 1, 4)^{T}.

For S^{⊥}, convert (integer part suffices) to rows ( \begin{matrix}1 & 1 & 0 \\ −1 & 1 & 4 \end{matrix} ) and compute rref as ( \begin{matrix}1 & 0 & −2 \\ 0 & 1 & 2 \end{matrix} );

so S^{⊥} is span of (2, −2, 1)^{T}; divide by length to get orthonormal basis \frac{1}{3}(2, −2, 1)^{T}.

(b) Give the QR-factorization of the matrix A = ( \begin{matrix}1 & 1 \\ 1 & 2 \end{matrix} ).

Apply Gram-Schmidt as in (a) to the columns of A to get Q = \frac{1}{\sqrt{2}} ( \begin{matrix}1 & −1 \\ 1 & 1 \end{matrix} )

and can obtain R as Q^{T} A = \frac{1}{\sqrt{2}} ( \begin{matrix}1 & 1 \\ −1 & 1 \end{matrix} ) ( \begin{matrix}1 & 1 \\ 1 & 2 \end{matrix} ) = \frac{1}{\sqrt{2}} ( \begin{matrix}2 & 3 \\ 0 & 1 \end{matrix} ).