search
Search
Login
Unlock 100+ guides
menu
menu
web
search toc
close
Comments
Log in or sign up
Cancel
Post
account_circle
Profile
exit_to_app
Sign out
What does this mean?
Why is this true?
Give me some examples!
search
keyboard_voice
close
Searching Tips
Search for a recipe:
"Creating a table in MySQL"
Search for an API documentation: "@append"
Search for code: "!dataframe"
Apply a tag filter: "#python"
Useful Shortcuts
/ to open search panel
Esc to close search panel
to navigate between search results
d to clear all current filters
Enter to expand content preview
icon_star
Doc Search
icon_star
Code Search Beta
SORRY NOTHING FOUND!
mic
Start speaking...
Voice search is only supported in Safari and Chrome.
Navigate to
check_circle
Mark as learned
thumb_up
0
thumb_down
0
chat_bubble_outline
0
Comment
auto_stories Bi-column layout
settings

Gaussian Elimination

schedule Jan 6, 2024
Last updated
local_offer
Linear Algebra
Tags
mode_heat
Master the mathematics behind data science with 100+ top-tier guides
Start your free 7-days trial now!

Algebraic approach to solve simultaneous equations

Consider the following system of linear equations:

$$\begin{equation}\label{eq:kJIkIimOl75yQKMMHL4} \begin{cases} 3x+3y=9\\ 4x+2y=8\\ \end{cases} \end{equation}$$

One way of solving this is to algebraically manipulate the given equations such that we are left with an equation with one unknown variable. Once we solve for one variable, the other variable can easily be found through substitution. Let's demonstrate this.

We multiply the top equation by $2$ and the bottom equation by $3$ to get:

$$\begin{equation}\label{eq:QvqY2GDyN0GsPJ24Hhz} \begin{cases} 6x+6y&=18\\ 12x+6y&=24\\ \end{cases} \end{equation}$$

Even though we have modified the original set of linear equations, multiplying the rows like so does not change the solution of the system. This point will be important later as well.

Now, subtract the bottom equation from the top equation to eliminate the $y$ variable:

$$\begin{align*} -6x&=-6\\ x&=1 \end{align*}$$

Substituting $x=1$ into the top equation in \eqref{eq:kJIkIimOl75yQKMMHL4} gives:

$$\begin{align*} 3(1)+3y&=9\\ y&=2 \end{align*}$$

The solution to our linear system is therefore $x=1$ and $y=2$.

Systematic approach to solve simultaneous equations (Gaussian elimination)

Let's now take another approach to solve our linear system called Gaussian elimination. We will cover the details of this algorithm later, but for now, we will simply go over its steps. We first express the linear system in the following matrix form:

$$\begin{equation}\label{eq:EAGQ6wW6J7xoNf93euG} \begin{pmatrix} 3&3\\ 4&2 \end{pmatrix} \begin{pmatrix} x\\y \end{pmatrix}= \begin{pmatrix} 9\\8 \end{pmatrix} \end{equation}$$

If this does not make sense to you, please review this theoremlink.

Next, we rewrite \eqref{eq:EAGQ6wW6J7xoNf93euG} as an so-called augmented matrix, which is a matrix that combines the matrix on the left and the vector on the right-hand side:

$$\begin{equation}\label{eq:hOKoi1qwbFFSrjobLAk} \left(\begin{array}{cc|c} 3&3&9\\ 4&2&8 \end{array}\right) \end{equation}$$

As you can see, the augmented matrix leaves out the variables and captures the essence of our system of linear equations. Augmented matrices can therefore be translated back to the matrix form \eqref{eq:EAGQ6wW6J7xoNf93euG} or the original system of linear equations \eqref{eq:kJIkIimOl75yQKMMHL4}.

Definition.

Augmented, coefficient and constant matrix of a linear system

An augmented matrix is a matrix that represents a system of linear equations. It combines the coefficient matrix of the system with the constants from the equations, effectively "augmenting" the coefficient matrix with an extra column.

Mathematically, suppose we have the following system of linear equations:

$$\begin{array}{c} a_{11}x_{1}+a_{12}x_{2}+\cdots +a_{1n}x_{n}=b_{1} \\ a_{21}x_{1}+a_{22}x_{2}+\cdots +a_{2n}x_{n}=b_{2} \\ \vdots\\ a_{m1}x_{1}+a_{m2}x_{2}+\cdots +a_{mn}x_{n}=b_{m} \end{array}$$

Where $a_{ij}$ is a scaler and $x_{j}$ is a variable or unknown.

The augmented matrix of this system is:

$$\left( \begin{array}{cccc|c} a_{11}&a_{12}&\cdots&a_{1n}&b_{1} \\ a_{21}&a_{22}&\cdots&a_{2n}&b_{2} \\ \vdots&\vdots&\ddots&\vdots&\vdots \\ a_{m1}&a_{m2}&\cdots& a_{mn} & b_{m} \end{array} \right)$$

The coefficient matrix of this system is:

$$\left( \begin{array}{cccc} a_{11}&a_{12}&\cdots&a_{1n} \\ a_{21}&a_{22}&\cdots&a_{2n} \\ \vdots&\vdots&\ddots&\vdots \\ a_{m1}&a_{m2}&\cdots& a_{mn} \end{array} \right)$$

The constant matrix of this system is:

