% S2015, 2250-10
\documentclass[11pt]{article}

%\documentclass[]{article}
%\usepackage{array}
%\usepackage{amsmath}
%\usepackage{amsfonts}
\usepackage{amssymb}
%\usepackage{amsxtra}
%\usepackage{epsfig}
%\setlength{\topmargin}{-.3 in}
%\setlength{\oddsidemargin}{0in}
%\setlength{\evensidemargin}{0in}
%\setlength{\textheight}{9.5in}
%\setlength{\textwidth}{6.5in}


 \setlength{\textheight}{10.4in}
 \setlength{\topmargin}{-1in}
 \setlength{\headheight}{0in}
 \setlength{\topsep}{0in}
 \setlength{\marginparwidth}{0in}
 \setlength{\marginparsep}{0in}
% \setlength{\footskip}{4pc}
%\setlength{\footheight}{0in}
 \setlength{\oddsidemargin}{0in}
 \setlength{\evensidemargin}{0in}
 \setlength{\textwidth}{6.4in}
 \setlength{\parskip}{4pt}
 \setlength{\parindent}{0pt}
\def\MAPLE{{\tt Maple}}
\def\MATLAB{{\tt Matlab}}
\def\MAXIMA{{\tt Maxima}}
\def\MATHEMATICA{{\tt Mathematica}}
\def\dd{\displaystyle}

