Solving Systems of Linear Equations: Row Echelon Form and Rank

linear-algebra
Published

April 2, 2026

The Rank of a Matrix

Throughout the last few sections, there has been a concept that you’ve seen yet still have not been formally introduced to. It is the notion of the rank of a matrix which in some way measures how much information that matrix, or its corresponding system of linear equations, is carrying.

Motivation: Image Compression

One great application of rank in machine learning is image compression. Take a crisp image. It uses a lot of storage because every pixel intensity has to be stored as a number. Could you store this image, or perhaps a slightly blurrier version of it, using significantly less space? The answer is yes.

It turns out that pixelated images are matrices, and the rank of a matrix is related to the amount of space needed to store that corresponding image. A crisp image might have rank 200, which is quite high. There’s a very powerful technique called Singular Value Decomposition (SVD) which can reduce the rank of a matrix while changing it as little as possible. SVD can reduce a heavy image of rank 200 into images of rank 1, 2, 5, 15, and 50. The images of rank 15 and 50 are very similar to the original and take a lot less space to store.

Rank of a System of Sentences

Recall that in systems of sentences, there was a notion of how much information the system carried. Let’s look at three systems of sentences:

  • System 1: “The dog is black” and “The cat is orange”
  • System 2: “The dog is black” and “The dog is black”
  • System 3: “The dog is ___” and “The dog is ___”

System 1 has two sentences and it carries two pieces of information. System 2 also has two sentences, but they’re the same, so this system carries only one piece of information. System 3 has two sentences, but it carries no information regarding the color of the animals.

The amount of information a system of sentences carries is defined as the rank of the system:

System Sentences Information Rank
1 “The dog is black” + “The cat is orange” 2 pieces 2
2 “The dog is black” + “The dog is black” 1 piece 1
3 “The dog is ___” + “The dog is ___” 0 pieces 0

Rank of a System of Equations

Now, let’s go back to the three systems of equations from the previous sections.

System 1 (Non-Singular — Unique Solution):

\[\begin{cases} a + b = 10 \\ a + 2b = 12 \end{cases}\]

This system has two equations and each equation brings something new to the table — some new piece of information. That’s why you’re able to narrow down the solutions to one point. The first equation narrows down to a line and the second one narrows them down to a point. The system has two pieces of information, so the rank is 2.

System 2 (Singular — Redundant):

\[\begin{cases} a + b = 10 \\ 2a + 2b = 20 \end{cases}\]

This system has two equations, but the second equation is the same as the first one (just multiplied by 2). Therefore the system really only carries one piece of information: the first equation. This is why you’re able to narrow down the set of solutions to a line, but that’s as far as you can get. The rank is 1.

System 3 (Trivial — Zero Information):

\[\begin{cases} 0a + 0b = 0 \\ 0a + 0b = 0 \end{cases}\]

This system has two equations, but they carry no information as any numbers \(a\) and \(b\) satisfy these equations. The system carries zero pieces of information and its rank is 0.

Rank of a Matrix

Since each system of equations has a corresponding matrix, the rank of the matrix is defined as the rank of the corresponding system of equations:

\[\underbrace{\begin{bmatrix} 1 & 1 \\ 1 & 2 \end{bmatrix}}_{\text{rank } 2} \qquad \underbrace{\begin{bmatrix} 1 & 1 \\ 2 & 2 \end{bmatrix}}_{\text{rank } 1} \qquad \underbrace{\begin{bmatrix} 0 & 0 \\ 0 & 0 \end{bmatrix}}_{\text{rank } 0}\]

Rank and the Solution Space

There’s a special relationship between the rank of a matrix and its solution space. Recall that the solution space for each of these matrices is the set of solutions to the system of equations when the constants are zero (i.e., the homogeneous system).

Matrix Solution Space Dimension Rank Rows
\(\begin{bmatrix} 1 & 1 \\ 1 & 2 \end{bmatrix}\) Only \(a=0, b=0\) (a point) 0 2 2
\(\begin{bmatrix} 1 & 1 \\ 2 & 2 \end{bmatrix}\) A line (\(a = -b\)) 1 1 2
\(\begin{bmatrix} 0 & 0 \\ 0 & 0 \end{bmatrix}\) All of \(\mathbb{R}^2\) (a plane) 2 0 2

