2.2 Using Matrices to Solve Systems of Equations

Part B: Solving a System by Pivoting ("Gauss-Jordan")

(Based on Section 2.2 in Finite Mathematics and Finite Mathematics and Applied Calculus)


Some On-line Resources for This Topic:

Solution of Systems of Equations by Row Operations
(The discussion here is based on Section 2.2 of Finite Math and Finite Mathematics and Calculus Applied to the Real World. )

Here, we put row operations to work for us in solving systems of equations. (If you are not familiar with row operations, go to Part A of this tutorial by pressing "Prev Tutorial" on the sidebar.) First of all, let's start with a complicated looking system of equations, such as

This system has the following augmented matrix.

We shall now reduce the matrix with our bare hands in a few simple steps by performing row operations to obtain a new matrix that will instantly tell us the solution of the system.

First Step: Clear all fractions and/or decimals (if any) by multiplying rows that contain them by a suitable number.

To clear the fractions, we multiply the first row by 6 and the second row by 4 as follows.

1

2
2

3
1

6
6 R1
-2
1

4
1

2
4 R2
3
4
1
-8
1
2

Now it's your turn to try Step 1. You must enter the row instructions, and also perform the associated row opearations! (For example, to enter the instruction that multiplies Row 1 by 2, type "2R1". To leave a row alone, leave the instruction blank..)

1

2
-1

4
0
1
 0.1 
 3 
 0 
-1
4
1

3
1

2
1

 

 
 

Second Step: Designate the first non-zero entry in the first row as the pivot.

This gives the 3 as the pivot:

    first row
    3
    4
    1
    -8
    1
    2

 
Third Step: Use the pivot to clear its column using operations of type 3. By clearing a column, or pivoting,we mean winding up with a matrix in which the pivot is the only non-zero number in its column. This the goal is to end up with the -8 "cleared away:"

    Goal:
    cleared pivot column

    3
    4
    1
    0
    *
    *

The asterisks stand for whatever numbers come out of the calculation. We must accomplish that by replacing Row 2 using an operation of the third type listed above. Here, we do the following:

    3
    4
    1
    -8
    1
    2
    3 R2 + 8 R1
    3
    4
    1
    0
    35
    14

 
Q Wait a minute! Just how did you come up with that row operation?
A Press here to open a pop-up window showing a method that always works, and requires little or no thought!

Q What about a bigger matrix?
A Here is an example of Steps 2 and 3 using a larger matrix:

Second Step Again: Designate the first non-zero entry in the first row as the pivot.

1
1
5
6
3
3
1
10
1
3
2
5.

Third Step Again: Use the pivot to clear its column using operations of type 3.

1
1
5
6
3
3
1
10R23 R1
1
3
2
5R3R1
1
1
5
6
0
6
16
28
0
4
3
11

Note All the row operations we use to pivot have the following form:

Here, a and b are always positive numbers.
Rc is the row you are changing. This is also the row next to which the instruction is written.
Rp is the pivot row -- the row containing the pivot.
Note that the only place a minus sign ever appears is between Rc and Rp.

Now it's your turn to try Steps 2 and 3. As before, you must enter the row instructions, and also perform the associated row opearations! For example, to enter the instruction that replaces Row 2 by 2R2-3R1, type "2R2-3R1" next to the row you want to change (Row 2). To leave a row alone, leave the instruction blank..

2 -1 0
4
 1 
 3 
 0 
-1
-3
23
1

 

 
 

The next step is one that can be performed at any time.

Simplification Step: If at any stage of the process, all the numbers in a row are multiples of an integer, divide by that integer -- a type 2 operation.

Below, for example, we notice that the entries in Row 2 are divisible by 7, so we divide that row by 7.

    3
    4
    1
    0
    35
    14
    1

    7
    R2
    3
    4
    1
    0
    5
    2

 
Fourth Step: Select the first non-zero number in the next row (Row 2) as pivot, and go to the Third Step.

