Lab for the Gauss-Jordan Method

**Gauss-Jordan Method for Linear
Systems.**** **Construct the solution to **AX **=
**B**, by using Gaussian elimination. Let the coefficients of
**A** and the constants of **B** be stored in the augmented
matrix

[**A**, **B**] = ()
which has n rows and n+1 columns; that is, the column vector **B**
= ()
is

stored in column n+1 of the augmented matrix [**A**,
**B**]. The system can be written

Row operations will be used to eliminate
in column p.

Remark. In the following subroutine the notation **i=!=p** means
"i not equal to j".

**Report to be handed
in.**

**Computer
Problems.**

**Exercise 1.** Use above Gaussian elimination method to solve the
linear system **AX = B**:

First form the augmented matrix **M** =
[**A**,**B**]

Then perform Gaussian elimination.

Remark. All the computations are printed too !

Verify the solution.

**Exercise 2.** Form the augmented matrix **M** using the
following steps.

Go the Input menu and pull down the Create/Table/Matrix/Palette and
form a 4 by 5 matrix.

Then store **A** in the first four columns of **M**.

Then store **B** in the fifth column of **M**.

You will need to Flatten **B** when you do this !

Then perform Gaussian elimination as you did before, showing all the intermediate computations.

This time get the solution vector **X** out of this augmented
matrix !

What did you just learn about the data structure of a row vector vs the data structure of a column vector ?

**Now use the subroutine Gauss for
finding the inverse of a matrix.**

**Exercise 3.** Use above Gaussian elimination method to find the
inverse of the matrix **A.**

Form the augmented matrix **M** = [**A**, **I**]
using the following steps.

Remark. Don't use **I** as a variable, it is a reserved word which
is the complex constant
.

Go the Input menu and pull down the Create/Table/Matrix/Palette and
form a 4 by 8 matrix.

Go the Input menu and pull down the Create/Table/Matrix/Palette and create a 4 by 4 identity matrix.

Then store **A** in the first four columns of **M**.

Then store **Iden** in the last four columns of **M**.

Then perform Gaussian elimination.

Get the inverse of **A** out of this augmented matrix ! And
store it in the matrix **B**.

Verify that **B** is the inverse of **A**.

(c) John H. Mathews, 1998