$$\begin{pmatrix} b_1\\b_2\\\vdots\\b_m \end{pmatrix}$$
Example.

Finding the augmented matrix given a system of linear equations

Consider the following system of linear equations:

$$\begin{cases} 5x+2y=1\\ 3x+4y=8\\ \end{cases}$$

The augmented matrix of this system is:

$$\begin{pmatrix} 5&2&1\\ 3&4&8 \end{pmatrix}$$

Recall from earlier that we multiplied the top row by $3$ and the bottom row by $2$ when solving for the variables. We can also perform the same operations on the augmented matrix \eqref{eq:hOKoi1qwbFFSrjobLAk} to get:

$$\left(\begin{array}{cc|c} 6&6&18\\ 12&6&24 \end{array}\right) \;\;\;\;\;\Longleftrightarrow\;\;\;\;\; \begin{cases} 6x+6y=18\\ 12x+6y=24\\ \end{cases}$$

This is equivalent to the simultaneous equation \eqref{eq:QvqY2GDyN0GsPJ24Hhz}. Such operations that do not alter the solutions of the system are called elementary row operations. Another example of an elementary row operation is interchanging the rows like so:

$$\left(\begin{array}{cc|c} 12&6&24\\ 6&6&18 \end{array}\right) \;\;\;\;\;\Longleftrightarrow\;\;\;\;\; \begin{cases} 12x+6y=24\\ 6x+6y=18\\ \end{cases}$$

This clearly does not affect the solutions because the ordering of the linear equations does not matter.

Definition.

Elementary row operations

Elementary row operations are basic manipulations that can be performed on the rows of an augmented matrix. The main property of elementary row operations is that they don't change the solution set of a system of linear equations represented by the matrix.

There are three types of elementary row operations:

  • multiplying a row by a non-zero constant.

  • swapping one row with another row.

  • adding a multiple of a row to another to another row.

Intuition. Let's now demonstrate the three types of elementary row operations. We will use the following system of linear equations for this:

$$\left(\begin{array}{cc|c} 3&3&9\\ 4&2&8 \end{array}\right) \;\;\;\;\;\Longleftrightarrow\;\;\;\;\; \begin{cases} 3x+3y=9\\ 4x+2y=8\\ \end{cases}$$

The first type of elementary row operation is multiplying a row by a non-zero constant. Let's multiply the first row by $2$ to get:

$$\left(\begin{array}{cc|c} 6&6&18\\ 4&2&8 \end{array}\right) \;\;\;\;\;\Longleftrightarrow\;\;\;\;\; \begin{cases} 6x+6y=18\\ 4x+2y=8\\ \end{cases}$$

Notice how multiplying a row by some non-zero constant does not change the solution to the system.

Let's demonstrate the second type of elementary row operation of swapping one row with another. We swap the first row with the second row:

$$\left(\begin{array}{cc|c} 4&2&8\\ 6&6&18 \end{array}\right) \;\;\;\;\;\Longleftrightarrow\;\;\;\;\; \begin{cases} 4x+2y=8\\ 6x+6y=18 \end{cases}$$

The ordering of the equations in the system clearly has no effect on the final solution.

Finally, we demonstrate the third type of elementary row operation and multiply the first row by $-3$ and then add it to the second row:

$$\left(\begin{array}{cc|c} -6&0&-6\\ 6&6&18 \end{array}\right) \;\;\;\;\;\Longleftrightarrow\;\;\;\;\; \begin{cases} -6x+0y=-6\\ 6x+6y=18 \end{cases}$$

Again, we emphasize that such an operation does not alter the solutions to the system.

Now that you know the three types of elementary row operations, let's go back to our goal of systematically solving system. We will now start from the beginning and perform a series of elementary row operations on the augmented matrix such that we end up with a simplified form:

$$\left(\begin{array}{cc|c} 3&3&9\\ 4&2&8 \end{array}\right)\underset{(1)}{\implies} \left(\begin{array}{cc|c} 6&6&18\\ 12&6&24 \end{array}\right)\underset{(2)}{\implies} \left(\begin{array}{cc|c} 6&6&18\\ -6&0&-6 \end{array}\right)\underset{(3)}{\implies} \left(\begin{array}{cc|c} 1&1&3\\ 1&0&1 \end{array}\right)$$

Note the following:

  • for the 1st step, we performed two elementary row operations of multiplying the top row by $2$ and the bottom row by $3$.

  • for the 2nd step, we performed an elementary row operation of subtracting the bottom row from the top row.

  • for the 3rd step, we performed two elementary row operations of multiplying the top row by $1/6$ and the bottom by $-1/6$.

Notice how we now have a zero term in middle. This means that we have managed to solve for $x$ because:

$$\begin{equation}\label{eq:cO6nps6cg0oOrhWvDSS} \left(\begin{array}{cc|c} 1&1&3\\ 1&0&1 \end{array}\right) \;\;\;\;\;\Longleftrightarrow\;\;\;\;\; \begin{cases} x+y=3\\ x\;\;\;\;\;\;=1\\ \end{cases} \end{equation}$$

However, when simplifying an augmented matrix, we often don't stop here and we keep simplifying until the augmented matrix looks like the following:

$$\left(\begin{array}{cc|c} 1&1&3\\ 1&0&1 \end{array}\right) \underset{(4)}{\implies} \left(\begin{array}{cc|c} 1&0&1\\ 1&1&3 \end{array}\right) \underset{(5)}{\implies} \left(\begin{array}{cc|c} 1&0&1\\ 0&1&2 \end{array}\right)$$

