Online Explanation 5.2

The Gauss-Jordan Method

We will use the Gauss-Jordan method in parts of this tutorial to solve linear systems of equation, square matrix inverses, and the pivot column part of the Gauss-Jordan method in solving linear programming problems by the simplex method.

All of the above problems are adaptable to a computer. Our calculator as mentioned before is a Computer Algebra System (CAS). The calculator's method for solving linear systems of equations of this and the next section is the rref function. As we will see in later section of this chapter, square matrix inversion is implemented in the calculator by raising the matrix, say a, to -1 power (a^-1). The only procedure not directly implemented is the simplex methods of our chapter on linear programming.

We could download complete simplex programs for our calculator, but there are different ways of implementing and presenting problems when using the simplex method. What we will do is write a multiple line functions called pivmat that will allow us to solve the simplex problems by the techniques illustrated in this tutorial.

In this section we will introduce the pivmat function that will be essential in the chapter on linear programming. We will use it to relate Gauss-Jordan elimination method to the step-by-step method of arriving at the rref operator.

Note 1: As mentioned earlier when we get to the chapter on linear programming, we have no choice but to work the problems at the row operation level or use this pivmat technique.

We will also go over how to use the row operators and specifically the row operators used in pivmat.

As we see in the tutorial and with the calculator equivalents  (shown below in the rule definition for the calculator row operators) there are three operators for each case.

Row Operations

(Tan 264)

Reference - Calculator Notation for Row Operations.

Operation 1: Interchange - good for humans and if pivmat has a zero in pivot element's position, you may interchange a row with a non-zero element in the pivot element's position below with the row where you currently are

Operation 2: cRi -> Ri; how you make a one in pivot the element position (c is the reciprocal of the pivot element, i is the pivot row); also make a one in the constant column when there is no solution

Operation 3: aRj + Ri -> Ri; how you make zeros in the rest of the pivot column (i is the row that you want to become a zero, a is the opposite of element that is to become zero, and j is the pivot row)

As -2*3 + 4 = 4 + (-2*3) = 4 - 2*3 using commutative property for addition, subtraction as the addition of the opposite, and precedence rules for operators. The order of the left expression for Operation 3 may vary in your text but it will be mathematically equivalent.

In our online explanations, we will write it out as shown in Operation 3 above. The calculator also requires this consistent order.

If your textbook examples, textbook problems, student solution manual, online assignments, or unit exams gives it in a different order you must put in the order illustrated in Operation 3 to input it into the calculator's mRowAdd operator. There is nothing wrong with different orders, however to use the calculator we must have it in the order illustrated above.

The main reason for different order given in other places is that math authors dislike writing negatives as the first term (i.e. -4 + 6). They would rather use the commutative property property for addition and definition of subtraction as adding the opposite (i.e. 6 - 4) to write the expression with the first term being positive.

 Calculator Row Operators - rowSwap, mRow, and mRowAdd

Please note the last three forms for the calculator row operations. We will return to this when we discuss the row operators in detail.

Next we turn to an example by Tan "

"(Tan 261).

Tan is demonstrating the solution in this vary organized manor, so that we can see how matrices can be used to solve the same system of equations in a parallel manor. We will use the matrix version, discussed next, to help us with all the areas of the textbook requiring the Gauss-Jordan method.

Augmented Matrices

First we need to represent the systems of linear equations in a compact manor. This is where matrices come in.

[Coefficients Matrix|Column Constants]->[augmented matrix]

Continuing with Tan "

"(Tan 262).

When translating to an augmented matrix we will need zeros for any missing coefficients. When we translate an augmented matrix with zeros back to a system of equations, leave the zero variable out.

Example 1 Three Equations, Three Unknowns Using "rref" function

We now work Tan's above example by the automated built-in "rref" function of our calculator. Read explantion that follows for additional details.

Use the pivmat function on each row. Details and explanation are given in the Pivot Matrix section. We start in Pivot Matrix section below with a 2 equations, 2 unknown example.

If a pivot element is zero, then we will have to use individual calculator row functions rowSwap to change the matrix into a new equivalent matrix. If after this operation, the new matrix is in row-reduced form we are done, if not back to the pivmat function.

We can also use the calculator's rref (row-reduced echelon form - book uses name row-reduced form) function to automate the entire process. Doing this however, will not give up the practice that we need in learning the user defined pivmat function.

Remember in the chapter on linear programming, we have no choice but to use pivmat function or work the whole problem by individual row functions. In the chapter on linear programming, there is one advantage, you will not have to switch to manual row functions for infinite and no solution problems. These situations are addressed by other factors when using the simplex method.

