- Home
- >
- Gauss jordan elimination – Explanation & Examples

Contents

# Gauss Jordan Elimination – Explanation & Examples

TheĀ **Gauss-Jordan Elimination** method is an algorithm to solve a linear system of equations. We can also use it to find the inverse of an invertible matrix. Let’s see the definition first:

**The Gauss Jordan Elimination, or Gaussian Elimination, is an algorithm to solve a system of linear equations by representing it as an augmented matrix, reducing it using row operations, and expressing the system in reduced row-echelon form to find the values of the variables.**

In this lesson, we will see the details of Gaussian Elimination and how to solve a system of linear equations using the Gauss-Jordan Elimination method. Examples and practice questions will follow.

## What is Gaussian Elimination?

Gaussian Elimination is a structured method of solving a system of linear equations. Thus, it is an algorithm and can easily be programmed to solve a system of linear equations. The main goal of Gauss-Jordan Elimination is:

- to represent a system of linear equations in anĀ
**augmented matrix form** - then performing the $ 3 $ row operations on it until the
**reduced row echelon form (RREF)Ā**is achieved - Lastly, we can easily recognize the solutions from the RREF

Let’s see what an augmented matrix form is, the $ 3 $ row operations we can do on a matrix and the reduced row echelon form of a matrix.

### Augmented Matrix

A system of linear equations is shown below:

$ \begin{align*} 2x + 3y &= \,7 \\ x – yĀ &= 4Ā \end{align*} $

We will write theĀ ** augmented matrix** of this system by using the coefficients of the equations and writing it in the

*style*shown below:

$ \left[ \begin{array}{ r r | r } 2 & 3 & 7 \\ 1 & -1 & 4Ā \end{array} \right] $

An example using $ 3 $ simultaneous equations is shown below:

$ \begin{align*} 2x + y + zĀ &= \,10 \\ x + 2y + 3z &= 1 \\Ā – x – y – zĀ &= 2Ā \end{align*} $

Representing this system as an augmented matrix:

$ \left[ \begin{array}{ r r r | r } 2 & 1 & 1 & 10 \\ 1 & 2 & 3 & 1 \\ – 1 & – 1 &Ā – 1Ā & 2Ā \end{array} \right] $

### Row Operations on a Matrix

There are $ 3 $ *elementary row operations* that we can do on matrices. It won’t change the solution of the system. They are:

- Interchange $ 2 $ rows
- Multiply a row by a non-zero ($ \neq 0 $) scalar
- Add or subtract the scalar multiple of one row to another row.

### Reduced Row-Echelon Form

The Gauss Jordan Elimination’s main purpose is to use the $ 3 $ elementary row operations on an augmented matrix to reduce it into the reduced row echelon form (RREF). A matrix is said to be in **reduced row echelon form**, also known asĀ **row canonical form**, if the following $ 4 $ conditions are satisfied:

- Rows with zero entries (all elements of that row are $ 0 $s) are at the matrix’s bottom.
- The
**leading entry**(the first non-zero entry in a row) of each non-zero row is to the**right***Ā*of the row’s leading entry directly above it. - The leading entry in any non-zero row is $ 1 $.
- All entries in the column containing the leading entry ($ 1 $) are zeroes.

## How to do Gauss Jordan Elimination

*There aren’t anyĀ definite steps to the Gauss Jordan Elimination Method, but the algorithm below outlines the steps we perform to arrive at the augmented matrix’s reduced row echelon form.*

- Swap rows so that all rows with zero entries are on the bottom of the matrix.
- Swap rows so that the row with the largest left-most digit is on the top of the matrix.
- Multiply the top row by a scalar that converts the top row’s leading entry into $ 1 $ (If the leading entry of the top row is $ a $, then multiply it by $ \frac{ 1 }{ a } $ to get $ 1 $ ).
- Add or subtract multiples of the top row to the other rows so that the entry’s in the column of the top row’s leading entry are all zeroes.
- Perform Steps $ 2 – 4 $ for the
*next leftmost non-zero entry*until all the leading entries of each row are $ 1 $. - Swap the rows so that the leading entry of each nonzero row is to the right of the leading entry of the row directly above it

At first glance, it’s not that easy to memorize/remember the steps. It’s a matter of solving several problems until you get the hang of the process. There is also the factor ofĀ **intuition** that plays a B-I-G role in performing the Gauss Jordan Elimination.

Let’s take a few examples to elucidate the process of solving a system of linear equations via the *Gauss Jordan Elimination Method*.

#### Ā

**Example 1**

**Example 1**

Solve the system shown below using the Gauss Jordan Elimination method:

$ \begin{align*} { – x } + 2y &= \, { – 6 } \\ { 3x } – 4yĀ &= { 14 }Ā \end{align*} $