Notice the pattern: in all three cases:

\[\text{rank} + \text{dimension of solution space} = \text{number of rows}\]

This is always the case for \(2 \times 2\) matrices. And in general, this relationship always holds: the rank and the dimension of the solution space always add up to the number of columns in the matrix. This is known as the Rank-Nullity Theorem.

Rank and Singularity

Notice also that the first matrix is non-singular and the other two are singular. So:

A matrix is non-singular if and only if it has full rank, that is, if the rank equals the number of rows.

This is the same as saying that a system of equations is non-singular if it carries as many pieces of information as equations it has, meaning that you carry the maximum amount of information possible. Each equation brings a new piece of information to the table and there’s no redundancy between equations.

Quiz: Determine the Rank

Determine the rank of the following matrices:

\[A = \begin{bmatrix} 3 & 1 \\ 1 & 2 \end{bmatrix} \qquad B = \begin{bmatrix} 1 & 3 \\ 2 & 6 \end{bmatrix}\]

Matrix \(A\): The solution space of the homogeneous system \(3a + b = 0\), \(a + 2b = 0\) is only \(a = 0, b = 0\) (a point). The dimension of the solution space is 0, so \(\text{rank}(A) = 2 - 0 = 2\). Matrix \(A\) is non-singular.

Matrix \(B\): Row 2 is \(2 \times\) Row 1, so the system \(a + 3b = 0\), \(2a + 6b = 0\) reduces to just \(a + 3b = 0\), which is a line. The dimension of the solution space is 1, so \(\text{rank}(B) = 2 - 1 = 1\). Matrix \(B\) is singular.

Rank of 3×3 Matrices

Just as it happened with \(2 \times 2\) matrices, the rank is a measure of how non-singular a \(3 \times 3\) matrix is and its geometric meaning is very similar. In order to define the rank of a \(3 \times 3\) matrix, we’ll look at the systems of three equations and three unknowns that you’ve been looking at so far. Let’s focus on what equations bring new information to the table. By “not bringing any information to the table,” I mean an equation that is already a linear combination of the other equations in the system.

System 1: All three equations are linearly independent. There’s no way to obtain one from the other two. Therefore, the system has three equations and all of them are new pieces of information, so it has three pieces of information. The number of independent equations is the rank:

\[\begin{cases} a + b + c = 0 \\ a + 2b + c = 0 \\ a + b + 2c = 0 \end{cases} \qquad \begin{bmatrix} 1 & 1 & 1 \\ 1 & 2 & 1 \\ 1 & 1 & 2 \end{bmatrix} \quad \text{rank } 3\]

System 2: The second equation is the average of the first and the third, so you can think of the first and the third as the new pieces of information. The second one doesn’t bring anything new to the table. You can verify this in different ways, but you will always get that there are three equations and two pieces of information:

\[\begin{cases} a + b + c = 0 \\ a + b + 2c = 0 \\ a + b + 3c = 0 \end{cases} \qquad \begin{bmatrix} 1 & 1 & 1 \\ 1 & 1 & 2 \\ 1 & 1 & 3 \end{bmatrix} \quad \text{rank } 2\]

System 3: The first equation is new. But the second one is twice the first one, so it depends on it. The third one is also three times the first one, so it depends on the first one as well. We have three equations and one piece of information:

\[\begin{cases} a + b + c = 0 \\ 2a + 2b + 2c = 0 \\ 3a + 3b + 3c = 0 \end{cases} \qquad \begin{bmatrix} 1 & 1 & 1 \\ 2 & 2 & 2 \\ 3 & 3 & 3 \end{bmatrix} \quad \text{rank } 1\]

System 4: No equation brings anything new to the table because no equation tells you anything about \(a\), \(b\), and \(c\). You have three equations, zero pieces of information:

\[\begin{cases} 0a + 0b + 0c = 0 \\ 0a + 0b + 0c = 0 \\ 0a + 0b + 0c = 0 \end{cases} \qquad \begin{bmatrix} 0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end{bmatrix} \quad \text{rank } 0\]

Summary

System Equations Independent Rank Type
1 3 3 3 Non-singular
2 3 2 2 Singular
3 3 1 1 Singular
4 3 0 0 Singular

