\documentclass{amsart}
\usepackage{amssymb,latexsym} 

\date{}
\begin{document}
%\begin{flushright} {\today} \end{flushright}
\begin{center}
{\bf MATH 221 Solutions to the sample final}
\end{center}

\medskip

2 (a). True. $c_i\vec{v}_i \cdot c_j\vec{v}_j = 0$ iff $ i \neq j$.


(b). True. This is the Pythagorean theorem. For an argument, note that
$|| \vec{v}-\vec{u} ||^2 = ||\vec{v}||^2 + ||\vec{u}||^2 - 2\vec{u}
\cdot \vec{v}$.  Hence the assumption forces $\vec{u} \cdot \vec{v}=0$
so that $\vec{u}$ and $\vec{v}$ are orthogonal.

(c). False. This is not true since the $\vec{0}$ vector is orthogonal
to any vector. For an example, note that $\{ (1,0) , (0,0) \}$ is an
orthogonal subset of $\mathbb{R}^2$.  Otherwise this is true if we
consider non-zero orthogonal vectors; this is a theorem from class.

(d). False. Let $A =
\begin{bmatrix}
  1 & 0
\end{bmatrix}$
so $A$ is a $1 \times 2$ matrix.  The Nullspace of $A$ is spanned by
$( 0 ,1 )$ while the column space is a subspace of $\mathbb{R}^1$.
What is true is that the orthogonal complement of the row space of $A$
is the nullspace of $A$.

(e). True.  A theorem from class.

(f). True.  If $\vec{x}$ is in $W^\perp$ then $\vec{x}$ is orthogonal
to every vector in $W$ and hence the $\vec{v}_j's$.  If $\vec{x}$ is
orthogonal to the $\vec{v}_j's$ then $\vec{x}$ is orthogonal to linear
combinations of the $\vec{v}_j's$ and hence every vector in $W$.

(g). True. Suppose that a vector $\vec{w}$ is in $W$ and $W^perp$.
Then $\vec{w} \cdot \vec{w} = 0$ implies $||\vec{w}|| = 0$ which
implies $\vec{w}=0$ (since vectors of zero length are zero).

(h). True by uniqueness of orthogonal projection (a theorem from
class).

(i). True. If $(A^T)A = I$, then $A$ is invertible and $A^{-1} = A^T$.
Thus $AA^{-1} = AA^T = I$, which means that the columns of $A^T$ are
orthonormal and hence the rows of A are orthonormal.

(j). False. $P = 
\begin{bmatrix}
  2 & 0 \\
  0 & 1 \\
\end{bmatrix}$ has orthogonal columns, but $P^-1$ is not equal to $P^T$.

(k). True. A theorem from class.

(l) False. Let $\vec{y} = (1,1)$ and $\vec{u} = (0,1)$ Then
$\text{proj}_{\text{span}(\vec{u})} (\vec{y}) = \vec{u}$ and
$\vec{u}$ is not a multiple of $\vec{y}$.

(m) True by uniqueness of orthogonal decomposition. \\

3) If $i \neq j$ then $\vec{v}_i \cdot \vec{v}_j = 0$.  Since U is
orthogonal, the corresponding linear transformation preserves the dot
product (angles), thus $(U\vec{v}_i) \cdot (U\vec{v}_j) = \vec{v}_i
\cdot \vec{v}_j = 0.$ Thus the set $\{U\vec{v}_1,U\vec{v}_2,
\ldots,U\vec{v}_n\}$ is orthogonal.  To see that this set is
orthonormal, the same argument as above shows that $||U\vec{v}_i||^2 =
(U\vec{v}_i) \cdot (U\vec{v}_i) = \vec{v}_i \cdot \vec{v}_i =
||\vec{v}_i||^2 = 1$ (or just notice that the linear transformation
associated with U also preserves lengths).\\

%$

4) Take $\vec{x} = \vec{e}_i$. Then $U\vec{x}$ is the $i^{\text{th}}$
column of $U$. Take $\vec{y} = e_j$, so that $U\vec{y}$ is the
$j{\text{th}}$ column of $U$. Write $\vec{u}_i$ for the
$i^{\text{th}}$ column of $U$ for $i = 1, \ldots, n$.  Then $
\vec{u}_i \cdot \vec{u}_j = (Ux) \cdot (U\vec{y}) = \vec{x} \cdot
\vec{y} = \vec{e}_i \cdot \vec{e}_j$.  Thus $\vec{u}_i \cdot \vec{u}_j$
is zero if $i \neq j$ and is 1 if $i=j$. This means the columns of $U$
are orthonormal,
and hence that $(U^T)U=I$ so that $U^{-1} = U^T$. \\

