
\documentclass[12pt]{article}
\usepackage{linalg}
\usepackage{linalg2270strang}
\usepackage{epsfig,amsmath,amsthm,amssymb, verbatim}
\def\checkbox{\fbox{$\phantom{X}$}~}
% Use this one to print just the question sheet.
\usepackage[questions]{mathtest}[2001/05/12]
\let\anotherpage\relax

% 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}{S2017}
\thispagestyle{empty}
\studentinfo
\instructions{Please, no books, notes or electronic devices.\\[1pc]
The last four (4) questions are proofs. Please divide your time accordingly.\\[1pc]
Extra details can be on the back side or on extra pages. Please supply a road map for details not on the front side.\\[1pc]
 Details count 75\% and answers count 25\%.
\\
\vspace*{1pc}
}
%\let\finishfirstpage\relax

\finishfirstpage
\setcounter{page}{1}
% Problems Start Here % ----------------------------------------------------- %
\anotherpage
\problem{100}{
Define matrix $A$, vector $\vec{b}$ and vector variable $\vec{x}$ by the equations
$$A=\left(\begin{array}{rrrr}
 z_1 &  z_2 & 0\\
  0 & z_3  & 0\\
  1 & z_4 & 1
 \end{array}\right), \quad \vec{b}=\colvector{-3 \\ 5\\ 1},\quad \vec{x} = \colvector{x_1\\ x_2\\ x_3}.$$
For the system $A\vec{x}=\vec{b}$, display the formula for $x_2$ according to Cramer's Rule. To save time, {\bf do not compute determinants}!}{}{
%$x_3=\Delta_3/\Delta$, $\Delta=\det\threebythree{-2 & 3& 0}{0 & -4 & 1}{1 & 4 & 1}=8$, %$\Delta_3=\det\threebythree{-2 & 3& -3}{0 & -4 & 5}{1 & 4 & 1}=51$, $x_3= \frac{51}{8}$.
%
%A:=Matrix(
%  [[ -2 , 3 ,0 ],
%  [0 ,  -4 , 0], [1,4,1]]);
% b:=Vector([-3,5,1]);
%  with(linalg):linsolve(A,b); det(A);
%A3:=Matrix(
%  [[ -2 , 3 ,-3 ],
%  [0 ,  -4 , 5], [1,4,1]]);det(A3);
%  # answers =  -3/8, -5/4, 51/8
%
}



\anotherpage

\problem{100}{
Define matrix $A=\threebythree{2&1&0}{6&8&1}{8&14&1}$.
Find a lower triangular matrix $L$ and an upper triangular matrix $U$ such that $A=LU$.
}{}{
%Let $E_1$ be the result of combo(1,2,-1) on $I$, and $E_2$ the result of combo(2,3,-1) on $I$.
%Then $E_2E_1A = U=\threebythree{3&1&0}{0& 2 & 1}{0 & 0 & 3}$. Let $L=E_1^{-1}E_2^{-1}=\threebythree{1&0&0}{1&1&0}{0&1&1}$.

%A:=Matrix([[2, 1, 0], [6, 8, 1], [8, 14, 1]]);
%with(LinearAlgebra):
%P,L,U:=LUDecomposition(A);
%convert(L,list,nested=true);
%convert(U,list,nested=true);
%Id:=Matrix(3,3,shape=identity);
%combo:=(a,s,t,c)->RowOperation(a,[t,s],c);
%swap:=(a,s,t)->RowOperation(a,[t,s]);
%mult:=(a,t,c)->RowOperation(a,t,c);
%A1:=combo(A,1,2,-3);A2:=combo(A1,1,3,-4); A3:=combo(A2,2,3,-2);
%E1:=combo(Id,1,2,-3);E2:=combo(Id,1,3,-4);E3:=combo(Id,2,3,-2);
%1/(E3.E2.E1);
}