It seems that calculating the rank is not that easy, so is there a simpler way to calculate it? The answer is yes, and it has to do with the row echelon form of a matrix.

Row Echelon Form (REF)

The row echelon form of a matrix is a simpler matrix obtained by applying row operations (swapping rows, multiplying a row by a non-zero constant, adding a multiple of one row to another). A matrix is in row echelon form when:

  1. All zero rows are at the bottom
  2. The leading entry (pivot) of each non-zero row is to the right of the pivot in the row above
  3. All entries below a pivot are zero

The goal is to transform any matrix into this staircase-like shape, where everything below the diagonal is zero. From this form, you can directly read off the rank.

Here are some side-by-side comparisons to build your intuition. In each pair, the matrix on the left is in REF and the one on the right breaks exactly one rule:

\[\color{green}{\begin{bmatrix} 1 & 3 & 2 \\ 0 & 1 & 5 \\ 0 & 0 & 1 \end{bmatrix}} \quad \text{REF} \checkmark \qquad \qquad \color{red}{\begin{bmatrix} 1 & 3 & 2 \\ 0 & 1 & 5 \\ 0 & \boxed{3} & 1 \end{bmatrix}} \quad \text{NOT REF} \times\]

The left matrix has zeros below every pivot. The right matrix is identical except for the \(\boxed{3}\) below the second pivot, which violates rule 3.

\[\color{green}{\begin{bmatrix} 1 & 4 & -1 \\ 0 & 1 & 2 \\ 0 & 0 & 0 \end{bmatrix}} \quad \text{REF} \checkmark \qquad \qquad \color{red}{\begin{bmatrix} 1 & 4 & -1 \\ \boxed{0} & \boxed{0} & \boxed{0} \\ 0 & 1 & 2 \end{bmatrix}} \quad \text{NOT REF} \times\]

The left matrix has the zero row at the bottom. The right matrix has the same rows, but the zero row is in the middle instead of the bottom, which violates rule 1.

Example 1: Non-Singular Matrix

In order to calculate the row echelon form for this matrix, here’s what you would do:

\[\begin{bmatrix} 5 & 1 \\ 4 & -3 \end{bmatrix}\]

The idea is to get rid of that 4 in the bottom left.

Step 1: Divide each row by the leftmost non-zero coefficient:

\[\begin{bmatrix} 5 & 1 \\ 4 & -3 \end{bmatrix} \xrightarrow{R_1 / 5, \; R_2 / 4} \begin{bmatrix} 1 & 0.2 \\ 1 & -0.75 \end{bmatrix}\]

Step 2: In order to remove that bottom-left 1, keep the first row the same, but subtract the first row from the second row:

\[\begin{bmatrix} 1 & 0.2 \\ 1 & -0.75 \end{bmatrix} \xrightarrow{R_2 - R_1} \begin{bmatrix} 1 & 0.2 \\ 0 & -0.95 \end{bmatrix}\]

We have succeeded at getting a zero in the bottom left corner, which is what we wanted.

Step 3: As a final step, divide the second row by the leftmost non-zero coefficient in order to get a 1 on the bottom right corner:

\[\begin{bmatrix} 1 & 0.2 \\ 0 & -0.95 \end{bmatrix} \xrightarrow{R_2 / (-0.95)} \begin{bmatrix} 1 & 0.2 \\ 0 & 1 \end{bmatrix}\]

Now the matrix is in row echelon form.

Example 2: Singular Matrix

What if you do this for a singular matrix? Well, if you try it for this matrix, let’s see what happens:

\[\begin{bmatrix} 5 & 1 \\ 10 & 2 \end{bmatrix}\]

Step 1: Divide each row by the leftmost coefficients:

\[\begin{bmatrix} 5 & 1 \\ 10 & 2 \end{bmatrix} \xrightarrow{R_1 / 5, \; R_2 / 10} \begin{bmatrix} 1 & 0.2 \\ 1 & 0.2 \end{bmatrix}\]

Step 2: In order to eliminate that bottom-left 1, take the bottom row and subtract the top row:

\[\begin{bmatrix} 1 & 0.2 \\ 1 & 0.2 \end{bmatrix} \xrightarrow{R_2 - R_1} \begin{bmatrix} 1 & 0.2 \\ 0 & 0 \end{bmatrix}\]