The augmented matrix here is even simpler than \eqref{eq:cO6nps6cg0oOrhWvDSS} because it directly gives us the solution:

$$\begin{equation}\label{eq:NPHg8xuR6DQbiCKs1bD} \left(\begin{array}{cc|c} 1&0&1\\ 0&1&2 \end{array}\right) \;\;\;\;\;\Longleftrightarrow\;\;\;\;\; \begin{cases} x=1\\ y=2 \end{cases} \end{equation}$$

This form of the augmented matrix is called the reduced row echelon form, which we formally define below.

Definition.

Reduced row echelon form of a matrix

Let $\boldsymbol{A}$ be a matrix. The reduced row echelon form of $\boldsymbol{A}$, often denoted as $\mathrm{rref}(\boldsymbol{A})$, has the following properties:

  • unless the row has all $0$s, all the rows must begin with a leading value of $1$.

  • the leading $1$ in the $i+1$-th row must be on the right-hand side of the leading $1$ in the $i$-th row.

  • rows with all $0$s are grouped at the bottom.

  • every row with a leading $1$ has all other columns except the right-most column set to $0$.

If only the first three properties are met, then the form is called a row echelon form.

WARNING

Some textbooks are more lenient with the structure of the row echelon form - they allow leading coefficients to be any value and not just $1$. We will stick with this lenient version of the row echelon form.

Example.

Non-reduced row echelon form (1)

Consider the following augmented matrix:

$$\left(\begin{array}{cc|c} 2&4&10\\ 0&1&2 \end{array}\right)$$

Why is this not in reduced row echelon form?

Solution. The augmented matrix is in row echelon form because the leading value of nonzero rows is strictly to the right of the leading value of the previous row. However, this form is not in the reduced version because the first row does not begin with a leading $1$. Dividing the top row by $2$ will give us:

$$\left(\begin{array}{cc|c} 1&2&5\\ 0&1&2 \end{array}\right)$$

This is still not in the reduced row echelon form because the first row with a leading $1$ has a non-zero value for the second column. We can multiply the second row by two and then subtract the bottom row from the top row to get the reduced row echelon form:

$$\left(\begin{array}{cc|c} 1&0&1\\ 0&1&2 \end{array}\right)$$

Here, we have the value $2$ in the bottom-right entry but this is acceptable because the reduced row echelon form requires that every row with a leading $1$ has all other columns except the right-most column set to $0$.

Example.

Non-reduced row echelon form (2)

Consider the following augmented matrix:

$$\left(\begin{array}{ccc|c} 0&0&1&3\\ 1&0&0&2\\ 0&1&0&8 \end{array}\right)$$

Why is this not in row echelon form?

Solution. This is not in row echelon form because the leading $1$ in the first row occurs on the right-hand side of the leading $1$ in the second row. We can swap the rows twice to get the reduced row echelon form:

$$\left(\begin{array}{ccc|c} 1&0&0&2\\ 0&1&0&8\\ 0&0&1&3 \end{array}\right)$$

Now, given any two successive rows, the leading $1$ of the latter row appears on the right-hand side of the leading $1$ of the row above it.

We will now introduce the Gaussian elimination algorithm, which is a systematic procedure to find the reduced row echelon form of a given augmented matrix.

Example.

Gaussian elimination (1)

Consider the following system of linear equations in matrix form:

$$\begin{pmatrix} 3&1&4\\ 1&2&2\\ 2&1&3 \end{pmatrix} \begin{pmatrix} x\\y\\z\\ \end{pmatrix}= \begin{pmatrix} 2\\5\\2 \end{pmatrix}$$

Find the reduced row echelon form and solve the system.

Solution. The augmented matrix is:

$$\left(\begin{array}{ccc|c} 3&1&4&2\\ 1&2&2&5\\ 2&1&3&2 \end{array}\right)$$

We now perform a set of elementary row operations to simplify this into the reduced row echelon form. We will denote the first, second and third rows as $\boldsymbol{r}_1$, $\boldsymbol{r}_2$ and $\boldsymbol{r}_3$ respectively. Note that these rows refer to the rows of the latest state of the augmented matrix.

The Gaussian elimination algorithm consists of two stages:

  • forward phase - make all the values below leading $1$s to be zero.

  • backward phase - make all the values apart from the leading $1$s and the last column zero.

Once we find the reduced row echelon form, we can then easily find the solutions.

Let's first carry out the forward phase. We swap $\boldsymbol{r}_1$ and $\boldsymbol{r}_2$ so that we get a leading $1$ for the first row:

$$\left(\begin{array}{ccc|c} 1&2&2&5\\ 3&1&4&2\\ 2&1&3&2 \end{array}\right)$$

Because the goal of the forward phase is to make all the values below the leading $1$s zero, we must convert the following red terms to zero:

$$\left(\begin{array}{ccc|c} 1&2&2&5\\ \color{red}3&1&4&2\\ \color{red}2&1&3&2 \end{array}\right)$$

We can achieve this by $3r_1-r_2$, that is, multiplying the first row by $3$ and then subtracting the second row:

$$\left(\begin{array}{ccc|c} 1&2&2&5\\ 0&5&2&13\\ \color{red}2&1&3&2 \end{array}\right)$$