% \begin{topics}{template} ... \end{topics}
% used like enumerate, itemize, description environments
% The item[] is never optional!
%
 \newcommand{\topicslabel}[1]{\mbox{#1}\hfil}
 \newenvironment{topics}[1]{
    \begin{list}{}{%
      \let\makelabel\topicslabel
      \settowidth{\labelwidth}{\topicslabel{#1}}
      \setlength{\leftmargin}{\labelwidth}
      \advance\leftmargin by 1.5em}
}{\end{list}}
\usepackage{alltt}
\usepackage{multicol}
%\usepackage{email}
\usepackage{hyperref}

\begin{document}
\begin{center} \large\sf Week 5 Examples\end{center}
\def\AA{@{}r@{\hspace{0.6ex}}r@{\hspace{0.6ex}}r@{\hspace{0.6ex}}r@{\hspace{0.6ex}}r@{\hspace{0.6ex}}r@{\hspace{0.6ex}}r@{\hspace{0.6ex}}r@{}}

{\bf Example 1}: Verify writing matrix product $A\vec{x}$ as a linear combination of the columns of $A$, by expansion of both sides, then compare the sides for equality of vectors.\\[1ex]
$\dd\left( \begin{array}{rr}
             7 &5 \\
             -2 & 8
\end{array}\right)
\left( \begin{array}{rr}
             3 \\
             9
\end{array}\right)
=
3\left( \begin{array}{rr}
             7\\
             -2
\end{array}\right)
+ 9\left( \begin{array}{rr}
             5\\
             8
\end{array}\right)
$ \quad (i.e., $A\vec{x}=x_1\mbox{(Col 1 of $A$)}
+ x_2\mbox{(Col 2 of $A$)}$ )

{\bf Example 2}: Display the $3\times 3$ elementary matrix $E$ for the given Toolkit operation.\\[1ex]
{\bf (2a)}~ Multiply row 2 of $I$ by $m$ [{\tt mult(2,m)}]\quad
{\bf (2b)}~ Swap rows 1 and 3 of $I$ [{\tt swap(1,3)}] \quad
{\bf (2c)}~ Add $m$ times rows 1 of $I$ to row 3 [{\tt combo(1,3,m)}]

{\bf Example 3}: Given elementary matrix $E$, find the unique Toolkit operation that created $E$ from the identity $I$.\\[1ex]
{\bf (3a)}~  $\dd\left( \begin{array}{\AA}
             1 &0& 0 \\
             0&1&m \\
             0&0&1
\end{array}\right)$ \quad
{\bf (3b)}~  $\dd\left( \begin{array}{\AA}
             0&1& 0 \\
             1&0&0 \\
             0&0&1
\end{array}\right)$ \quad
{\bf (3c)}~  $\dd\left( \begin{array}{\AA}
             1 &0& 0 \\
             0&1&0 \\
             0&0&m
\end{array}\right)$ \quad
{\bf (3d)}~  $\dd\left( \begin{array}{\AA}
             1 &0& 0 \\
             0&1&0 \\
             m&0&1
\end{array}\right)$ \quad
{\bf (3e)}~  $\dd\left( \begin{array}{\AA}
             m &0& 0 \\
             0&1&0 \\
             0&0&1
\end{array}\right)$
\\[1ex]
{\bf Answers}: {\tt combo(3,2,m), swap(1,2), mult(3,m), combo(1,3,m), mult(1,m)}

{\bf Example 4}: Label the matrices of the previous example when $m=1$ as $E_1,\ldots,E_5$. Find the product $A=E_1E_2E_3E_4E_5$ without using matrix multiply. {\bf Answer}: $A=
\left( \begin{array}{\AA}
              0 &1& 0\\[-0.5ex]
              1 &0& 1\\[-0.5ex]
              0 &0& 1
\end{array}\right)$, because $E_5=I$, then apply Toolkit operations
{\tt combo(1,3,1),
mult(3,1),
swap(1,2),
combo(3,2,1)}.

{\bf Example 5}: Find the inverses of the elementary matrices in Example 3.
\\[1ex]
{\bf Answer}:  $\left( \begin{array}{\AA}
             1 &0& 0 \\[0.5ex]
             0&1&-m \\[0.5ex]
             0&0&1
\end{array}\right)$ \quad
  $\left( \begin{array}{\AA}
             0&1& 0 \\[0.5ex]
             1&0&0 \\[0.5ex]
             0&0&1
\end{array}\right)$ \quad
 $\left( \begin{array}{\AA}
             1 &0& 0 \\[0.5ex]
             0&1&0 \\[0.5ex]
             0&0&\frac{1}{m}
\end{array}\right)$ \quad
 $\left( \begin{array}{\AA}
             1 &0& 0 \\[0.5ex]
             0&1&0 \\[0.5ex]
             -m&0&1
\end{array}\right)$ \quad
$\left( \begin{array}{\AA}
             \frac{1}{m} &0& 0 \\[0.5ex]
             0&1&0 \\[0.5ex]
             0&0&1
\end{array}\right)$

{\bf Example 6}: Find the inverse by methods 1 and 2 below:
$\left( \begin{array}{\AA}
            1&1  \\[0.5ex]
            0&2
\end{array}\right)$\quad
$\left( \begin{array}{\AA}
            2&0  \\[0.5ex]
            1&2
\end{array}\right)$\quad
$\left( \begin{array}{\AA}
            -1&1  \\[0.5ex]
            1&1
\end{array}\right)$\quad
$\left( \begin{array}{\AA}
            1&1  \\[0.5ex]
            2&1
\end{array}\right)$
 \hspace*{3ex}{\bf Method 1}. $\left( \begin{array}{\AA}
            a&b  \\[0.5ex]
            c&d
\end{array}\right)^{-1} = \frac{1}{\Delta}\left( \begin{array}{\AA}
            d&-b  \\[0.5ex]
            -c&a
\end{array}\right)$ where $\Delta=ad-bc$.\\[1ex]
\hspace*{3ex}{\bf Method 2}. Toolkit reduction of $C=<A|I>$ to $<I|B>$ where $B=A^{-1}$.
\\[1ex]
{\bf Answers}:
$\left( \begin{array}{\AA}
            1&-\frac12  \\[0.5ex]
            0&\frac12
\end{array}\right)$\quad
$\left( \begin{array}{\AA}
            \frac12&0  \\[0.5ex]
            -\frac14&\frac12
\end{array}\right)$\quad
$\left( \begin{array}{\AA}
            -\frac12&\frac12  \\[0.5ex]
            \frac12&\frac12
\end{array}\right)$\quad
$\left( \begin{array}{\AA}
            -1&1  \\[0.5ex]
            2&-1
\end{array}\right)$\

{\bf Example 7}: Solve the equations $\left\{\begin{array}{\AA}
            -x_1&+&x_2 &=& 4,  \\[0.5ex]
            2x_1&-&x_2 &=& 1,
\end{array}\right.$ by converting to a matrix equation $A\vec{x}=\vec{b}$
and solving for $\vec{x}=A^{-1}\vec{b}$. Check the answer.

{\bf Example 8}: Which of the following matrices have inverses? Answer without finding the inverse.\\[1ex]
{\bf (8a)}~ $\left( \begin{array}{\AA}
            -1&1  \\[0.5ex]
            2&-3
\end{array}\right)$\quad
{\bf (8b)}~ $\left( \begin{array}{\AA}
            -1&1  \\[0.5ex]
            1&-1
\end{array}\right)$\quad
{\bf (8c)}~ $\left( \begin{array}{\AA}
            -1&1&1 \\[0.5ex]
            0&1&1 \\[0.5ex]
            0&-1&1
\end{array}\right)$\quad
{\bf (8d)}~ $\left( \begin{array}{\AA}
            1&0&1 \\[0.5ex]
            0&1&1 \\[0.5ex]
            1&1&2
\end{array}\right)$\quad
{\bf (8e)}~ $\left( \begin{array}{\AA}
            1&0&1 \\[0.5ex]
            0&1&1 \\[0.5ex]
            1&1&1
\end{array}\right)$

{\bf Example 9}: Find the vector general solution in the form $\vec{x}$ = homogeneous + particular.\\[1ex]
{\bf (9a)}~ $\left\{\begin{array}{\AA}
            -x_1&+&x_2 &=& 4,  \\[0.5ex]
            2x_1&-&x_2 &=& 1,
\end{array}\right.$ \quad
{\bf (9b)}~ $\left\{\begin{array}{\AA}
            -x_1&+&x_2 &+& x_3 &=& 4,  \\[0.5ex]
                &-&5x_2 &-& 3x_3&=& -15, \\[0.5ex]
            -3x_1&-& 2x_2& &  &=& -3.
\end{array}\right.$ \quad
{\bf (9c)}~ $\left\{\begin{array}{\AA}
  -x_1&+&x_2 &+& 2x_3 &=& 4,  \\[0.5ex]
  2x_1&-&x_2 & & &=& 1, \\[0.5ex]
  && && 0 &=& 0.
\end{array}\right.$

{\bf Example 10}: Evaluate determinants by Sarrus' $2\times 2$ and $3\times 3$ Rule.\\
{\bf Notation}: Only determinants have vertical bars.\\[1ex]
{\bf (10a)}~ $\left| \begin{array}{\AA}
            -1&1  \\[0.5ex]
            2&-3
\end{array}\right|$\quad
{\bf (10b)}~ $\left| \begin{array}{\AA}
            -1&1  \\[0.5ex]
            1&-1
\end{array}\right|$\quad
{\bf (10c)}~ $\left| \begin{array}{\AA}
            -1&1&1 \\[0.5ex]
            0&1&1 \\[0.5ex]
            0&-1&1
\end{array}\right|$\quad
{\bf (10d)}~ $\left| \begin{array}{\AA}
            1&0&1 \\[0.5ex]
            0&1&1 \\[0.5ex]
            1&1&2
\end{array}\right|$\quad
{\bf (10e)}~ $\left|\begin{array}{\AA}
            1&0&1 \\[0.5ex]
            0&1&1 \\[0.5ex]
            1&1&1
\end{array}\right|$

\end{document}
