Omni Calculator logo

Welcome to Omni's Gauss-Jordan elimination calculator! Whether you've come here because you need to learn how to solve a linear system by the Gauss-Jordan elimination algorithm or instead you want to invert a matrix using this method, you're at the right place!

We will explain what the Gauss-Jordan elimination actually is and how it differs from the Gauss elimination, which you may have encountered earlier in your mathematical journey. Then we will tell you how to do the Gauss-Jordan elimination by hand or if you'd rather save some effort, how to use this Gauss-Jordan elimination calculator most efficiently.

πŸ™‹ The Gauss-Jordan elimination algorithm is especially popular in the context of solving systems of linear equations. In our dedicated tool, namely the reduced row echelon form calculator, we approach the Gauss-Jordan elimination method from this specific angle.

What is the Gauss-Jordan elimination method?

The Gauss-Jordan elimination method is a procedure where we convert a matrix into its reduced row echelon form by using only three specific operations, called elementary row operations.

The purpose of the Gauss-Jordan elimination method is, most often, to:

  • Solve a system of linear equations;
  • Inverse a matrix;
  • Compute the rank of a matrix; or
  • Compute the determinant of a matrix.

As you can see, several new notions appeared: row echelon, elementary operations, etc. Let's discuss them first, and then we will move on to discussing how to do the Gauss-Jordan elimination.

What is the (reduced) row echelon form of a matrix?

A matrix is in the row echelon form when:

  • For zero rows: they are all at the bottom of the matrix; and
  • For non-zero rows: the leftmost non-zero entry in a row (called the pivot or the leading coefficient) is to the right of the pivot of the row above.

A matrix is in reduced row echelon form if additionally:

  • Each pivot is equal to 1; and
  • Each pivot is the only non-zero coefficient in its column (there are only zeros above and below the pivot).

Examples

Matrices in the row echelon form (but not in the reduced row echelon form):

[123056007][450300120001]\begin{bmatrix} 1 & 2 & 3 \\ 0 &5 &6 \\ 0 &0 &7 \end{bmatrix} \quad \begin{bmatrix} 4 &5 &0 & 3\\ 0 & 0 & 1 & 2\\ 0 &0 &0 & 1 \end{bmatrix}
[113014][200101010000]\begin{bmatrix} 1 & 1 &3 \\ 0 &1 &4 \end{bmatrix} \quad \begin{bmatrix} 2 & 0 & 0& 1\\ 0 &1 &0& 1\\ 0 &0 &0&0 \end{bmatrix}

Matrices in the reduced row echelon form:

[103014][100300160000]\begin{bmatrix} 1 & 0 & 3 \\ 0 &1 &4 \end{bmatrix} \quad \begin{bmatrix} 1 & 0 & 0& 3\\ 0 &0 &1& 6\\ 0 &0 &0& 0 \end{bmatrix}

What are row operations in Gauss elimination?

Here we list the allowed row operations in the Gauss (and Gauss-Jordan) elimination:

  1. Swapping any two of the rows.

  2. Adding/subtracting a scalar multiple of one row to/from another row.

  3. Multiplying any of the rows by any (non-zero!) scalar.

Let's look at some examples:

  1. Swap the 1st row with the 2nd row:
[123456789]  β†’  [456123789]\quad \begin{bmatrix} 1 & 2 & 3 \\ 4 &5 &6 \\ 7 &8 &9 \end{bmatrix} \ \ \rightarrow \ \ \begin{bmatrix} 4 &5 &6 \\ 1 & 2 & 3 \\ 7 &8 &9 \end{bmatrix}
  1. Multiply the 1st row by 22:
[123456789]  β†’  [246456789]\quad \begin{bmatrix} 1 & 2 & 3 \\ 4 &5 &6 \\ 7 &8 &9 \end{bmatrix} \ \ \rightarrow \ \ \begin{bmatrix} 2 & 4 & 6 \\ 4 &5 &6 \\ 7 &8 &9 \end{bmatrix}
  1. Add the 1st row multiplied by -2 to the 2nd row:
[123456789]  β†’  [123210789]\quad \begin{bmatrix} 1 & 2 & 3 \\ 4 &5 &6 \\ 7 &8 &9 \end{bmatrix} \ \ \rightarrow \ \ \begin{bmatrix} 1 & 2 & 3 \\ 2 & 1 & 0 \\ 7 &8 &9 \end{bmatrix}

πŸ™‹ If you need a refresher on how to perform math operations (addition, multiplication, etc...) on matrix rows, visit our vector calculator.

Can you see how each of these operations helps us perform the Gauss-Jordan elimination? Let's see:

  1. By swapping rows, we can easily put the zero rows at the bottom of the matrix.

  2. The aim of adding/subtracting a scalar multiple of a row to/from another row is to turn the entries above and below the pivots into zeros.

  3. By multiplying a row by a scalar, you'll easily make the pivots equal to 1 – just multiply the pivot, equal to some p, by the scalar 1/p.

Gauss-Jordan elimination: 3Γ—3 example

To see how the row operations introduced above work in practice, let's use them to solve the following 3Γ—3 example by the Gauss-Jordan elimination:

{x+2yβˆ’2z=12x+4yβˆ’5z=42x+2y+3z=4\left\{ \begin{align*} x+2y-2z = 1\\ 2x+4y-5z = 4\\ 2x+2y+3z=4\\ \end{align*} \right.

The augmented matrix of this system reads:

[12βˆ’2124βˆ’542234]\begin{bmatrix} 1 & 2 & -2 & 1\\ 2 & 4 & -5 & 4\\ 2 & 2 & 3 & 4\\ \end{bmatrix}

Let's subtract the 1st row multiplied by 22 from the 2nd row:

[12βˆ’2100βˆ’122234]\begin{bmatrix} 1 & 2 & -2 & 1\\ 0 & 0 & -1 & 2\\ 2 & 2 & 3 & 4\\ \end{bmatrix}

We've managed to produce zero in the 2nd row and 1st column! We do the same for the 3rd row and 1st column:

[12βˆ’2100βˆ’120βˆ’272] \begin{bmatrix} 1 & 2 & -2 & 1\\ 0 & 0 & -1 & 2\\ 0 & -2 & 7 & 2\\ \end{bmatrix}

Perfect! In fact, as you can see, we've managed to produce two zeros in the 2nd row! Let's use this unexpected gift: we swap the 2nd and 3rd rows:

[12βˆ’210βˆ’27200βˆ’12]\begin{bmatrix} 1 & 2 & -2 & 1\\ 0 & -2 & 7 & 2\\ 0 & 0 & -1 & 2\\ \end{bmatrix}

In this way, we've already obtained a row echelon form. From here, you can easily solve the system. Let's, however, stick to the Gauss-Jordan elimination and try to produce the reduced row echelon form.

First, we multiply the last row by βˆ’1-1 so that the pivot equals 11:

[12βˆ’210βˆ’272001βˆ’2] \begin{bmatrix} 1 & 2 & -2 & 1\\ 0 & -2 & 7 & 2\\ 0 & 0 & 1 & -2\\ \end{bmatrix}

And we multiply the 2nd row by βˆ’12-\frac 12 so that the pivot equals 11:

[12βˆ’2101βˆ’72βˆ’1001βˆ’2]\begin{bmatrix} 1 & 2 & -2 & 1\\ 0 & 1 & -\frac 72 & -1\\ 0 & 0 & 1 & -2\\ \end{bmatrix}

Next, we want to eliminate the non-zero element in the 1st row and 2nd column. To this end, from the 1st row we subtract the 2nd row multiplied by 22:

[105301βˆ’72βˆ’1001βˆ’2]\begin{bmatrix} 1 & 0 & 5 & 3\\ 0 & 1 & -\frac 72 & -1\\ 0 & 0 & 1 & -2\\ \end{bmatrix}

Two more entries to eliminate: the above-diagonal elements in the 3rd column. You know what to do, right? From the 1st row we subtract the 3rd row multiplied by 55:

[1001301βˆ’72βˆ’1001βˆ’2]\begin{bmatrix} 1 & 0 & 0 & 13\\ 0 & 1 & -\frac 72 & -1\\ 0 & 0 & 1 & -2\\ \end{bmatrix}

And to the 2nd row we add the 3rd row multiplied by 72\frac 72:

[10013010βˆ’8001βˆ’2]\begin{bmatrix} 1 & 0 & 0 & 13\\ 0 & 1 & 0 & -8\\ 0 & 0 & 1 & -2\\ \end{bmatrix}

Yay, we're done! Our matrix is in the reduced row echelon form. In the last column, we see the solution to our linear system:

{x=13y=βˆ’8z=βˆ’2\left\{ \begin{align*} x = 13\\ y = -8\\ z =-2\\ \end{align*} \right.

How do I do the Gauss-Jordan elimination by hand?

Perform the Gauss-Jordan elimination as follows:

  1. Swap the rows so that there is a pivot (non-zero number) in the 1st row and 1st column.

  2. Multiply the first row so that the pivot becomes 1.

  3. Add/subtract multiples of the 1st row to/from the other rows to turn all the remaining entries of the 1st column are zeros.

  4. Swap rows to have a pivot in the 2nd row and 2nd column. Apply Steps 2 & 3.

  5. Repeat steps 2-4, moving along the main diagonal.

Hmmm.... so many steps! Performing the Gauss-Jordan elimination algorithm, even if straightforward, may be time-consuming. You surely have better ideas on how to use your free time, don't you? ;) Use our Gauss-Jordan elimination calculator to do your homework quickly and then move on to... other stuff.

How to use this Gauss-Jordan elimination calculator?

Omni's Gauss-Jordan elimination calculator is a very simple tool to use. Follow these steps:

  1. Input the coefficients of your matrix.

  2. Tell us whether you want the row echelon form or the reduced row echelon form as a result. We recommend the latter as the former is non-unique!

  3. The calculations go off immediately, and the result is displayed below the coefficient fields.

  4. Note you can use this calculator to generate as many 2Γ—2 and 3Γ—3 examples of Gauss-Jordan elimination as you wish.

FAQ

Is Gauss-Jordan elimination the same as Gauss elimination?

Almost. The Gauss-Jordan elimination requires that we eliminate the coefficients above and below each pivot and make sure each pivot is equal to 1. As a consequence:

  • The result of the Gauss-Jordan elimination is a matrix in the reduced row echelon form.

  • While the result of the Gauss elimination is a matrix in the row echelon form.

In the row echelon form of a matrix unique?

The row echelon form is not unique: it depends on the sequence of row operations used to arrive at this form. However, all row echelon forms have the pivots in the same places and the same number of rows with all zero entries.

The reduced row echelon form is unique: it is independent of the sequence of operations.

How do I invert a matrix by Gauss-Jordan elimination?

To obtain the inverse of an n Γ— n matrix A using the Gauss-Jordan elimination:

  1. Write down the block matrix [A | I], where I is the identity matrix.

  2. Use the Gauss-Jordan elimination algorithm to transform this matrix to the reduced row echelon form.

  3. The matrix generated in the right-hand part is the inverse of A.

  4. Check the result by verifying that the inverse times the initial matrix of A gives the identity.

Anna Szczepanek, PhD
Matrix size
2Γ—3
A=
⌈a1b1c1βŒ‰
⌊a2b2c2βŒ‹
First row
a₁
b₁
c₁
Second row
aβ‚‚
bβ‚‚
cβ‚‚
Solution
Show me...
the reduced row echelon form.
Check out 35 similar linear algebra calculators πŸ”’
Adjoint matrixCharacteristic polynomialCholesky decomposition… 32 more
People also viewed…

Discount

The discount calculator uses a product's original price and discount percentage to find the final price and the amount you save.

Root mean square

The root mean square calculator allows you to determine the quadratic mean (RMS) of any data set.

Round to the nearest dollar

Use this tool to calculate the rounding to the nearest dollar of any money amount.

Snowman

The perfect snowman calculator uses math & science rules to help you design the snowman of your dreams!
Copyright by Omni Calculator sp. z o.o.
Privacy, Cookies & Terms of Service