\anotherpage
\problem{100}{
Find the complete vector solution $\vec{x} = \vec{x}_h + \vec{x}_p$ for the nonhomogeneous system
$$\left(\begin{array}{rrrrrr}0&3&1&0&0\\
0&3&3&1&1\\
0&0&0&0&0\end{array}\right)
\colvector{x_1 \\ x_2 \\ x_3\\ x_4 \\ x_5} = \colvector{3 \\ 1 \\ 0}.$$
Please display vector answers for both $\vec{x}_h$ and $\vec{x}_p$. The homogeneous solution $\vec{x}_h$ is a linear combination of Strang's special solutions.
Symbol $\vec{x}_p$ denotes a particular solution.
}{}{
%The augmented matrix has reduced row echelon form (last frame) equal to
%the matrix
%$\left(\begin{array}{cccc} 1& 0& -1/6& 1/2\\ 0& 1& 1/2& 1/2\\ 0& 0& 0& 0 \end{array}\right)$.
%Then $x_3=t_1, x_2=-t_1/2+1/2, x_1=t_1/6+1/2$ is the general solution in scalar form. The partial
%derivative on $t_1$ gives the homogeneous solution basis vector
%$\colvector{-1/6\\ -1/2\\ 1}$. Then $\vec{x}_h=c_1\colvector{-1/6\\ -1/2\\ 1}$. Set
%$t_1=0$ in the scalar solution to find a particular solution
%$\vec{x}_p=\colvector{1/2\\ 1/2 \\ 0}$.
%restart;
%with(LinearAlgebra):
%A:=Matrix( [[0,3,1,0,0], [0,3,3,0,1],[0,0,0,0,0]]);b:=<3,1,0>;
%V:=LinearSolve(A,b); # [_t[1], _t[2], -3*_t[2]+3, _t[4], 6*_t[2]-8]
%seq(map(diff,V,_t[i]),i=1..4);
%subs(_t[1]=0,_t[2]=0,_t[3]=0,_t[4]=0,V);
}

\anotherpage
\problem{100}{
%%%Not on the final exam S2012:
Let $V$ be the vector space of all functions on $(-\infty,\infty)$. 
Define subspace $S=\SPAN(\vec{v}_1,\vec{v}_2,\vec{v}_3)$ where $\vec{v}_1,\vec{v}_2, \vec{v}_3$ 
are independent vectors defined respectively by the equations $y=x-1$, $y=1+x^2$, $y=2x+x^2$.
If $\vec{v}=c_1\vec{v}_1 + c_2\vec{v}_2+ c_3\vec{v}_3$, then the uniquely determined constants $c_1,c_2,c_3$
are called the {\em coordinates of $\vec{v}$ relative to the
basis $\vec{v}_1, \vec{v}_2, \vec{v}_3$}.

{\bf Compute} $c_1$, $c_2$, $c_3$ for $\vec{v}$ defined by $y=1+2x+3x^2$
}{}{
%A:=<3,2,1|4,4,1>; v:=<1,2,0>; LinearSolve(A,v); c1,c2=[-1, 1]
$c_1=2, c_2=3, c_3=0$.
}


\anotherpage
\problem{100}{The functions $1$, $x^2$, $x^5$ represent independent vectors $\vec{u}_1,\vec{u}_2,\vec{u}_3$ in the vector space $V$ of
all functions on $0< x < \infty$. The set $S=\SPAN(\vec{u}_1,\vec{u}_2,\vec{u}_3)$ is a subspace of $V$. 
Let vectors $\vec{v}_1,\vec{v}_2,\vec{v}_3$ in $V$ be defined by the functions
$1+x^2, x^5-x^2, 5+2x^5$, respectively. The {\bf coordinate map} defined by 
$$ c_1\vec{u}_1 +c_2\vec{u}_2+c_3\vec{u}_3 \to \minicolvector{c_1\\ c_2\\ c_3}$$
maps the vectors $\vec{v}_1,\vec{v}_2,\vec{v}_3$ into the following images in $\Rr^3$, respectively:
$$\minicolvector{1\\ 1 \\ 0},\quad \minicolvector{0\\ -1 \\ 1},\quad \minicolvector{5 \\ 0 \\ 2}.$$
The independence tests below can decide independence of vectors $\vec{v}_1,\vec{v}_2,\vec{v}_3$ by formulating the independence question in vector space $V$ or in vector space $\Rr^3$, because the coordinate map takes independent sets to independent sets. 

{\bf Check below} all independence tests which apply to decide independence of $\vec{v}_1,\vec{v}_2,\vec{v}_3$.

\begin{center}\begin{tabular}{llp{0.6\textwidth}}
 \checkbox~ & \bf Wronskian test & Wronskian determinant of $f_1,f_2,f_3$ nonzero at $x=x_0$ implies independence of $f_1,f_2,f_3$. \\
 \checkbox~ & \bf Sampling test & Sampling determinant for samples $x=x_1,x_2,x_3$ nonzero implies independence of $f_1,f_2,f_3$. \\
 \checkbox~ & \bf Rank test & Three vectors are independent if their augmented matrix has rank 3. \\
 \checkbox~ & \bf Determinant test & Three vectors are independent if their augmented matrix is square and has nonzero determinant.
\\
 \checkbox~ & \bf Orthogonality test & Three vectors are independent if they are all nonzero and pairwise orthogonal.
\\
 %\checkbox~ & \bf Euler Solution Test & Any finite set of distinct Euler solution atoms is independent.\\[1ex]
 \checkbox~ & \bf Pivot test & Three vectors are independent if their augmented matrix $A$ has 3 pivot columns.
\end{tabular}\end{center}
}{}{
%The first and second apply to the given functions, while the others
%apply only to fixed vectors.
}


