
\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}
\let\finishfirstpage\bigskip

% Beginning of the Document

\begin{document}
\examtitle{MATH 2270-2}{Sample Exam 1}{Spring 2012}

\studentinfo
\instructions{No books or notes. No electronic devices, please.\\
These problems have credits 5 to 20, which is an estimate of the time required to write the solution.
The exam will have 100 points instead of the 170 represented here.}
\finishfirstpage
% Problems Start Here % ----------------------------------------------------- %
\problem{5}{%
State the {\em Three Possibilities} for a linear system $A\vec{x}=\vec{b}$.
}{}{%
A linear system has either (1) A unique solution, (2) No solution, or (3) Infinitely many solutions.
}

\problem{5}{%
Completely describe each operation in the basic Toolkit for solving a linear system (combo, swap, mult).
}{}{%
Combo(s,t,c) = Add c times row s to row t \\
Swap(s,t) = Swap rows s and t \\
Mult(t,m) = Multiply row t by m (m not zero)\\
These apply to a matrix. Replace row by equation for systems of equations.
}

\problem{5}{%
Can the following system have no solution for some choice of $b_1,b_2,b_3$?
$$
 \begin{array}{rl}
    \phantom{2}x_1    + \phantom{2}x_2   + \phantom{2}x_3  + \phantom{2}x_4 & =b_1\\
 4x_1    + 2x_2   + 3x_3  \phantom{+ 2x_4} & =b_2\\
 \phantom{2x_1 }  \phantom{+ 2x_2 +}    \phantom{2}x_3  + \phantom{2}x_4 & =b_3
  \end{array}
  $$
}{}{%
No. There are three lead variables and one free variable.
Because the number of lead variables matches the number of equations, then it is impossible to obtain a signal equation.
}

\problem{5}{%
True or false? Explain. If $A$ and $B$ are $n\times n$
invertible, then $(AB)^{-1}=A^{-1}B^{-1}$.
}{}{%
In general $(AB)^{-1}$ is the product of the inverses in reverse order, $B^{-1}A^{-1}$.
There are cases where $B^{-1}A^{-1} \ne A^{-1}B^{-1}$. Start with two invertible matrices
$C,D$ such that $CD\ne DC$. Then let $A=C^{-1}$ and $B=D^{-1}$. For example,
$C=\twobytwo{1&2}{4&0}$ and $D=\twobytwo{2&1}{3&0}$.
}

\problem{5}{%
True or false? Explain. If square matrices $A$ and $B$
satisfy $AB=I$, then $A\vec{x}=\vec{b}$ has a unique solution $\vec{x}$ for each
vector $\vec{b}$.
}{}{%
Both $A$ and $B$ are invertible and inverses of each other. Then $\vec{x}=B\vec{b}$ is the unique solution of $A\vec{x}=\vec{b}$.
}

\problem{5}{%
 Give an example of a $3\times 2$ matrix $A$ and a frame
sequence with three or more frames, starting at $A$, which proves that
the invented system $A\vec{x}=\vec{0}$ has a unique solution.
}{}{%
Let $A$ be the augmented matrix of a $2\times 2$ identity matrix and a row of zeros.
}

\problem{5}{%
Give an example of a $4\times 3$ matrix $A$ and a frame
sequence with three or more frames, starting at $A$, which proves that
the invented system $A\vec{x}=\vec{0}$ has infinitely many solutions.
}{}{%
Make the last two rows of $A$ all zeros.
}

\problem{5}{
Let $A$ be a $3\times 4$ matrix. What is the elimination matrix that
replaces Row 2 of $A$ with Row 2 minus Row 1 and replaces Row 3 of $A$
by Row 3 minus 2 times Row 1?
}{}{
\[\begin{pmatrix} 1 & 0 & 0\\ -1 & 1 & 0 \\ -2 & 0 & 1\end{pmatrix}\]
}

\problem{5}{
Let $A$ be a $3\times 3$
matrix. Let
$$F=\threebythree{1 & 2 & 3}{0 & 0 & 1}{0 & 0 & 0}.$$
Assume $F$ is obtained from $A$ by the
following sequential row operations: (1) Swap rows 2 and 3; (2)
Add $-2$ times row 2 to row 3; (3) Add $3$ times row 1 to row 2;
(4) Multiply row 2 by $-3$. Find $A$.
}{}{%
Apply the inverse elementary operations on $F$ in reverse order: Multiply row 2 by $-1/3$;
Add $-3$ times row 1 to row 2; Add $2$ times row 2 to row 3; Swap rows 2 and 3. Then
$$A=\threebythree{1 & 2 & 3}{-6 & -12 & -\frac{56}{3}}{-3 & -6 & -\frac{28}{3}}.$$
% [[1, 2, 3], [-6, -12, -56/3], [-3, -6, -28/3]]
}

