Table of contents
Row Echelon Form of a Matrix
- All nonzero rows are above any row of all zeros
- Each leading entry (pivot) is in a column to the right of the leading entry in previous row.
- All entries below a leading entry are zero.
The following are two examples of row echelon marices:
Reduced Row Echelon Forms
- It is in echelon form.
- The pivot of each nonzero row is \(1\).
- Each leading \(1\) is the only entry in its column.
The following are two examples of reduced row echelon forms:
\[\left[\begin{array}{rrr|r} 1 & \ast & \ast & \ast\\ 0 & 1 & \ast & \ast \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \end{array}\right]\qquad\qquad \left[\begin{array}{rrrrrrr|r} 0 & 1 & \ast & \ast & \ast & \ast & \ast & \ast\\ 0 & 0 & 0 & 1 & \ast & \ast & \ast & \ast\\ 0 & 0 & 0 & 0 & 1 & \ast & \ast & \ast \\ 0 & 0 & 0 & 0 & 0 & 0 & 1 & \ast \end{array}\right]\]Echelon Forms in SageMath
To obtain a row echelon form of a matrix using SageMath, we will perform row operations. The matrix class has a specific function for it.
Supose that we have a matrix stored in the variable A
. Then we can use the following operation:
A.add_multiple_of_row(i,j,a)
This means a*(row j) + row i
.
IMPORTANT NOTE: Remember that in SageMath (and Python) indexing starts at 0.
For example, if we want to add 3 times the first row to the third (R3+3\(\times\)R1) we would use the command
A.add_multiple_row(2,0,3)
So i=2
corresponds to the third row, j=0
corresponds to the first row, and a=3
is the multiplier.
The echelon_form()
function in SageMath
One can also use
A.echelon_form()
However, this function does not return the echelon form but the reduced echelon form.
Be careful!!
SageMath Examples
Check the following examples on how to perform the operations and obtain the echelon forms.