Again, $3r_1-r_2$ is an elementary row operation and does not change the solution of our system! In essence, we are simplifying the system step-by-step until we end up with a form that allows us to directly find the solution!

Next, to make the red term become $0$, we perform $2\boldsymbol{r}_1-\boldsymbol{r}_3$ to get:

$$\left(\begin{array}{ccc|c} 1&2&2&5\\ 0&5&2&13\\ 0&3&1&8 \end{array}\right)$$

Notice how we have $0$s under the leading $1$ in the first row - in a sense, we have eliminated those numbers. We are now done with the first column, so let's focus on the following sub-matrix in green:

$$\left(\begin{array}{ccc|c} 1&2&2&5\\ 0&\color{green}5&\color{green}2&\color{green}13\\ 0&\color{green}3&\color{green}1&\color{green}8 \end{array}\right)$$

Typically, we divide the second row by $5$ to get a leading one, but strictly speaking, we do not need to be too concerned about getting leading $1$s just yet. What's more important is to get a $0$ below the value $5$, which we achieve by performing $3\boldsymbol{r}_2-5\boldsymbol{r}_3$ to get:

$$\left(\begin{array}{ccc|c} 1&2&2&5\\ 0&5&2&13\\ 0&0&1&-1 \end{array}\right)$$

We can divide the second row by $5$ to get a leading $1$, which will conclude the forward phase since we will have $0$s below all leading $1$s. Again, we won't divide by $5$ because we would end up with fractions in the second row. Don't worry too much about getting the leading $1$s just yet because we can always divide by the first value in the row to convert them into leading $1$ at any time!

We now begin with the backward phase. In this phase, the objective is to convert the following red terms into zeros:

$$\left(\begin{array}{ccc|c} 1&\color{red}2&\color{red}2&5\\ 0&5&\color{red}2&13\\ 0&0&1&-1 \end{array}\right)$$

Remember, the forward phase guarantees that the last row has the most number of leading $0$s. Therefore, we can use this last row to convert the following red terms into zeros:

$$\left(\begin{array}{ccc|c} 1&2&\color{red}2&5\\ 0&5&\color{red}2&13\\ 0&0&1&-1 \end{array}\right)$$

We perform $\boldsymbol{r}_2-2\boldsymbol{r}_3$ to get:

$$\left(\begin{array}{ccc|c} 1&2&2&5\\ 0&5&0&15\\ 0&0&1&-1 \end{array}\right)$$

We perform $\boldsymbol{r}_1-2\boldsymbol{r}_3$ to get:

$$\left(\begin{array}{ccc|c} 1&2&0&7\\ 0&5&0&15\\ 0&0&1&-1 \end{array}\right)$$

Great, what's left is to eliminate the $2$ on top of the $5$. Before we do so, let's first divide the second row by $5$ to get a leading one:

$$\left(\begin{array}{ccc|c} 1&2&0&7\\ 0&1&0&3\\ 0&0&1&-1 \end{array}\right)$$

Finally, we perform $\boldsymbol{r}_1-2\boldsymbol{r}_2$ to get:

$$\left(\begin{array}{ccc|c} 1&0&0&1\\ 0&1&0&3\\ 0&0&1&-1 \end{array}\right)$$

What we have now is the reduced row-echelon form of the augmented matrix!

Once we find the augmented matrix, solving the system is a piece of cake 🍰. Converting the augmented matrix back into a system of linear equations:

$$\left(\begin{array}{ccc|c} 1&0&0&1\\ 0&1&0&3\\ 0&0&1&-1 \end{array}\right) \;\;\;\;\;\Longleftrightarrow\;\;\;\;\; \begin{cases} x=1\\ y=3\\ z=-1\\ \end{cases}$$

Great, we're done!

Example.

Gaussian elimination (2)

Consider the following system of linear equations:

$$\begin{cases} 2x_1+4x_2+x_3=1\\ 3x_1+1x_2+3x_3=8\\ 2x_1+2x_2+3x_3=5\\ \end{cases}$$

Use Gaussian Elimination to solve the system.

Solution. The augmented matrix is:

$$\left(\begin{array}{ccc|c} 2&4&1&1\\ 3&1&3&8\\ 2&2&3&5\\ \end{array}\right)$$

Let's now perform a series of elementary row operations to obtain the reduced row echelon form:

$$\left(\begin{array}{ccc|c} 2&4&1&1\\ 3&1&3&8\\ 2&2&3&5\\ \end{array}\right) \underset{(1)}{\implies} \left(\begin{array}{ccc|c} 2&4&1&1\\ 0&10&-3&-13\\ 2&2&3&5\\ \end{array}\right) \underset{(2)}{\implies} \left(\begin{array}{ccc|c} 2&4&1&1\\ 0&10&-3&-13\\ 0&2&-2&-4\\ \end{array}\right) \underset{(3)}{\implies} \left(\begin{array}{ccc|c} 2&4&1&1\\ 0&10&-3&-13\\ 0&0&7&7\\ \end{array}\right) $$

The elementary row operation taken for each step is as follows:

  • $(1)$: $3\boldsymbol{r}_1-2\boldsymbol{r}_2$.

  • $(2)$: $\boldsymbol{r}_1-\boldsymbol{r}_2$.

  • (3): $\boldsymbol{r}_2-5\boldsymbol{r}_2$.

