topic badge

10.04 Row operations

Lesson

Row operations

Matrix row operations (or row transformations) are the steps normally carried out in solving systems of linear equations by the Gaussian elimination method.

Consider a matrix equation $A\mathbf{x}=\mathbf{b}$Ax=b., where $A$A is a matrix formed from the coefficients from individual equations and $\mathbf{b}$b is a column matrix formed from the right-hand sides of the equations. The following example shows how this comes about.

Worked examples

Question 1

A system of linear equations is given.

This is equivalent to the matrix equation

You should check by matrix multiplication that this version is the same as the original system of equations.

 

When solving such a system, we progressively eliminate variables by making their coefficients zero. For example, in the system in question $1$1 we would multiply the second and third equations by $2$2 and then subtract the first equation. This causes the $x$x-terms in the second and third equations to have the coefficient zero.

Observe that manipulations of this kind involve only the coefficients and not the variables themselves. We may as well set up a tableau like the following to facilitate the process. We make a matrix with the columns of matrix $A$A with the column of right-hand sides appended to it. Now, whatever is done to the rows of matrix $A$A will also be done to the appended column.

Certain row operations are permissible. These correspond to what would be permissible for the original system of equations. Specifically, we can

  • multiply a row by a constant
  • add a row to another row
  • change the order of rows

By means of these row operations, the augmented matrix is reduced to what is called row echelon form from which it will be possible to determine the solution set of the system. 

 

We continue the example begun above to show how this is done.

Question 2

The system of equations with which we began has been expressed as an augmented matrix.

We multiply rows 2 and 3 by -2.

Row 1 is added to row 2 and row 1 is added to row 3.

Row 2 is added to row 3.

Row 3 is multiplied by $-\frac{1}{2}$12.

 

The augmented matrix is now in row echelon form. This matrix corresponds to a different system of equations from the one with which we began but it must have the same solution as the original system. The new system is the matrix form of the equations

We have $z=3$z=3. By substituting this value into the second equation, we obtain $y=4$y=4, and then by substituting these values of $z$z and $y$y into the first equation, we obtain $x=5$x=5. So, $(x,y,z)=(5,4,3)$(x,y,z)=(5,4,3) is the solution.

 

It would be possible in this case to continue the row operations to obtain a coefficient matrix with zeros in all positions not on the main diagonal and $1$1s on the diagonal. The solution is then the right-most column. Usually, however, it involves less work to carry out the back substitutions as was done above.

 

We can carry out row operations to reduce an augmented matrix to the diagonal form mentioned in the previous paragraph in order to find the inverse of a matrix. Begin with the matrix to be inverted and append to it the identity matrix. The row operations, which we illustrate in the example below, amount to solving the matrix equation $AX=I$AX=I. The matrix $X$X is the unknown inverse $A^{-1}$A1.

Question 3

Let , as before. To find $A^{-1}$A1, set up the following tableau and proceed with row operations that will reduce $A$A to the identity matrix.

As before, we multiply rows 2 and 3 by $2$2.

We add row 1 to row 2 and we add row 1 to row 3.

Row 2 is added to row 3.

Row 2 is multiplied by $\frac{1}{3}$13 and row 3 is multiplied by $-\frac{1}{2}$12.

Row 3 is added to row 1 and row 3 is added to row 2.

Row 2 is multiplied by $-1$1 and is then added to row 1.

Row 1 is multiplied by $\frac{1}{2}.$12.

The three columns on the right should now be the inverse of $A$A. This should be checked by matrix multiplication, $A.A^{-1}=I$A.A1=I.

It may happen that a complete row of zeros appears during the row operations process. In the Gaussian elimination procedure, this occurs when the system of equations does not have a unique solution. In such a case, the equations in the system are not independent, in the sense that one of them can be expressed as a linear combination of the others.

The consequence of a row of zeros appearing when looking for the inverse of a matrix is that the matrix has no inverse. Such a matrix is said to be singular. Its rows are not independent.

Backsubstitution

A special form of an augmented matrix is one that is in row-echelon form.  This form has $1$1's in the diagonals, and all zeros to the left of those ones.  

The following are examples of augmented matrices in row-echelon form.  

,            ,               

If we pause for a moment and consider what this final system looks like, then we have

