% latex2e
\documentclass[12pt]{article}

\oddsidemargin 5pt \evensidemargin 5pt \marginparwidth 68pt
\marginparsep 10pt \topmargin 10pt \headheight 10pt
\headsep 15pt \footskip 35pt
\textheight = 625pt  \textwidth 440pt \columnsep 10pt \columnseprule 5pt

\pagestyle{myheadings}
\def\la{\langle}  \def\ra{\rangle}
\def\ansbox{\fbox{\rule[-.25in]{0in}{.5in} answer}}
\def\arr{\Rightarrow}
\def\header{{\hfill Exam 3 \hfill A. Miller \hfill Spring  99
                                       \hfill Math 210\hfill}}
\markboth\header\header
\newcount\probno
\newcount\total
\newwrite\examTBLFile

\probno=0
\def\prob#1{\advance\probno by 1 \newpage  % \par
    \noindent\the\probno . (#1 \%) \advance\total by #1
    \immediate\write\examTBLFile{\the\probno
       \string& #1 \string&
       \string\qquad \string\\ \string\hline}}

\def\probx#1{\advance\probno by 1 % \newpage  % \par
    \noindent\the\probno . \advance\total by #1
    \immediate\write\examTBLFile{\the\probno
       \string& #1 \string&
       \string\qquad \string\\ \string\hline}}
\def\finishtbl{
    \immediate\write\examTBLFile{Total \string& \the\total
    \string& \qquad \string\\ \string\hline}
     }

\newwrite\ans
\immediate\openout\ans=answers
\outer\def\answer{\par\medbreak
  \immediate\write\ans{}
  \immediate\write\ans{\string\bigskip \the\probno . }
  \copytoblankline}
\outer\def\putanswer{\par\medbreak
  \immediate\write\ans{}
  \copytoblankline}