\iffalse

%\section*{Chapter 5: Eigenanalysis}
\anotherpage
\problem{100}{Consider a $3\times 3$ real matrix $A$
%$$A=\left(\begin{array}{rrrr}
%  0 & 4 & -1 & 0 \\
% -4 & 0 & -2 & 1 \\
%  0 & 0 &  5 & 1 \\
%  0 & 0 & -3 & 1
% \end{array}\right)$$
%
%A:=matrix([[0 , 4 , -1 ],
%  [-4 , 0 , -2 ],
%  [0 , 0 ,  5  ]]);eigenvals(A);
%
%       # 5, 4 I, -4 I
with eigenpairs
$$\left(2 ,  \colvector{1\\ 4\\ -4}\right),
\quad \left(1+i, \colvector{i\\ 1\\ 0}\right),
\quad \left(1-i, \colvector{-i\\ 1\\ 0}\right).$$
\begin{quote}

 (a) [60\%] Display an invertible matrix $P$ and a
 diagonal matrix $D$ such that $AP=PD$.

 (b) [40\%] Display a matrix product formula for $A$. To save time, {\bf do not evaluate any matrix products}.
\end{quote}
}{}{(a) The columns of $P$ are the eigenvectors and the diagonal entries of $D$ are the eigenvalues $2,1+i,1-i$, taken in the same order.
(b) The matrix formula comes from $AP=PD$, by solving for $A=PDP^{-1}$.}
\fi