We can see from the third equation here, that we have the value of $z$z, so we could then substitute that into the second equation to find $y$y.

$y-5\times3=-17$y5×3=17

$y-15=-17$y15=17

$y=-2$y=2

And then using both the values of $z$z and $y$y, we can find the value of $x$x.  

$x+2\times\left(-2\right)+3\times3=4$x+2×(2)+3×3=4

$x-4+9=4$x4+9=4

$x+5=4$x+5=4

$x=-1$x=1

This method of substituting, starting from the $z$z and working back up through the equations is called backsubstitution

If we have an augmented matrix in row-echelon form, than this is the best method to use to solve the system. 

Practice questions

QUESTION 4

The augmented matrix   $1$1 $5$5 $-13$13   is in row-echelon form and represents a linear system in $x$x and $y$y.
$0$0 $1$1 $-3$3
Solve for $x$x and $y$y.

QUESTION 5

The augmented matrix   $1$1 $3$3 $-2$2 $-13$13   is in row-echelon form and represents a linear system in $x$x, $y$y and $z$z.
$0$0 $1$1 $4$4 $10$10
$0$0 $0$0 $1$1 $3$3
Solve for $x$x, $y$y and $z$z.

QUESTION 6

The augmented matrix   $1$1 $-2$2 $17$17   is in row-echelon form and represents a linear system in $x$x and $y$y.
$0$0 $0$0 $0$0
Solve for $x$x and $y$y. If the system has an infinite number of solutions, express $x$x in terms of $y$y.

So as we just saw, if the augmented matrix is in row-echelon form we can use backsubstitution to solve the system fairly easily.  But how do we turn the augmented matrix into one that is in row-echelon form?

Row echelon form

The process we use is called row operations.  It is basically identical to the algebraic method we typically use for solving a system of equations.

Let's look at the system of equations  

As an augmented matrix we would write it like this,  

Remembering that we want $1$1's on the diagonals, and leading $0$0's everywhere else. We have some manipulation to do.  

We can manipulate the system in any of the following ways,

  • We can take a multiple of any row.  This can be fractional or multiple. 
  • We can take linear combinations of rows, for example things like Row $1$1 $+$+ twice Row $2$2, or Row $2$2 $-$ Row $1$1, these would often be simplified to $R_1+2R_2$R1+2R2, or $R_2-R_1$R2R1
  • We can let the rows swap places
 

We want a $1$1in position $M_{11}$M11,

so let's take $\frac{1}{2}R1$12R1 

now we need a zero in position $M_{21}$M21,

so let's do $R_2+3R_1$R2+3R1

final step is that we now need a $1$1 in position $M_{22}$M22,

so $$

At this point we can solve using

backsubstitution if we needed to. 

Hence,$y=2$y=2
$x+\frac{3}{2}\times2=8$x+32×2=8
$x+3=8$x+3=8
$x=5$x=5

  Let's look at another one, this time a system in $3$3 unknowns. 

Writing this system as an augmented matrix gives, 

Can you see how there is no z value in the 3'rd row, well I might just switch the matrices around.  One thing you will realize is that there are many roads to Rome, that is, that there are many many ways to the solution here - what's important is that you work through it step by step and take care.  You don't have to do this question the way I have done it, in fact I know there are some quicker ways.  Why not see if you can find them?  

See if you can follow the row operations I have performed here, I'm only going to use my shorthand.

   
$\frac{1}{4}R_1$14R1  
$R_3+R_2$R3+R2  
$R_2-2R_1$R22R1 and $R_3-3R_1$R33R1  
$\frac{4}{10}R_2$410R2  
$R_3-\frac{9}{4}R_2$R394R2  
$\frac{10}{11}R_3$1011R3  
     
Hence, $z$z $=$= $-3$3
$y+\frac{4}{10}z$y+410z $=$= $\frac{28}{10}$2810
$10y+4z$10y+4z $=$= $28$28
$10y-12$10y12 $=$= $28$28
$10y$10y $=$= $40$40
$y$y $=$= $4$4
$x-\frac{3y}{4}$x3y4 $=$= $-1$1
$4x-3y$4x3y $=$= $-4$4
$4x-12$4x12 $=$= $-4$4
$4x$4x $=$= $8$8
$x$x $=$= $2$2

