\documentclass{exam}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usepackage{pgfplots}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{mathrsfs}
\usepackage{tabularx,ragged2e}
\usepackage{hyperref}
\usepackage{color}
\usepackage{tikz}
\usepackage{enumerate}
\usepackage{tabularx,ragged2e}
\newcommand*\circled[1]{\tikz[baseline=(char.base)]{
            \node[shape=circle,draw,inner sep=2pt] (char) {#1};}}

\newcommand{\dd}{\mathrm{d}}
%\renewcommand*{\arraystretch}{2}
\cfoot{}
\begin{document}

\begin{coverpages}
\begin{center}{\huge MATH 3520 - EXAM 1 FALL 2019 \\
SOLUTION
%\vspace*{0.4in}
%\large Name: \makebox[3in]{\hrulefill}\\
}
\end{center}

\begin{flushleft}\vspace{0.5in}
Wednesday, 18 September \\
Instructor: Tom Cuchta
\end{flushleft}

\textbf{Instructions:}
\begin{itemize}
	\item  Show all work, clearly and in order, if you want to get full
	credit. If you claim something is true \textbf{you must show work backing up your claim}. I reserve the right to take off points if I cannot see how you arrived at your answer (even if your final answer is correct).
	\item Justify your answers algebraically whenever possible to ensure full credit. 	
	\item  Circle or otherwise indicate your final answers.
	\item  Please keep your written answers brief; be clear and to the point.
	\item  Good luck!
\end{itemize}

\end{coverpages}

\begin{questions}
\question[12] Solve the system in any way you choose. Don't forget to express the solution in the appropriate way.
\begin{parts}
\part[6] $\left\{ \begin{array}{llll}
x_1 & & +2x_3 &= 5 \\
x_1 & +x_2 & +3x_3 &= 6 \\
2x_1 & &+5x_3 &=12
\end{array} \right.$ \\
\textit{Solution}: Write an augmented matrix and put it into reduced echelon form:
\[ \begin{array}{ll}
\begin{bmatrix} 1 & 0 & 2 & 5 \\ 
1 & 1 & 3 & 6 \\
2 & 0 & 5 & 12
\end{bmatrix} &\stackrel{r_2^*=r_2-r_1, r_3^*=r_3-2r_1}{\sim} \begin{bmatrix} 1&0&2&5 \\
0 & 1 & 1 & 1 \\
0 & 0 & 1 & 2
\end{bmatrix} \\
&\stackrel{r_2^*=r_2-r_3, r_1^*=r_1-2r_3}{\sim} \begin{bmatrix} 
1&0&0&1 \\
0&1&0&-1 \\
0&0&1&2 
\end{bmatrix}
\end{array}\]
Therefore the solution of the system is 
\[\vec{x}=\begin{bmatrix} x_1 \\ x_2 \\ x_3 \end{bmatrix} = \begin{bmatrix} 1 \\ -1 \\ 2 \end{bmatrix}.\]
\part[6] $\left\{ \begin{array}{llll}
x_1 & &+x_3 & =2 \\
-2x_1 & +x_2 & -x_3 & =-5 \\
-x_1 & +x_2 & & =-3
\end{array} \right.$ \\
\textit{Solution}: Write an augmented matrix and put it into reduced echelon form:
\[ \begin{array}{ll}
\begin{bmatrix} 
1&0&1&2 \\ 
-2&1&-1&-5 \\
-1&1&0&-3
\end{bmatrix} &\stackrel{r_2^*=r_2+2r_1, r_3^*=r_3+r_1}{\sim} \begin{bmatrix} 1&0&1&2 \\
0&1&1&-1 \\
0&1&1&-1
\end{bmatrix} \\
&\stackrel{r_3^*=r_3-r_2}{\sim} \begin{bmatrix} 
1&0&1&2 \\
0&1&1&-1 \\
0&0&0&0
\end{bmatrix}
\end{array}   \]
This matrix encodes the equations
\[ \left\{ \begin{array}{ll}
x_1 + x_3 = 2 & \longrightarrow x_1 = 2-x_3\\
x_2+x_3=-1 & \longrightarrow x_2=-1-x_3
\end{array} \right.\]
Therefore we have solution
\[ \vec{x} = \begin{bmatrix} x_1 \\ x_2 \\ x_3 \end{bmatrix} = \begin{bmatrix} 2-x_3 \\ -1-x_3 \\ x_3 \end{bmatrix} = \begin{bmatrix} 2 \\ -1 \\ 0 \end{bmatrix} + \begin{bmatrix} -1 \\ -1 \\ 1 \end{bmatrix} x_3,\]
where $x_3$ is a free variable.
\end{parts}

\question[16] If $\vec{v}$ a linear combination of $\vec{u}_1$ and $\vec{u}_2$? If so, explain why. If not, explain why not. 
\begin{parts}
\part[8] $\vec{v}=\begin{bmatrix} 2 \\ 2 \\ 2 \end{bmatrix}$, $\vec{u}_1=\begin{bmatrix} 1 \\ 0 \\ 3 \end{bmatrix}$, $\vec{u}_2=\begin{bmatrix} 2 \\ 4 \\ -2 \end{bmatrix}$ \\
\textit{Solution}: We are asked if the following equation has a solution:
\[ \alpha_1 \begin{bmatrix} 1 \\ 0 \\ 3 \end{bmatrix} + \alpha_2 \begin{bmatrix} 2 \\ 4 \\ -2 \end{bmatrix} = \begin{bmatrix} 2 \\ 2 \\ 2 \end{bmatrix}.\]
Algebra on the left-hand side yields the equivalent equation
\[ \begin{bmatrix} \alpha_1+2\alpha_2 \\ 4\alpha_2 \\ 3\alpha_1-2\alpha_2 \end{bmatrix} = \begin{bmatrix} 2 \\ 2 \\ 2 \end{bmatrix}.\]
Therefore we solve it by putting an augmented matrix into reduced echelon form:
\[ \begin{array}{ll}
\begin{bmatrix} 1 & 2 & 2 \\ 0&4&2 \\ 3&-2&2 \end{bmatrix} & \stackrel{r_3^*=r_3-3r_1}{\sim} \begin{bmatrix} 1&2&2 \\ 0&4&2 \\ 0&-8&-4 \end{bmatrix} \\
&\stackrel{r_3^*=r_3+2r_2}{\sim} \begin{bmatrix} 1&2&2 \\ 0&4&2 \\ 0&0&0 \end{bmatrix} \\
&\stackrel{r_2^*=\frac{1}{4}r_2}{\sim} \begin{bmatrix} 1&2&2 \\ 0&1&\frac{1}{2} \\ 0&0&0 \end{bmatrix} \\
&\stackrel{r_1^*=r_1-2r_2}{\sim} \begin{bmatrix} 1&0&1 \\ 0&1&\frac{1}{2} \\ 0&0&0 \end{bmatrix}
\end{array} \]
Therefore the equation has solution
\[ \vec{\alpha} = \begin{bmatrix} \alpha_1 \\ \alpha_2 \end{bmatrix} = \begin{bmatrix}1 \\ \frac{1}{2} \end{bmatrix}, \]
and so we say \textbf{YES}, $\vec{v}$ is a linear combination of $\vec{u}_1$ and $\vec{u}_2$.
\part[8] $\vec{v}=\begin{bmatrix} 1 \\ 1 \\ 1 \end{bmatrix}$, $\vec{u}_1=\begin{bmatrix} -1 \\ 1 \\ 0 \end{bmatrix}$, $\vec{u}_2=\begin{bmatrix} 0 \\ 1 \\ -1 \end{bmatrix}$ \\
\textit{Solution}: We consider the equation
\[ \alpha_1 \begin{bmatrix} -1 \\ 1 \\ 0 \end{bmatrix} + \alpha_2 \begin{bmatrix} 0 \\ 1 \\ -1 \end{bmatrix} = \begin{bmatrix} 1 \\ 1 \\ 1 \end{bmatrix}.\]
This gives augmented matrix
\[ \begin{array}{ll}
\begin{bmatrix} -1&0&1 \\ 1&1&1 \\ 0&-1&1 \end{bmatrix} & \stackrel{r_2^*=r_2+r_1}{\sim} \begin{bmatrix} -1&0&1 \\ 0&1&2 \\ 0&-1&1 \end{bmatrix} \\
&\stackrel{r_3^*=r_3+r_2}{\sim} \begin{bmatrix} -1&0&1 \\ 0&1&2 \\ 0&0&3\end{bmatrix},
\end{array}\]
but the third row of this matrix encodes the equation ``$0=3$" which is false. Therefore we say \textbf{NO}, $\vec{v}$ is not a linear combination of $\vec{u}_1$ and $\vec{u}_2$.
\end{parts} 

\question[12] Demonstrate that $\mathbb{R}^{2 \times 1} = \mathrm{span} \left\{ \begin{bmatrix} 1 \\ 2 \end{bmatrix}, \begin{bmatrix} -1 \\ 0 \end{bmatrix} \right\}$. \\
\textit{Solution}: It is ``obvious" that $\mathrm{span} \left\{ \begin{bmatrix} 1 \\ 2 \end{bmatrix}, \begin{bmatrix} -1 \\ 0 \end{bmatrix} \right\} \subset \mathbb{R}^{2 \times 1}$. Therefore we must show that 
\[ \mathbb{R}^{2 \times 1} \subset \mathrm{span} \left\{ \begin{bmatrix} 1 \\ 2 \end{bmatrix}, \begin{bmatrix} -1 \\ 0 \end{bmatrix} \right\}.\]
Let $A=\begin{bmatrix} a \\ b \end{bmatrix} \in \mathbb{R}^{2 \times 1}$ be arbitrary. Consider the equation
\[ \alpha_1 \begin{bmatrix} 1 \\ 2 \end{bmatrix} + \alpha_2 \begin{bmatrix} -1 \\ 0 \end{bmatrix} = \begin{bmatrix} a \\ b \end{bmatrix}.\]
Solve it by using the agumented matrix
\[ \begin{array}{ll}
\begin{bmatrix} 1&-1&a \\ 2&0&b \end{bmatrix} & \stackrel{r_2^*=r_2-2r_1}{\sim} \begin{bmatrix} 1&-1&a \\ 0&2&b-2a \end{bmatrix} \\
&\stackrel{r_2^*=\frac{1}{2}r_2}{\sim} \begin{bmatrix} 1&-1&a \\ 0&1&\frac{b}{2}-a\end{bmatrix} \\
&\stackrel{r_1^*=r_1+r_2}{\sim} \begin{bmatrix} 1 & 0 & \frac{b}{2}+\frac{a}{2} \\ 
0&1&\frac{b}{2}-a\end{bmatrix},
\end{array}\]
therefore the weights 
\[ \vec{\alpha} = \begin{bmatrix} \alpha_1 \\ \alpha_2 \end{bmatrix} = \begin{bmatrix} \frac{b+a}{2} \\ \frac{b}{2}-a \end{bmatrix}\]
demonstrate that we may arrive at the vector $\begin{bmatrix} a \\ b \end{bmatrix}$ as a linear combination of the vectors $\begin{bmatrix} 1 \\ 2 \end{bmatrix}$ and $\begin{bmatrix} -1 \\ 0 \end{bmatrix}$, and the desired subset relation (and hence equality) is now established.

\question[18] Is the set of vectors linearly independent or linearly dependent? Explain why.
\begin{parts}
\part[9] $\left\{ \begin{bmatrix} 1 \\ 2 \\ 5 \\ 9  \end{bmatrix}, \begin{bmatrix} 0 \\ 1 \\ 1 \\ 1 \end{bmatrix}, \begin{bmatrix} 0 \\ 0 \\ 1 \\ 1 \end{bmatrix} \right\}$ \\
\textit{Solution}: Consider the equation
\[ \alpha_1 \begin{bmatrix} 1 \\ 2 \\ 5 \\ 9 \end{bmatrix} + \alpha_2 \begin{bmatrix} 0 \\ 1 \\ 1 \\ 1 \end{bmatrix} + \alpha_3 \begin{bmatrix} 0 \\ 0 \\ 1 \\ 1 \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \\ 0 \\ 0 \end{bmatrix}.\]
To solve it, we write the augmented matrix
\[ \begin{array}{ll}
\begin{bmatrix} 1 &0&0&0 \\ 2&1&0&0 \\ 5&1&1&0 \\ 9&1&1&0 \end{bmatrix} \sim \ldots \sim \begin{bmatrix} 1&0&0&0 \\ 0&1&0&0 \\ 0&0&1&0 \\ 0&0&0&1 \end{bmatrix}.
\end{array} \]
From this we see that the solution is
\[ \vec{\alpha} = \begin{bmatrix} \alpha_1 \\ \alpha_2 \\ \alpha_3 \\ \alpha_4 \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \\ 0 \\ 0 \end{bmatrix},\]
and so we conclude that the set in question is \textbf{linearly independent}. 
\part[9] $\left\{ \begin{bmatrix} 1 \\ 2 \\3 \end{bmatrix}, \begin{bmatrix} -2 \\ -3 \\ -7 \end{bmatrix}, \begin{bmatrix} 2 \\ 7 \\ 8 \end{bmatrix} \right\}$ \\
\textit{Solution}: Consider the equation
\[ \alpha_1 \begin{bmatrix} 1 \\ 2 \\ 3 \end{bmatrix} + \alpha_2 \begin{bmatrix} -2 \\ -3 \\ -7 \end{bmatrix} + \alpha_3 \begin{bmatrix} 2 \\ 7 \\ 8 \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \\ 0 \end{bmatrix}.\]
To solve it, write the augmented matrix
\[ \begin{bmatrix} 1&-2&2&0 \\ 2&-3&7&0 \\ 3&-7&8&0 \end{bmatrix} \sim \ldots \sim \begin{bmatrix} 1 &0&0&0 \\ 0&1&0&0 \\ 0&0&1&0 \end{bmatrix}.\]
From this we see that the solution is
\[ \vec{\alpha} = \begin{bmatrix} \alpha_1 \\ \alpha_2 \\ \alpha_3 \end{bmatrix} = \begin{bmatrix} 0 \\ 0 \\ 0 \end{bmatrix},\]
and so we conclude that the set in question is \textbf{linearly independent}.
\end{parts}

\question[18] Let $A=\begin{bmatrix} 1 & 2 \\ 1 & -1 \end{bmatrix}$, $B = \begin{bmatrix} -1 & 0 \\ 2 & 5 \end{bmatrix}$, $C = \begin{bmatrix} 1 & -1 \\ 0 & -1 \\ -1 & 1 \end{bmatrix}$, and  $D=\begin{bmatrix} -1 & 0 & 2 & 3 \\ 1&2&3&4 \end{bmatrix}$. Perform the computation or state why it is impossible to compute.
\begin{parts} 
\part[6] $2A+B$ \\
\textit{Solution}: Compute
\[ \begin{array}{ll}
2A+B &= 2 \begin{bmatrix} 1&2 \\ 1&-1 \end{bmatrix} + \begin{bmatrix} -1 & 0 \\ 2 &5 \end{bmatrix} \\
&= \begin{bmatrix} 2&4 \\ 2&-2 \end{bmatrix} + \begin{bmatrix} -1 & 0 \\ 2&5 \end{bmatrix} \\
&= \begin{bmatrix} 2-1 & 4+0 \\ 2+2 & -2+5 \end{bmatrix} \\
&= \begin{bmatrix} 1 & 4 \\ 4 & 3 \end{bmatrix}.
\end{array} \]
\part[6] $B+D$ \\
\textit{Solution}: This is impossible to compute because $B \in \mathbb{R}^{2\times 2}$ while $D \in \mathbb{R}^{2\times 4}$ and so the addition is not defined since they are in difference spaces.
\part[6] $\left(AC^T \right)C$ \\
\textit{Solution}: Compute
\[ \begin{array}{ll}
\left(AC^T\right)C &= \left( \begin{bmatrix} 1&2 \\ 1&-1 \end{bmatrix} \begin{bmatrix} 1&-1 \\ 0&-1 \\ -1&1 \end{bmatrix}^T \right) \begin{bmatrix} 1&-1 \\ 0&-1 \\ -1&1 \end{bmatrix} \\
&= \left( \begin{bmatrix} 1&2 \\ 1&-1 \end{bmatrix} \begin{bmatrix} 1&0&-1 \\ -1&-1&1 \end{bmatrix} \right) \begin{bmatrix} 1&-1 \\ 0&-1 \\ -1&1 \end{bmatrix} \\
&= \left( \begin{bmatrix} 1\cdot 1 + 2 \cdot (-1) & 1 \cdot 0 + 2 \cdot (-1) & 1 \cdot (-1) + 2 \cdot 1 \\
1 \cdot 1 + (-1) \cdot (-1) & 1 \cdot 0 + (-1) \cdot (-1) & 1 \cdot (-1) + (-1) \cdot 1 
\end{bmatrix}  \right)  \begin{bmatrix} 1&-1 \\ 0&-1 \\ -1&1 \end{bmatrix} \\
&= \begin{bmatrix}-1 & -2 & 1 \\ 2 & 1 & -2  \end{bmatrix} \begin{bmatrix} 1&-1 \\ 0&-1 \\ -1&1 \end{bmatrix} \\
&= \begin{bmatrix} (-1)\cdot 1 + (-2) \cdot 0 + 1 \cdot (-1) & (-1) \cdot (-1) + (-2) \cdot (-1) + 1 \cdot 1 \\ 2 \cdot 1 + 1 \cdot 0 + (-2) \cdot (-1) & 2 \cdot (-1) + 1 \cdot (-1) + (-2) \cdot 1 
\end{bmatrix} \\
&= \begin{bmatrix} -2 & 4 \\ 4 & -5 \end{bmatrix}.
\end{array} \]
\end{parts} 

\question[12] A matrix $A$ is called idempotent if the following equation holds: 
\[A^2=A,\] 
where $A^2$ means $AA$ -- i.e. multiplying $A$ with itself. Are the following matrices idempotent? Explain why or why not.
\begin{parts}
\part[6] $\begin{bmatrix} 3 & -6 \\ 1 & -2 \end{bmatrix}$  \\
\textit{Solution}: Compute
\[ \begin{bmatrix} 3&-6 \\ 1&-2 \end{bmatrix} \begin{bmatrix} 3&-6 \\ 1&-2 \end{bmatrix} = \begin{bmatrix} 3 \cdot 3 + (-6) \cdot 1 & 3 \cdot (-6) + (-6) \cdot (-2) \\ 1 \cdot 3 + (-2) \cdot 1 & 1 \cdot (-6) + (-2) \cdot (-2) \end{bmatrix} = \begin{bmatrix} 3 & -6 \\ 1 & -2 \end{bmatrix},\]
therefore this matrix \textbf{IS} idempotent.
\part[6] $\begin{bmatrix} 1 & 1 \\ 1 & 0 \end{bmatrix}$ \\
\textit{Solution}: Compute
\[ \begin{bmatrix} 1&1 \\ 1&0 \end{bmatrix} \begin{bmatrix} 1&1 \\ 1&0 \end{bmatrix} = \begin{bmatrix} 1 \cdot 1 + 1 \cdot 1 & 1 \cdot 1 + 1 \cdot 0 \\ 1 \cdot 1 + 0 \cdot 1 & 1 \cdot 1 + 0 \cdot 0 \end{bmatrix} = \begin{bmatrix} 2 & 1 \\ 1 & 1 \end{bmatrix}, \]
therefore this matrix \textbf{IS NOT} idempotent.
\end{parts}

\question[12] Find the inverse of the matrix $\begin{bmatrix}
2&0&1 \\
-2&1&1 \\
2&-1&0 
\end{bmatrix}$. \\
\textit{Solution}: Set up the appropriate matrix and put it into reduced echelon form:
\[ \begin{array}{ll}
\begin{bmatrix} 2&0&1&1&0&0 \\ -2&1&1&0&1&0 \\ 2&-1&0&0&0&1 \end{bmatrix} \sim \ldots \sim \begin{bmatrix} 1&0&0&\frac{1}{2}&-\frac{1}{2}&-\frac{1}{2} \\ 0&1&0&1&-1&-2 \\ 0&0&1&0&1&1 \end{bmatrix}.
\end{array} \]
\end{questions}
\end{document}