
\documentclass[12pt]{article}
\usepackage{linalg2270strang}
\usepackage{epsfig,amsmath,amsthm,amssymb, verbatim}

% Use this one to print just the question sheet.
%\usepackage[questions]{mathtest}[2001/05/12]

% Use this one to print an entire exam booklet.
\usepackage[answersheet]{mathtest}[2001/05/12]

% Use this one to print questions and answers.
%\usepackage[answers]{mathtest}[2001/05/12]

% For use with pdflatex
% \pdfpagewidth\paperwidth
% \pdfpageheight\paperheight

% Basic User Defs

\def\ds{\displaystyle}


% Beginning of the Document

\begin{document}
\examtitle{MATH 2270-2}{Exam 2}{S2012}
\thispagestyle{empty}
\studentinfo
\instructions{No books or notes. No electronic devices, please.\\
These problems have credits 10 to 25, which is an estimate of the time
required to write the solution.
\vspace*{1pc}
}


\finishfirstpage
\setcounter{page}{1}
% Problems Start Here % ----------------------------------------------------- %
\problem{15}{% April 1, 2012
Let $A=\begin{pmatrix}
1 & 0 \\
1 & 1 \\
0 & 2
\end{pmatrix}$. Find a basis of vectors for each of the four fundamental subspaces, which are the nullspaces of $A$, $A^T$ and
the column spaces of $A$, $A^T$.
}{}{
The most efficient way to begin is to compute $\rref(A)=\begin{pmatrix}
1 & 0 \\
0 & 1 \\
0 & 0
\end{pmatrix}$. Then the last frame algorithm implies the nullspace of $A$ is the zero vector. The computation
also says that the rank of $A$ is two, so the first two rows of $A$ are independent. Finally, the pivot columns of $A$ are columns 1,2.

{\bf Nullspace}: As above, the nullspace of $A$ is the zero vector.

{\bf Row space}: Rows 1 and 2 of A are a basis, because they are independent. Because the row space is in $\Rr^2$ and has dimension 2, then the row space equals $\Rr^2$.

{\bf Column space}: Columns 1 and 2 are the pivot columns of $A$, and they are a basis. It is a proper 2-dimensional subspace of $\Rr^3$.

{\bf Left nullspace}: The easiest plan is to find the nullspace of $A^T=\begin{pmatrix}
1 & 1 & 0 \\
0 & 1 & 2
\end{pmatrix}$. Then $\rref(A^T)=\begin{pmatrix}
1 & 0 & -2 \\
0 & 1 & 2
\end{pmatrix}$, which implies one free variable and special solution $\colvector{2 \\ -2 \\ 1}$, which is a basis for the left nullspace of $A$,
briefly $\SPAN\left( \colvector{2 \\ -2 \\ 1} \right)$.
}

\anotherpage