First let us solve by using the calculator's rref function. If one is not required to show steps, the calculator's rref function or solve function are the techniques to use. The downfall to the solve functions is the chapter on linear programming. There is no calculator equivalent to solve for simplex problems, but the simplex method can use the Unit Column (pivmat) technique, this is why we emphasize rref and hybrid step-by-step in this section. Also, in complex infinite solutions the calculator solve answer is so cryptic, that the rref technique of this section produces a better answer.

To use the rref technique, the calculator's implementation of  the Gauss-Jordan technique, set up an initial matrix "a". The calculator does not distinguish case, since lower case is the calculator's default case, use a lower case "a" for your matrix name.

Use brackets to indicate beginning and end of the matrix, comma to separate elements, and a semicolon to indicate a new row. For temporary use store it with the letter "a". See the calculator screens on the left.

From the [CATALOG] key select the built in "rref" function.

1x + 0y +0 z = 3, i.e. x =3
0x + 1y + 0z = 1, i.e. y =1
0x + 0y + 1z = 2, i.e. z =2

See picture above.

Problem 1 Three Equations, Three Unknowns Using "rref" function

Solve the following systems of linear equations using the calculators "rref" function to automate the Gauss-Jordan elimination method.

3x + y = 1,
-7x - 2y = -11

We could also use the Matrix Editor. It is probably easier to use the HOME screen since sizes of the matrices are always varying in this and the next section.

The Matrix Editor is better if we had repeated examples of 2,3, and 4 equations, and 2,3, and 4 respective unknowns. You could store the first occasion of that problem from the [HOME] screen as a matrix variable a2 (2 equations), a3 (3 equations), and a4 (4 equations) and use the matrix editor to enter the data for subsequent problems. Notice that we picked a two character variable name for each size system so cleanup [2nd F6] would not clear them out. In our example above we would store it at a3, use rref(a3), and then a3 would be available from the Matrix Editor for the next problem.

Using the Matrix Editor for variable a2

-x + y = 1
2x + y = 4

Assume that we have previously worked Problem 1 involving 2 equations, 2 and stored the matrix as a2. Open the matrix a2 form the [APPS Data/Matrix Editor]. Follow the prompts on the screen to get to open the specific matrix a2 and type in the new entries. Return to your [HOME] screen and use rref(a2) to get your answer. The editing process is shown below:

 From the [APPS] menu you can also view and edit the matix.

We will demonstrate the hybrid step-by-step method in the the pivmat sub topic discussion.

Row-Reduced Form

(Tan 263)

The calculator's "rref" function stands for row-reduced epsilon form.

To check for row-reduced form, enter the matrix into the calculator and store under a. Then use the catalog to enter rref(a). If the matrix stays the same it is in row-reduced form. If it changes, we have to be careful. What your text uses for row-reduced form and what the calculator use for row-reduced epsilon form is not the same.

For example, if the first row of a 2 by 3 matrix is 0 1 3 and the second is 0 0 5 your text's would consider this reduced. The calculator algorithm would change the last row to 0 0 1. In both case when we use this tp sovle a system of equations we get either 0 = 5, your text's form, or 0 = 1, our calculator's form. In either case there could be no solution since these statements are false.

In all other cases, a changed matrix with the calculator's "rref" function, means the orginal is not in row-reduced form.

From Tan we have "

"(Tan 263-264).

When we use the hybrid step-by-step pivmat it will be our job to check if the matrix is in row-reduced form before we use pivmat to produce a unit column for that row.

The Gauss-Jordan Elimination Method

(Tan 266)

To accomplish rule 1:

i. Move any row or rows consisting entirely of zeros to the bottom.

ii. After any pivmat operation use the rowSwap operation to move the row or rows consisting entirely of zeros to the bottom.

To accomplish rule 2, 3, and 4:

iii. If the pivot element is a non-zero element, use pivmat to that column. This will cause a 1 to be the leading entry and the other entries in the column to be zero.

iv. repeat step ii above

v. We proceed from the top to the bottom diagonally. Each pivmat is at one down and at least one to the right of the previous. If a column is all zeros, move one more to the left in that row, and perform pivmat. If we are at a lower row of all zeros we are also done.

This accomplishes the rule that the first non-zero entry is a 1 (called a leading 1). A Unit Column for the coefficient matrix (our pivmat) is when the column in the  coeficient matrix if one of the entries in the column is a 1 and the other entries are zeros. If we extend pivmat to the constant column, we accomplish 2, 3, and 4 of the Gauss-Jordan Elimination method and get the same result as our calculator's "rref" fucntion.