\problem{5}{
What is the inverse of the following matrix?
\[
E=\begin{pmatrix}
  1 & 0 & 0 & 0 & 0\\
  0 & 1 & 0 & 0 & 0\\
 0 & 0 & 1 & 0 & 0\\
  0 & 0 & -5 & 1 & 0\\
  0 & 0 & 1 & 0 & 1
\end{pmatrix}\]
}{}{$E$ is the elimination matrix for combo(3,4,-5) (add 5 times Row  3 to Row 4) followed by combo(3,5,1) (add 1 times Row 3 to Row 5).
The inverse is the
  elimination matrix that reverses these steps, combo(3,5,-1) followed by combo(3,4,5).
\[
E^{-1}=\begin{pmatrix}
  1 & 0 & 0 & 0 & 0\\
  0 & 1 & 0 & 0 & 0\\
 0 & 0 & 1 & 0 & 0\\
  0 & 0 & 5 & 1 & 0\\
  0 & 0 & -1 & 0 & 1
\end{pmatrix}\]
}

\problem{5}{
Describe in words the effect of multiplying
\[
E=\begin{pmatrix}
   1 & 0 & 0 & 0\\
   0 & 1 & 0 & 0\\
   0 & -3 & 1 & 0\\
   0 & 2 & 0 & 1
\end{pmatrix}\]
on the left of a $4\times 5$ matrix $A$ to get $EA$.
}{}{
The matrix $E$ is obtained from the identity $I$ by combo(2,3,-3) followed by combo(2,4,2).
For $EA$, the same combo operations are applied to $A$ instead, in the same order.
}

\problem{20}{
Let $a$, $b$ and $c$ denote
constants and consider the system of equations
$$
\left(\begin{array}{ccc}
1  &  b-c  & a \\
1  &   c   & -a \\
2  &  b  & a
\end{array}\right)
\left(\begin{array}{r} x \\ y \\ z
\end{array}\right)
= \left(\begin{array}{r} -a \\ a \\ a
\end{array}\right)
$$
\begin{itemize}
\item[{\bf (a)}.] Determine those values of $a$, $b$ and $c$ such
that the system has a unique solution.
\newline
\item[{\bf (b)}.] Determine those values of $a$, $b$ and $c$ such
that the system has no solution.
\newline
\item[{\bf (c)}.] Determine those values of $a$, $b$ and $c$ such
that the system has infinitely many solutions.
\end{itemize}
To save time, don't attempt to solve the equations or to produce a complete
frame sequence.
}{}{
No solution for $2c-b=0$ and $a\ne 0$. Unique solution for $a\ne 0$ and $2c-b\ne 0$.
Infinitely many solutions for $a=0$.

Combo is used to obtain in 5 steps the matrix
$$\left(\begin{array}{rrrr}1& b-c& 0& -2a\\ 0& -b+2c& 0& 4a\\ 0& 0& a& a \end{array}\right)$$
The sequence of steps are documented below for maple.}
\begin{verbatim}
 macro(combo=linalg[addrow]);macro(mult=linalg[mulrow]);
 macro(swap=linalg[swaprow]);
 A:=(a,b,c)->Matrix([[1,b-c,a,-a],[1,c,-a,a],[2,b,a,a]]);
 A1:=combo(A(a,b,c),1,2,-1);
 A2:=combo(A1,1,3,-2);
 A3:=combo(A2,2,3,-1);
 A4:=combo(A3,3,2,2);
 A5:=combo(A4,3,1,-1);
 A5 := Matrix([[1,b-c,0,-2*a],[0,-b+2*c,0,4*a],[0,0,a,a]]);
\end{verbatim}


%\anotherpage
\problem{15}{
Let $A=\begin{pmatrix} 1 & 2\\ 3 & 4\end{pmatrix}$. Let $B=\begin{pmatrix} 1 &
  1\\ 1 & 1\end{pmatrix} $. Let $C= \begin{pmatrix} 1 & 1\\ 1 &
  0\end{pmatrix}$.
Calculate the following:
\[A(BC),\quad (AB)C,\quad C^2,\quad 2A+B-C,\quad A(B-C)\]
}{}{
\[A(BC)=\begin{pmatrix} 6 & 3 \\ 14 &7 \end{pmatrix}\]
\[(AB)C=\begin{pmatrix} 6& 3 \\14 &7\end{pmatrix}\]
\[C^2=\begin{pmatrix} 2&1 \\ 1&1\end{pmatrix}\]
\[2A+B-C=\begin{pmatrix} 2& 4\\6 &9\end{pmatrix}\]
\[A(B-C)=\begin{pmatrix} 0&2 \\0 &4\end{pmatrix}\]
}

