KNOWPIA
WELCOME TO KNOWPIA

In linear algebra, a matrix is in **echelon form** if it has the shape resulting from a Gaussian elimination.

A matrix being in **row echelon form** means that Gaussian elimination has operated on the rows, and
**column echelon form** means that Gaussian elimination has operated on the columns. In other words, a matrix is in column echelon form if its transpose is in row echelon form. Therefore, only row echelon forms are considered in the remainder of this article. The similar properties of column echelon form are easily deduced by transposing all the matrices.
Specifically, a matrix is in **row echelon form** if

- All rows consisting of only zeroes are at the bottom.
- The leading coefficient (also called the pivot) of a nonzero row is always strictly to the right of the leading coefficient of the row above it.

Some texts add the condition that the leading coefficient must be 1.^{[1]}

These two conditions imply that all entries in a column below a leading coefficient are zeros.^{[2]}

The following is an example of a 3×5 matrix in row echelon form, which is not in *reduced* row echelon form (see below):

Many properties of matrices may be easily deduced from their row echelon form, such as the rank and the kernel.

A matrix is in **reduced row echelon form** (also called **row canonical form**) if it satisfies the following conditions:^{[3]}

- It is in row echelon form.
- The leading entry in each nonzero row is a 1 (called a leading 1).
- Each column containing a leading 1 has zeros in all its other entries.

The reduced row echelon form of a matrix may be computed by Gauss–Jordan elimination. Unlike the row echelon form, the reduced row echelon form of a matrix is unique and does not depend on the algorithm used to compute it.^{[4]} For a given matrix, despite the row echelon form not being unique, all row echelon forms and the reduced row echelon form have the same number of zero rows and the pivots are located in the same indices.^{[4]}

This is an example of a matrix in reduced row echelon form, which shows that the left part of the matrix is not always an identity matrix:

For matrices with integer coefficients, the Hermite normal form is a row echelon form that may be calculated using Euclidean division and without introducing any rational number or denominator. On the other hand, the reduced echelon form of a matrix with integer coefficients generally contains non-integer coefficients.

By means of a finite sequence of elementary row operations, called Gaussian elimination, any matrix can be transformed to row echelon form. Since elementary row operations preserve the row space of the matrix, the row space of the row echelon form is the same as that of the original matrix.

The resulting echelon form is not unique; any matrix that is in echelon form can be put in an (equivalent) echelon form by adding a scalar multiple of a row to one of the above rows, for example:

However, every matrix has a unique *reduced* row echelon form. In the above example, the reduced row echelon form can be found as

This means that the nonzero rows of the reduced row echelon form are the unique reduced row echelon generating set for the row space of the original matrix.

A system of linear equations is said to be in *row echelon form* if its augmented matrix is in row echelon form. Similarly, a system of linear equations is said to be in *reduced row echelon form* or in *canonical form* if its augmented matrix is in reduced row echelon form.

The canonical form may be viewed as an explicit solution of the linear system. In fact, the system is inconsistent if and only if one of the equations of the canonical form is reduced to 0 = 1.^{[5]} Otherwise, regrouping in the right hand side all the terms of the equations but the leading ones, expresses the variables corresponding to the pivots as constants or linear functions of the other variables, if any.

The following pseudocode converts a matrix into a reduced row echelon form:

functionToReducedRowEchelonForm(Matrix M)islead:= 0rowCount:= the number of rows in McolumnCount:= the number of columns in Mfor0 ≤r<rowCountdoifcolumnCount≤leadthenstop functionend ifi=rwhileM[i,lead] = 0doi=i+ 1ifrowCount=itheni=rlead=lead+ 1ifcolumnCount=leadthenstop functionend ifend ifend whileifi≠rthenSwap rowsiandrDivide rowrby M[r,lead]for0 ≤i<rowCountdoifi≠rdoSubtract M[i, lead] multiplied by rowrfrom rowiend ifend forlead=lead+ 1end forend function

The following pseudocode converts the matrix to a row echelon form (not abbreviated):

functionToRowEchelonForm(Matrix M)isnr:= number of rows in Mnc:= number of columns in Mfor0 ≤ r < nrdoallZeros:= truefor0 ≤c<ncdoifM[r,c] != 0thenallZeros:= falseexit forend ifend forifallZeros= truethenIn M, swap rowrwith rownrnr:=nr- 1end ifend forp:= 0whilep<nrandp<ncdolabelnextPivot:r:= 1whileM[p,p] = 0doif(p+r) <=nrthenp:=p+ 1gotonextPivotend ifIn M, swap rowpwith row (p+r)r:=r+ 1end whilefor1 ≤r< (nr-p)doifM[p+r,p] != 0 thenx:= -M[p+r,p] / M[p,p]forp≤c<ncdoM[p+r,c] := M[p,c] *x+ M[p+r,c]end forend ifend forp:=p+ 1end whileend function

**^**See, for instance, Leon (2009, p. 13)**^**Meyer 2000, p. 44**^**Meyer 2000, p. 48- ^
^{a}^{b}Anton, Howard; Rorres, Chris (2013-10-23).*Elementary Linear Algebra: Applications Version, 11th Edition*. Wiley Global Education. p. 21. ISBN 9781118879160. **^**Cheney, Ward; Kincaid, David R. (2010-12-29).*Linear Algebra: Theory and Applications*. Jones & Bartlett Publishers. pp. 47–50. ISBN 9781449613525.

The Wikibook Linear Algebra has a page on the topic of: Row Reduction and Echelon Forms |

- Interactive Row Echelon Form with rational output