Step 3: Now let’s see what happens when you try to divide the second row by the leftmost non-zero coefficient. Well, that’s impossible because you’d be dividing 0 by 0, which is undefined. That’s no problem. What you do is you let this be the row echelon form instead:

\[\begin{bmatrix} 1 & 0.2 \\ 0 & 0 \end{bmatrix}\]

Example 3: Zero Matrix

Finally, for the zero matrix, there’s not a lot you can do because you cannot divide each row by the leftmost coefficients (those are zero). Instead, you just say this is the row echelon form:

\[\begin{bmatrix} 0 & 0 \\ 0 & 0 \end{bmatrix}\]

The Connection Between REF and Rank

In summary, here are the matrices and their row echelon forms:

Original Matrix Row Echelon Form Ones on Diagonal Rank
\(\begin{bmatrix} 5 & 1 \\ 4 & -3 \end{bmatrix}\) \(\begin{bmatrix} 1 & 0.2 \\ 0 & 1 \end{bmatrix}\) 2 2
\(\begin{bmatrix} 5 & 1 \\ 10 & 2 \end{bmatrix}\) \(\begin{bmatrix} 1 & 0.2 \\ 0 & 0 \end{bmatrix}\) 1 1
\(\begin{bmatrix} 0 & 0 \\ 0 & 0 \end{bmatrix}\) \(\begin{bmatrix} 0 & 0 \\ 0 & 0 \end{bmatrix}\) 0 0

Here is a very interesting connection with rank:

The rank of a matrix is the number of ones in the diagonal of the row echelon form.

That’s an easy way to calculate the rank! Notice furthermore that the first one is non-singular, the second one is singular, and the third one is singular.

A matrix is non-singular if and only if the row echelon form has only ones and no zeros on the diagonal.

Row Echelon Form for Larger Matrices

Now that you’ve seen row echelon form for \(2 \times 2\) matrices, let me show you what it is for bigger matrices.

From Systems to REF

Recall the system of equations from the previous section and the process you took to solve it. The intermediate step was where the first equation has variables \(a\), \(b\), and \(c\), the second one only has variables \(b\) and \(c\), and the third one only has variable \(c\):

\[\begin{bmatrix} 1 & 1 & 2 \\ 3 & -3 & -1 \\ 2 & -1 & 6 \end{bmatrix} \xrightarrow{R_2 - 3R_1, \; R_3 - 2R_1} \begin{bmatrix} 1 & 1 & 2 \\ 0 & -6 & -7 \\ 0 & -3 & 2 \end{bmatrix} \xrightarrow{R_3 - \frac{1}{2}R_2} \begin{bmatrix} 1 & 1 & 2 \\ 0 & -6 & -7 \\ 0 & 0 & 11/2 \end{bmatrix}\]

Subtracting \(3 \times\) the first row from the second and \(2 \times\) the first row from the third eliminates the first column. Then subtracting \(\frac{1}{2} \times\) the second row from the third eliminates the second column. The result is in row echelon form with zeros below the diagonal.

The exact same row operations can be done on the matrix corresponding to the system in order to get the matrix on the right, which now has ones on the diagonal and zeros underneath the diagonal. This is the row echelon form of the matrix.

The General Shape

This is the way a row echelon form matrix looks like in general. The \(\star\) entries represent numbers that could be zero or non-zero, it doesn’t matter:

\[\begin{bmatrix} 2 & \star & \star & \star & \star \\ 0 & 1 & \star & \star & \star \\ 0 & 0 & 3 & \star & \star \\ 0 & 0 & 0 & -5 & \star \\ 0 & 0 & 0 & 0 & 1 \end{bmatrix} \qquad \begin{bmatrix} 3 & \star & \star & \star & \star \\ 0 & 0 & 1 & \star & \star \\ 0 & 0 & 0 & -4 & \star \\ 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 \end{bmatrix}\]

The matrix may or may not have rows full of zeros. However, if it does, they need to go at the bottom. Furthermore, notice that every non-zero row has a leftmost non-zero entry. These are called the pivots. Every row has a particular pivot and there’s a rule about pivots: every pivot has to be strictly to the right of the pivot of the row above. In other words, if you stand at a pivot and you look at all the pivots above, they all need to be strictly to its left.