\problem{20}{
Classify the following sets of vectors for (1) Independence or (2) Dependence. For each set of vectors,
report whether or not they form a {\bf basis} for the indicated vector space.

\[
\begin{pmatrix}
  1\\ 2
\end{pmatrix},
\begin{pmatrix}
  2\\ 2
\end{pmatrix}
\text{ in } \mathbb{R}^2\]

\[
\begin{pmatrix}
  1\\ 0 \\ 0
\end{pmatrix},
\begin{pmatrix}
  0\\ 2 \\ 0
\end{pmatrix},
\begin{pmatrix}
  1\\ -1 \\ 1
\end{pmatrix},
\begin{pmatrix}
  -1\\ 1 \\ 1
\end{pmatrix}
\text{ in } \mathbb{R}^3\]
}{}{
\[
\begin{pmatrix}
  1\\ 2
\end{pmatrix},
\begin{pmatrix}
  2\\ 2
\end{pmatrix}
\text{ in } \mathbb{R}^2\]
These two vectors are not scalar multiples of each other, so they are
linearly independent. Because $\mathbb{R}^2$ is two dimensional, any two
linearly independent vectors form a basis. These two vectors form a basis for $\mathbb{R}^2$.

\[
\begin{pmatrix}
  1\\ 0 \\ 0
\end{pmatrix},
\begin{pmatrix}
  0\\ 2 \\ 0
\end{pmatrix},
\begin{pmatrix}
  1\\ -1 \\ 1
\end{pmatrix},
\begin{pmatrix}
  -1\\ 1 \\ 1
\end{pmatrix}
\text{ in } \mathbb{R}^3\]
Because $\mathbb{R}^3$ is three dimensional, then no set of
more than three vectors can ever be linearly independent in $\mathbb{R}^3$.
The set is dependent. These four vectors do not form a basis. A basis consists of three linearly
independent vectors. Three such can be determined as the pivot columns of an augmented matrix of the four vectors.
}