\anotherpage
\problem{100}{The matrix
$A=\left(\begin{array}{rrrrr} % [[3, -1, 1], [-1, 3, 1], [-1, -1, 5]]
  3 & -1 & 1 \\
 -1 &  3 & 1  \\
 -1 & -1 & 5
 \end{array}\right)$
 has eigenvalues $3,4,4$. 

\BF{(a)} [80\%] Find all eigenvectors for $\lambda=4$.
To save time, {\bf don't find $\lambda=3$ eigenvectors}. 

\BF{(b)} [20\%] Report whether or not matrix $A$ is diagonalizable. Explain.

% P:=<1,-1,2|1,1,0|1,0,2>^+; DD:=<3,0,0|0,4,0|0,0,4>;A5:=P.DD.(1/P);
% with(LinearAlgebra): Eigenvectors(A5);
}{}{
\iffalse
Because $A-4I=\left(\begin{array}{rrr}
% [[-1, -1, 0], [-1, -1, 0], [-1, -1, 0]]
-1 & -1 & 0  \\
-1 & -1 & 0  \\
-1 & -1 & 0
 \end{array}\right)$ has RREF $B=\left(\begin{array}{rrr}
 1 &  1 & 0  \\
 0 &  0 &  0  \\
 0 &  0 &  0
 \end{array}\right)$, then there are two eigenpairs for $\lambda=4$, with
 eigenvectors $\vec{v}_1=\colvector{-1\\ 1\\ 0}$ and $\vec{v}_2=\colvector{0\\ 0\\ 1}$.
These answers are Strang's special solutions for the homogeneous problem $B\vec{v}=\vec{0}$.
\fi
The matrix is diagonalizable, because there are three eigenpairs.
}

\iffalse
\anotherpage
\problem{100}{
Using the subspace criterion, write three different hypotheses each of which imply that a set
$S$ in a vector space $V$ is not a subspace of $V$. The full statement
of three such hypotheses is called the {\bf Not a Subspace Theorem}.
}{}{(1) If the zero vector is not in $S$, then $S$ is not a subspace.\\
(2) If two vectors in $S$ fail to have their sum in $S$, then $S$ is not
a subspace.\\ (3) If a vector is in $S$ but its negative is not, then $S$ is not a subspace.
}
\fi

\anotherpage
\problem{100}{
Define $S$ to be the set of all vectors
$\vec{x}=\colvector{x_1\\ x_2\\ x_3}$ in $\Rr^{3}$ such that $x_1+x_3=x_2$ and  $x_3x_2=x_1x_2$.
Show that
$S$ is {\bf NOT} a subspace of $\Rr^{3}$, that is, exhibit a counterexample to one of the items in the {\em Subspace Criterion}.
}{}
{
\iffalse
Let $A=\left(\begin{array}{rrr}
  1 & -1 &  1  \\
 -1 & 1 &  1  \\
  1 & 0 &  -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}$. 
\fi
}

\anotherpage
\problem{100}{
Let $A$ be a $4\times 3$ matrix. Assume the columns of $A^TA$ are dependent. Prove or disprove that $A$ has dependent columns.
}{}{
The columns of matrix $B$ are independent if and only if the nullspace of $B$ is the zero vector. If you don't know this result, then find it in Lay's book, or prove it yourself.\\
The columns of $A^TA$ are dependent means there is a vector $\vec{x}\ne \vec{0}$ in the nullspace of $A^TA$. Therefore, $A^TA\vec{x}=\vec{0}$. 
Multiply by $\vec{x}^T$ to get $\vec{x}^TA^TA\vec{x}=\vec{x}\cdot \vec{0} = 0 $. Re-write as $(A\vec{x})\cdot (A\vec{x})=0$ or $\|A\vec{x}\|=0$. Then $A\vec{x}=\vec{0}$ and $\vec{x}\ne\vec{0}$ implies the nullspace of $A$ is the not the zero vector. 
We conclude that the columns of $A$ are dependent.
}

\anotherpage
\problem{100}{Let $3\times 3$ matrices $A$, $B$ and $C$ be
related by $AP=PB$ and $BQ=QC$ for some invertible matrices $P$ and $Q$. Assume $B$ has eigenvalues $2,3,7$.
Prove that matrices $A$ and $C$ also have eigenvalues $2,3,7$.
}{}{The proof depends on the identity $A-rI = PBP^{-1}-rI = P(B-rI)P^{-1}$ and the determinant product theorem $|CD|=|C||D|$. We get $|A-rI|=|P||B-rI||P^{-1}|=|PP^{-1}||B-rI|=|B-rI|$. Then $A$ and $B$ have exactly the same characteristic equation. Similarly, $B$ and $C$ have the same characteristic equation. Therefore, $A$, $B$ and $C$ have the same characteristic equation. So all three matrices has eigenvalues $2,3,7$.}



\anotherpage
\problem{100}{
The {\bf Fundamental Theorem of Linear Algebra} says that the null space of a matrix is orthogonal to the row space of the matrix.\\[1pc]
Let $A$ be an $m\times n$ matrix. Define subspaces
$S_1$ = column space of $A$,
$S_2$ = null space of $A^T$.
Prove that the only vector $\vec{v}$ in both $S_1$ and $S_2$ is the zero vector.
}{}{The fundamental theorem of linear algebra is summarized by {\tt rowspace $\perp$ nullspace}. Apply it to $A^T$. 
Then it says that the two subspaces $S_1 \perp S_2$.
\\
Let $\vec{v}$ belong to both $S_1$ and $S_2$. Because $S_1$ is orthogonal to $S_2$, and $\vec{v}$ is in $S_1$, then $\vec{v}\cdot \vec{x}=0$ for all $\vec{x}$ in $S_2$. But $\vec{v}$ is also in $S_2$, allowing the choice $\vec{x}=\vec{v}$, therefore $\vec{v}\cdot\vec{v}=0$. This means $\|\vec{v}\|=0$, or $\vec{v}=\vec{0}$, as claimed.
This proves the two subspaces $S_1, S_2=$ intersect in the zero vector.
}


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

\problemsdone
\end{document}

% End of the Document
