## Section3.6Augmented Matrices

In this section, we will see how to use matrices to solve systems of equations. In both the graphical method and the expected value method, you have had to solve a system of equations. In the graphical method you had systems consisting of two lines such as Example 3.6.1.

###### Example3.6.1.Two Equations.

An example of a system of two lines:

\begin{align*} y \amp = \frac{3}{5}x-\frac{1}{5}\\ y \amp =-x+3. \end{align*}

In the expected value method we had systems of three equations such as Example 3.6.2.

###### Example3.6.2.Three Equations.

An example of a system of three equations where the variables are $E_1(A), E_1(B), P_2(C), P_2(D)\text{:}$

\begin{align*} E_1(A) \amp = P_2(C)-P_2(D)\\ E_1(B) \amp = 2P_2(D)\\ 1 \amp = P_2(C)+P_2(D). \end{align*}

In Example 3.6.2, even after setting $E_1(A)=E_1(B)$ so that there were only 2 variables, the algebra began to get cumbersome. What if we wanted to solve a much larger game, such as a 5 X 5 game?

We've used matrices to represent our games, but now we want to use them as a mathematical tool to help us solve systems of equations. In order to use matrices to solve our systems of equations, we want to write all our equations in the same form: we will have all the variable terms on the left of the equals sign and all constants on the right.

Thus, in Example 3.6.1 we can write the system as

\begin{align*} \frac{3}{5}x-y \amp =\frac{1}{5}\\ x+y \amp = 3. \end{align*}

In fact, we can simplify the first equation by multiplying both sides by 5:

\begin{align*} 3x-5y \amp =1\\ x+y \amp = 3. \end{align*}

We can use the coefficients and constants to create a matrix:

\begin{equation*} \left[ \begin{matrix}3 \amp -5 \amp 1\\ 1 \amp 1 \amp 3 \end{matrix} \right]. \end{equation*}

In this matrix you have a column for the coefficients of each variable. So the coefficients of $x$ are in the first column, the coefficients of $y$ are in the second. The constant terms are always in the last column. Each row corresponds to one equation. This matrix is called an augmented matrix. It is really just a matrix, but we call it augmented if we include information from both sides of the equation (the coefficients and the constants).

The algebraic method for solving the system of equations (finding the $x$ and $y$ values that satisfy both equations) is called row reduction. It is based on the elimination method that you may have seen in a precalculus or college algebra course. We won't go through the algebra here, as we really don't need it. Since our goal is to be able to easily solve larger systems of equations, we will rely on technology to do the algebra.

Computer algebra systems such as Sage, Mathematica, and Maple, as well as graphing calculators, can easily do the row reduction for us.

On a graphing calculator, use the matrix function to enter the matrix. Then use the “rref” function (this stands for “reduced row echelon form”). The result will be the following matrix:

\begin{equation*} \left[ \begin{matrix}1 \amp 0 \amp 2\\ 0 \amp 1 \amp 1 \end{matrix} \right]. \end{equation*}

We can solve this even more directly using Sage.

Recall that the first column is for $x$ and the second is for $y\text{.}$ Each row represents an equation. So translating each row back to equations, we have the following system of equations:

\begin{align*} x+0y \amp =2\\ 0x+y \amp = 1 \end{align*}

or

\begin{align*} x \amp =2\\ y \amp = 1. \end{align*}

By plugging these values back into the original equations, you can verify that this is in fact the solution.

Since the technology does all the algebra for us, our job is to translate the equations into an appropriate matrix and then translate the final matrix back into the solution to the system of equations. Remember, when using a matrix to solve a game, the matrix is only a tool, it is not the solution to the game.

Now, let's try the equations for the expected value method using Example 3.6.2. As presented, how many variables does the system have?

\begin{align*} E_1(A) \amp = P_2(C)-P_2(D)\\ E_1(B) \amp = 2P_2(D)\\ 1 \amp = P_2(C)+P_2(D) \end{align*}

It has 4: $E_1(A), E_1(B), P_2(C)$ and $P_2(D)\text{.}$ But when we solved these equations, we set the expected values equal. This gives us the two equations

\begin{align*} P_2(C)-P_2(D) \amp = 2P_2(D)\\ 1 \amp = P_2(C)+P_2(D). \end{align*}

Now if we put these into the form with all variables on the left and constants on the right, we get

\begin{align*} P_2(C)-3P_2(D) \amp = 0\\ P_2(C)+P_2(D) \amp = 1. \end{align*}

Putting these equations into an augmented matrix, gives us

\begin{equation*} \left[ \begin{matrix}1 \amp -3 \amp 0\\ 1 \amp 1 \amp 1 \end{matrix} \right], \end{equation*}

where the first column corresponds to $P_2(C)$ and the second column corresponds to $P_2(D)\text{.}$

Using row reduction, we get

\begin{equation*} \left[ \begin{matrix}1 \amp 0 \amp 3/4\\ 0 \amp 1 \amp 1/4 \end{matrix} \right]. \end{equation*}

Thus, recalling Column 1 is for $P_2(C)$ and Column 2 is for $P_2(D)\text{,}$ our solution is $P_2(C)=3/4\text{,}$ and $P_2(D)=1/4\text{.}$

Here are some more systems of equations to practice solving using augmented matrices. If you want to use the above Sage cells just edit the values for each row in the cell.

Solve the system of equations.

\begin{equation*} \begin{matrix}2x-2y\amp =6\\x+3y\amp =7 \end{matrix} \end{equation*}

Solve the system of equations.

\begin{equation*} \begin{matrix}4p_1-2p_2\amp =0\\p_1+p_2\amp =1 \end{matrix} \end{equation*}

For larger matrices, you can edit the Sage cell by adding additional terms in each row, and adding more rows. For example, you can replace $[3,-5,1],[1,1,3]$ with $[4,8,-4,4],[3,8,5,-11],[-2,1,12,-17]\text{.}$

Consider the system of equations

\begin{equation*} \begin{matrix}4x+8y-4z\amp =4\\3x+8y+5z\amp =-11\\-2x+y+12z\amp =-17. \end{matrix} \end{equation*}
1. Set up the augmented matrix for this system.

2. Use row reduction to find the solution.

Consider the system of equations

\begin{equation*} \begin{matrix}2x+y-4z\amp =10\\3x+5z\amp =-5\\y+2z\amp =7. \end{matrix} \end{equation*}
1. Set up the augmented matrix for this system.

2. Use row reduction to find the solution.

Consider the system of equations

\begin{equation*} \begin{matrix}a+b-5c\amp =0\\-4a-b+6c\amp =0\\a+b+c\amp =1. \end{matrix} \end{equation*}
1. Set up the augmented matrix for this system.

2. Use row reduction to find the solution.

Consider the system of equations

\begin{equation*} \begin{matrix}3x+2y-w-v\amp =0\\2x-y+3z+w+5v\amp =0\\x+2y+6z-w\amp =0\\ -y+z-3w+v\amp =0\\x+y+z+w+v\amp =1. \end{matrix} \end{equation*}
1. Set up the augmented matrix for this system.

2. Use row reduction to find the solution.

Now we are ready to apply everything we have learned about solving repeated zero-sum games to a much more challenging game in the next section!