\documentclass[t]{paulslides}
\usepackage{pgf,tikz}
\usepackage{enumerate}
\usetikzlibrary{arrows}
\usepackage{amsthm}

\definecolor{UniBlue}{RGB}{83,121,170}
\setbeamercolor{block title}{use=structure,fg=white,bg=blue!75!black}
\setbeamercolor{block body}{use=structure,fg=black,bg=blue!10!white}

\title{MA162: Finite mathematics}
\subtitle{Gauss Jordan}
\author{Paul Koester}
\institute{University of Kentucky}
\date{March 31, 2014}

\begin{document}

\maketitle

\begin{frame}[t]{Last Time}
\begin{itemize}
  \item We introduced the Gauss-Jordan elimination method for solving systems of linear equations.
  \item In all of those problems, the system of equations had a unique solution.
  \item Today, we'll see how to deal with the two other cases:  No solution and Infinitely many solutions 
\end{itemize}
\end{frame}

\begin{frame}[t]{Applied Problem}
Mr. and Mrs. Garcia have a total of \(\$100,000\) to be invested in stocks, bonds, and a money market account.  
The stocks have a rate of return (RoR) of \(12\%\)/year, the bonds pay \(8\%\)/year and the money market pays \(6\%\)/year.  
The Garcias have stipulated that the amount invested in stocks should be equal to the sum of the amount invested in bonds plus twice the amount invested in money markets.  
How should the Garcias allocate their resources if they require an annual income of \(\$12,000\) from their investments?  
\vfill
This looks very similar to example from last time.  But very small changes in numbers can result in VERY DIFFERENT behavior of solutions.
\end{frame}