\def\copytoblankline{\begingroup\setupcopy\copyans}
\def\setupcopy{\def\do##1{\catcode`##1=12}\dospecials
     \catcode`\|=12\obeylines}
{\obeylines \gdef\copyans#1
  {\def\next{#1}%
  \ifx\next\empty\let\next=\endgroup%
  \else\immediate\write\ans{\next}\let\next=\copyans\fi\next}}
\def\printanswers{\newpage\begin{center} Answers \end{center}
    \immediate\closeout\ans\input answers}

\begin{document}
%\noindent  \header

\bigskip

\begin{center}
No calculators.  No note or index cards.   \\
Show all work.  Explain your answers.      \\
In general, little credit will be given for answers alone. \\
You do not need to simplify fractions.\\
\end{center}

\par\vskip .25in

\begin{center}
Name\makebox[3in]{\hrulefill} \\
\end{center}

\begin{center}
TA: Winston Yang\\
Circle the time of your discussion section: \\
\end{center}
\begin{center}
\hfill Tues 8:50 \hfill Tues 9:55
\hfill Thurs 8:50 \hfill Thurs 9:55 \hfill \\
\end{center}

% end file with \finishtbl
\bigskip
\begin{center} \Large
 \begin{tabular}{||c|c|c||} \hline\hline
  Problem & Points & Score \\  \hline\hline
  \input{exam.tbl}
  \hline \hline
 \end{tabular}
\end{center}

\immediate\openout\examTBLFile=exam.tbl

\setcounter{page}{0}



\prob{16} Consider the set of solutions of
the system of equations
$$ax-2y=6$$
$$x+y =b$$
Where $a$ and $b$ are constants.  The following problems
may have more than one correct solution.  You should only give one,
but explain why it is correct.
\par\bigskip
(a) Give an example of an $a$ and $b$ such that this system
has no solution.
\par\bigskip $a=$ \hspace{2in}  $b=$
\par\bigskip (b) Give an example of $a$ and $b$ such that this system
has infinitely many solutions.
\par\bigskip $a=$ \hspace{2in}  $b=$
\answer \par (a) $a=-2, b=0$ (or any other pair with $a=-2$ and $b\not=-3$)
$$-2x-2y=6$$
$$  x+y =0$$
implies
$$  x+y=-3$$
$$  x+y =0$$
which has no solutions since it implies $0=3$.
\par (b) $a=-2, b=-3$  since this makes both equations the same.
$$-2x-2y=6$$
$$  x+y =-3$$

\prob{16}
The following system has a unique solution.  Find it and plug it
back into the system to verify that it is correct.
$$\begin{array}{ccl}
%   1     2      3     4
    x +   y +    z   + w       & = &  10   \\
         -y +    z   + w       & = &   5   \\
         3y +   2z   + w       & = &  16   \\
   2x  + 2y +   2z             & = &  12    \\
\end{array}$$
\par\bigskip $x=$
\par\bigskip $y=$
\par\bigskip $z=$
\par\bigskip $w=$

\answer The augmented matrix is
$$\left[\begin{array}{rrrr|r}
1 &   1 &  1 &  1 &  10 \\
0 &  -1 &  1 &  1 &   5 \\
0 &   3 &  2 &  1 &  16 \\
2 &   2 &  2 &  0 &  12 \\
\end{array}\right]
\;\;\;\;\;
\left[\begin{array}{rrrr|r}
1 &   1 &  1 &  1 &  10 \\
0 &  -1 &  1 &  1 &   5 \\
0 &   3 &  2 &  1 &  16 \\
0 &   0 &  0 & -2 &  -8 \\
\end{array}\right]
\;\;\;\;\;
\left[\begin{array}{rrrr|r}
1 &   1 &  1 &  1 &  10 \\
0 &  -1 &  1 &  1 &   5 \\
0 &   0 &  5 &  4 &  31 \\
0 &   0 &  0 & -2 &  -8 \\
\end{array}\right]$$
\par
\hspace{.5in} $(-2\times row_1) + row_4 \Rightarrow row_4$
\hspace{.5in} $(3\times row_2) + row_3 \Rightarrow row_3$
\par Backsubstituting gives:
$$\begin{array}{rcrr}
x+y+z+w &=& 10  & \arr x=10-y-z-w=10-2-3-4=1 \arr x=1 \\
-y+z+w &=& 5    & \arr -y=5-z-w=5-3-4=-2 \arr y=2 \\
5z+4w  &=& 31   & \arr 5z=31-4w=31-16=15 \arr z=3 \\
-2w    &=& -8   & \arr w=4 \\
\end{array}$$

\prob{16} Calculate the following.  (If the dimensions are incorrect,
say that it is ``undefined''.)
\par\bigskip\bigskip
$ \left[\begin{array}{rr}
     0   &   1       \\
    -1   &   0       \\
     1   &   1       \\
\end{array}\right] \;\;+\;\;
\left[\begin{array}{rr}
    -1   &   0       \\
     1   &   2       \\
     1   &  -1       \\
\end{array}\right]\;\; = $ \hfill
\par\vfill
$ \left[\begin{array}{rrr}
     0   &   1  &    3     \\
    -1   &   0  &    1     \\
     1   &   1  &    0     \\
\end{array}\right] \;
\left[\begin{array}{r}
    -1          \\
     1          \\
     1          \\
\end{array}\right] \;\; = $ \hfill
\par\vfill
$\left[\begin{array}{r}
    -1          \\
     1          \\
     2          \\
\end{array}\right] \;
\left[\begin{array}{rrr}
     0   &   1  &    3  \\
\end{array}\right]\;\; = $ \hfill
\par\vfill
\answer %
$$\left[\begin{array}{rr}
    -1   &   1       \\
     0   &   2       \\
     2   &   0       \\
\end{array}\right] \;\;\;\;\;
\left[\begin{array}{r}
     4          \\
     2          \\
     0          \\
\end{array}\right] \;\;\;\;\;
 \left[\begin{array}{rrr}
     0   &   -1  &    -3     \\
     0   &    1  &     3     \\
     0   &    2  &     6     \\
\end{array}\right]
$$

\prob{18} Find a 3 by 3 matrix $B$ so that $A(B+I)=I$ where $I$ is
the 3 by 3 identity matrix and
\par\bigskip
$A= \left[\begin{array}{rrr}
     0   &   1  &    0     \\
    -1   &   0  &   -3     \\
     1   &   0  &    2     \\
\end{array}\right] \;\;\;\;
I= \left[\begin{array}{rrr}
     1   &   0  &    0     \\
     0   &   1  &    0     \\
     0   &   0  &    1     \\
\end{array}\right] \;\;\;\;
B=$
\answer $A(B+I)=I$ so $B+I=A^{-1}$ and $B=A^{-1}-I$.  
To find $A^{-1}$:
$$\left[\begin{array}{rrr|rrr}
     0   &   1  &    0    & 1 & 0 & 0 \\
    -1   &   0  &   -3    & 0 & 1 & 0 \\
     1   &   0  &    2    & 0 & 0 & 1 \\
\end{array}\right] $$
swap rows 
$$\left[\begin{array}{rrr|rrr}
     1   &   0  &    2    & 0 & 0 & 1 \\
     0   &   1  &    0    & 1 & 0 & 0 \\
    -1   &   0  &   -3    & 0 & 1 & 0 \\
\end{array}\right]$$
$(row_1 + row_3) \Rightarrow row_3$
$$\left[\begin{array}{rrr|rrr}
     1   &   0  &    2    & 0 & 0 & 1 \\
     0   &   1  &    0    & 1 & 0 & 0 \\
     0   &   0  &   -1    & 0 & 1 & 1 \\
\end{array}\right]$$
$(row_3\times 2 + row_1 )\Rightarrow row_1$
$$\left[\begin{array}{rrr|rrr}
     1   &   0  &    0    & 0 & 2 & 3 \\
     0   &   1  &    0    & 1 & 0 & 0 \\
     0   &   0  &   -1    & 0 & 1 & 1 \\
\end{array}\right]$$
$(row_3\times -1)\Rightarrow row_3$
$$\left[\begin{array}{rrr|rrr}
     1   &   0  &    0    & 0 &  2 &  3 \\
     0   &   1  &    0    & 1 &  0 &  0 \\
     0   &   0  &    1    & 0 & -1 & -1 \\
\end{array}\right]$$
$$B=A^{-1}-I=\left[\begin{array}{rrr}
      -1 &   2 &  3 \\
       1 &  -1 &  0 \\
       0 &  -1 & -2 \\
\end{array}\right]
$$ 

\prob{16} Formulate the following as a linear programming problem.
Set up a table for the data.
Identify the variables, the constraints, and the objective function.
Maximize or minimize?
\par{\bf Do not attempt to solve the problem.}
\par\bigskip
A farmer owns a {\bf 300} acre farm and can plant any combination of
three crops.  Crop A requires 1 man-day of labor and \$10 of capital
for each acre planted.  Crop B requires 4 man-days of labor and
\$20 of capital for each acre planted.   Crop C requires 3 man-days
of labor and \$15 of capital for each acre planted.
Crop A produces \$40 of revenue for each acre planted,
Crop B \$60, and Crop C \$50.
The farmer has \$3300 of capital and 485 man-days of labor available
for the year.  What is the optimal planting strategy?
\par Set up but do not solve.  Labor is supplied by the farmer
and his family and so costs nothing.  Profit is revenue minus cost.
\answer We use the following table:
\par\bigskip \begin{tabular}{|c|r|r|c|c|} \hline
        & Labor &  Capital &  Revenue & Profit \\ \hline
Crop A  &   1  &     10    &     40    &  30    \\ \hline
Crop B  &   4  &     20    &     60    &  40   \\ \hline
Crop C  &   3  &     15    &     50    &  35   \\ \hline
        & 485  &    3300   & &\\ \hline
\end{tabular}
\par\bigskip 
Letting $x$ be the number of acres of Crop A, $y$ Crop B,
and $z$ Crop C.   Then we seek to maximize the profit
$$P=30x+40y+35z$$
subject to the constraints:
$$x,y,z \geq 0$$
$$x+y+z \leq 300$$
$$x+4y+3z\leq 485$$
$$10x+20y+15z\leq 3300$$

\prob{18}
Graph the region $F$ determined by the following 5 inequalities.
Determine all the corner points of $F$ and shade the region $F$.
$$x\geq 0$$
$$y\geq 0$$
$$ x  + 3y \geq 6$$
$$ x  +  y \geq 4$$
$$3x  +  y \geq 6$$
\par\bigskip
Find the minimum of $z=x+2y$ and the maximum of $z=x+2y$ in the region $F$.
If one or the other doesn't exist, explain why.
\answer There are four corner points: $(0,6),(1,3),(3,1),(6,0)$.
The region $F$ is unbounded and contains points $(x,y)$ which are
arbitrarily large, so $z=x+2y$ has no maximum.  Its minimum is
at $(3,1)$ where $z=5$.

\finishtbl
\printanswers

\end{document}