The row echelon form, as you saw before, is very useful to tell you the rank of a matrix. It’s actually the number of pivots. The matrix on the left has rank 5 and the matrix on the right has rank 3.

A Note on Notation

Here’s a very important note in terms of notation. On the left, you see a row echelon form matrix with pivots that are not necessarily 1. You could do some cosmetics and divide each row by its pivot to get a matrix where all pivots are 1:

\[\begin{bmatrix} 3 & 2 & 5 \\ 0 & 1 & 4 \\ 0 & 0 & -4 \end{bmatrix} \xrightarrow{R_1/3, \; R_3/(-4)} \begin{bmatrix} 1 & 0.67 & 1.67 \\ 0 & 1 & 4 \\ 0 & 0 & 1 \end{bmatrix}\]

In most textbooks, the form on the left is allowed. In general, pivots different than 1 are valid. However, for this course, we’re going to use the form on the right. We’re going to take that extra step of dividing by the leading entry in order to get the pivots to be 1. This makes no mathematical difference in terms of rank. It’s the same rank and it’s more consistent with the way we are solving our systems of equations by dividing by the leading coefficient.

REF of 3×3 Matrices

Non-singular example: The matrix you’ve seen before can be reduced by subtracting the first row from the second and third rows:

\[\begin{bmatrix} 1 & 1 & 1 \\ 1 & 2 & 1 \\ 1 & 1 & 2 \end{bmatrix} \xrightarrow{R_2 - R_1, \; R_3 - R_1} \begin{bmatrix} 1 & 1 & 1 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}\]

Notice that the result is in row echelon form.

Singular example (rank 2): Now what if the matrix is singular? Let’s try to find the row echelon form of this singular matrix. First subtract the first row from the second and third ones. Then take the second row, multiply it by two, and subtract it from the third one:

\[\begin{bmatrix} 1 & 1 & 1 \\ 1 & 1 & 2 \\ 1 & 1 & 3 \end{bmatrix} \xrightarrow{R_2 - R_1, \; R_3 - R_1} \begin{bmatrix} 1 & 1 & 1 \\ 0 & 0 & 1 \\ 0 & 0 & 2 \end{bmatrix} \xrightarrow{R_3 - 2R_2} \begin{bmatrix} 1 & 1 & 1 \\ 0 & 0 & 1 \\ 0 & 0 & 0 \end{bmatrix}\]

That is the row echelon form of that matrix.

Singular example (rank 1): Let’s find the row echelon form for another singular matrix. Take the first row, multiply it by two, and subtract it from the second row. Then take the first row, multiply it by three, and subtract it from the third row:

\[\begin{bmatrix} 1 & 1 & 1 \\ 2 & 2 & 2 \\ 3 & 3 & 3 \end{bmatrix} \xrightarrow{R_2 - 2R_1, \; R_3 - 3R_1} \begin{bmatrix} 1 & 1 & 1 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end{bmatrix}\]

Rank from REF: The General Rule

Just like for \(2 \times 2\) matrices, the rank of the matrix is the number of pivot ones in the row echelon form:

Original Matrix Row Echelon Form Pivots Rank
\(\begin{bmatrix} 1 & 1 & 1 \\ 1 & 2 & 1 \\ 1 & 1 & 2 \end{bmatrix}\) \(\begin{bmatrix} 1 & 1 & 1 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}\) 3 3
\(\begin{bmatrix} 1 & 1 & 1 \\ 1 & 1 & 2 \\ 1 & 1 & 3 \end{bmatrix}\) \(\begin{bmatrix} 1 & 1 & 1 \\ 0 & 0 & 1 \\ 0 & 0 & 0 \end{bmatrix}\) 2 2
\(\begin{bmatrix} 1 & 1 & 1 \\ 2 & 2 & 2 \\ 3 & 3 & 3 \end{bmatrix}\) \(\begin{bmatrix} 1 & 1 & 1 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end{bmatrix}\) 1 1
\(\begin{bmatrix} 0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end{bmatrix}\) \(\begin{bmatrix} 0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end{bmatrix}\) 0 0

These are exactly the ranks of the corresponding matrices that we determined earlier by counting independent equations.

