% 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 4 Examples\end{center}

{\bf Example 1}: Solve the system or explain why it cannot be solved.

  $\dd\left\{ \begin{array}{lcr}
         x + 2y &=&  1\\
         x -  y &=&  -2
         \end{array}\right.$
 \hfill
     $\dd\left\{ \begin{array}{lcr}
         x + 2y &=&  1\\
         x + 2y &=&  2
         \end{array}\right.$
 \hfill
      $\dd\left\{ \begin{array}{lcr}
         x + 2y &=&  1\\
              0 &=&  0
              \end{array}\right.$

{\bf Answers}. Unique solution $x=-1, y=1$; No solution, parallel lines; Infinitely many solutions, parametric equation of the line: $x=1-2t_1, y=t_1$.

{\bf Example 2}: Consider $y'' -121y = 0$, $y(0)=44$, $y'(0)=22$.
      The supplied general solution is $y=A e^{11 x} + B e^{-11 x}$.
      Substitute $y$ into relations $y(0)=44, y'(0)=22$ to obtain a $2\times 2$ system for unknowns $A,B$. Solve it for the unique solution
        $A=23, B=21$.

 {\bf Example 3}: Determine the lead and free variables. Solve the echelon system.
$$\dd\left\{ \begin{array}{rcrcrcrcrcrcr}
      x_1 &-& 2x_2 &+& 3x_3 &+& 2x_4 &+&  x_5  &=& 10,\\
          & &      & &  x_3 & &      &+&  2x_5 &=& -3,\\
          & &      & &      & & x_4  &-&  4x_5 &=&  7
 \end{array}\right.$$
 {\bf Answer}: Lead = $x_1,x_3,x_4$; Free = $x_2,x_5$. Solution
 $x_1=5+2t_1-3t_2,x_2=t_1,x_3=-3-2t_2,x_4=7+4t_2,x_5=t_2$.
 Method: Assign invented symbols $t_1,t_2$ to the free variables. Then back-substitute. Best method: Find the reduced echelon system (the {\em Last Frame}) by Toolkit {\tt combo} applied to the variable list in reverse order. Then apply the {\em Last Frame Algorithm}: Assign invented symbols to the free variables, isolate the lead variables, then back-substitute.
 Report for each variable an equation in terms of the invented symbols (the scalar general solution).

 {\bf Example 4}:
 The unique solution case.
                     %C:=Matrix([[1,2,1,1],[1,3,1,2],[1,1,2,3]]);
$$\dd\left\{ \begin{array}{rcrcrcrcrcrcr}
     x &+& 2y &+& z &=& 1 \\
     x &+& 3y &+& z &=& 2 \\
     x &+& y &+& 2z &=& 3
\end{array}\right.$$
       (1) Find the scalar form of the unique solution.\quad
       (2) Why are there only lead variables in the last frame?\quad
       (3) Why are there no free variables?

 {\bf Example 5}: The no solution case.
                     %C:=Matrix([[1,2,1,1],[1,3,1,2],[2,5,2,4]]);
$$\dd\left\{ \begin{array}{rcrcrcrcrcrcr}
      x &+& 2y &+&  z &=& 1\\
      x &+& 3y &+&  z &=& 2\\
     2x &+& 5y &+& 2z &=& 4
\end{array}\right.$$
       Use the Toolkit {\tt combo, swap, mult} to find a frame with a signal equation.

 {\bf Example 6}: The infinitely many solution case.
                     
\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@{}}
$$%C:=Matrix([[1,2,1,1],[1,3,1,2],[2,5,2,3]]);
\mbox{({\bf 6a})~~}\dd\left\{ \begin{array}{\AA}
      x &+& 2y &+&  z &=& 1 \\
      x &+& 3y &+&  z &=& 2 \\
     2x &+& 5y &+& 2z &=& 3
\end{array}\right.\quad\quad
%C:=Matrix([[1,2,1,1],[3,6,3,3],[0,0,0,0]]);
\mbox{({\bf 6b})~~}\left\{ \begin{array}{\AA}
      x &+& 2y &+&  z& &= 1 \\
     3x &+& 6y &+& 3z &=& 3 \\
        & &    & &  0 &=& 0
\end{array}\right.\quad\quad
% C:=Matrix([[0,0,0,0],[0,0,0,0],[0,0,0,0]]);
\mbox{({\bf 6c})~~}\left\{ \begin{array}{\AA}
                0 &=& 0 \\
                0 &=& 0 \\
                0 &=& 0
\end{array}\right.$$
      (1) Find the last frame or RREF.\quad
       (2) How many free variables?\quad
        (3) Apply the last frame algorithm to find the solution.

 {\bf Example 7}: Determine for 
 each value of symbol $k$ the possibility: (1) Unique solution, (2) No solution, (3) Infinitely many solutions.
$$\mbox{({\bf 7a})~~}\dd\left\{ \begin{array}{rcrcrcrcrcrcr}
             x &+& ky &=& 2,\\
        (2-k)x &+&  y &=& 3.
\end{array}\right.
\quad\quad
\mbox{({\bf 7b})~~}\dd\left\{ \begin{array}{rcrcrcrcrcrcr}
             3x &+& 2y &=& 0,\\
             6x &+& ky &=& 0.
\end{array}\right.$$

{\bf Example 8}: Verify the conversions from scalar equations to augmented matrix, or conversely.\\[1ex]
$$\mbox{({\bf 8a})~~}\dd\left\{ \begin{array}{\AA}
             x &+& 3y &=& 2\\
            -x &+&  y &=& 3
\end{array}\right.
\quad\longrightarrow
\dd\left( \begin{array}{rr|r}
             1 &3 & 2\\
             -1 & 1 & 3
\end{array}\right)
\quad\quad
\mbox{({\bf 8b})~~}\dd
\dd\left( \begin{array}{rr|r}
             7 &5 & 1\\
             -2 & 8 & -1
\end{array}\right)
\quad\longrightarrow
\left\{ \begin{array}{\AA}
             7x &+& 5y &=& 1\\
            -2x &+& 8y &=& -1
\end{array}\right.
$$


{\bf Example 9}: Classify as: diagonal, scalar,
upper triangular, lower triangular, identity, zero, none of these. More than one classification is possible.
\\[1ex]
$\mbox{({\bf 9a})~~}\dd\left(\begin{array}{rrr}
1&0&0  \\
0&1&0 \\
0&0&1   
\end{array}\right)$
\quad\quad
$\mbox{({\bf 9b})~~}\dd\left(\begin{array}{rrr}
1&0&0  \\
0&0&0 \\
0&0&3
\end{array}\right)$
\quad\quad
$\mbox{({\bf 9c})~~}\dd\left(\begin{array}{rrr}
1&0&2  \\
0&0&0 \\
0&0&0
\end{array}\right)$
\quad\quad
$\mbox{({\bf 9d})~~}\dd\left(\begin{array}{rrr}
\pi &0&0  \\
0&0&0 \\
0&e&1
\end{array}\right)$

{\bf Example 10}: Define $\vec{a}=2\vec{\imath}+3\vec{\jmath}$,
$\vec{b}=-3\vec{\imath}+2\vec{\jmath}$. Compute the dot product $\vec{a}\cdot \vec{b}=a_1b_1+a_2b_2$, using the definitions
$\vec{\imath}=\left(\begin{array}{r}1\\ 0\end{array}\right)$,
$\vec{\jmath}=\left(\begin{array}{r}0\\ 1\end{array}\right)$.
Because of identity $\vec{a}\cdot \vec{b}= |\vec{a}|| \vec{b}|\cos(\theta)$, the answer $\vec{a}\cdot \vec{b}=0$ means the vectors are orthogonal ($\theta=90$ degrees).


{\bf Example 11}: Multiply.\\[1ex]
$\mbox{({\bf 11a})~~}\dd\left(\begin{array}{\AA}
1&0&2  \\
0&1&0 \\
2&0&1
\end{array}\right)
\left(\begin{array}{\AA}
1 \\
-1\\
2
\end{array}\right)
$
\quad\quad
$\mbox{({\bf 11b})~~}\dd\left(\begin{array}{\AA}
1&0&2  \\
0&1&0 \\
2&0&1
\end{array}\right)
\left(\begin{array}{\AA}
1 & 2\\
-1 & 1\\
2 & -1
\end{array}\right)
$
\quad\quad
$\mbox{({\bf 11c})~~}\dd\left(\begin{array}{\AA}
1&0&2  \\
0&1&0 
\end{array}\right)
\left(\begin{array}{\AA}
1 & 2\\
0 & 3\\
2 & -1
\end{array}\right)
$

{\bf Example 12}: Let $A=\left( \begin{array}{rr}
             7 &5 \\
             -2 & 8
\end{array}\right)$, $B=\left( \begin{array}{rr}
             7 &5 \\
             -2 & 8
\end{array}\right)$, $I=\left( \begin{array}{rr}
             1 &0 \\
             0 & 1
\end{array}\right)$.\\[0.5ex]
Compute $C=2AB+3B-5A+4I$.


{\bf Example 13}: Write in matrix multiply form $A\vec{x}=\vec{b}$.
\\[1ex]
$\dd
\left\{ \begin{array}{\AA}
             7x &+& 5y &=& 1\\
            -2x &+& 8y &=& -1
\end{array}\right.
$\quad {\bf Answer}: $\dd\left( \begin{array}{rr}
             7 &5 \\
             -2 & 8 
\end{array}\right)
\left( \begin{array}{rr}
             x \\
             y
\end{array}\right)
=
\left( \begin{array}{rr}
             1\\
             -1
\end{array}\right)$, 
$A=\dd\left( \begin{array}{rr}
             7 &5 \\
             -2 & 8
\end{array}\right)$,
$\vec{b}
=
\left( \begin{array}{rr}
             1\\
             -1
\end{array}\right)$\\
Test the answer with {\bf equality of matrices}: two matrices are equal if and only if they have matching entries.

{\bf Example 14}: An $m\times n$ matrix $A$ is always the coefficient matrix of a homogeneous system $A\vec{x}=\vec{0}$, which represents a scalar system of $m$ equations in $n$ unknowns (the components of $\vec{x}$). The {\bf rank} of $A$ is the number of leading variables. The {\bf nullity} of $A$ is the number of free variables. Always, {\bf rank} + {\bf nullity} = number of variables. Find the rank and nullity.\\[1ex]
$\left( \begin{array}{\AA}
             7 &5 \\
             -2 & 8
\end{array}\right)$,\quad
$\left( \begin{array}{\AA}
             7 &5 \\
             14 & 10
\end{array}\right)$,\quad
$\left( \begin{array}{\AA}
             1 &0 \\
             0 & 1
\end{array}\right)$,\quad
$\left( \begin{array}{\AA}
             0& 0\\
             0&0
\end{array}\right)$,\quad
$\left( \begin{array}{\AA}
             1& 7 &5 \\
             0&-2 & 8
\end{array}\right)$,\quad
$\left( \begin{array}{\AA}
             1& 2 &3&3&5 \\
             0&0& 0&0&0 \\
             0&1& 0&0&1 
\end{array}\right)$,\quad
$\left( \begin{array}{\AA}
             1& 2  \\
             0&0 \\
             1&1 \\
             0&1
\end{array}\right)$

\end{document}