This is a two-step process: First select a pivot on the second row. Next, perform the pivoting operation; that is, clear the pivot column (the pivot column is now the second column).

    Goal:
    clear the pivot column

    3
    4
    1
    5 R1-4 R2
    0
    5
    2
    15
    0
    -3
    0
    5
    2

 
Q So how did you come up with that row operation?
A Press here to find out!

Q Can we see how the above steps work with a bigger matrix?
A Ok. Recall that we did the follwing operations on a larger matrix.

We can now continue with Step 4 and use optional simplification steps along the way

Simplification Step: If at any stage of the process, all the numbers in a row are multiples of an integer, divide by that integer -- a type 2 operation.

Fourth Step: Select the first non-zero entry in the next row as pivot, and go to Step 3.

Simplification Step:

Step 4:

At this point, we have run out of rows (there is no next row to go to) so we are done with the pivoting.

We have one last step:

Final Step: Turn all the pivots into 1's by dividing each of the rows by the value of its pivot.

    23 matrix:
    15
     0 
    -3
    1

    15
    R1
    0
    5
    2
    1

    5
    R2
    1
     0 
    -1

    5
    0
    1
    2

    5
    34 matrix:
    3
    0
    0
    3
    0
    3
    0
    6
    0
    0
    1
    1

    1

    3
    R1
    1

    3
    R2
     
     
    1
    0
    0
    1
    0
    1
    0
    2
    0
    0
    1
    1

 
And we're done! Look at the 23 matrix first: The first row now corresponds to the equation

The second row corresponds to

So we have solved for x and y!

Similarly, the 34 matrix

tells us that

You can review the whole process from start to finish by pressing here for the 23 matrix or here for the 34 matrix

Press the "Chapter Summary" button on the sidebar for a convenient summary of this procedure and also other material.

Consider the following system.

Q Which of the following corresponds to the augmented matrix after fractions are cleared?

Q The instruction required to perform the first pivot operation is:

 
Q The result of the above pivot operation is

 
Q The instruction required to perform the next pivot operation is:

 
Q The result of the above pivot operation is

Q The solution of the original system of equations is

Note Sometimes, things don't work out so smoothly. For instance, you might wind up with a row of zeros, or a row like this: [0   0   9]. Just how to deal with this is discussed in the next tutorial.

Here is one with four unknowns.

Consider the following sustem of equtions

The result of clearing fractions and decimals, and then performing the first pivot operation is:
1
1
0
4
0
0
-4
1
-16
4
0
2
-2
2
1
0
0
1
2
1
1
1
0
4
0
0
-2
1
-8
2
0
1
-1
1
1
0
0
1
2
1
1
1
0
4
0
0
4
1
16
4
0
2
-2
2
1
0
0
1
2
1

 
Q The result of the next pivot operation (followed by a simplification step) is:
4
0
1
0
4
0
-4
1
-16
4
0
0
-1
-4
2
0
0
1
2
1
4
0
1
0
4
0
1
-
1

4
4
-1
0
0
-1
-4
2
0
0
1
2
1
1
0
1
0
4
0
-4
1
-16
4
0
0
-1
-4
2
0
0
1
2
1

 
Q The result of the next two pivoting steps (including some simplification steps) is:
1
0
0
0
3
0
-1
0
0
-6
0
0
-1
0
-4
0
0
0
-2
3
1
0
0
0
0
0
-1
0
0
-6
0
0
-1
0
-4
0
0
0
-2
3
1
0
0
0
4
0
-1
0
0
4
0
0
-1
0
2
0
0
0
2
1

 
Q The solution of the system is:

Tired of tutorials for now? Try some of the exercises in Section 2.2 of Finite Math, or Finite Mathematics and Calculus Applied to the Real World and then go on to the next tutorial to help answer unresolved questions.


Last Updated: March, 2006
Copyright © 1999, 2006 Stefan Waner and Steven R. Costenoble