Reduced Row Echelon Form (RREF)

Now that you’ve learned the row echelon form, let me show you the reduced row echelon form, which is just one more step.

From REF to Solved System

Let’s say that you’re solving the system \(5a + b = 17\) and \(4a - 3b = 6\). Recall that what you do is go to an intermediate step of removing the variable \(a\) from the bottom equation in order to calculate the value of \(b\). Then you step back up, replacing the value of \(b\) in the first equation to get the value of \(a\). The solved system then has equations \(a = 3\) and \(b = 2\).

Following the same procedure but with the corresponding matrix of coefficients (forgetting about the constants 17 and 6), you go through the intermediate row echelon form using row manipulations:

\[\begin{bmatrix} 5 & 1 \\ 4 & -3 \end{bmatrix} \xrightarrow{\text{row operations}} \begin{bmatrix} 1 & 0.2 \\ 0 & 1 \end{bmatrix} \xrightarrow{\text{more operations}} \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}\]

The final matrix has ones on the diagonal and zeros everywhere else. Why is this the matrix corresponding to the solved system? Because you can see the system \(a = 3\) and \(b = 2\) as:

\[\begin{cases} 1 \cdot a + 0 \cdot b = 3 \\ 0 \cdot a + 1 \cdot b = 2 \end{cases}\]

from which the matrix \(\begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}\) comes out.

The intermediate matrix is the row echelon form. The final one is the reduced row echelon form, which corresponds to the solved system.

Going from REF to RREF

The way to get from the row echelon form to the reduced row echelon form is simply to use each 1 on the diagonal to eliminate all the non-zero entries above it.

For example, here you’d like to get rid of that pesky \(0.2\) at the top right. Leave the bottom row untouched and from the first row, subtract \(0.2\) times the second row:

\[\begin{bmatrix} 1 & 0.2 \\ 0 & 1 \end{bmatrix} \xrightarrow{R_1 - 0.2 \cdot R_2} \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}\]

That’s the reduced row echelon form.

The General Shape

The way a reduced row echelon form matrix looks in general is similar to REF, but with an additional requirement: any number above a pivot must also be zero.

\[\begin{bmatrix} 1 & 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 1 \end{bmatrix} \qquad \begin{bmatrix} 1 & 0 & 0 & \star & 0 \\ 0 & 0 & 1 & \star & 0 \\ 0 & 0 & 0 & 0 & 1 \\ 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 \end{bmatrix}\]

The rules are:

  1. It must be in row echelon form
  2. Each pivot must be a 1
  3. All entries above a pivot must be zero

Just like with REF, the rank of the matrix is the number of pivots. The matrix on the left has rank 5 and the one on the right has rank 3.

A 3×3 Example

Let’s say this is the row echelon form of a matrix, and we’re going to turn it into reduced row echelon form:

\[\begin{bmatrix} 1 & 2 & -5 \\ 0 & 1 & 4 \\ 0 & 0 & 1 \end{bmatrix}\]

Step 1: Get rid of the \(2\) in position \((1,2)\). Subtract \(2 \times\) the second row from the first:

\[\begin{bmatrix} 1 & 2 & -5 \\ 0 & 1 & 4 \\ 0 & 0 & 1 \end{bmatrix} \xrightarrow{R_1 - 2R_2} \begin{bmatrix} 1 & 0 & -13 \\ 0 & 1 & 4 \\ 0 & 0 & 1 \end{bmatrix}\]

Step 2: Get rid of the \(-13\) in position \((1,3)\). Add \(13 \times\) the third row to the first:

\[\begin{bmatrix} 1 & 0 & -13 \\ 0 & 1 & 4 \\ 0 & 0 & 1 \end{bmatrix} \xrightarrow{R_1 + 13R_3} \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 4 \\ 0 & 0 & 1 \end{bmatrix}\]

Step 3: Get rid of the \(4\) in position \((2,3)\). Subtract \(4 \times\) the third row from the second:

\[\begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 4 \\ 0 & 0 & 1 \end{bmatrix} \xrightarrow{R_2 - 4R_3} \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}\]

And that’s the reduced row echelon form: the identity matrix. This tells us the system is non-singular with a unique solution.


Next: Programming Assignment: Gaussian Elimination