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

% Use this one to print just the question sheet.
%\usepackage[questions]{mathtest}[2001/05/12]
%\let\vfill\relax\let\anotherpage\relax\let\finishfirstpage\relax
%\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]
%\let\finishfirstpage\relax
%\let\anotherpage\relax

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

% Basic User Defs

\def\ds{\displaystyle}
\usepackage{alltt}

% Beginning of the Document

\begin{document}
\examtitle{MATH 2270-4}{Exam 1}{Spring 2019}

\studentinfo
\instructions{No books or notes. No electronic devices, please.\\
Each question has credit 100, with multiple parts given a percentage of the total 100.\\ If you must write a solution out of order or on
the back side, then supply a road map.
\\
%The actual exam will have the same number of problems, identical problem
%types, on exactly the same topics. Covered on the exam are chapters 1, 2, 3
%from the 2270 textbook [{\bf Lay} et al]. \\~
}
\finishfirstpage
% Problems Start Here % ----------------------------------------------------- %


\problem{100}{%
Matrix Algebra, Chapters 1,2.\\
Symbol $I$ is used below for the $n\times n$ identity. Notation $C^T$ means the transpose of matrix $C$.
Accept as known theorems the following results:

\begin{small}\sf\def\AA{\hspace*{pc}}

\AA{\bf Theorem 1}. If $C$ and $D$ are $n\times n$ and $CD=I$, then $DC=I$.
\newline
\AA{\bf Theorem 2}. If $A$ and $B$ are invertible $n\times n$, then $AB$ is invertible and $\left(AB\right)^{-1}=B^{-1}A^{-1}$.
\newline
\AA{\bf Theorem 3}. If matrices $F$, $G$ have dimensions allowing $FG$ to be defined, then $(FG)^T = G^TF^T$.
\newline
%{\bf Theorem 4}. If matrices $F$, $G$ have dimensions allowing $F+G$ to be defined, then $(F+G)^T = F^T + G^T$.
%\newline
\AA{\bf Theorem 4}. If $C$ is $n\times n$ invertible, then $C^T$ is invertible and $\left(C^T\right)^{-1}=\left(C^{-1}\right)^T$.
%\newline
%{\bf Theorem 6}. If $A$ and $B$ are $n\times n$, then $|AB|=|A||B|$ {\footnotesize (Determinant Product Theorem)}.
%\newline
%{\bf Theorem 7}. Assume $A$ is $n\times n$. Matrix $A$ is invertible if and only $|A|\ne 0$.
\end{small}

\medskip

In the statement below, either invent a counter example or else explain why it is true (citing relevant theorems above).
Used in the theorems is the definition of inverse: $G$ has an inverse $H$ if and only if $GH=I$ and $HG=I$.

%\begin{itemize}
%\item[{\bf (a)}] [50\%]
 \begin{quote} \Large\sf
  If matrices $A$, $B$ are $n\times n$ with $A^TA=I$, then $A^{-1}$ exists and
$A^{-1}(A+B^T) = I + (BA)^T$.
 \end{quote}

%\item[{\bf (b)}] [50\%]~  If matrices $A$, $B$ are $n\times n$ and $A^2B^2$ is not invertible, then both $A$ and $B$ have determinant zero.
%\end{itemize}
}{}{%
TRUE.
Why it is true: \newline
First, $A^TA=I$ implies $AA^T=I$ by Theorem 1. Then $A^T$ is the inverse of $A$ by the definition of inverse: $A^{-1}=A^T$.\newline
$A^{-1}(A+B^T) =A^{-1}A+A^{-1}B^T$ by matrix multiply\newline
$\phantom{A^{-1}(A^{-1}+B^T)}= I + A^{-1}B^T$ by the definition of inverse matrix.\newline
$\phantom{A^{-1}(A^{-1}+B^T)}= I + A^TB^T$ by $A^TA=I$, Theorem 1 and the definition of inverse.\newline
$\phantom{A^{-1}(A^{-1}+B^T)}=(A^{-1}A)^T+(BA)^T$ because of Theorem 3.
\newline
%$\phantom{A(A^{-1}+B)^T}=I+(BA)^T$ because $A$ is invertible.
%\\
%~\\
%(b) FALSE. Let $A=I$ and let $B$ equal the zero matrix. Then $A^2B^2$ is the zero matrix, which has determinant zero and therefore it is not invertible by %Theorem 7.
%However, $|A|=1$ even though $|B|=0$. Conclusion: the hypotheses are true but the conclusion is false.
\relax
}

