Matrix RREF
calculator.
Row reduce a matrix to its one reduced form, then read the rank and any solution.
| # | x₁ | x₂ | x₃ | b |
|---|---|---|---|---|
| 1 | ||||
| 2 | ||||
| 3 |
Entries can be whole numbers, decimals or fractions such as −3/4. Blank rows are left out.
- Rank
- 3
- Pivot columns
- 1, 2, 3
- Free variables
- None
Every variable column has a pivot, so the system has exactly one solution.
Entries can be whole numbers, decimals or fractions such as −3/4. Blank rows are left out.
Echelon pattern
The reduced matrix has pivots in columns 1, 2 and 3. The last column is the right side b. Rank 3.
Working, one row operation at a time
- 1Start from the augmented matrix1−21002−8850−510
- 2Clear the rest of column 1Subtract5timesrow 1 from row 31−21002−88010−1010
- 3Divide row 2 by2This makes the pivot in column 2 equal to 1.1−21001−44010−1010
- 4Clear the rest of column 2Add2timesrow 2 to row 1Subtract10timesrow 2 from row 310−7801−440030−30
- 5Divide row 3 by30This makes the pivot in column 3 equal to 1.10−7801−44001−1
- 6Clear the rest of column 3Add7timesrow 3 to row 1Add4timesrow 3 to row 210010100001−1
- 7Read the answer from the reduced rowsx₁=1x₂=0x₃=−1
- 8Check: put the solution back into each row1(1)−2(0)+1(−1)=00(1)+2(0)−8(−1)=85(1)+0(0)−5(−1)=10Each row gives its right side.
How it's worked out
A matrix is in reduced row echelon form (RREF) when five rules hold. Rows of zeros sit at the bottom. The first nonzero entry of each row, called its pivot, sits to the right of the pivot above it. Every entry below a pivot is 0. Each pivot is 1. Each pivot is the only nonzero entry in its column.
Three row operations get you there, and none of them changes the solutions of the system the matrix stands for. You can swap two rows, multiply a row by a number that is not 0, or add a multiple of one row to another.
The tool works column by column from the left, which is Gauss-Jordan elimination. It finds the next column with a nonzero entry at or below the current row. It swaps a row up only when the natural pivot is 0, so the steps match hand working. Then it divides the pivot row so the pivot becomes 1, and clears every other entry in that column, above and below.
Any order of valid row operations ends at the same matrix, because every matrix has exactly one RREF. Your hand working can take a different route and still be right, as long as it ends at the same reduced matrix.
Worked examples
Priya checks a three-equation system from her homework
Priya has three equations in three unknowns. She writes the numbers as an augmented matrix, with the right sides in the last column.
The reduction takes 5 groups of row operations. The left block becomes the identity, so each row now says one variable equals one number.
So , and . Putting these back into the first equation gives 0, the second gives 8 and the third gives 10. Those match the right sides, so her answer holds.
A system with two free variables
This system has five unknowns and three equations. Its top-left entry is 0, so the first step swaps rows 1 and 2 to get a nonzero pivot.
Columns 3 and 4 have no pivot, so x₃ and x₄ are free: they can be any numbers. Each pivot row then gives one of the other unknowns in terms of them.
Setting both free variables to 0 gives one particular solution, with . Every other solution adds some amount of the two direction vectors the tool shows in vector form.
Marco finds an inverse by reducing [A | I]
Marco needs the inverse of a 2 by 2 matrix. He writes the matrix with the identity beside it, so the grid is 2 by 4, and sets the last column as part of the matrix rather than a right side.
The inverse rule says that if the left block reduces to the identity, the right block is the inverse. Here the reduced matrix has rank 2 and its left block is the identity.
The entry shows why the exact view matters: a decimal would hide that it is exactly a half. If the left block had kept a row of zeros, the matrix would have no inverse.
Reading your result
For an augmented matrix [A | b], the pivots decide which of three cases you are in. The table uses this page's examples.
| Case | In the RREF | Pivots |
|---|---|---|
| One solution | A pivot in every variable column | 3 |
| Infinitely many | 2 variable columns with no pivot | 3 |
| No solution | A pivot in the b column | 3 |
No solution. A pivot in the last column means a row reads 0 = 1. That can never be true, so the system is inconsistent. In the no-solution example it is row 3, after subtracting twice the first equation from the second leaves 0 = 1.
Free variables. A variable is free when its column has no pivot. If the system has a solution and at least one free variable, it has infinitely many.
Rank and nullspace. The rank is the number of pivots, and rank plus nullity equals the number of columns. The 2 by 3 matrix with rows (1, 2, 3) and (2, 4, 6) has rank 1, so its nullspace has 2 basis vectors, one for each free column.
The pivot columns of the original matrix, not of the reduced one, form a basis for its column space. Use the RREF to find which columns they are, then take those columns from A.
Common mistakes
- Reading a row of zeros as infinitely many solutions. A zero row only means one equation repeated the others. What gives infinitely many is a variable column with no pivot, in a system that has a solution.
- Leaving the last column set as part of the matrix. If the last column is really the right side b, a pivot there reads as one more unit of rank instead of a sign that there is no solution. Set the last column to b for a system of equations.
- Typing a rounded decimal for a fraction. An entry of 0.333 is not 1/3, so the exact view cannot show clean fractions. Type 1/3 and the working stays exact.
- Taking basis columns from the RREF. The reduced matrix tells you which columns are pivot columns. The basis for the column space is those columns of the original matrix.
Questions people ask
Sources
- Margalit and Rabinoff, Interactive Linear Algebra, Row Reduction
- Margalit and Rabinoff, Interactive Linear Algebra, Parametric Form
- Margalit and Rabinoff, Interactive Linear Algebra, The Rank Theorem
- Margalit and Rabinoff, Interactive Linear Algebra, Dimension
- Margalit and Rabinoff, Interactive Linear Algebra, Matrix Inverses