Thus the solution is $x=2,y=4,z=-3$x=2,y=4,z=3.  

 

Reduced row echelon form

Starts of exactly the same as we have done for row-echelon form, but we take it a few more steps and isolate the answer specifically.  So we reduce the augmented matrix to having only $1$1's on the diagonals and we remove the rest of the terms.  

Let's do that for the matrix we started above.

   
$R_2-\frac{4}{10}R_3$R2410R3  
$R_1+\frac{3}{4}R_2$R1+34R2  

 

From here, no backsubstitution is necessary, we can read the solutions straight off.

 

Practice questions

Question 7

Use the row transformation $R_3$R3$\to$$R_3-2R_1$R32R1 to transform   $9$9 $0$0 $5$5   .
$2$2 $-7$7 $6$6
$4$4 $1$1 $3$3
  1.     $\editable{}$ $\editable{}$ $\editable{}$      
    $\editable{}$ $\editable{}$ $\editable{}$  
    $\editable{}$ $\editable{}$ $\editable{}$  

Question 8

Consider the following system of equations:

$x$x $+$+ $2y$2y $=$= $11$11
$4x$4x $+$+ $y$y $=$= $23$23
  1. Write the augmented matrix for the system of equations.

        $\editable{}$ $\editable{}$ $\editable{}$      
    $\editable{}$ $\editable{}$ $\editable{}$  
  2. Transform the augmented matrix into row echelon form.

        $1$1 $\editable{}$ $\editable{}$      
    $0$0 $-7$7 $\editable{}$  
        $1$1 $\editable{}$ $\editable{}$      
    $0$0 $1$1 $\editable{}$  
  3. Hence solve for $x$x and $y$y in the system of equations.

Question 9

Consider the system of equations:

$x+3y+z$x+3y+z $=$= $1$1
$3x+2y+z$3x+2y+z $=$= $0$0
$7x+14y+5z$7x+14y+5z $=$= $4$4
  1. Fill in the gaps to write the system of equations as an augmented matrix:

        $1$1 $\editable{}$ $\editable{}$ $\editable{}$    
        $\editable{}$ $\editable{}$ $\editable{}$ $0$0    
        $\editable{}$ $\editable{}$ $\editable{}$ $\editable{}$    
  2. Given that $R_i$Ri refers to the $i$ith row of the matrix, perform the following row reductions on the augmented matrix:

    $1$1 $3$3 $1$1 $1$1
    $3$3 $2$2 $1$1 $0$0
    $7$7 $14$14 $5$5 $4$4
    $R_2\to$R2$R_2-3R_1$R23R1
    $1$1 $3$3 $1$1 $1$1
    $\editable{}$ $\editable{}$ $\editable{}$ $\editable{}$
    $7$7 $14$14 $5$5 $4$4

    $R_2\to$R2$-\frac{1}{7}R_2$17R2

    $1$1 $3$3 $1$1 $1$1
    $\editable{}$ $\editable{}$ $\editable{}$ $\editable{}$
    $7$7 $14$14 $5$5 $4$4
    $R_3\to$R3$R_3-7R_1$R37R1
    $1$1 $3$3 $1$1 $1$1
    $0$0 $1$1 $\frac{2}{7}$27 $\frac{3}{7}$37
    $\editable{}$ $\editable{}$ $\editable{}$ $\editable{}$
    $R_3\to$R3$7R_2+R_3$7R2+R3
    $1$1 $3$3 $1$1 $1$1
    $0$0 $1$1 $\frac{2}{7}$27 $\frac{3}{7}$37
    $\editable{}$ $\editable{}$ $\editable{}$ $\editable{}$
  3. Given the result of part (b), what can we say about the number of solutions to this system of equations?

    There are infinitely many solutions.

    A

    There are no solutions.

    B

    There is a unique solution

    C
  4. The row-echelon form of the matrix can be rewritten as the following equivalent system of equations:

    $x+3y+z$x+3y+z $=$= $1$1
    $y+\frac{2z}{7}$y+2z7 $=$= $\frac{3}{7}$37

    By letting $z=t$z=t, express the solutions to the system in terms of the variable $t$t:

    $x$x $=$= $\editable{}$
    $y$y $=$= $\editable{}$
    $z$z $=$= $t$t