This concludes the forward phase. Next, let's simplify the last row by dividing by $7$ to get:

$$\left(\begin{array}{ccc|c} 2&4&1&1\\ 0&10&-3&-13\\ 0&0&7&7\\ \end{array}\right) \underset{(4)}{\implies} \left(\begin{array}{ccc|c} 2&4&1&1\\ 0&10&-3&-13\\ 0&0&1&1\\ \end{array}\right)$$

We now begin with the backward phase:

$$\left(\begin{array}{ccc|c} 2&4&1&1\\ 0&10&-3&-13\\ 0&0&1&1\\ \end{array}\right) \underset{(5)}{\implies} \left(\begin{array}{ccc|c} 2&4&1&1\\ 0&10&0&-10\\ 0&0&1&1\\ \end{array}\right) \underset{(6)}{\implies} \left(\begin{array}{ccc|c} 2&4&0&0\\ 0&10&0&-10\\ 0&0&1&1\\ \end{array}\right) \underset{(7)}{\implies} \left(\begin{array}{ccc|c} 1&2&0&0\\ 0&1&0&-1\\ 0&0&1&1\\ \end{array}\right)$$

The elementary row operations taken are:

  • $(5)$: $\boldsymbol{r}_1+3\boldsymbol{r}_3$.

  • $(6)$: $\boldsymbol{r}_1-\boldsymbol{r}_2$.

  • $(7)$: $\boldsymbol{r}_1/2$ and $\boldsymbol{r}_2/10$.

Finally, we perform $\boldsymbol{r}_1-2\boldsymbol{r}_2$ to get our reduced row echelon form:

$$\left(\begin{array}{ccc|c} 1&0&0&2\\ 0&1&0&-1\\ 0&0&1&1\\ \end{array}\right)$$

Converting this back into a linear system gives us the solution:

$$x=2,\;\;\;\;\; y=-1,\;\;\;\;\; z=1$$

We're done!

Theorem.

Using row echelon form to check for the existence of a solution

The row echelon form, instead of the reduced version, is sufficient to check for the existence of solutions. In other words, the row echelon form determines whether the system is consistentlink or inconsistentlink.

The reduced row echelon form is better for computing the actual solutions but if all we want to do is to check that a solution exists, then the row echelon form is sufficient.

Example.

Consistent systems

Consider the following row echelon form of some augmented matrix:

$$\left(\begin{array}{ccc|c} 3&8&4&5\\ 0&2&3&2\\ 0&0&5&3\\ \end{array}\right)$$

Note that we colored the last column to emphasize that these values are not coefficients. We can already tell that a solution exists, that is, the system is consistent, because:

  1. the last row gives us $z$.

  2. substituting $z$ into the second row gives us $y$.

  3. substituting $y$ and $z$ into the first equation gives us $x$.

Similarly, consider the following row echelon form:

$$\left(\begin{array}{ccc|c} 3&8&4&5\\ 0&2&3&2\\ 0&0&0&0\\ \end{array}\right)$$

The last row is all zeros, which means that we are left with $2$ equations and $3$ unknowns. Since one variable is free to vary, the system is consistent and has infinitely many solutions!

Example.

Inconsistent systems

Consider the following row echelon form of some augmented matrix:

$$\left(\begin{array}{ccc|c} 3&8&4&5\\ 0&2&3&2\\ 0&0&0&3\\ \end{array}\right)$$

In this case, a solution does not exist because the last row leads to a contradiction of $0=3$. In other words, this system of linear equations is inconsistent, that is, this system cannot be solved.

Example.

Showing that a system is consistent (1)

Consider the following system of linear equations:

$$\begin{cases} 2x+3y&=1\\ 4x+y&=3\\ \end{cases}$$

Show that the system is consistent.

Solution. The augmented matrix of the system is:

$$\left(\begin{array}{cc|c} 2&3&1\\ 4&1&3\\ \end{array}\right)$$

Let's obtain the row echelon form:

$$\left(\begin{array}{cc|c} 2&3&1\\ 4&1&3\\ \end{array}\right) \implies \left(\begin{array}{cc|c} 2&3&1\\ 0&5&-1\\ \end{array}\right)$$

Because we can solve for the unknowns, we conclude that the system is consistent with an unique solution.

Example.

Showing that a system is consistent (2)

Consider the following simultaneous equations:

$$\begin{cases} 2x+3y&=1\\ 4x+6y&=2\\ \end{cases}$$

Show that the system is consistent.

Solution. The row echelon form is:

$$\left(\begin{array}{cc|c} 2&3&1\\ 4&6&2\\ \end{array}\right) \implies \left(\begin{array}{cc|c} 2&3&1\\ 0&0&0\\ \end{array}\right)$$

We get all zeros for the last row, which means that we are left with one equation with two unknowns. Therefore, the system is consistent with infinitely many solutions.

Example.

Showing that a system is inconsistent

Consider the following system of linear equations:

$$\begin{cases} 2x+3y&=9\\ 2x+3y&=8\\ \end{cases}$$

Show that the system is inconsistent.

Solution. The row echelon form is:

$$\left(\begin{array}{cc|c} 2&3&9\\ 2&3&8\\ \end{array}\right) \implies \left(\begin{array}{cc|c} 2&3&9\\ 0&0&1\\ \end{array}\right)$$

Because we get a contradiction ($0=1$), we conclude that the system is inconsistent and has no solutions.