%\anotherpage
\problem{20}{
Find all solutions to the equation $A\bar{x}=\bar{b}$ for
\[A=
\begin{pmatrix}
  1 & 2 & 3 &4\\
5 & 6 & 7 &8
\end{pmatrix}
\]
\[\bar{b}=
\begin{pmatrix}
  0\\4
\end{pmatrix}
\]
}{}{
The augmented matrix for this system of equations is
\[\begin{pmatrix}
  1 & 2 & 3 &4& 0\\
5 & 6 & 7 &8& 4
\end{pmatrix}\]
Find the reduced row echelon form by Gauss-Jordan Elimination, as follows.
\[\begin{pmatrix}
  1 & 2 & 3 &4& 0\\
5 & 6 & 7 &8& 4
\end{pmatrix}\quad\mbox{Augmented matrix}\]
\[\begin{pmatrix}
  1 & 2 & 3 &4& 0\\
0 & -4 & -8 &-12& 4
\end{pmatrix}\quad\mbox{combo(1,2,-5)}
\]
\[\begin{pmatrix}
  1 & 0 & -1 &-2& \phantom{-}2\\
0 & 1& \phantom{-}2 &\phantom{-}3& -1
\end{pmatrix}\quad\mbox{mult(2,-1/4)}
\]
The last frame, or RREF, implies the system
$$\begin{array}{rrrrrrrrrrrr}
x_1 & &-& x_3 &-&2x_4 & = & 2 \\
    & x_2 &+& 2x_3 &+& 3x_4 &=& -1
\end{array}
$$
The lead variables are $x_1,x_2$ and the free variables are $x_3,x_4$.
The last frame algorithm introduces invented symbols $t_1,t_2$. The free variables are set to these symbols, then
back-substitute into the lead variable equations of the last frame to obtain the general solution
$$
\begin{array}{rrrrrrr}
x_1 &=& 2 + t_1 +2t_2,\\
x_2 &=& -1 -2t_1-3t_2,\\
x_3 &=& t_1,\\
x_4 &=& t_2.
\end{array}
$$
Strang's {\em special solutions} $\vec{s}_3$ and $\vec{s}_4$ are the partials of $\vec{x}$ on the invented symbols $t_1$, $t_2$.
A particular solution $\vec{x}_p$ is obtained by setting all invented symbols to zero. Then
$$
\vec{x} = \vec{x}_p + t_1\vec{s}_3+t_2\vec{s}_4 =
\left(\begin{array}{r}2\\ -1 \\ 0\\ 0\end{array}\right)
+t_1\left(\begin{array}{r}1\\ -2 \\ 1\\ 0\end{array}\right)
+t_2\left(\begin{array}{r}2\\ -3 \\ 0\\ 1\end{array}\right)
$$




{\bf Below is a second solution which follows the methods of Strang's textbook.}

Solutions to the original equation are the same as solutions to the
last frame,
\[\begin{pmatrix}
  1 & 0 & -1 &-2\\
0 & 1& \phantom{-}2 &\phantom{-}3
\end{pmatrix}\vec{x}=\begin{pmatrix}2\\-1\end{pmatrix}\]

Columns 1 and 2 are pivot columns; columns 3 and 4 are free
columns, so $x_3$ and $x_4$ are the free variables.

A particular solution is obtained by setting $x_3=x_4=0$ and solving
for $x_1$ and $x_2$.
\[\begin{pmatrix}
  1 & 0 & -1 &-2\\
0 & 1& \phantom{-}2 &\phantom{-}3
\end{pmatrix}\begin{pmatrix}x_1\\x_2\\0\\0\end{pmatrix}=\begin{pmatrix}2\\-1\end{pmatrix}\]
The particular solution is
\[\bar{x}_p=\begin{pmatrix}2\\-1\\0\\0\end{pmatrix}\]

The other solutions differ from $\vec{x}_p$ by vectors in the
nullspace of $A$. A basis for the nullspace is given by the {\em special
solutions} obtained by setting one free variable equal to 1, the
others equal to 0, and solving for the non-free variables. This is equivalent
to taking partial derivatives on the free variables in the general solution
of the system of equations.

Special solution $\vec{s}_3$ is obtained by setting $x_3=1$ and
$x_4=0$ and solving
\[\begin{pmatrix}
  1 & 0 & -1 &-2\\
0 & 1& \phantom{-}2 &\phantom{-}3
\end{pmatrix}\begin{pmatrix}x_1\\x_2\\1\\0\end{pmatrix}=\begin{pmatrix}0\\0\end{pmatrix}\]
 So $\vec{s}_3=\begin{pmatrix}1\\-2\\1\\0\end{pmatrix}$

Similarly, $\vec{s_4}$ is obtained by setting $x_3=0$ and $x_4=1$ and solving
\[\begin{pmatrix}
  1 & 0 & -1 &-2\\
0 & 1& \phantom{-}2 &\phantom{-}3
\end{pmatrix}\begin{pmatrix}x_1\\x_2\\0\\1\end{pmatrix}=\begin{pmatrix}0\\0\end{pmatrix}\]

So $\vec{s}_4=\begin{pmatrix}2\\-3\\0\\1\end{pmatrix}$

Finally, all solutions are of the form
$\vec{x}_p+x_3\vec{s}_3+x_4\vec{s}_4$, so all solutions to the
equation are all vectors:
\[\vec{x}=\begin{pmatrix}2\\-1\\0\\0\end{pmatrix}+x_3 \begin{pmatrix}1\\-2\\1\\0\end{pmatrix}+x_4 \begin{pmatrix}2\\-3\\0\\1\end{pmatrix}\]
where $x_3$ and $x_4$ are arbitrary real numbers.
}

\problem{20}{
Prove that a system of 4 linear equations in 5 unknowns has either no solution
or infinitely many solutions.
}{}{
The number of leading variables is at most 4, because there are only 4 equations.
Therefore, there is at least one free variable. This means there cannot
be a unique solution, and there remains only two possibilities: no solution or infinitely many solutions.
}

\problem{20}{
Let matrix $A$ have 201 rows and 201 columns. All entries of $A$ are zero off the diagonal, except for the
number $-7$ in row 107, column 35. The diagonal entries of $A$ are all one. Describe the inverse of $A$, in words.
}{}{
It is the same as $A$ except change the $-7$ to $7$. Matrix $A$ is an elementary matrix for combo(35,107,-7).
The inverse of $A$ is the elementary matrix for combo(35,107,7).
}

%\problem{22}{
%
%}{}{
%
%}
%
%\problem{23}{
%
%}{}{
%
%}
%
%\problem{24}{
%
%}{}{
%
%}


\phantom{page}
\vfill \begin{center} End of the sample exam questions.\end{center}



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

\problemsdone
\end{document}

% End of the Document