Pivot Matrix

Example 2 Two Equations, Two Unknowns Using "pivmat"

Solve the system of linear equations.

x - 2y = 8
3x + 4y = 4

The argument list for the function is as follows:
pivmat(
matrix, pivot row, pivot column, number of rows).

 Type in the matrix as illustrated, press [ENTER]. Use [2nd] VARLINK to call up "pivmat". Fill in arguments as (a,1,1,2)->b and press [ENTER] . Notice that we stored result as b. Performing the "pivmat" function on your 83/86. Edit "pivmat". Fill in arguments as (b,2,2,2)->c and press [ENTER] . Notice that we stored result as c.
Read solution as x = 4 and y = -2. The ordered pair (4,-2).

Problem 2 Two Equations, Two Unknowns Using "pivmat"

Solve the system of linear equations. using the Gauss-Jordan elimination method. Show the 3 pivots for column 1, 2, 3 and the final answer for x, y, and z. If we are not using the user defined function pivmat there will be more steps.

x + 3y - z = -3
2x + y - 2z = 4
3x + 4y - z = 7

To do the problems in your textbook, enter the matrix into the calculator and store under "a". Perform all the "pivmat" necessary to derive the answer. Practice at least three problems from you textbook using "pivmat".

Row Operators

Refer to the row operators defined in your calculator. This was given in conjunction with the explanation earlier on The Gauss-Jordan method.

The rowSwap would be necessary if following a pivmat operation an entire row of zeros was located in the middle on the new augmented matrix.

The mRow and mRowAdd make up the power of the user defined pivmat function. We could use these manually to work out problems exactly as stated in the book.

To do the problems in you textbook, using row operators, enter the matrix into the calculator and store under "a" and proceed as in the next example.

Example 3 Gauss-Jordan Elimination Method Using Row Operators

Solve the system of equations using the Gauss-Jordan elimination method (use row operators).

3x + 9y = 6
2x + y = 4

Technique would be as follows (directions are given next to the answer):

Enter the following into your calculator.

[3,9,6:2,1,4]->a
mRow(1/3,a,1)->b Replace R1 with 1/3 R1
mRowAdd(-2,b,1,2)->c Replace R2 with -2R1 +R2
mRow(-1/5,c,2)->d Replace R2 with -1/5 R2
mRowAdd(-3,d,2,1)->e Replace R1 with -3 R2 + R1

This would be equivalent to working every step manually.

Problem 3 Gauss-Jordan Elimination Method Using Row Operators

Show only the first two row operations only.

x + 3y + z =3
3x + 8y + 3z = 7
2x - 3y + z = -10

Here we only do several steps manually, not the whole problem manually.

This will illustrate that we understand the manaul process without having to do the error-prone manual calculations with fractions and negative numbers required in most solutions. If we make one mistake from that part on our remaining work is incorrect.

The "pivmat" function can be used to help us catch errors early if we are using the manual or row operations technique. Remember it gives us each unit column, thus it enables us to check our manual or row operations at each unit column stage during our row manipulations.

Application

To work these problem using the Gauss-Jordan Elimination Method use the calculator's "rref" function. From the [HOME] screen, enter the matrix and store it under a, then use rref(a) to come up with the answer. This way you can concentrate on the translation by verifying your answer without the hugh time and manual error-prone techniques. It will be easy to see that you were right or that your error was in the translation not the calculations.

 Online Explanation and Examples 5.2 Solving Systems of Linear Equations: Unique Solutions

Pivmat Calculator Screen

Add the "pivmat" function from the [APPS] Program Editor - New option or use TI-Graph Link to upload the file above.

Click on the Show 89 movie to see a video of using the TI-89 for entering pivmat and using it for the Example 2 illustration below.

Example 1 Calculator Screens

Type in the matrix as
[2, 4, 6, 22; 3, 8, 5, 27; -1, 1, 2, 2] -> a. Press
[ENTER]. Notice semicolons at end of rows.

Insert from [CATALOG] "rref" and add the argument "a" as illustrated and press [ENTER].

Click on the Show 89 movie to see how to use the command line to enter and edit a matrix and use the rref function to perform the Gauss-Jordan technique. It demostrates the Data/Matrix editor. It explains how we can use calculator's built-in row operators to solve the problem. See Example 3 below.

Example 3 Calculator Screens

Using matrix row operators.