# How to Calculate Gauss Jordan Elimination - Definition, Example

## Learn How to Calculate Gauss Jordan Elimination - Tutorial

##### Definition:

Gauss-Jordan Elimination is a technique of resolving the linear equations. Using this method, a matrix can be fetched to row echelon and reduced row echelon form.

Row echelon form occurs in a matrix under the following conditions, a) If the first non-zero element in each row (i.e,.) primary value is 1. b) All the values in the above and below column of the primary value are zero. c) Each primary value is in a column to the right of the primary value in the previous row. Reduced echelon form occurs in a matrix under the following conditions, a) The matrix should be in row echelon form. b) The leading value in each row is the only non-zero value in the column.

##### Example:

Use Gauss-Jordan elimination to solve the linear system of equations,

2y + z =4 x + y + 2z =6 2x + y + z = 7
##### Solution:
###### Step 1:

First, write the given linear equations in the form of a matrix by taking the value of variables,

2y + z =4 x + y + 2z =6 2x + y + z = 7

So the matrix becomes,

0 2 1 | 4 ->(r1) 1 1 2 | 6 ->(r2) 2 1 1 | 7 ->(r3)

###### Step 2:

In order to bring the diagonal matrix values to 1, let's interchange r1 and r2. So the matrix will be as follows.

 1 1 2 | 6 -> (r2) 0 2 1 | 4 -> (r1) 2 1 1 | 7 -> (r3)
###### Step 3:

Now, to make the first value in r3 to 0 let's add (-2 x r1) with the third row of the matrix i.e. r3

 1 1 2 | 6 0 2 1 | 4 2 1 1 | 7 -> (r3)+(-2 x r1)

The matrix becomes,

 1 1 2 | 6 0 2 1 | 4 0 -1 -3 | -5
###### Step 4:

To make the second column in r1 and r3 to 0, add (-1/2 x r2) with r1 and (1/2 x r2) with r3

 1 1 2 | 6 -> (r1)+(-1/2 x r2) 0 2 1 | 4 0 -1 -3 | -5 -> (r3) + (1/2 x r2)

So, the matrix becomes,

 1 0 3/2 | 4 0 2 1 | 4 0 0 -5/2 | -3
###### Step 5:

Now, to get 0 in third column of r1 and r2, add (3/5 x r3) with r1 and (2/5 x r3) with r2,

 1 0 3/2 | 4 -> (r1) + (3/5 x r3) 0 2 1 | 4 -> (r2) + (2/5 x r3) 0 0 -5/2 | -3

So, the matrix becomes,

 1 0 0 | 11/5 0 2 0 | 14/5 0 0 -5/2 | -3
###### Step 6:

Now, to get the values along the diagonal as 1 in all the rows, we can multiply the row r2 by 1/2 and r3 by -2/5

 1 0 0 | 11/5 0 2 0 | 14/5 -> (r2) x (1/2) 0 0 -5/2 | -3 -> (r3) x (-2/5)

Hence, the matrix is,

 1 0 0 | 11/5 0 1 0 | 7/5 0 0 1 | 6/5

Thus, each diagonal element is 1 and the value of x, y, z are,

X = 11/5Y = 7/5Z = 6/5