\vfill\anotherpage
\problem{100}{%
Elementary Matrices and Toolkit Sequences, Chapters 1,2.\newline\noindent\fbox{\begin{minipage}{0.9\textwidth}
{\bf Definition}: {\sf An {\bf elementary matrix} $E$ is the matrix answer after applying exactly one combo, swap or multiply to the identity matrix $I$. An {\bf elimination matrix} $M$
is a product of elementary matrices.}
\end{minipage}}
\medskip
\newline
Let $A$ be a $3\times 4$ matrix. Find the elimination matrix $M$ which
under left multiplication against matrix $A$ performs (1), (2) and (3) below with one matrix multiply.
\begin{itemize}
\item[{\bf (1)}] Replace Row 3 of $A$ with Row 3 minus twice Row 2 to obtain new matrix $A_1$.
\item[{\bf (2)}] Swap Row 1 and Row 3 of $A_1$ to obtain new matrix $A_2$.
\item[{\bf (3)}] Multiply Row 3 of $A_2$ by $1/5$ to obtain new matrix $A_3$.
\end{itemize}
}{}{%
Do (1), (2), (3) in order with $A$ replaced by the identity $I$. The result is $M$.
This answer is identical to the product $M=E_3E_2E_1$ where
\begin{itemize}
\item[{\bf (1)}] $E_1$ represents {\tt combo(2,3,-2)} applied to the identity $I$.
\item[{\bf (2)}] $E_2$ represents {\tt swap(1,3)} applied to the identity $I$.
\item[{\bf (3)}] $E_3$ represents {\tt mult(3,1/5)} applied to the identity $I$.
\end{itemize}
Instead of performing matrix multiplies, we create $E$ with a toolkit sequence as follows:
$$
\begin{array}{l}
\begin{pmatrix}   1 & 0 &  0\\
                  0 & 1 &  0 \\
                  0 & 0 &  1 \end{pmatrix}
\\
 \begin{pmatrix}   1 &  0 &  0\\
                   0 &  1 &  0 \\
                   0 & -2 &  1 \end{pmatrix} \quad\mbox{{\tt combo(2,3,-2)}}
\\
 \begin{pmatrix}   0 & -2 &  1 \\
                   0 &  1 &  0 \\
                   1 &  0 &  0  \end{pmatrix} \quad\mbox{{\tt swap(1,3)}}
\\
 \begin{pmatrix}   0 & -2 &  0 \\
                   0 & 1 &  0 \\
                   \frac15 & 0 &  0  \end{pmatrix} \quad\mbox{{\tt mult(3,1/5)}}
                   \end{array}$$
}
\vfill\anotherpage
\problem{100}{
Linear algebraic equations.\\
System $A\vec{u}=\vec{b}$ with symbols. The Three Possibilities. Chapters 1,2,3.\\[1pc]
Let symbols $a$, $b$ and $c$ denote
constants and consider the system of equations
$$\left\{\begin{array}{rcrcrcrc}
x &+& by&+& cz &=& a \\
2x &+& (b+c)y&-& az &=& -a \\
x &+& cy&+& az &=& -a
\end{array}\right.
$$
Use techniques learned in this course to briefly explain the following facts. Only write what is needed to justify a statement.
\begin{itemize}
\item[{\bf (a)}] [40\%] The system has a unique solution for $(c-b)(2a+c)\ne 0$.

\item[{\bf (b)}] [30\%] The system has no solution if $2a+c=0$ and $a\ne 0$ (don't explain the other possibilities).

\item[{\bf (c)}] [30\%] The system has infinitely many solutions if $a=b=c=0$ (don't explain the other possibilities).
\end{itemize}

}{}{
The system can be written as
$$
\left(\begin{array}{ccc}
1  &  b  & c \\
2  &  b+c  & -a \\
1  &   c   & a \\
\end{array}\right)
\left(\begin{array}{r} x \\ y \\ z
\end{array}\right)
= \left(\begin{array}{r} a \\ -a \\ -a
\end{array}\right)
$$
%% Matrix([[c,b,1,a],[b+c,-a,2,-a],[b,a,1,-a]])
which will be referenced in the solution below as $A\vec{u}=\vec{b}$.\newline
(a) {\bf Uniqueness}: This requires zero free variables. Then the determinant of the coefficient matrix $A$ must be nonzero. After cofactor expansion the determinant
is factored as $(2a+c)(c-b)$. The inverse of the coefficient matrix then exists for $(2a+c)(c-b)\ne 0$, which implies equation
$A\vec{u}=\vec{b}$ has unique solution $\vec{u}=A^{-1}\vec{b}$.

(b) {\bf No solution}: The toolkit of combo, swap and mult are used in part (b). We seek a signal equation when $b+2a=0$ and $a\ne 0$.  After 3 combo steps the matrix is transformed into
$$A_3=\left(\begin {array}{ccc@{~|~}c}
1&b&c&a\\[-1ex] 0&c-b&-2\,c-a &-3\,a\\[-1ex]
0&0&2\,a+c&a
\end {array}
\right)$$
The last row of $A_3$ is a signal equation if $2a+c=0$ and $a\ne 0$. The combo details are in the Maple code below.

(c) {\bf Infinitely many solutions}: If $a=b=c=0$, then from part (b)
$$A_3=\left(\begin{array}{rrr@{~|~}r} 1& 0& 0& 0\\[-1ex] 0& 0& 0& 0\\[-1ex] 0& 0& 0& 0 \end{array}\right)$$
A homogeneous problem always has solution zero, therefore it never has a signal equation. 
Matrix $A_3$ has one lead variable and two free variables, because the last two rows of $A_3$ are zero. 
The system has infinitely many solutions.

A full analysis of the three possibilities is too involved to discuss here; it was not required in the problem.

The sequence of steps used in (a), (b), (c) are documented below for maple.
\begin{alltt}
 combo:=(A,s,t,m)->linalg[addrow](A,s,t,m);\\
 mult:=(A,t,m)->linalg[mulrow](A,t,m);\\
 swap:=(A,s,t)->linalg[swaprow](A,s,t);\\
 A:=(a,b,c)->Matrix([[1,b,c,a],[2,b+c,-a,-a],[1,c,a,-a]]);\\
 A(a,b,c);\\
 delta:=linalg[det](A(a,b,c)[1..3,1..3]);factor(delta);\\
 A1:=combo(A(a,b,c),1,2,-2);\\
 A2:=combo(A1,1,3,-1);\\
 A3:=simplify(combo(A2,2,3,-1));
\end{alltt}
\relax
}

\vfill\anotherpage
%Continued\vfill\anotherpage

\fbox{\begin{minipage}{0.9\textwidth}
{\bf Definition}. {\small\sf Vectors $\vec{v}_1, \ldots, \vec{v}_k$ are
called {\bf independent} provided solving vector equation $c_1 \vec{v}_1 +
\cdots + c_k \vec{v}_k = \vec{0}$ for constants $c_1,\ldots, c_k$ results in
the unique solution $c_1=\cdots=c_k=0$. Otherwise the vectors are called
{\bf dependent}.}
\end{minipage}
}
\medskip

\problem{100}{%
Linear Independence, Chapters 1,2,3.
\\
Solve parts (a), (b) and (c) using the vectors displayed below. Application of theorems is expected:
the Pivot Theorem, the Rank Test, the Determinant Test. Or, directly use the definition of independence (above).
Details are 75\%, answer 25\%.

% C:=<0,2,2,0|0,0,0,0|1,2,1,2|1,4,3,2>;
% 0&0&1&1\\
% 2&0&2&4\\
% 2&0&1&3\\
% 0&0&2&2
\[
\vec{v}_1=\begin{pmatrix}
   0 \\ 2 \\ 2 \\ 0
\end{pmatrix},\quad
\vec{v}_2=\begin{pmatrix}
   0 \\ 0 \\ 0 \\ 0
\end{pmatrix},\quad
\vec{v}_3=\begin{pmatrix}
   1 \\ 2 \\ 1 \\ 2
\end{pmatrix},\quad
\vec{v}_4=\begin{pmatrix}
   1 \\ 4 \\ 3 \\ 2
\end{pmatrix}
\]

{\bf (a)} [50\%]
Show details for the dependence of the $4$ vectors.
\newline
{\bf (b)} [20\%]
List a maximum number of independent vectors extracted from the $4$ vectors.
\newline
{\bf (c)} [30\%]
Write each vector not listed in {\bf (b)} as a linear combination of the reported independent vectors.
}{}{
{\bf (a)}~ It is possible to verify dependence by applying a Theorem: {\em Any se of vectors containing $\vec{0}$ is dependent}. However, this theorem does not apply to identify the independent vectors. The vectors are dependent by the Pivot Theorem because the augmented matrix of the vectors
has pivot columns 1,3. Therefore, vectors $\vec{v}_1, \vec{v}_3$ are independent.
By the Pivot Theorem, the second and fourth vectors are a linear combination of the
pivot column vectors $\vec{v}_1, \vec{v}_3$. Details:
\[\begin{pmatrix}
 0&0&1&1\\
 2&0&2&4\\
 2&0&1&3\\
 0&0&2&2
\end{pmatrix} \quad\mbox{has RREF =}\quad
\begin{pmatrix}
  1&0&0&1\\
  0&0&1&1\\
  0&0&0&0\\
  0&0&0&0
\end{pmatrix}\]
\newline
{\bf (b)}~ A maximum number of independent vectors: $\vec{v}_1, \vec{v}_3$.
\newline
{\bf (c)}~ The second and fourth vectors are dependent upon vectors $\vec{v}_1, \vec{v}_3$, because \\ $\vec{v}_2=\minicolvector{0\\0\\0\\0}=0\minicolvector{0\\2\\2\\0}+0\minicolvector{1\\2\\1\\2}$, which equals zero times $\vec{v}_1$ plus zero times $\vec{v}_3$, and \\ $\vec{v}_4=\minicolvector{1\\4\\3\\2}=\minicolvector{0\\2\\2\\0}+\minicolvector{1\\2\\1\\2}$, which equals $\vec{v}_1 + \vec{v}_3$.
}

\medskip\vfill\anotherpage
\problem{100}{
Vector general solution of a matrix equation $A\vec{x}=\vec{b}$, Chapters 1,2.
\\
Find the vector general solution $\vec{x}$ to the equation $A\vec{x}=\vec{b}$ for
\[A=
\begin{pmatrix}
  0 & 1 & 0 &4\\
  0 & 3 & 1 &0 \\
  0 & 4 & 1 & 4\\
  0 & 0 & 0 & 0 \\
\end{pmatrix}
,\quad
\vec{b}=
\begin{pmatrix}
  5\\3 \\8\\ 0
\end{pmatrix}
\]

\medskip
{\bf Expected}: (a) [10\%] Augmented matrix, (b) [40\%] Toolkit steps for the RREF, (c) [10\%] Conversion of RREF to scalar equations,
(d) [20\%] Last frame Algorithm details to write out the scalar general solution, (e) [20\%] Conversion of the scalar general solution to the vector general solution. This answer is in the form of a single vector equation for $\vec{x}$,  the solution of system $A\vec{x}=\vec{b}$. The expected components of $\vec{x}$ are $x_1,x_2,x_3,x_4$.
}{}{
% with(LinearAlgebra):
%A:=<0, 1 , 0 ,4|  0, 3 , 1 ,0 |  0, 4 , 1 , 4|  0,0,0,0 >^+;
%b:=<5,3,8,0>;LinearSolve(A,b,free = 't');

The augmented matrix for this system of equations is
\[\begin{pmatrix}
   0 & 1 & 0 &4 & 5\\
  0 & 3 & 1 &0 & 3\\
  0 & 4 & 1 & 4 & 8\\
  0 & 0 & 0 & 0 & 0\\
\end{pmatrix}\]
% 0&1&0&4&5\\ 0&0&1&-12& -12\\ 0&0&0&0&0\\ 0&0&0&0&0

The reduced row echelon form is found to be
\[\begin{pmatrix}
  0 & 1 & 0 &4 & 5\\
  0 & 0 & 1 &-12 &-12\\
  0 & 0 & 0 & 0 &0\\
  0 & 0 & 0 & 0 & 0\\
\end{pmatrix}\]
The last frame, or RREF, is equivalent to the scalar system
$$\left\{\begin{array}{rrrrrrrrrrrr}
 && x_2 &&     &+&     4x_4 &=& 5 \\
 &&     && x_3 &-&    12x_4 &=& -12\\
 &&     &&     &&         0 &=& 0 \\
 &&     &&     &&         0 &=& 0 \\
\end{array}\right.
$$
The lead variables are $x_2,x_3$ and the free variables are $x_1,x_4$.
The last frame algorithm assigns invented symbols $t_1,t_2$ to free variables $x_1,x_4$.
Then back-substitute into the lead
variable equations of the last frame to obtain the scalar general solution
$$
\begin{array}{rll}
x_1 &=& t_1,\\
x_2 &=& 5 - 4t_2,\\
x_3 &=& -12+12t_2,\\
x_4 &=& t_2.
\end{array}
$$
Strang's {\em special solutions} are $\vec{v}_1, \vec{v}_2$, obtained as the partial derivatives of $\vec{x}$
on the invented symbols $t_1,t_2$, respectively. A particular solution $\vec{x}_p$ is
obtained by setting all invented symbols to zero. Then
$$
\vec{x} = \vec{x}_p + t_1\vec{v}_1 +t_2\vec{v}_2 =
\left(\begin{array}{r} 0\\ 5 \\ -12\\ 0\end{array}\right)
+t_1\left(\begin{array}{r} 1\\ 0 \\ 0\\ 0\end{array}\right)
+t_2\left(\begin{array}{r} 0 \\ -4\\ 12\\ 1 \end{array}\right)
$$
\relax
}

\vfill\anotherpage
\problem{100}{
 Determinants, Chapter 3. \\
Details 75\%, answers 25\%.\\
\medskip
% {\bf (a)} [30\%] Assume given $3\times 3$ matrices $A$, $B$. Assume $E_1$, $E_2$, $E_3$ are
% elementary matrices representing respectively a combination, a swap
%and a multiply by $4$. Assume $\det(B)=5$ and  $E_3E_2E_1A=A^2B^3$.
% Let $C=-2A$. Find all possible values of $\det(C)$.
%\newline
{\bf (a)} [20\%] Invent a $3\times 3$ non-triangular matrix whose determinant equals $\pi+e^2$. Common approximations are $\pi=3.14$ and $e=2.718$, but kindly do not approximate. Expected are determinant evaluation details.
\\[1pc]
{\bf (b)} [20\%] There are $50$ distinct $5\times 5$ matrices $A$ whose entries are restricted to be either $0$ or $1$.
Give one example where $|A|=0$ and each row and column of $A$ contains at least two zeros and at least two ones. Expected is an explanation for $|A|=0$.
\\[1pc]
{\bf (c)} [60\%] Determine all values of $x$ for which $A^{-1}$
exists, where $A=2I+C$, $I$ is the $3\times 3$ identity and $C=\left(
\begin{array}{cccc}
1 &   x  & -1 \\
x &  0 & 1  \\
1 & 0 & -2
\end{array}\right)
$.
%\newline
%{\bf (c)} [40\%] Let symbols $a, b, c$ denote constants and define
%$$ A=\left(\begin{array}{rrrr}
% 1 & 0 &  0 & 0 \\
% 1 & -2 &  0 & 0  \\
% a & b &  0 & 1 \\
% 1 & c &  1 & 2
%\end{array}\right)
%$$
%Apply the  adjugate [adjoint] formula for the inverse
%$$A^{-1} = \frac{\adj(A)}{|A|}$$
%to find the value of the entry in row
% $3$, column $2$ of $A^{-1}$.
}{}{
%\newline
%(a)  Start with the determinant product theorem $|FG|=|F||G|$. Apply it to obtain
%$|E_3||E_2||E_1||A|=|A|^2|B|^3$. Let $x=|A|$, $|B|=5$, $|E_1|=1$, $|E_2|=-1$ and $|E_3|=4$ in this equation to obtain quadratic equation
%$(4)(-1)(1)x=x^2(5)^3$.
%Then solve for $x=0$ or $x=-4/5^3$.
% Then $|C|=|(-2I)A|=|-2I||A|=-8x$. The answer is $|C|=-8x=0$ or $|C|=-8x=(-8)(-4/5^3)=\frac{32}{125}$.
\newline
{\bf (a)} [20\%] %Invent a $3\times 3$ non-triangular matrix whose determinant equals $\pi+e^2$.
Because $A=\minithreebythree{1&0&0}{0&a&b}{0&c&d}$ has determinant $|A|=ad-bc$ by the cofactor rule, the choice $a=1$, $d=\pi$, $b=-e$, $c=e$ results in $|A|=\pi+e^2$.
\newline
{\bf (b)} [20\%] 
%There are $50$ distinct $5\times 5$ matrices $A$ whose entries are restricted to be either $0$ or $1$. Give one example where $|A|=0$ and no row or column of $A$ is all zeros. Expected is an explanation for $|A|=0$.
Let $A$ be the matrix constructed from two row vectors $<1,1,0,0,0>$ then three row vectors $<0,0,1,1,1>$.
Due to duplicate rows, the determinant is zero. There are many other possible solutions.
\newline
{\bf (c)} [60\%] Find $C+2I=\left( \begin {array}{ccc} 3&x&-1\\ \noalign{\medskip}x&2&1
\\ \noalign{\medskip}1&0&0\end {array} \right)
$, then evaluate its determinant. Set the answer to zero, then solve for $x= -2$. Used here is $F^{-1}$ exists if and only if $|F|\ne 0$.
The answer: matrix $2I+C$ has an inverse for all $x\ne -2$.
%\newline
%(c) Find the cross-out determinant in row 2, column 3 (no mistake, the transpose swaps rows and columns). Form the fraction, top=checkboard sign times cross-out determinant, bottom=$|A|$. The value is $\frac{c}{2}-b$. A maple check:
%\begin{alltt}
% C4:=Matrix([[1,0,0,0],[1,-2,0,0],[a,b,0,1],[1,c,1,2]]);\newline
%1/C4; # The inverse matrix\newline
%C5:=linalg[minor](C4,2,3);\newline
%top:=linalg[det](C5)*(-1)\^{}(2+3);bot:=linalg[det](C4);top/bot;\newline
% \# ans =c-2b divided by 2
%\end{alltt}
}
%\vfill\anotherpage
%\phantom{page}
\vfill
\begin{center} End Exam 1.\end{center}

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

\problemsdone
\end{document}

% End of the Document
