Open In App

Row Echelon Form

A matrix is in Row Echelon form if it has the following properties:

For reduced row echelon form, the leading 1 of every row contains 0 below and above its in that column.



Below is an example of row-echelon form: 



and reduced row-echelon form:

Any matrix can be transformed to reduced row echelon form, using a technique called Gaussian elimination. This is particularly useful for solving systems of linear equations.

Gaussian Elimination

Gaussian Elimination is a way of converting a matrix into the reduced row echelon form. It can also be used as a way of finding a solution to a solution to the system of linear equations. The idea behind this is that we perform some mathematical operations on the row and continue until only one variable is left.

Below are some operations which we can perform:

Given the following linear equation:

and the augmented matrix above 

Now, we need to convert this into the row-echelon form. To convert this into row-echelon form, we need to perform Gaussian Elimination.

Rank of matrix

The rank of the matrix is the number of non-zero rows in the row echelon form. To find the rank, we need to perform the following steps:

Let’s take an example matrix:

Now, we reduce the above matrix to row-echelon form

Here, only two row contains non-zero elements. Hence, the rank of the matrix is 2.

Implementation

# install sympy
! pip install sympy
 
# import sympy
import sympy
 
# find the reduced row echelon form
sympy.Matrix([[4,0,1],[2,0,2],[3,0,3]]).rref()
 
# find the rank of matrix
print("Rank of matrix :",sympy.Matrix([[4,0,1],[2,0,2],[3,0,3]]).rank())

                    

Output:

(Matrix([
[1, 0, 0],
[0, 0, 1],
[0, 0, 0]]), (0, 2))

Rank of matrix : 2

Article Tags :