Theorem.

Reduced row echelon form of homogeneous linear system

If $\boldsymbol{B}$ is the reduced row echelon form of some matrix $\boldsymbol{A}$, then solutions to the homogeneous linear system $\boldsymbol{Ax}=\boldsymbol{0}$ and $\boldsymbol{Bx}=\boldsymbol{0}$ are the same.

Proof. Suppose the augmented matrix of the homogenous linear system $\boldsymbol{Ax}=\boldsymbol{0}$ is:

$$\left(\begin{array}{cccc|c} *&*&*&*&0\\ *&*&*&*&0\\ *&*&*&*&0\\ *&*&*&*&0\\ \end{array}\right)$$

Performing elementary row operations on this augmented matrix:

  • does not affect the rightmost column whose entries are all zeros; multiplying a row by a scalar, interchanging rows, or adding a multiple of one row to another will keep the rightmost column all zeroes. This means that we can simply focus on row-reducing the coefficient matrix instead of the augmented matrix.

  • does not change the solution of the system.

Since the reduced row echelon form $\boldsymbol{B}$ of $\boldsymbol{A}$ is obtained by performing a series of elementary row operations on $\boldsymbol{A}$, we know that $\boldsymbol{Ax}=\boldsymbol{0}$ and $\boldsymbol{Bx}=\boldsymbol{0}$ share the same solutions. This completes the proof.

Theorem.

Row echelon form of an augmented matrix is not unique

A row echelon form of an augmented matrix is not unique.

Proof. Consider the following row echelon form of some augmented matrix:

$$\mathrm{ref}(\boldsymbol{A})=\begin{pmatrix} 1&5\\ 0&1 \end{pmatrix}$$

Let's perform an elementary row operation of adding the bottom row to the top row:

$$\mathrm{ref}(\boldsymbol{A})=\begin{pmatrix} 1&6\\ 0&1 \end{pmatrix}$$

We now have two different row echelon forms of our augmented matrix - both of which are equally valid. This completes the proof.

Practice problems

Consider a system of linear equations with $4$ unknowns and $3$ equations. What is the shape of the coefficient matrix?

$$3\times3$$
$$4\times3$$
$$3\times4$$
$$4\times4$$

Each row of a coefficient matrix represents an equation whereas each column represents a variable (or unknown). Therefore, the shape of the coefficient matrix in this case is $3\times4$.

Find the augmented matrix and coefficient matrix of the following system of linear equations:

$$\begin{cases} 2x+3y+4z&=1\\ 4x+y+z&=3\\ x+2y+5z&=6\\ \end{cases}$$
Show solution

The augmented matrix of the system is:

$$\left(\begin{array}{ccc|c} 2&3&4&1\\ 4&1&1&3\\ 1&2&5&6 \end{array}\right)$$

The coefficient matrix of the system is:

$$\begin{pmatrix} 2&3&4\\ 4&1&1\\ 1&2&5 \end{pmatrix}$$

Consider the following augmented matrix:

$$\left(\begin{array}{ccc|c} 5&1&7&2\\ 4&1&1&0\\ 0&2&-9&8 \end{array}\right)$$

Convert this into a system of linear equations.

Show solution

The system of linear equations is:

$$\begin{cases} 5x+y+7&=2\\4x+y+z&=0\\2y-9z&=8\\ \end{cases}$$

Consider the following matrix:

$$\boldsymbol{A}=\begin{pmatrix} 1&3\\ 2&4 \end{pmatrix}$$

Find the row-echelon form as well as the reduced row-echelon form of $\boldsymbol{A}$.

Show solution

Let's start by performing an elementary row operation $\boldsymbol{r}_1-1/2\;\boldsymbol{r}_2$ to get:

$$\begin{pmatrix} 1&3\\2&4 \end{pmatrix} \underset{(1)}{\implies} \begin{pmatrix} 1&3\\0&5 \end{pmatrix}$$

Therefore, the row-echelon form is:

$$\mathrm{ref}(\boldsymbol{A}) = \begin{pmatrix} 1&3\\0&5 \end{pmatrix}$$

If we require a strict version of the row-echelon form where the leading non-zero value must be one, then we can perform another elementary row operation of $1/5\;\boldsymbol{r}_2$ to get:

$$\begin{equation}\label{eq:x47FAWEpJRzUCjS2mzH} \mathrm{ref}(\boldsymbol{A}) = \begin{pmatrix} 1&3\\0&1 \end{pmatrix} \end{equation}$$

Note that the row-echelon form is not uniquelink so your answer may be different but still correct. For example, let's perform another elementary row operation $\boldsymbol{r}_1+2\boldsymbol{r}_2$ to get:

$$\mathrm{ref}(\boldsymbol{A}) = \begin{pmatrix} 1&5\\0&1 \end{pmatrix}$$

Notice how this is also a valid row-echelon form of $\boldsymbol{A}$.

Now, let's determine the reduced row-echelon form of $\boldsymbol{A}$. Let's refer to \eqref{eq:x47FAWEpJRzUCjS2mzH} and perform an elementary row operation of $\boldsymbol{r}_1-3\boldsymbol{r}_2$ to get:

$$\mathrm{rref}(\boldsymbol{A}) = \begin{pmatrix} 1&0\\0&1 \end{pmatrix} $$

Consider the following matrix:

$$\boldsymbol{A}=\begin{pmatrix} 3&-2&2&2\\ 2&-1&2&-3\\ 2&2&-1&3 \end{pmatrix}$$

Find the row-echelon form as well as the reduced row-echelon form of $\boldsymbol{A}$.

Show solution

To obtain the row-echelon form, we must perform a series of elementary row operations:

$$\begin{pmatrix} 3&-2&2&2\\2&-1&2&-3\\2&2&-1&3 \end{pmatrix}\underset{(1)}{\implies} \begin{pmatrix} 3&-2&2&2\\2&-1&2&-3\\0&-3&3&-6 \end{pmatrix}\underset{(2)}{\implies} \begin{pmatrix} 3&-2&2&2\\0&-3&3&-6\\2&-1&2&-3 \end{pmatrix}$$

Here, the we performed the following elementary row operations:

1. $\boldsymbol{r}_2-\boldsymbol{r}_3$.

2. interchange $\boldsymbol{r}_2$ and $\boldsymbol{r}_3$.

Let's continue:

$$\begin{pmatrix} 3&-2&2&2\\0&-3&3&-6\\2&-1&2&-3 \end{pmatrix}\underset{(3)}{\implies} \begin{pmatrix} 6&-4&4&4\\0&-3&3&-6\\2&-1&2&-3 \end{pmatrix}\underset{(4)}{\implies} \begin{pmatrix} 6&-4&4&4\\0&-3&3&-6\\0&-1&-2&13 \end{pmatrix}$$

The elementary row operations are:

3. $2\boldsymbol{r}_1$.

4. $\boldsymbol{r}_1-3\boldsymbol{r}_3$.

Finally, we perform $\boldsymbol{r}_2-3\boldsymbol{r}_3$ to get:

$$\begin{pmatrix} 6&-4&4&4\\0&-3&3&-6\\0&-1&-2&13 \end{pmatrix}\underset{(5)}{\implies} \begin{pmatrix} 6&-4&4&4\\0&-3&3&-6\\0&0&9&-45 \end{pmatrix} $$

Therefore, the row-echelon form is:

$$\mathrm{ref}(\boldsymbol{A})= \begin{pmatrix} 6&-4&4&4\\0&-3&3&-6\\0&0&9&-45 \end{pmatrix} $$

If we go by the strict definition of row-echelon form where the leading non-zero value must be one, then:

$$\mathrm{ref}(\boldsymbol{A})= \begin{pmatrix} 6&-4&4&4\\0&-3&3&-6\\0&0&9&-45 \end{pmatrix}= \begin{pmatrix} 1&-2/3&2/3&2/3\\0&1&-1&2\\0&0&1&-5 \end{pmatrix} $$

Note that the row-echelon form is not unique, which means that the answer you came up with may be different but still correct. We encourage you to perform some elementary row operations on your answer to get the form above - if you can, then your answer is correct.

Let's now obtain the reduced row-echelon form.

$$\begin{pmatrix} 1&-2/3&2/3&2/3\\0&1&-1&2\\0&0&1&-5 \end{pmatrix} \underset{(6)}{\implies} \begin{pmatrix} 3&-2&2&2\\0&1&-1&2\\0&0&1&-5 \end{pmatrix} \underset{(7)}{\implies} \begin{pmatrix} 3&-2&2&2\\0&1&0&-3\\0&0&1&-5 \end{pmatrix}$$
$$\begin{pmatrix} 3&-2&2&2\\0&1&0&-3\\0&0&1&-5 \end{pmatrix} \underset{(8)}{\implies} \begin{pmatrix} 3&-2&0&12\\0&1&0&-3\\0&0&1&-5 \end{pmatrix} \underset{(9)}{\implies} \begin{pmatrix} 3&0&0&6\\0&1&0&-3\\0&0&1&-5 \end{pmatrix} \underset{(10)}{\implies} \begin{pmatrix} 1&0&0&2\\0&1&0&-3\\0&0&1&-5 \end{pmatrix}$$

Therefore, the reduced row-echelon form is:

$$\mathrm{rref}(\boldsymbol{A})= \begin{pmatrix} 1&0&0&2\\0&1&0&-3\\0&0&1&-5 \end{pmatrix}$$

Consider the following:

$$\begin{cases} 2x-3y&=5\\ 3x-y&=4\\ \end{cases}$$

Solve for the system using Gaussian elimination. Use comma to separate the solutions (e.g. $3$,$4$ to indicate $x=3$, $y=4$).

Your answer
Submit answer
Show solution

The augmented matrix is:

$$\left(\begin{array}{cc|c} 2&-3&5\\3&-1&4 \end{array}\right)$$

We then perform a series of elementary row operations to obtain the reduced row echelon form. Let's first start with the forward-pass:

$$\left(\begin{array}{cc|c} 2&-3&5\\3&-1&4\\ \end{array}\right) \underset{(1)}{\implies} \left(\begin{array}{cc|c} 2&-3&5\\0&-7&7\\ \end{array}\right) \underset{(2)}{\implies} \left(\begin{array}{cc|c} 2&-3&5\\0&1&-1\\ \end{array}\right)$$

Here, the elementary row operations are as follows:

  1. $3\boldsymbol{r}_1 -2\boldsymbol{r}_2$.

  2. $(-1/7)\;\boldsymbol{r}_2$.

