CI 161 Notes on Using Matrices to solve systems of equations:

Pedagogical foci: Equation balance, integer arithmetic, quadratic equations.

The Concept of Balance for Systems of Equations

Before beginning to investigate lines and parabolas with matrices, we must talk about three principles of balance for equation solving.

Balance Principle #1 (Adding rows to rows OK): Equal Quantities added to Equal Quantities results in still Equal Quantities.

To explain BP#1 further: There is no doubt that

And similarly it is clear that

So, if we add them both together, is it not clear that

5=5 ?

Another way to think about it is with a balance scale. If you have 2 unit weights on each side of a scale and you put on 3 unit weights on each side, the scale is still in balance and now has 5 weights on each side. What this essentially means, when we work with matrices which will represent equations, is that adding rows to rows does not change the ‘information’ or ‘solutions’ created by the initial system.

Balance Principle #2 (Multiplying a Row by a Number OK):If equal quantities are both multiplied by the same number, the result is still equal quantities.

This is really just the same thing as BP#1 if one recalls that multiplication is defined as ‘repeated addition,’ or . Using the example as above,

Clearly

2=2

Doesn’t ?

or; ?

Yes, since , and if we add the same number of 2’s to both sides of a balance scale, it will still be in balance. Also note that since division can be thought of as multiplication by a fraction, then BP#2 also means we can ‘divide’ an equation, or row of a matrix, and still have a true balanced equation. For example, , so:

Balance Principle #3 (Row Switching is OK) If two sets of equal quantities are equal, the order they are presented does not matter.

This is perhaps the easiest principle to understand, which essentially says that the order of equations in a given system does not change the solution, or information, given in the system. For example,

2=2 and 3=3

is the same as:

3=3 and 2=2.

Example.Let’s suppose we wish to find two numbers such that they both add to 7 and the largest minus the smaller equals 1. What are the two numbers?

Solution: If we let the larger number be and the smaller number be then we get the following system of ‘linear’ (1st degree) equations:

Now, we will put this system into a matrix as follows:

Note: The two columns of numbers towards the left represent the coefficients multiplying the variables and .

The basic idea for solving the system with a matrix is to keep applying the three principles of balance in order to achieve a matrix representation like:

If we can get these left two columns of numbers, to show up while keeping the overall system in balance, then we will have solved the system, since this would result in:

and

where the symbols and just represent some numbers which are the solutions to the system. So, let’s proceed to solve this system using the balance steps:

  1. Our first goal is to achieve a 1 in the upper left corner. In this case we have that, but if we didn’t we could switch rows if there is a one in the right position in the bottom row; or, we could divide the row to make a 1 (division is actually the same as multiplication since ). We call these numbers on the diagonal ‘pivots.’
  1. Our next goal, after having a 1 in the pivot position, is to make zeros underneath the 1. Remember we can add rows to other rows and we can multiply rows also; but, we can also multiply AND add a row to another row. In our method, we will always ADD rows so that we don’t get confused. Below the pivot is a 1, so I would like to add a to it so that I can zero it out. So, to do this we will multiply ALL of row 1 by and then add that row to row 2. We can write this like: for our new row 2. It is helpful to pencil-in the row that you are adding underneath the second row as such:

+

This gives us the new matrix, which is still in balance:

  1. Working in a kind of counter clockwise direction, we next want to make a 1 in the pivot position of the second row (currently occupied by the number ). When making this pivot, one would not want to add row 1 at all, since that would destroy the nice zero we just made, so it is best to divide the row at this point, which in this case would be a step such as: , which would give us:
  1. We have almost reached our goal of making show up for the coefficients of the variables. All that is needed to be done is to make a zero ‘above’ the pivot in the second row. To do this we will use row 2 since when we add the correct multiple of that row to row 1, the 0 in row 2 will never disturb the pivot in row 1. So, at this point, would achieve our goal:

giving us our solution matrix:

LOOKING BACK

Going back to the original system of equations, let’s see if and forms a solution for ‘both’ of the equations:

in which case, we observe that the solutions work and we have found the two numbers.

3.1.2 Example. Now for a similar example involving fractions, suppose that twice a number plus another number is 17, and twice the first number plus three times the second number is 27. What are the two numbers?

Solution:

Reading the last sentence first, we can assign the typical variables, and for the unknown first and second numbers, respectively. Working with the given information, we have the following system:

giving us the following matrix system to reduce:

  1. Remember our first goal is to get a 1 in the upper-left pivot position, but in this case we did not already have a 1. It is usually the case to divide the first row by 2, but since there is also a 2 below it, if we wanted, we could knock out the 2 below the 2 in the first row now. (instead of subtracting, we always add to avoid confusion, so in this case we have :

which gives us:

  1. We can now confront the need to do the operation . (or we could make a 1 in the second row by dividing by a 2, it is totally up to you!)
  1. Since, in the way we are showing the steps, we didn’t make the 1 in the second row yet, we now do this with the row operation :
  1. Almost finished! This one is a bit harder because it involves fractions. Just keep a steady focus and keep performing the correct balance operations until your goal matrix is achieved. We would like to make a zero above the pivot in the second row, we need to add as follows:

giving us our goal coefficient matrix and subsequent solution:

The two numbers are and !

LOOKING BACK

A quick check shows that the solutions fit the original equations and make sense in the overall problem:

Finding Equations of Lines through Two Points

The familiar approach to finding the equation of a line through two points runs something like this:

3.2.1 Example. Find the equation of the line through the points and

(Recall that the intercept form for the equation of a line is: and the slope going through two points and is defined as: ).

Now by plugging in either point, we can solve for :

The intercept form for the equation of a line is: . Sometimes, the ‘standard form’ of a line is asked for, which is of the form , which essentially requires bring the and monomial terms to one side of the equation:

LOOKING BACK

Let’s see if the given points satisfy the equation in standard form:

andverifies we found the correct equation through the two points

In the next example, it will be demonstrated how to find the same equation through the given points, using a matrix to solve for the two unknowns, and .

Example.Find the equation of the line through the points and using a matrix approach.

Plug in the given points into and develop a system of equations as follows:

and

Now, we can use our three principles of balance to find the unknown variables and :

The final matrix reveals that and in agreement with the previous example’s result that as can be verified in the graph in Figure 3.1.

Figure 3.1 Graph of through two given points.

Solving Systems for finding Equations of Parabolas

When working with matrices, many of you might be thinking, ‘why should we do these matrix methodssince I can easily find these equations using methods I have already learned such as ‘substitution.’ Well, it is true that you can solve a system using substitution, but the fact of the matter is that when working with much larger systems, the advantages of using matrices becomes more evident. As an example, imagine you were locked in a room, and the only way you could get out would be to solve a system of equations. Well, using substitution, you might be in the room a long, long time; but, by using matrices and applying the exact same three balance principles we’ve discussed, you could get out in about 10-15 minutes once you get the hang of it! So, let’s ‘up’ the system to the level and begin to learn the general pattern.

Example. I am thinking of three integers such that they all add to 19, five less than the sum of the first two numbers is the third number and the first number is twice the third number. What are the three numbers?

Solution:

Reading the last sentence first, we need to find three numbers, so let’s use the standard algebra letters and for the first, second and third numbers, respectively. The first relationship is not too difficult and comes out to:

In the second relationship, one must read carefully and understand the subtleties in the sentence. If you read it carefully enough, you should see that it amounts to the algebraic equation:

For our matrix systems, the equations must have all of the letters on the left, and the numbers on the right; so, it is important to order the variables the same way. Using the typical convention, order the variables as and rearrange the equation to get:

Try it on your own and see if you get the same result. In the above case the parentheses were really not needed, but they were included to emphasize that the 5 was being taken away from the entire ‘sum’of. If you had been given a problem where it said that the third number was less than the number 5, it would be important to understand that the was grouped together; so, that statement would amount to an equation like: and would have to be converted to This little digression is not meant to confuse you, but make you aware of how careful one must be when converting words into equations in relation to the use of grouping symbols like parentheses. It is not a topic you can instantly understand, but must master through practice, making a few mistakes and finally getting successful results which you can check on your own by ‘looking back.’

Back to the problem, the last relationship can also present some confusion when trying to write the equation. Many times when working with a relationship such as this, students pick the wrong variable to multiply by a number. To prevent this problem, try and identify which is the larger number. The statement says that the first number is twice the third number. Clearly it is the first number that is larger, so that would lead to the equation Remember, though, that for our matrix approach, we need all of the variables on the left side and in the correct order, leading to the equation:

Now that we have the equations, we will further rewrite them by remembering to place all of the 0’s in for coefficients of variables which are not present in the equations:

Having the equations in this form, we are finally ready to write down the matrix:

  1. In the case, our new goal coefficient matrix for the first three columns is . We are lucky we already have a 1 in the first pivot position, so now we will do 2 balance operations at once and make 0’s underneath the 1 in the upper left position. This can easily be accomplished by doing and . You might be wondering why I picked as the row I used. You can actually pick any rows to use, since if you are using the principles of balance correctly, the system will still be in balance and contain the original information that was given in the problem. After doing a lot of this, one finds that it is easiest to just use the first row to do the elimination on all of the lower rows. If you did those operations, you would get the matrix:
  1. Next, one could do BP#3 and then BP#2 by exchanging the second and third rows and then multiply the second row by The reason for this is to focus on getting the 1 in the second pivot position, in the second row (like my goal matrix has in the position circled. Performing these operations gives us the matrix system:
  1. Now, the focus can again move kind of ‘counter-clockwise’ to the pivot in the third row (i.e., ), in which case we can make a 1 by the operation , giving us:

.

  1. Now, what is left is to begin making 0’s in the spots ‘above’ the pivot positions. To make things faster, we can use twice to zero out the numbers in and . Try and think about why the following operations would do this: and , in which case we would have the new representation:

.

  1. Almost finished since once the 1 is zeroed out above the second pivot, we will have our goal matrix! To do this we need only apply the balance operation, to get our answer:

.

LOOKING BACK

Let’s check now and see if these solutions are the correct numbers by putting them into the original equations:

Example. Find the equation of the parabola, in the form , running through the points , and .

First notice that if only two points are chosen, such as and then there are an infinite variety of parabolas that can go through those points. When we list the third point, it really narrows the choices down to only one unique parabola. This fact directly corresponds to the need for three equations, when solving for three unknowns, just as in the previous line example, only two equations/points are necessary to find the equation of a line.

  1. First, we generate three equations by plugging in the given ordered pair points:
  1. Now we can form a system matrix which solves for the unknowns and
  1. Finally, we simply apply the three principles of balance which reduces the matrix and finds the unknowns:

.

LOOKING BACK

The balance principles have yielded the result that , and , suggesting that the unknown parabola has the equation: .

Checking to see that this parabola runs through the given points:

confirming that we found the correct equation of a parabola, as can also be seen from the graph in Figure 3.2

Graph of through three given points.

HP M1 problems:

  1. I am thinking of three numbers such that the third number is three times the first number, the numbers all add to 55 and the third number is twice the second number. What are the three numbers.
  1. Find the quadratic equation of the form going through the points (1,0); (-1,8); and (2,5).

Enter the Matrix and Destroy Voldemort!

  1. To find the magic number that Harry Potter needs to utter to destroy Lord Voldemort, he needs to figure out the formula for a quadratic equation, based on the inscription of three ordered pairs of integers found on the front of Dumbledore’s tomb. If the equation, in the form of =?, can be found, then all Harry need do is to plug in the ‘perfect’ number ?=7 into the equation of the parabola the matrix finds, and then say the corresponding ? digit to Voldemort, before casting the HavraCadavre spell.

The points on the tomb for the mystic parabola were (−1,22) (1,6) and (2,1). What is the number he needs to say?