Solution

The first step is to write theĀ **augmented matrix** of the system. We show this below:

$ \left[ \begin{array}{ r r | r } – 1 & 2 & – 6 \\ 3 & -4 & 14Ā \end{array} \right] $

Now, our task is to reduce the matrix into the reduced row echelon form (RREF) by performing the $ 3 $ elementary row operations.

The augmented matrix that we have is:

$ \left[ \begin{array}{ r r | r } – 1 & 2 & – 6 \\ 3 & – 4 & 14Ā \end{array} \right] $

**Step 1:**

We can multiply the first row by $ – 1 $ to make the leading entry $ 1 $. Shown below:

$ \left[ \begin{array}{ r r | r } 1 & – 2 & 6 \\ 3 & – 4 & 14Ā \end{array} \right] $

**Step 2:**

We can now multiply the first row by $ 3 $ and subtract it from the second row. Shown below:

$ \left[ \begin{array}{ r r | r } 1 & -2 & 6 \\ {3 – ( 1 \times 3 ) } & { -4 – ( -2 \times 3 ) } & { 14 –Ā ( 6 \times 3 ) }Ā \end{array} \right] $

$Ā = \left[Ā \begin{array}{ r r | r } 1 & – 2 & 6 \\ 0 & 2 & – 4Ā \end{array} \right] $

We have a $ 0 $ as the first entry of the second row.

**Step 3:**

To make the second entry of the second row $ 1 $, we can multiply the second row by $ \frac{ 1 }{ 2 } $. Shown below:

$Ā \left[ \begin{array}{ r r | r } 1 & – 2 & 6 \\ { \frac{ 1 }{ 2 } \times 0} & { \frac{ 1 }{ 2 } \times 2 } & { \frac{ 1 }{ 2 } \times – 4}Ā \end{array} \right] $

$Ā = \left[ \begin{array}{ r r | r } 1 & – 2 & 6 \\ 0 & 1 & – 2Ā \end{array} \right] $

**Step 4:**

We are almost there!Ā

The second entry of the first row should be $ 0 $. In order to do that, we multiply the second row by $ 2 $ and add it to the first row. Shown below:

$ \left[ \begin{array}{ r r | r } { 1 + (0 \times 2 ) } & { – 2 + (1 \times 2 ) } & {6 + ( – 2 \times 2 ) } \\ 0 & 1 & – 2Ā \end{array} \right] $

$Ā = \left[Ā \begin{array}{ r r | r } 1 & 0 & 2 \\ 0 & 1 & – 2Ā \end{array} \right] $

This is theĀ **reduced row echelon**Ā **form**. From the *augmented matrix*, we can write two equations (solutions):

$ \begin{align*} xĀ + 0y &= \, 2 \\Ā 0xĀ + yĀ &=Ā -2Ā \end{align*} $

$ \begin{align*} x &= \, 2 \\ y &= – 2Ā \end{align*} $

Thus, the solution of the system of equations is $ x = 2 $ and $ y = – 2 $.

**Example 2**

**Example 2**

Solve the system shown below using the Gauss Jordan Elimination method:

$ \begin{align*} x + 2y &= \, 4 \\ x – 2yĀ &= 6Ā \end{align*} $

Solution

Let’s write the augmented matrix of the system of equations:

$ \left[Ā \begin{array}{ r r | r } 1 & 2 & 4 \\ 1 & – 2 & 6Ā \end{array} \right] $

Now, we do the elementary row operations on this matrix until we arrive in the reduced row echelon form.

Step 1:

We multiply the first row by $ 1 $ and then subtract it from the second row. This is basically subtracting the first row from the second row:

$ \left[ \begin{array}{ r r | r } 1 & 2 & 4 \\ 1 – 1 & – 2 – 2 & 6 – 4Ā \end{array} \right] $

$ =\left[ \begin{array}{ r r | r } 1 & 2 & 4 \\ 0 & – 4 & 2Ā \end{array} \right] $

Step 2:

We multiply the second row by $ -\frac{ 1 }{ 4 }$ to make the second entry of the row, $ 1 $:

$\left[ \begin{array}{ r r | r } 1 & 2 & 4 \\ 0 \times -\frac{ 1 }{ 4 } & – 4 \times -\frac{ 1 }{ 4 } & 2 \times -\frac{ 1 }{ 4 } Ā \end{array} \right] $

$ =\left[ \begin{array}{ r r | r } 1 & 2 & 4 \\ 0 & 1 & -\frac{ 1 }{ 2 }Ā \end{array} \right] $

Step 3:

Lastly, we multiply the second row by $ – 2 $ and add it to the first row to get the reduced row echelon form of this matrix:

$\left[ \begin{array}{ r r | r } 1+(- 2\times 0) & 2+( – 2 \times 1) & 4 + ( – 2 \times -\frac{ 1 }{ 2 } ) \\ 0 & 1 & -\frac{ 1 }{ 2 }Ā \end{array} \right] $

$=\left[ \begin{array}{ r r | r } 1 & 0 & 5 \\ 0 & 1 & -\frac{ 1 }{ 2 }Ā \end{array} \right] $

This is theĀ **reduced row echelon**Ā **form**. From the *augmented matrix*, we can write two equations (solutions):

$ \begin{align*} x + 0y &= \, 5 \\ 0x+ yĀ &= -\frac{ 1 }{ 2 }Ā \end{align*} $

$ \begin{align*} x &= \, 5 \\ y &= -\frac{ 1 }{ 2 } Ā \end{align*} $

Thus, the solution of the system of equations is $ x = 5 $ and $ y = -\frac{ 1 }{ 2 } $.

*Practice Questions*

*Practice Questions*

Solve the system shown below using the Gauss Jordan Elimination method:

$ \begin{align*} 2x + y &= \, – 3 \\ – x – yĀ &= 2Ā \end{align*} $

Solve the system shown below using the Gauss Jordan Elimination method:

$ \begin{align*} x + 5y &= \, 15 \\ – x + 5yĀ &= 25Ā \end{align*} $

### Answers

We start off by writing the augmented matrix of the system of equations:

$ \left[ \begin{array}{r r | r} 2 & 1 & – 3 \\ – 1 & – 1 & 2Ā \end{array} \right] $

Now, we do the elementary row operations to arrive at our solution.

First,

We inverse the signs of second row and exchange the rows. So, we have:

$ \left[ \begin{array}{r r | r} 1 & 1 & – 2 \\ 2 & 1 & – 3Ā \end{array} \right] $

Second,

We subtract twice of first row from second row:

$ \left[ \begin{array}{r r | r} 1 & 1 & – 2 \\ 2 – ( 2 \times 1 ) & 1 – ( 2 \times 1 ) & – 3 – ( 2 \times – 2 )Ā \end{array} \right] $

$ = \left[ \begin{array}{r r | r} 1 & 1 & – 2 \\ 0 & – 1 & 1Ā \end{array} \right] $

Third,

We inverse the second row to get:

$ = \left[\begin{array}{r r | r} 1 & 1 & – 2 \\ 0 & 1 & – 1Ā \end{array} \right] $

Lastly,

We subtract the second row from the first row and get:

$ = \left[\begin{array}{r r | r} 1 & 0 & – 1 \\ 0 & 1 & – 1Ā \end{array} \right] $From this

*augmented matrix*, we can write two equations (solutions):$ \begin{align*} x + 0y &= \, – 1 \\ 0x+ yĀ &= – 1Ā Ā \end{align*} $

$ \begin{align*} x &= \, – 1 \\ y &= – 1Ā \end{align*} $

Thus, the solution of the system of equations is $ x = – 1Ā $ and $ y = – 1 $.

- The augmented matrix of the system is:

$ \left[\begin{array}{r r|r} 1 & 5 & 15 \\ – 1 & 5 & 25Ā \end{array} \right] $

Let’sĀ get this matrix to reduced row echelon form and find the solution of the system.

First,

Negate the first row then subtract it from the second row to get:

$ \left[ \begin{array}{r r|r} 1 & 5 & 15 \\ – 1 – ( – 1 ) & 5 – ( – 5 ) & 25 – ( – 15)Ā \end{array} \right] $

$ =\left[ \begin{array}{r r|r} 1 & 5 & 15 \\ 0 & 10 & 40Ā \end{array} \right] $

Second,

Divide the second row by $10$ to get:

$ \left[\begin{array}{r r | r} 1 & 5 & 15 \\ 0 & 1 & 4Ā \end{array} \right] $

Then,

Multiply the second row by $ 5 $ and subtract it from the first row to finally get the solution:

$ \left[\begin{array}{r r | r} 1 – ( 5 \times 0 ) & 5 – ( 5 \times 1 ) & 15 – ( 5 \times 4 ) \\ 0 & 1 & 4Ā \end{array} \right] $

$ =\left[\begin{array}{r r | r} 1 & 0 & – 5 \\ 0 & 1 & 4Ā \end{array} \right] $

This is the reduced row echelon form (RREF). From this*augmented matrix*, we can write two equations (solutions):$ \begin{align*} x &= \, – 5 \\ y &= 4Ā \end{align*} $

Thus, the solution of the system of equations is $ x = – 5Ā $ and $ y = 4 $.