\begin{frame}[t]{Garcia's System of Equations}
Let \(S\) denote the amount in stocks, \(B\) the amount in bonds, and \(M\) the amount in money markets.\\
\vfill
\textbf{Three equations:}\\
The Garcia's capital:   \(  S + B + M = \$100,000\) \\
Required return:   \(  0.12S + 0.08B + 0.06M = \$12,000\) \\
Desired Diversification:   \(  S =   B + 2M = 0\) \\  \vfill
Rewrite the last one as \(S - B + 2M = 0\), and build the matrix:
\vfill
 \[
  \left[\begin{array}{ccc|c}
          1 &       1  &        1 &  100000 \\
    0.12 &  0.08  &  0.06 &    12000 \\
          1 &      -1  &      -2 &              0 \\
  \end{array}\right]
  \]
\vfill  
Now apply Gauss-Jordan
  
\end{frame}

\begin{frame}[t]{Doing Gauss-Jordan}
\begin{scriptsize}
 \[
  \left[\begin{array}{ccc|c}
          1 &       1  &        1 &  100000 \\
    0.12 &  0.08  &  0.06 &    12000 \\
          1 &      -1  &      -2 &              0 \\
  \end{array}\right]
  \xrightarrow[R_2 \mapsto R_2 - 0.12R_1]{R_3 \mapsto R_3 - R_1}
  \left[\begin{array}{ccc|c}
          1 &        1  &         1  &   100000 \\
          0 &  -0.08  &  -0.06 &               0 \\
          0 &       -2  &       -3  &  -100000 \\
  \end{array}\right]
  \]
  \[
  \xrightarrow{R_2 \mapsto \frac{1}{-0.04}R_2}
  \left[\begin{array}{ccc|c}
          1 &        1  &         1  &   100000 \\
          0 &        1  &      1.5 &               0 \\
          0 &       -2  &       -3  &  -100000 \\
  \end{array}\right]
  \xrightarrow{R_3 \mapsto R_3 + 2R_2}
  \left[\begin{array}{ccc|c}
          1 &        1  &         1  &   100000 \\
          0 &        1  &      1.5 &               0 \\
          0 &        0  &         0  &  -100000 \\
  \end{array}\right]
 \]
 \end{scriptsize}
The bottom row reads \(  0S + 0B + 0M = -100000\).  In other words, \(  0 = -100,000\)!! \\

The practical interpretation is that there is no way to satisfy all of the Garcia's requirements.  
They'll either have to invest more, lower their required return, change their desired diversification, etc.

\end{frame}

\begin{frame}[t]{Identifying Systems with no solution}
\begin{itemize}
  \item Begin using the Gauss-Jordan method on the augmented matrix  \vfill
  \item If, at any point in the calculation, you come across a row with all zeros on the left of the vertical bar
            but a nonzero entry on the right side of the same row, then STOP.  Your system is inconsistent.  In other words, it has no solution. 
\end{itemize}
\end{frame}

\begin{frame}[t]{Revising the Garcia's Expectations}
Mr. and Mrs. Garcia have a total of \(\$100,000\) to be invested in stocks, bonds, and a money market account.  
The stocks have a rate of return (RoR) of \(12\%\)/year, the bonds pay \(8\%\)/year and the money market pays \(6\%\)/year.  
The Garcias have stipulated that the amount invested in stocks should be equal to the sum of the amount invested in bonds plus twice the amount invested in money markets.  
How should the Garcias allocate their resources if they require an annual income of \(\$10,000\) from their investments?  
\vfill
Thus, the Garcias have decided to lower their expected return.
\end{frame}

\begin{frame}[t]{Doing Gauss-Jordan on revised system}
\begin{scriptsize} 
 \[
  \left[\begin{array}{ccc|c}
          1 &       1  &        1 &  100000 \\
    0.12 &  0.08  &  0.06 &    10000 \\
          1 &      -1  &      -2 &              0 \\
  \end{array}\right]
  \xrightarrow[R_2 \mapsto R_2 - 0.12R_1]{R_3 \mapsto R_3 - R_1}
  \left[\begin{array}{ccc|c}
          1 &        1  &         1  &   100000 \\
          0 &  -0.04  &  -0.06 &     -2000 \\
          0 &       -2  &       -3  &  -100000 \\
  \end{array}\right]
  \]
  \[
  \xrightarrow{R_2 \mapsto \frac{1}{-0.04}R_2}
  \left[\begin{array}{ccc|c}
          1 &        1  &         1  &   100000 \\
          0 &        1  &      1.5 &      50000 \\
          0 &       -2  &       -3  &  -100000 \\
  \end{array}\right]
  \xrightarrow{R_3 \mapsto R_3 + 2R_2}
  \left[\begin{array}{ccc|c}
          1 &        1  &         1  &   100000 \\
          0 &        1  &      1.5 &      50000 \\
          0 &        0  &         0  &               0 \\
  \end{array}\right]
 \]
 \end{scriptsize}  
Like before, there is no pivot column in the bottom row.  However, things are very different this time, as the bottom row 
simply reads \(0 = 0\), a true, but not useful, assertion.

\end{frame}

\begin{frame}[t]{Finishing the calculation}
Lets continue with Gauss-Jordan:
\[
  \left[\begin{array}{ccc|c}
          1 &        1  &         1  &   100000 \\
          0 &        1  &      1.5 &      50000 \\
          0 &        0  &         0  &               0 \\
  \end{array}\right]
 \xrightarrow{R_1\mapsto R_1 - R_2}
  \left[\begin{array}{ccc|c}
          1 &        0  &      -0.5  &     50000 \\
          0 &        1  &       1.5 &      50000 \\
          0 &        0  &          0  &               0 \\
  \end{array}\right]
 \]
Put the variables back in
\begin{align*}
  S - 0.5M &= 50000 \\
  B + 1.5M &= 50000 \\
\end{align*}
Rewrite as follows:
\begin{align*}
  S  & =  50000  + 0.5 t \\
  B  & = 50000   - 1.5 t \\
  M  & =  t \\
\end{align*}
\end{frame}

\begin{frame}[t]{Interpreting the Result}
\begin{align*}
  S  & =  50000  + 0.5 t \\
  B  & = 50000   - 1.5 t \\
  M  & =  t \\
\end{align*}
The Garcias have flexibility in choosing their allocation.\\
For example, if they put \$10,000 in the money market, then they should put \(S = \$50,000 + 0.5*\$10,000 = \$55,000\) in stocks and 
\(B = \$50,000 - 1.5*\$10,000 = \$35,000\) in bonds.\\

Algebraically, the value of \(t\) could be anything.  It is a free parameter.\\
\end{frame}


\begin{frame}[t]{Interpreting the Result}

Realistically, each of S, B, and M should be nonnegative (in this class we don't allow short-sells), 
in which case t can take values between \(0\) and \(\$33,333.33\).\\
( If \(t < 0\) then Garcias put negative amount in money market.  If \(t > \$33,333.33\) then they put negative amount in bonds.) 

\textbf{Exercise:}  Find the allocation with the maximal amount invested in stocks
\end{frame}

\begin{frame}[t]{Row-Reduced Form of a Matrix}
A matrix is in row-reduced form if
  \begin{itemize}
    \item Each row consisting entirely of zeros lies below any other row with nonzero entries \vfill
    \item The first nonzero entry in a row (reading from left to right) is a 1 (called a leading 1) \vfill
    \item In any two successive (nonzero) rows, the leading 1 in the lower row lies to the right of the leading 1 in the upper row \vfill
    \item If a column contains a leading 1, then the other entries in that column are zeros \vfill
  \end{itemize}
Gauss-Jordan puts matrices in Row-Reduced form.  You know that you are done with Gauss-Jordan when your matrix is in Row-Reduced form.
\end{frame}

\begin{frame}[t]{Are these reduced?}
For each of the matrices, decide if they are in row-reduced form.  If not, state why and put it into row-reduced form.\\
In each case, also identify which matrices correspond to inconsistent systems (no solution) 
and which correspond to underdetermined systems (infinitely many solutions).\\

\begin{scriptsize}
\[
  \left[\begin{array}{ccc|c}
          1 &        1  &         1  &   6 \\
          0 &        1  &         2 &    8 \\
          0 &        0  &         0  &   1 \\
  \end{array}\right]
\]
\vfill
\[
  \left[\begin{array}{ccc|c}
          2 &        0  &         1  &   6 \\
          0 &        1  &         2 &    8 \\
          0 &        0  &         0  &   1 \\
  \end{array}\right]
\]
\vfill
\[
  \left[\begin{array}{ccc|c}
          1 &        0  &         1  &   6 \\
          0 &        1  &         2 &    8 \\
          0 &        0  &         1  &   1 \\
  \end{array}\right]
\]
\vfill
\[
  \left[\begin{array}{cccc|c}
          1 &        3  &         0  &   1   &  6 \\
          0 &        0  &         0 &     0  &  0 \\
          0 &        0  &         1 &     5  &  10 \\
  \end{array}\right]
\]
\vfill

\end{scriptsize}

\end{frame}


\begin{frame}[t]{Solving systems with infinitely many solutions}
Determine the solution to this system. 
\begin{scriptsize}
\[
  \left[\begin{array}{cccc|c}
          1 &        3  &         0  &   1   &  6 \\
          0 &        0  &         1 &     5  &  10 \\
          0 &        0  &         0 &     0  &  0 \\
  \end{array}\right]
\]
\end{scriptsize}

\end{frame}


\end{document}