5) Suppose that $\vec{x}$ and $\vec{y}$ are each orthogonal to the
given vector $\vec{v}$, and suppose that $c$ and $d$ are scalars. To
show that $c\vec{x} + d\vec{y}$ is in the subspace, one needs to see
that $cvec{x} + d\vec{y}$ is orthogonal to $\vec{v}$.  Well,
$(c\vec{x} + d\vec{y}) \cdot \vec{v} = c(\vec{x} \cdot \vec{v}) +
d(\vec{y} \cdot \vec{v}) = c \cdot 0 + d \cdot 0 = 0$ since $\vec{x}
\cdot \vec{v} = \vec{y} \cdot \vec{v} = 0$.  This shows that
$\{\vec{x} : \vec{x} \cdot \vec{v} = 0\}$ is a subspace.\\



6) a) Let $A$ be the matrix with columns
$\vec{v}_1,\vec{v}_2,\vec{v}_3$.  One finds that $A$ has two pivots,
in the first two columns.  So colomn space of $A$ has dimension 2.

b) Note that $V$ is spanned by $\vec{v}_1$ and $\vec{v}_2$. A vector
$\vec{x} = (a,b,c)$ is orthogonal to $V$ iff $\vec{x}$ is orthogonal
to $\vec{v}_1$ and to $\vec{v}_2$.  Thus, $\vec{x}$ is in $V^{\perp}$
iff $\begin{bmatrix}
  1 & 1  & 1 \\
  1 & -2 & -2
\end{bmatrix}\vec{x} = \vec{0}$
So we are reduced to finding the Null space of the above 2x3 matrix.
The reduced echelon form of this matrix is $\begin{bmatrix}
  1 & 0  & \frac{4}{3} \\
  0 & 1 & \frac{-1}{3}
\end{bmatrix}$. 
So $V^{\perp}$ is spanned by $(-\frac{4}{3}, \frac{1}{3},1)$ or by
$(-4,3,1)$.

c) $\vec{c}$ is in $V$ iff $\vec{c}$ is equal to its orthogonal
projection onto $V$. Since the orthogonal complement of V is spanned
by a single vector, $\vec{c}$ is in $V$ iff $\vec{c}$ is orthogonal to
$(-4,3,1)$. Thus the condition is that $-4 c_1 + c_22 + 3 c_3 = 0$.
If there is a particular solution $\vec{p}= (x,y,z)$, then $\vec{p} +
\vec{v}$ is also a solution for any vector $\vec{v}$ in the Nullspace
of A. Since the nullspace of A is 1 dimensional there are infinitely
many solutions in this case. \\


(7) (a) The matrix formed by the 3 vectors may be row
reduced:
$$\begin{pmatrix}1&1&0\\2&1&2\\1&0&2\end{pmatrix} \sim
\begin{pmatrix}1&1&0\\0&-1&2\\0&-1&2\end{pmatrix} \sim
\begin{pmatrix}1&0&2\\0&-1&2\\0&0&0\end{pmatrix}$$hence the
dimension of the column space is 2 and is actually spanned
by the vetcors ${\bf x}_1 = (1, 2, 1)^T$ and ${\bf x}_2 = (1,
1, 0)^T$. (b) To find an orthogonal basis ${\bf u}_1, {\bf
u}_2$ with the same span we may take ${\bf u}_1 = {\bf x}_1$
and
$${\bf u}_2 = {\bf x}_2 - \frac{{\bf x}_2.{\bf x}_1}{{\bf
x}_1.{\bf x}_1}{\bf x}_1 = (1, 1, 0)^T - \frac{1}{2} (1, 2,
1)^T = (1/2, 0, -1/2)^T.$$

\bigskip
\noindent
(8) (a) It is clear that ${\bf v}_1.{\bf v}_2 = {\bf
v}_1.{\bf v}_3 = {\bf v}_2.{\bf v}_3 = 0$. (b) an orthogonal
set is necessarily linearly independent so the dimension of
the span $W$ of these 3 vectors is 3, by the definition of
dimension. (c) the projection of a vector ${\bf x}$ to the
space $W$ is given by
$${\rm proj}_W {\bf x} = \frac{{\bf x}.{\bf v}_1}{{\bf
v}_1.{\bf v}_1}{\bf v}_1 +
\frac{{\bf x}.{\bf v}_2}{{\bf v}_2.{\bf v}_2}{\bf v}_2 +
\frac{{\bf x}.{\bf v}_3}{{\bf v}_3.{\bf v}_3}{\bf v}_3 =
- {\bf v}_1 + 2 {\bf v}_3 = (-1, -1, 2, -2)^T.$$

\bigskip
\noindent
(9) (a) The matrix formed by the 3 vectors (as row
vectors) can be row reduced to
$$A = \begin{pmatrix} 1&1&1\\1&2&2\\1&3&3\end{pmatrix} \sim
\begin{pmatrix} 1&1&1\\0&1&1\\0&2&2 \end{pmatrix} \sim
\begin{pmatrix} 1&0&0\\0&1&1\\0&0&0\end{pmatrix}.$$The null
space $V^{\perp}$ is spanned by the vector $(0, 1, -1)^T$.
(b) The matrix formed by the 3 vectors (as column
vectors) can be row reduced to
$$A = \begin{pmatrix} 1&1&1\\1&2&3\\1&2&3\end{pmatrix} \sim
\begin{pmatrix} 1&1&1\\0&1&2\\0&0&0 \end{pmatrix} \sim
\begin{pmatrix} 1&0&-1\\0&1&1\\0&0&0\end{pmatrix}.$$
the equation $A{\bf x} = {\bf c} = (c_1,
c_2, c_3)^T$ is consistent if and only if ${\bf c}$ is a
linear combination of the vectors ${\bf u}_1 = (1, 1, 1),
{\bf u}_2 = (1, 2, 2)$, i. e., $$c_1 = a + b, c_2 = a + 2b,
c_3 = a + 2 b, a, b \in {\bf R}.$$ (c) infinitely many.