Technically, the first step is not an elementary row operation because we are multiplying not just one row but two rows at once and then taking their sum. This is only a shortcut and does not change the final solutions. We can break this down into two elementary row operations - first to multiply the 1st row by $3$, and then 2nd to multiply the second row by $-2$ and then adding it to the first row.

Next, we proceed with the backward-pass:

$$\left(\begin{array}{cc|c} 2&-3&5\\0&1&-1\\ \end{array}\right) \underset{(3)}{\implies} \left(\begin{array}{cc|c} 2&0&2\\0&1&-1\\ \end{array}\right) \underset{(4)}{\implies} \left(\begin{array}{cc|c} 1&0&1\\0&1&-1\\ \end{array}\right)$$

Here, the elementary row operations are as follows:

3. $-3\boldsymbol{r}_2+ \boldsymbol{r}_1$.

4. $(1/2)\;\boldsymbol{r}_1$.

    Therefore, the solution to the system is:

    $$\begin{align*} x&=1\\ y&=-1\\ \end{align*}$$

    Consider the following system of linear equations:

    $$\begin{cases} 2x-3y+2z&=2\\ 3x-y+z&=-1\\ x+3y-z&=1\\ \end{cases}$$

    Solve for the system using Gaussian Elimination. Use comma to separate the values (e.g. $2$,$3$,$4$ for $x=2$, $y=3$ and $z=4$).

    Your answer
    Submit answer
    Show solution

    The augmented matrix is:

    $$\left(\begin{array}{ccc|c} 2&-3&2&2\\3&-1&1&-1\\1&3&-1&1 \end{array}\right)$$

    We then perform forward-passing via a series of elementary row operations:

    $$\left(\begin{array}{ccc|c} 2&-3&2&2\\3&-1&1&-1\\1&3&-1&1 \end{array}\right) \underset{(1)}{\implies} \left(\begin{array}{ccc|c} 1&3&-1&1\\2&-3&2&2\\3&-1&1&-1 \end{array}\right) \underset{(2)}{\implies} \left(\begin{array}{ccc|c} 1&3&-1&1\\0&9&-4&0\\0&10&-4&4 \end{array}\right) $$

    We continue with forward-passing:

    $$ \left(\begin{array}{ccc|c} 1&3&-1&1\\0&9&-4&0\\0&10&-4&4 \end{array}\right) \underset{(3)}{\implies} \left(\begin{array}{ccc|c} 1&3&-1&1\\0&9&-4&0\\0&-1&0&-4 \end{array}\right) \underset{(4)}{\implies} \left(\begin{array}{ccc|c} 1&3&-1&1\\0&1&0&4\\0&9&-4&0 \end{array}\right) \underset{(5)}{\implies} \left(\begin{array}{ccc|c} 1&3&-1&1\\0&1&0&4\\0&0&4&36 \end{array}\right) $$

    We're now done with forward-passing. We proceed with backward-passing:

    $$\left(\begin{array}{ccc|c} 1&3&-1&1\\0&1&0&4\\0&0&4&36 \end{array}\right) \underset{(6)}{\implies} \left(\begin{array}{ccc|c} 1&3&-1&1\\0&1&0&4\\0&0&1&9 \end{array}\right) \underset{(7)}{\implies} \left(\begin{array}{ccc|c} 1&3&0&10\\0&1&0&4\\0&0&1&9 \end{array}\right) \underset{(8)}{\implies} \left(\begin{array}{ccc|c} 1&0&0&-2\\0&1&0&4\\0&0&1&9 \end{array}\right) $$

    Therefore, the solution is:

    $$\begin{align*} x&=-2\\ y&=4\\ z&=9 \end{align*}$$

    Consider the following system of linear equations:

    $$\begin{cases} 2x+3y&=6\\ 2x+3y&=5\\ \end{cases}$$

    By finding the row echelon form, identify the characteristic of the system.

    The system is consistent with a unique solution.

    The system is consistent with infinitely many solutions.

    The system is inconsistent.

    The augmented matrix is:

    $$\left(\begin{array}{cc|c} 2&3&6\\2&3&5 \end{array}\right)$$

    The row echelon form is:

    $$\left(\begin{array}{cc|c} 2&3&6\\2&3&5 \end{array}\right) \implies \left(\begin{array}{cc|c} 2&3&6\\0&0&1 \end{array}\right)$$

    The last row tells us that $0=1$, which means that the system is inconsistent.

    Consider the following system of linear equations:

    $$\begin{cases} 2x+4y&=8\\ 2x+3y&=5\\ \end{cases}$$

    By finding the row echelon form, identify the characteristic of the system.

    The system is consistent with a unique solution.

    The system is consistent with infinitely many solutions.

    The system is inconsistent.

    The augmented matrix is:

    $$\left(\begin{array}{cc|c} 2&4&8\\2&3&5 \end{array}\right)$$

    The row echelon form is:

    $$\left(\begin{array}{cc|c} 2&4&8\\2&3&5 \end{array}\right) \implies \left(\begin{array}{cc|c} 2&4&8\\0&1&3 \end{array}\right)$$

    Because we can directly solve for the unknowns (e.g. $y=3$), the system is consistent with a unique solution.

    robocat
    Published by Isshin Inada
    Edited by 0 others
    Did you find this page useful?
    thumb_up
    thumb_down
    Comment
    Citation
    Ask a question or leave a feedback...