\problem{25}{%
Assume $V=\SPAN(\vec{v}_1,\vec{v}_2,\vec{v}_3)$ with $\vec{v}_1=\begin{pmatrix}1\\ 0\\ 1\\0\end{pmatrix},
\vec{v}_2=\begin{pmatrix}0 \\1 \\0 \\ 1\end{pmatrix}, \vec{v}_3=\begin{pmatrix}0 \\1 \\1 \\ 1\end{pmatrix}$. Find the Gram-Schmidt orthonormal vectors $\vec{q}_1,\vec{q}_2,\vec{q}_3$
whose span equals $V$.
}{}{
$$ \vec{q}_1 = \colvector{\frac{1}{\sqrt2} \\ 0 \\ \frac{1}{\sqrt2} \\ 0 },\quad
\vec{q}_2 = \colvector{0 \\ \frac{1}{\sqrt2} \\ 0 \\ \frac{1}{\sqrt2} },\quad
\vec{q}_3 = \colvector{-\frac{1}{\sqrt2} \\ 0 \\ \frac{1}{\sqrt2} \\ 0 }.
$$
Vector $\vec{v}_1$ is not of length 1, it has length $\sqrt{1^2+0^2+1^2+0^2}=\sqrt2$. Let
$\vec{q}_1$ be the unit vector $\frac{1}{\sqrt2}\vec{v}_1$. The vector $\vec{q}_2$ is already orthogonal to $\vec{q}_1$.
It also has length $\sqrt2$. Then $\vec{q}_2=\frac{1}{\sqrt2}\vec{v}_2$.

We have to do some work to find $\vec{q}_3$.

According to the theory, $\vec{q}_3$ equals $\vec{y}_3$ divided by $\| \vec{y}_3 \|$ and $\vec{y}_3 = \vec{v}_2$ minus the shadow projection vector
of $\vec{v}_3$ onto $\SPAN(\vec{v}_1)$ minus the shadow projection of $\vec{v}_3$ onto $\SPAN(\vec{v}_2)$. Then
$$\begin{array}{rcl}
\vec{y}_3 &=& \vec{v}_3 - c_1 \vec{v}_1 - c_2 \vec{v}_2,\\
c_1 &=& \dd\frac{\vec{v}_1\cdot \vec{v}_3}{\vec{v}_1\cdot\vec{v}_1} = \frac{1}{2},\\
c_2 &=& \dd\frac{\vec{v}_2\cdot \vec{v}_3}{\vec{v}_2\cdot\vec{v}_2}\frac{2}{2}.
\end{array}
$$
Finally, $$\vec{y}_3 = \begin{pmatrix}0\\ 1\\
  1\\ 1\end{pmatrix}-\frac{1}{2}\begin{pmatrix}1\\ 0\\ 1\\
  0\end{pmatrix}-\frac{2}{2}\begin{pmatrix}0\\ 1\\ 0\\
  1\end{pmatrix}=\begin{pmatrix}
-\frac{1}{2}\\ 0 \\ \frac{1}{2}\\0
\end{pmatrix}$$

The
length is $\| \vec{y}_3 \|=\sqrt{(-\frac{1}{2})^2+0^2+(\frac{1}{2})^2+0^2}=\frac{1}{\sqrt2}$.
Then $\vec{q}_3=\sqrt2\begin{pmatrix}
-\frac{1}{2}\\ 0 \\ \frac{1}{2}\\0 \end{pmatrix}$
and
$\{ \vec{q}_1,\vec{q}_2,\vec{q}_3 \}$ is an orthonormal basis of $V$.
}

\anotherpage




\problem{15}{
Find the least squares best fit line $y=v_1x+v_2$ for the points $(1,1)$, $(2, 3)$,
$(3, 1)$, $(4,4)$.}{}{
Substitute the points $(x,y)$ into $y=v_1x+v_2$ to obtain 3 equations in the two unknowns $v_1,v_2$.
Write the equations as a system $A\vec{v}=\vec{b}$, using
$$A=\begin{pmatrix}1 & 1\\ 2 & 1\\ 3 & 1 \\ 4 & 1\end{pmatrix},\quad \vec{b}=\begin{pmatrix} 1\\ 3 \\ 1 \\ 4\end{pmatrix}$$
Unfortunately, $\vec{b}$ is not in the column space of $A$, so $A\vec{v}=\vec{b}$ has no solution. The normal equations $A^TA\vec{v}=A^T\vec{b}$
give a least squares solution
$$\vec{v}=(A^TA)^{-1}A^T\vec{b}$$
Compute $A^TA=\begin{pmatrix}30 & 10\\10 & 4\end{pmatrix}$, then
$(A^TA)^{-1}=
\frac{1}{10}\begin{pmatrix}2 & -5\\-5 &  15\end{pmatrix}$ and
$$A^Tb=\begin{pmatrix} 26 \\ 9 \end{pmatrix}$$
Finally,
$$\vec{v}=(A^TA)^{-1}A^T\vec{b}=
\frac{1}{10}\begin{pmatrix}2 & -5\\-5 &  15\end{pmatrix}
\begin{pmatrix} 26 \\ 9 \end{pmatrix}=
\begin{pmatrix}  \frac{7}{10} \\ \frac12 \end{pmatrix}$$
The best fit line $y=v_1 x + v_2$ is given by
\[y=\frac{7}{10}x+\frac{1}{2}\]
}

\anotherpage