\bigskip
\noindent
(10) The points are $(-1, 1), (0,1), (1, 0), (2, 2)$,
$$A = \begin{pmatrix}
1&-1&1\\1&0&0\\1&1&1\\1&2&4\end{pmatrix},\;{\bf b} =
\begin{pmatrix}
1\\1\\0\\2\end{pmatrix},$$
$$A^T = \begin{pmatrix}
1&1&1&1\\-1&0&1&2\\1&0&1&4\end{pmatrix},\;A^T {\bf b} =
\begin{pmatrix} 1&1&1&1\\-1&0&1&2\\1&0&1&4\end{pmatrix}
\begin{pmatrix}
1\\1\\0\\2\end{pmatrix} = \begin{pmatrix}
4\\3\\9\end{pmatrix},$$
$$A^T A = \begin{pmatrix}
1&1&1&1\\-1&0&1&2\\1&0&1&4\end{pmatrix}\begin{pmatrix}
1&-1&1\\1&0&0\\1&1&1\\1&2&4\end{pmatrix} = \begin{pmatrix}
4&2&6\\2&6&8\\6&8&18\end{pmatrix}.$$To find $\hat{{\bf x}}$
row reduce the augmented matrix,
$$\begin{pmatrix}
4&2&6&4\\2&6&8&3\\6&8&18&9\end{pmatrix}.$$

\bigskip
\noindent
(11) The vectors are ${\bf v}_1 = (-1, 3, 1, 1), {\bf v}_2 =
(6, -8, -2, -4), {\bf v}_3 = (6, 3, 6, -3)$. First find an
orthogonal basis ${\bf u}_1, {\bf u}_2, {\bf u}_3$ with
${\bf u}_1 = {\bf v}_1$,
$${\bf u}_2 = (6, -8, -2, -4) + 3 (-1, 3, 1, 1) = (3, 1,
1, -1)$$
\begin{align*}{\bf u}_3 = (6, 3, 6, -3) - \frac{1}{2}(-1, 3,
1, 1) - \frac{5}{2}(3, 1,
1, -1) = (-1, -1, 3, -1).\end{align*}Then normalize these
vectors:
$${\bf w}_1 = \frac{{\bf u}_1}{2 \sqrt{3}}, {\bf w}_2 =
\frac{{\bf u}_2}{2 \sqrt{3}}, {\bf w}_3 = \frac{{\bf
u}_3}{2 \sqrt{3}}.$$Now form a matrix $Q$ with ${\bf w}_1,
{\bf w}_2, {\bf w}_3$ as column vectors:
$$Q = \frac{1}{2 \sqrt{3}} \begin{pmatrix}
-1&3&-1\\3&1&-1\\1&1&3\\1&-1&-1\end{pmatrix}$$
  Then $R = Q^TA$
where $A$ is the matrix formed by taking the 3 original
vectors ${\bf v}_1,
{\bf v}_2, {\bf v}_3$ as column vectors:
$$A = \begin{pmatrix}
-1&6&6\\3&-8&3\\1&-2&6\\1&-4&-3\end{pmatrix}$$
$$R = \frac{1}{2 \sqrt{3}} \begin{pmatrix}
-1&3&1&1\\3&1&1&-1\\-1&-1&3&-1\end{pmatrix}
\begin{pmatrix}
-1&6&6\\3&-8&3\\1&-2&6\\1&-4&-3\end{pmatrix} =
\frac{1}{2 \sqrt{3}} \begin{pmatrix}
12&-36&6\\0&12&30\\0&0&12\end{pmatrix}.
$$

\bigskip
\noindent
(12) First compute
$$A^TA = \begin{pmatrix}
1&2&-1\\2&4&-2\end{pmatrix}\begin{pmatrix}
1&2\\2&4\\-1&-2\end{pmatrix} = \begin{pmatrix}
6&12\\12&24\end{pmatrix}$$
$$A^T {\bf b} = \begin{pmatrix}
1&2&-1\\2&4&-2\end{pmatrix}\begin{pmatrix}
3\\2\\1\end{pmatrix} = \begin{pmatrix}
6\\12\end{pmatrix}$$then solve the equation $A^TA {\bf x} =
A^T{\bf b}$
$$\begin{pmatrix}
6&12\\12&24\end{pmatrix} \begin{pmatrix}
x_1\\x_2\end{pmatrix} = \begin{pmatrix}
6\\12\end{pmatrix}$$hence $x_1 = 1, x_2 = 0$.

\end{document}

\end{document}