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

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

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

% Use this one to print questions and answers.
%\usepackage[answers]{mathtest-edit27apr}[2001/05/12]
%\let\anotherpage\relax
%\let\hrulefill\relax
%\def\myvspace#1{\myvspace{#1}}
%\def\myvspace#1{\relax}

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

% Basic User Defs

\def\ds{\displaystyle}
\def\BF#1{{\bf #1}}
\def\checkbox{\fbox{$\phantom{X}$}~}


% Beginning of the Document

\begin{document}
\examtitle{MATH 2270-2}{Final Exam}{Spring 2017}

\studentinfo

\finishfirstpage
\instructions{No books, notes or electronic devices, please.\\
The questions have credits which reflect the time required to write the solution.\\
If you must write a solution out of order or on the back side, then supply a road map.\\
Solutions are expected to include readable and convincing details. A correct answer without details earns 25\%.\\
Expect about 3 to 10 minutes per problem. Final exam problems may have multiple parts.
}

\anotherpage

%\section*{Chapter 1}


\problem{50}{
Consider the system $A\vec{u}=\vec{b}$ with  $\vec{u}=\minicolvector{x_1\\ x_2\\ x_3\\ x_4\\ x_5}$ defined by
\begin{align*}
  x_1+3x_2+4x_3+x_4 + x_5 = 2\\
 2x_1+x_2+8x_3+x_4 + 2x_5= 4\\
 2x_1+2x_2+8x_3+x_4 + x_5= 2\\
\end{align*}
Solve the following parts (a) to (e):
\begin{enumerate}
\item[{\bf (a)}] [10\%] Find the reduced row echelon form of the augmented matrix.

\hrulefill
\myvspace{3in}

\item[{\bf (b)}] [10\%] Write the scalar equations corresponding to the answer in (a). Then
identify the {\bf free} variables and the {\bf lead} variables.

\hrulefill
\anotherpage
\item[{\bf (c)}] [10\%] Display a formula for the {\bf vector} general solution $\vec{u}$.

\hrulefill
\myvspace{1.2in}

\item[{\bf (d)}] [10\%] Extract from the answer in (c) vector formulas for a particular solution $\vec{u}_p$ and the homogeneous solution $\vec{u}_h$.
    
 \hrulefill
\myvspace{2in}
   
\item[{\bf (e)}] [10\%] Extract from the answer in (d) a vector solution basis for $A\vec{u}=\vec{0}$. These vectors
 are called {\bf Strang's Special Solutions}.
 
 \hrulefill

\end{enumerate}
}{}{Infinite solution case: RREF(A)= $\left[ \begin {array}{cccccc} 1&0&4&0&0&-2\\ \noalign{\medskip}0&1&0&0
&-1&-2\\ \noalign{\medskip}0&0&0&1&3&10\end {array} \right]
$.}
{Chapter 1}
% A:=<1,3,4,1,1|2,1,8,1,2|2,2,8,1,1>^+;b:=<2,4,2>;with(LinearAlgebra):LinearSolve(A,b);ReducedRowEchelonForm(<A|b>);
% rref(a)=[[1, 0, 4, 0, 0, -2], [0, 1, 0, 0, -1, -2], [0, 0, 0, 1, 3, 10]]


\anotherpage



\problem{40}{~\\
Define $A=\twobytwo{1&4}{1&5}$ and $B=A+A^T$, where $A^T$ is the transpose of $A$.

\begin{enumerate}
 \item[{\bf (a)}] [20\%] Apply two different methods to find the inverse of the matrix $A$.
 
 \hrulefill
\myvspace{3in}

 \item[{\bf (b)}] [20\%] Compute $(B^{-1})^T$.
 
 \hrulefill


 \end{enumerate}
}{}{(a) $A^{-1}=\left[ \begin {array}{cc} 5&-4\\ \noalign{\medskip}-1&1\end {array}
 \right]
$
\\
The two methods are (1) $A^{-1}=\frac{\adj(A)}{|A|}$ and (2)
For $C=<A|I>$, then $\rref(C)=<I|A^{-1}>$. Details expected, but not supplied here.
\\
(b)$B= \left[ \begin {array}{cc} 2&5\\ \noalign{\medskip}5&10\end {array}
 \right]
$\\\
$B=B^T$ so we compute only $B^{-1}$.
\\
 $B^{-1} = \left[ \begin {array}{cc} -2&1\\ \noalign{\medskip}1&-2/5\end {array}
 \right]
$ }
{Chapter 2}
% A:=<1,4|1,5>^+; 1/A;


\anotherpage


%\section*{Chapter 3}



\problem{30}{
Let $P,Q,R$ be real numbers. Define matrix $A$ and vector $\vec{b}$ by the equations
$$A=\left(\begin{array}{rrrr}
 -2 &  2 & 0  \\
  0 & -1 &  4  \\
  1 &  0 &  -2
 \end{array}\right), \quad \vec{b}=\colvector{P\\ Q \\ R }.$$
Find the value of $x_2$ by Cramer's Rule
in the system $A\vec{x}=\vec{b}$.
}{}
{in progress: $x_2=\Delta_2/\Delta$, $\Delta_2=\det\threebythree{-2 & P & 0}{0 & Q & 4}{1 & R & -2}=4P+4Q+8R$, $\Delta=\det(A)=4$, $x_2=P+Q+2R$. }
{Chapter 3}
% A:=<-2,2,0|0,-1,4|1,0,-2>^+; Determinant(A);A2:=<-2,P,0|0,Q,4|1,R,-2>^+;Determinant(A2);
% x2 = 4*Q+8*R+4*P divided by 4 = P+Q+2R



\anotherpage



\problem{20}{It is known that functions $x$, $\cos (x)$, $e^x$ are independent in the vector space $V$ of all functions on $(-\infty,\infty)$. Define functions in $V$ by the equations $f_1(x)=x+e^x$, $f_2(x)=2x-e^x$, $f_3(x)=3\cos(x) + x + e^x$.

{\bf Definition}: {\small\it An Euler solution atom is a base atom multiplied by a factor $x^ne^{ax}$ where $n=0,1,2,\ldots$ and $a$ is a real constant. A base atom is one of $1$, $\cos(bx)$, $\sin(bx)$ where $b>0$ is real.}

Check the independence tests below which apply to prove that the functions $f_1,f_2,f_3$ are independent in the vector space $V$. Don't check one which won't work!

\begin{center}\begin{tabular}{llp{0.6\textwidth}}
 \checkbox~ & \bf Wronskian test & Wronskian of $\vec{f}_1,\vec{f}_2,\vec{f}_3$ nonzero at $x=x_0$ implies independence of $\vec{f}_1,\vec{f}_2,\vec{f}_3$. \\
 \checkbox~ & \bf Euler Solution Atom test & Any finite set of distinct Euler atoms is independent.\\[1ex]
 \checkbox~ & \bf Sample test & Functions $\vec{f}_1,\vec{f}_2,\vec{f}_3$ are independent if a sampling matrix has nonzero determinant.\\[1ex]
 \end{tabular}\end{center}
}{}{in progress
}
{Chapters 1 to 4}

\anotherpage

\problem{30}{It is known that functions $x$, $\cos (x)$, $e^x$ are independent in the vector space $V$ of all functions on $(-\infty,\infty)$. Define functions in $V$ by the equations $f_1(x)=x+e^x$, $f_2(x)=2x-e^x$, $f_3(x)=3\cos(x) + x + e^x$.

{\bf (a)} [10\%] Independence of the functions $f_1,f_2,f_3$ in the vector space $V$ can be established using the coordinate map
$$c_1x + c_2e^x + c_3\cos(x)\quad\mbox{maps into}\quad \minicolvector{c_1\\ c_2\\ c_3}.$$
Reformulate the independence of functions $f_1,f_2,f_3$ into independence of column vectors $\vec{v}_1, \vec{v}_2, \vec{v}_3$ in the vector space $\Rr^3$.

\hrulefill
\myvspace{3in}

{\bf (b)} [10\%]
Show details for {\bf one} of the tests below applied to $\vec{v}_1, \vec{v}_2, \vec{v}_3$, defined in part (a).

\hrulefill

\anotherpage

{\bf (c)} [10\%]
Check all tests below that may be applied to $\vec{v}_1, \vec{v}_2, \vec{v}_3$, as defined in part (a). Don't check a test which won't work!

\begin{center}\begin{tabular}{llp{0.6\textwidth}}
  \checkbox~ & \bf Rank test & Vectors $\vec{v}_1,\vec{v}_2,\vec{v}_3$ are independent if their augmented matrix has rank 3. \\
 \checkbox~ & \bf Determinant test & Vectors $\vec{v}_1,\vec{v}_2,\vec{v}_3$ are independent if their square augmented matrix has nonzero determinant. \\
  \checkbox~ & \bf Pivot test & Vectors $\vec{v}_1,\vec{v}_2,\vec{v}_3$ are independent if their augmented matrix $A$ has 3 pivot columns.\\[1ex]
 \checkbox~ & \bf Orthogonality test & A set of nonzero pairwise orthogonal vectors is independent.\\[1ex]
 \checkbox~ & \bf Combination test & A list of vectors is independent if each vector is not a linear combination of the preceding vectors.
\end{tabular}\end{center}
}{}{in progress
}
{Chapters 1 to 4}
\anotherpage

\problem{20}{
Define $S$ to be the set of all vectors
$\vec{x}$ in $\Rr^{3}$ such that $x_1+2x_3-x_2=0$, $x_3=0$ and $x_3+x_2=x_1$.
Supply the proof details which verify that
$S$ is a subspace of $\Rr^{3}$.
}{}
{in progress\\
Let $A=\left(\begin{array}{rrr}
  1 & -1 &  2  \\
  0 & 0 &  1  \\
  1 & - &  -1
 \end{array}\right)$. Then the restriction equations can be written as $A\vec{x}=\vec{0}$. Apply the nullspace theorem (also called
the kernel theorem), which says that the nullspace of a matrix is a subspace.
\\
 Another solution: The given
restriction equations are linear homogeneous algebraic equations.
Therefore, $S$ is the nullspace of some matrix $B$, hence a subspace of $\Rr^3$.
This solution uses the fact that linear homogeneous algebraic equations can be written as a matrix equation $B\vec{x}=\vec{0}$.
\\
Another solution: Verify the three checkpoints for a subspace $S$ in the Subspace Criterion.
This is quite long, and certainly the last choice for a method of proof.
}
{Chapters 2, 4}
\anotherpage


%\section*{Chapter 4}

% chapter 4
\problem{40}{
Let $S$ be the subspace of $\mathbb{R}^4$ spanned by the vectors
$$\vec{x}_1=\begin{pmatrix}1\\1\\1\\0\end{pmatrix},\quad
\vec{x}_2=\begin{pmatrix}1\\-1\\0\\1\end{pmatrix},\quad \vec{x}_3=\begin{pmatrix}1\\1\\0\\1\end{pmatrix}.$$
 
{\bf (a)} [10\%] Explain, by citing a theorem, why $S$ is a subspace.
 
 \hrulefill
 \myvspace{1.2in}
 
{\bf (b)} [30\%] Find a Gram-Schmidt orthonormal basis $\vec{u}_1, \vec{u}_2, \vec{v}_3$
for subspace $S$.

\hrulefill
}{}{Let $\vec{v}_1=\vec{x}_1$ and
$\vec{u}_1=\frac{1}{\|\vec{v}_1\|}\vec{v}_1$. Already $\vec{x}_1 \cdot \vec{x}_2=0$, therefore
take $\vec{v}_2=\vec{x}_2$ and $\vec{u}_2=\frac{1}{\|\vec{v}_2\|}\vec{v}_2$.
Define $\vec{v}_3=\vec{x}_3$ - (shadow projection of $\vec{x}_3$ onto $\vec{u}_1$) - (shadow projection of $\vec{x}_3$ onto $\vec{u}_2$).
Then$\vec{v}_3=\colvector{0\\,\frac23\\ -\frac23\\ \frac23}$.
Finally, $\vec{u}_3=\frac{1}{\|\vec{v}_3\|}\vec{v}_3$.
We report the Gram-Schmidt basis:
$$\vec{u}_1=\frac{1}{\sqrt3}\colvector{1\\ 1\\ 1\\ 0 },\quad
\vec{u}_2 =\frac{1}{\sqrt3}\colvector{1 \\ -1 \\ 0 \\ 1},\quad
\vec{u}_3=\frac{\sqrt3}{2}\colvector{0\\,\frac23\\ -\frac23\\ \frac23}.$$
}
{Chapter 6}


\anotherpage

\problem{30}{% Edited 27 apr
Let $A$ be an $m\times n$ matrix and assume that $A^TA$ has rank $n-1$. Prove that the
rank of $A$ cannot equal $n$.

\hrulefill
}{
in progress
}{}
{Chapters 1 to 6}


\anotherpage

%\section*{Chapter 6}




\problem{40}{The matrix $A$ below has eigenvalues $2$, $3$ and $3$.
Compute all eigenpairs of $A$.
Is $A$ diagonalizable?
$$
 A=\left(\begin{array}{rrrr}
 4 & 1 & 1 \\
 -1 & 2 & 1 \\
 0 & 0 &  2
 \end{array}\right)$$
 
 \hrulefill
}{}{Compute $\rref(A-3I)=\threebythree{1&1&0}{0&0&1}{0&0&0}$. This has rank 2, nullity 1. There is just one eigenvector $\colvector{1\\ -1 \\ 0}$ for $\lambda=3$. Not diagonalizable, not possible to display three eigenpairs. The eigenvector for $\lambda=2$ is $\colvector{-2\\ 5 \\ 1}$.
}
{Chapter 5}

%A:=matrix([[4 , 1 , -1 ],
%%  [-1 , 2 , -2 ],
%%  [0 , 0 ,  3  ]]);eigenvals(A);
% \hrulefill
%




\anotherpage

\problem{30}{
 Define $A=\left(\begin{array}{rr}1&1\\1&-1\\1&0\end{array}\right)$ and $\vec{\bf b}=\colvector{2\\ 3\\ 1}$. Let $W$ be the column space of $A$. Write the normal equations for the inconsistent problem $A\vec{x}=\vec{b}$ and solve for the least squares solution $\vec{\hat{x}}$.
 
 Remark. {\small\it Vector $\vec{\hat{\bf b}}=A\vec{\hat{x}}$ is the near point to $\vec{\bf b}$ in the subspace $W$.}
 
 \hrulefill
}{}{The columns of $A$ are independent. The normal equation is $A^TA\vec{y}=A^T\vec{b}$, which in explicit form is $\twobytwo{3&0}{0&2}\vec{y} = \colvector{1\\ 0}$.  The answer is $\vec{\hat{x}}=\colvector{2\\ -\frac12}$. Then
$\vec{\hat{\bf b}}=A\vec{y}=\colvector{\frac32\\ \frac52\\ 2}$.}
{Chapter 6}
% A:=<1,1|1,-1|1,0>^+;b:=<2,3,1>;LinearSolve(A,b);LinearSolve(A^+ . A,A^+ . b);LeastSquares(A,b);


\anotherpage


\problem{30}{
Given vectors $\vec{q}_1, \vec{q}_2, \vec{q}_3$ in $\Rr^3$, define  
$$A=2 \vec{q}_1\vec{q}_1\,^T +5\vec{q}_2\vec{q}_2\,^T+7\vec{q}_3\vec{q}_3\,^T.$$

{\bf (a)} [10\%] Prove that $A$ is symmetric. 

\hrulefill

\myvspace{2in}

{\bf (b)} [20\%] The Spectral Theorem for symmetric matrices produces a similar formula where $2,5,7$ are replaced by the eigenvalues of $A$. Write the formula for $3\times 3$ matrices $A$ and explain all the symbols used in the formula.

\hrulefill
}{}{in progress\\
Define $A=Q^TDQ$ where $Q$ is the augmented matrix of the vectors. Then $A$ is symmetric. Let $D$ be the diagonal matrix with entries $2,5,7$.
Then the identity is true by the Spectral Theorem for symmetric matrices. For simplicity, take the three vectors to be the columns of the identity, then $Q^T=Q=I$ and the claimed identity follows is part of the Spectral Theorem for symmetric matrices.
}
{Chapter 6}
\anotherpage




\problem{30}{
The spectral theorem says that a symmetric matrix $A$ satisfies $AQ=QD$ where $Q$ is orthogonal and $D$ is diagonal. Find $Q$ and $D$ for the symmetric matrix
$A=\begin{pmatrix}4 & -1\\ -1 &4\end{pmatrix}$.

\hrulefill
}{}{in progress\\
% A:=<5,1|1,5>;Eigenvalues(A);Eigenvectors(A);
%4,6
Start with the equation $r^2-10r+24=0$ having roots $r=4,6$. Compute the eigenpairs  $(4,\vec{v}_1)$, $(6,\vec{v}_2)$ where
$\vec{v}_1=\colvector{1\\ 1}$ and $\vec{v}_2=\colvector{-1\\ 1}$. The two vectors are orthogonal but not of unit length. Unitize them to
get $\vec{u}_1=\frac{1}{\sqrt2}\vec{v}_1$,  $\vec{u}_2=\frac{1}{\sqrt2}\vec{v}_2$. Then $Q=<\vec{u}_1 | \vec{u}_2>=\frac{1}{\sqrt2}\twobytwo{1&-1}{1&1}$,
$D=\diag(4,6)$.
}
{Chapter 7}

\anotherpage



\problem{40}{
Write out the singular value decomposition for the matrix
$A=\twobytwo{5&1}{1&5}$.

\hrulefill
}{}{in progress
}
{Chapter 7}
%A:=<5,1|1,5>;Eigenvalues(A);Eigenvectors(A);Determinant(A-r*IdentityMatrix(2));
%s,V1:=Eigenvectors(A^+ . A);sig:=<6,0|0,4>;
%V:=simplify(V1.(1/sqrt(2)));v1:=V[1..2,1];v2:=V[1..2,2];A.v1/6;A.v2/4;
%u1:=A.v1/6;u2:=A.v2/4;U:=<u1|u2>;U.sig.V^+;


\anotherpage

\problem{30}{
Let the linear transformation $T$ from $\Rr^2$ to $\Rr^2$
be defined by its action on two independent vectors:
$$
T\left(\begin{pmatrix}3\\ 2\end{pmatrix}\right)=
\begin{pmatrix}4\\ 2\end{pmatrix},\quad
T\left(\begin{pmatrix}2\\ 1\end{pmatrix}\right)=
\begin{pmatrix}5 \\ 1\end{pmatrix}
.$$
Find the unique $2\times 2$ matrix $A$ such that $T$ is defined
by the matrix multiply equation $T(\vec{x})=A\vec{x}$

\hrulefill
}{}{in progress\\
}
{Chapter 4}

\anotherpage
\problem{40}{ 
Let $A$ be an $m\times n$ matrix. Denote by $S_1$ the row space of of
$A$ and $S_2$ the column space of $A$. Using only the Pivot Theorem 
and the Toolkit of swap, combo, multiply,
prove that $S_1$ and $S_2$ have the same dimension.

\hrulefill
}{}{in progress
}
{Chapter 4, 7}

\anotherpage

\problem{20}{
Least squares can be used to find the best fit line $y=ax+b$ for the
points $(1,2)$, $(2, 2)$, $(3,0)$. Find the line equation by the method of least squares.
}{}{Find a matrix equation $A\vec{x}=\vec{B}$ using the line equation $y=ax+b$ where $\vec{x}=\colvector{a\\ b}$. Then solve the normal equation $A^TA\vec{v}=A^T\vec{B}$.
A full solution is expected, with a formula for $A$. Solve the normal equation and report $a,b$.
}
{Chapter 4}


\anotherpage

\anotherpage
\problem{20}{
State the Fundamental Theorem of Linear Algebra. Include {\bf Part 1}:
The dimensions of the four subspaces, and {\bf Part 2}: The
orthogonality equations for the four subspaces.

\hrulefill
}{}{Part 1. The dimensions are $n-r,r,rm-r$ for nullspace(A), colspace(A), rowspace(A), nullspace($A^T$).
Part 2. The orthogonality relation is rowspace $\perp$ nullspace, for both $A$ and $A^T$.
A full statement is expected, not the brief one given here.}
{Chapters 1 to 7}

\iffalse
\anotherpage

\problem{20}{
State the {\bf Spectral Theorem} for symmetric matrices. Then write a paragraph about the important results developed for the spectral theorem: real eigenvalues, orthogonality, diagonalizability and the use of Gram-Schmidt.

\hrulefill
}{}{
A real symmetric $n\times n$ matrix $A$ has only real eigenvalues. Matrix $A$ has $n$ eigenpairs, in short it is is diagonalizable. To each eigenvalue of multiplicity $k$, there are $k$ independent eigenvectors. These eigenvectors span a subspace of dimension $k$ which by Gram-Schmidt is spanned by $k$ orthonormal vectors. Two such subspaces corresponding to different eigenvalues are orthogonal. The spectral decomposition of $A$ is $A=QDQ^T$ where $D$ is a diagonal matrix of eigenvalues and $Q$ is an orthogonal matrix of corresponding eigenvectors.
}
{Chapter 7}


\fi

%\phantom{page}
%\anotherpage


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

\problemsdone
\end{document}

% End of the Document