\problem{20}{
Let
$A=\begin{pmatrix}
2 & 0 & 0 & 0 & 0  \\
0 & 2 & 1 & 0 & 0  \\
0 & 0 & 2 & 0 & 0  \\
0 & 0 & 0 & 3 & 1  \\
0 & 0 & 0 & 0 & 3
\end{pmatrix}$. Find all eigenpairs.
}{}{
The eigenvalues are the diagonal entries
2, 2, 2, 3, 3. Double and triple roots exist, but it is sometimes false that there will be $n$ eigenpairs ($n=5$ here). For $\lambda=2,2,3$
the corresponding eigenvectors are
\[\begin{pmatrix}1\\ 0\\ 0\\0 \\0\end{pmatrix},
\begin{pmatrix}0\\ 1\\ 0\\0 \\0\end{pmatrix},
\begin{pmatrix}0\\ 0\\ 0\\1 \\0\end{pmatrix}\]
REMARK. Jordan Theory predicts exactly 3 eigenpairs, with two eigenpairs from root $\lambda=2$. The prediction uses the theory of block matrices $\diag(B_1,B_2,B_3)$ and knowledge of examples of Jordan forms. The number of Jordan blocks equals the number of eigenpairs, which is exactly three. Known shortcuts exist for computing the eigenpairs, but these techniques save very little solution time.

ANSWER CHECK. To test the answers, multiply $A\vec{v}$ for an eigenpair $(\lambda,\vec{v})$, then check that the answer
after multiplication simplifies to $\lambda \vec{v}$.
}
\anotherpage


\def\trace{\mbox{\bf trace}}

\problem{15}{
Prove the Cayley-Hamilton Theorem for $2\times 2$ matrices with real
eigenvalues.}{}{
Start with $A=\twobytwo{a&b}{c&d}$, characteristic equation $\lambda^2 +
c_1 \lambda + c_2 = 0$, where $c_1=-\trace(A) = -(a+d)$ and
$c_2=\det(A)=ad-bc$. Write the characteristic equation as
$\lambda^2+c1\lambda = -c_2$, then substitute as in the Cayley-Hamilton
theorem, arriving at the proposed equation $A^2+c_1A = -c_2I$. Expand
the left side: $$A^2+c_1A = A(A+c_1I) = A(A - (a+d)I) = -A\adj(A),\quad
\adj(A)=\twobytwo{d&-b}{-c&a}.$$ Because $A\adj(A) = |A|I$ (the adjugate
identity), then the right side of the preceding display simplifies to
$-\det(A)I = -c_2I$. This proves the Cayley-Hamilton theorem for
$2\times 2$ matrices: $A^2+c_1A = -c_2I$.
}
\anotherpage


        \problem{10}{ How many eigenpairs for
$A=\threebythree{0&1&1}{0&0&0}{0&0&1}$?}{}{ The eigenvalues are on the
diagonal, $0,0,1$.

{\bf Case $\lambda=0$}. Exactly one eigenpair.

For $\lambda=0$ we have
$B=A-\lambda I = A$ and $\rref(B)=\threebythree{0&1&0}{0&0&1}{0&0&0}$.
The equations for $\vec{v}=(x_1,x_2,x_3)$ are $x_2=0,x_3=0,0=0$. Then
$\vec{v}$ is a linear combination of one special solution, because there
is just one free variable, hence one eigenpair.

{\bf Case $\lambda=1$}. Exactly one eigenpair.

This case is analyzed by algebraic multiplicity of $\lambda$, which
equals 1. Then there is one and only one eigenpair, because $1 \le$ geometric
multiplicity = number of eigenpairs $\le$ algebraic multiplicity $=1$.
}
\phantom{page}
\vfill \begin{center} No new questions beyond this point.\end{center}
%\anotherpage

%
%\phantom{page}
%\anotherpage
%
%\phantom{page}
%\anotherpage
%
%\phantom{page}
%\anotherpage
%
%\phantom{page}
%\anotherpage
%
%
%\phantom{page}
%\anotherpage


% Problems End Here % ------------------------------------------------------- %

\problemsdone
\end{document}

% End of the Document