Applications of augmented matrices

We can use matrices to solve problems involving real-world applications. A very common one is in systems relating to economics (prices, profits, losses, markups, and more), but basically anything that would involve carrying out the same operation on multiple items can be made more simple by using matrices. 

Some key things to remember:

  • if you have to convert your system in a matrix, check what you place in rows and columns.  The operations you carry out on them will rely on you having done this first critical step correctly.
  • If you need to multiply, have you set up your matrices such that the dimensions allow multiplication
  • always check that your answer seems reasonable

Practice questions

Question 10

Consider the system of equations:

$x+3y+z$x+3y+z $=$= $1$1
$3x+2y+z$3x+2y+z $=$= $0$0
$7x+14y+5z$7x+14y+5z $=$= $4$4
  1. Fill in the gaps to write the system of equations as an augmented matrix:

        $1$1 $\editable{}$ $\editable{}$ $\editable{}$    
        $\editable{}$ $\editable{}$ $\editable{}$ $0$0    
        $\editable{}$ $\editable{}$ $\editable{}$ $\editable{}$    
  2. Given that $R_i$Ri refers to the $i$ith row of the matrix, perform the following row reductions on the augmented matrix:

    $1$1 $3$3 $1$1 $1$1
    $3$3 $2$2 $1$1 $0$0
    $7$7 $14$14 $5$5 $4$4
    $R_2\to$R2$R_2-3R_1$R23R1
    $1$1 $3$3 $1$1 $1$1
    $\editable{}$ $\editable{}$ $\editable{}$ $\editable{}$
    $7$7 $14$14 $5$5 $4$4

    $R_2\to$R2$-\frac{1}{7}R_2$17R2

    $1$1 $3$3 $1$1 $1$1
    $\editable{}$ $\editable{}$ $\editable{}$ $\editable{}$
    $7$7 $14$14 $5$5 $4$4
    $R_3\to$R3$R_3-7R_1$R37R1
    $1$1 $3$3 $1$1 $1$1
    $0$0 $1$1 $\frac{2}{7}$27 $\frac{3}{7}$37
    $\editable{}$ $\editable{}$ $\editable{}$ $\editable{}$
    $R_3\to$R3$7R_2+R_3$7R2+R3
    $1$1 $3$3 $1$1 $1$1
    $0$0 $1$1 $\frac{2}{7}$27 $\frac{3}{7}$37
    $\editable{}$ $\editable{}$ $\editable{}$ $\editable{}$
  3. Given the result of part (b), what can we say about the number of solutions to this system of equations?

    There are infinitely many solutions.

    A

    There are no solutions.

    B

    There is a unique solution

    C
  4. The row-echelon form of the matrix can be rewritten as the following equivalent system of equations:

    $x+3y+z$x+3y+z $=$= $1$1
    $y+\frac{2z}{7}$y+2z7 $=$= $\frac{3}{7}$37

    By letting $z=t$z=t, express the solutions to the system in terms of the variable $t$t:

    $x$x $=$= $\editable{}$
    $y$y $=$= $\editable{}$
    $z$z $=$= $t$t

Question 11

Consider the system of equations:

$2x$2x $=$= $4$4
$x+y$x+y $=$= $-1$1
  1. Fill in the gaps to write the system of equations as an augmented matrix:

    $2$2 $\editable{}$ $\editable{}$
    $\editable{}$ $\editable{}$ $\editable{}$
  2. Given that $R_i$Ri refers to the $i$ith row of the matrix, use the method of Gauss-Jordan Elimination to reduce the augmented matrix to the form $\left[I\ |\ b\right]$[I | b], where $I$I is the 2x2 identity matrix and $b$b is the solution vector:

    $2$2 $0$0 $4$4
    $1$1 $1$1 $-1$1
    $R_1\to$R1$\frac{1}{2}R_1$12R1
    $\editable{}$ $\editable{}$ $\editable{}$
    $1$1 $1$1 $-1$1

    $R_2\to$R2$R_2-R_1$R2R1

    $1$1 $0$0 $2$2
    $\editable{}$ $\editable{}$ $\editable{}$
  3. Hence write down the solution to the system:

    $x$x $=$= $\editable{}$
    $y$y $=$= $\editable{}$

 

What is Mathspace

About Mathspace