Gaussian Elimination

Elementary Row Operations

The Definition of Elementary Row Operations

Elementary Row Operations

The following three transformations of a matrix are called elementary row operations:

  1. Interchanging two rows: interchange row ii and row jj of the matrix
  2. Multiplying a row by a scalar: multiply a row of the matrix by a nonzero constant kk
  3. Adding a multiple of one row to another: add kk times row jj to row ii, written Ri+kRjR_i + kR_j

Properties of Elementary Row Operations

Elementary Row Operations Do Not Change the Rank of a Matrix

Elementary row operations do not change the rank of the matrix.

Proof

Proof:

  • Interchanging two rows: does not change linear dependence
  • Multiplying by a scalar: does not change linear dependence
  • Adding a multiple: does not change linear dependence

The Matrix Representation of Elementary Row Operations

The Matrix Representation of Elementary Row Operations

An elementary row operation is equivalent to left-multiplication by an elementary matrix.

Elementary matrices:

  1. Interchange matrix: EijE_{ij} denotes the matrix that interchanges row i and row j
  2. Scaling matrix: Ei(k)E_i(k) denotes the matrix that multiplies row i by k
  3. Shear matrix: Eij(k)E_{ij}(k) denotes the matrix that adds k times row j to row i

Gaussian Elimination

The Basic Idea of Gaussian Elimination

Idea: use elementary row operations to reduce the augmented matrix to row echelon form, then solve by back substitution.

Row Echelon Form Matrices

Row Echelon Form Matrix

A matrix satisfying the following conditions is called a row echelon form matrix:

  1. The zero rows (rows consisting entirely of zeros) lie below the nonzero rows
  2. The first nonzero entry of each nonzero row (called the pivot) lies to the right of the pivot of the row above
  3. The entries below each pivot are zero

Example:

(123401230001)\left( \begin{array}{cccc} 1 & 2 & 3 & 4 \\ 0 & 1 & 2 & 3 \\ 0 & 0 & 0 & 1 \end{array} \right)

The Steps of Gaussian Elimination

Steps:

  1. Forward elimination: use elementary row operations to reduce the augmented matrix to row echelon form
  2. Back substitution: start from the last row and solve for the unknowns one row at a time

An Example of Gaussian Elimination

Example 1: solve the system by Gaussian elimination: {x+y+z=62x+3y+z=13x−y+2z=4\begin{cases} x + y + z = 6 \\ 2x + 3y + z = 13 \\ x - y + 2z = 4 \end{cases}

Solution:

  1. Write down the augmented matrix:

    (1116231131−124)\left( \begin{array}{ccc|c} 1 & 1 & 1 & 6 \\ 2 & 3 & 1 & 13 \\ 1 & -1 & 2 & 4 \end{array} \right)
  2. Forward elimination:

    • R2−2R1R_2 - 2R_1:(111601−111−124)\left( \begin{array}{ccc|c} 1 & 1 & 1 & 6 \\ 0 & 1 & -1 & 1 \\ 1 & -1 & 2 & 4 \end{array} \right)
    • R3−R1R_3 - R_1:(111601−110−21−2)\left( \begin{array}{ccc|c} 1 & 1 & 1 & 6 \\ 0 & 1 & -1 & 1 \\ 0 & -2 & 1 & -2 \end{array} \right)
    • R3+2R2R_3 + 2R_2:(111601−1100−10)\left( \begin{array}{ccc|c} 1 & 1 & 1 & 6 \\ 0 & 1 & -1 & 1 \\ 0 & 0 & -1 & 0 \end{array} \right)
  3. Back substitution:

    • From the third row: −z=0-z = 0, so z=0z = 0
    • From the second row: y−z=1y - z = 1, so y=1y = 1
    • From the first row: x+y+z=6x + y + z = 6, so x=5x = 5
  4. Solution: x=5x = 5, y=1y = 1, z=0z = 0

Gauss-Jordan Elimination

The Idea of Gauss-Jordan Elimination

Idea: starting from row echelon form, go further and reduce the matrix to reduced row echelon form (the Jordan canonical form).

Reduced Row Echelon Form Matrices

Reduced Row Echelon Form Matrix

A matrix satisfying the following conditions is called a reduced row echelon form matrix:

  1. It is in row echelon form
  2. Every pivot is 1
  3. All the other entries in the column containing a pivot are zero

Example:

(100401030012)\left( \begin{array}{cccc} 1 & 0 & 0 & 4 \\ 0 & 1 & 0 & 3 \\ 0 & 0 & 1 & 2 \end{array} \right)

The Steps of Gauss-Jordan Elimination

Steps:

  1. Reduce to row echelon form by Gaussian elimination
  2. Turn each pivot into 1
  3. Turn the entries above each pivot into zero

Analysis of the Structure of the Solution

The Unique Solution

Condition: the system has a unique solution when the rank of the coefficient matrix equals the rank of the augmented matrix, and that common rank equals the number of unknowns.

Infinitely Many Solutions

Condition: the system has infinitely many solutions when the rank of the coefficient matrix equals the rank of the augmented matrix, and that common rank is less than the number of unknowns.

Form of the general solution: a particular solution plus the general solution of the homogeneous system

No Solution

Condition: the system has no solution when the rank of the coefficient matrix is less than the rank of the augmented matrix.

The Advantages and Disadvantages of Gaussian Elimination

Advantages

  1. Universality: it applies to systems of linear equations of any size
  2. Numerical stability: the numerical error accumulated during the computation is small
  3. Ease of implementation: the algorithm is simple and easy to program
  4. The structure of the solution can be analysed: the rank analysis tells you which case you are in

Disadvantages

  1. Heavy computation: for large systems the amount of computation is considerable
  2. Storage requirements: the whole augmented matrix has to be stored
  3. Unsuitable for sparse matrices: for sparse matrices the efficiency is not high

Exercises

Exercise 1

Solve the system {x+2y=53x−y=4\begin{cases} x + 2y = 5 \\ 3x - y = 4 \end{cases} by Gaussian elimination.

Gaussian eliminationelementary row operationsaugmented matrixmatrix

Approach: Follow the steps of Gaussian elimination.

Steps:

  1. The augmented matrix:

    (1253−14)\left( \begin{array}{cc|c} 1 & 2 & 5 \\ 3 & -1 & 4 \end{array} \right)
  2. Forward elimination: R2−3R1R_2 - 3R_1:(1250−7−11)\left( \begin{array}{cc|c} 1 & 2 & 5 \\ 0 & -7 & -11 \end{array} \right)

  3. Back substitution:

    • From the second row: −7y=−11-7y = -11, so y=117y = \frac{11}{7}
    • From the first row: x+2y=5x + 2y = 5, so x=5−2×117=137x = 5 - 2 \times \frac{11}{7} = \frac{13}{7}

Answer: x=137x = \frac{13}{7}, y=117y = \frac{11}{7}

Exercise 2

Solve the system {x+y+z=02x+2y+2z=0\begin{cases} x + y + z = 0 \\ 2x + 2y + 2z = 0 \end{cases} by Gaussian elimination.

Gaussian eliminationelementary row operationsaugmented matrixmatrix

Approach: Follow the steps of Gaussian elimination, noting that this is a homogeneous system.

Steps:

  1. The augmented matrix:

    (11102220)\left( \begin{array}{ccc|c} 1 & 1 & 1 & 0 \\ 2 & 2 & 2 & 0 \end{array} \right)
  2. Forward elimination: R2−2R1R_2 - 2R_1:(11100000)\left( \begin{array}{ccc|c} 1 & 1 & 1 & 0 \\ 0 & 0 & 0 & 0 \end{array} \right)

  3. Analyse the structure of the solution:

    • The rank of the coefficient matrix is 1, and the number of unknowns is 3
    • The number of free variables is 3-1=2
    • Let y=ty = t and z=sz = s, then x=−t−sx = -t - s

Answer: x=−t−sx = -t - s, y=ty = t, z=sz = s (where t,st, s are arbitrary constants)

Exercise 3

Decide which case the system {x+y=1x+y=2\begin{cases} x + y = 1 \\ x + y = 2 \end{cases} falls into.

Gaussian eliminationelementary row operationsaugmented matrixstructure of solutions

Approach: Use Gaussian elimination to analyse the structure of the solution.

Steps:

  1. The augmented matrix:

    (111112)\left( \begin{array}{cc|c} 1 & 1 & 1 \\ 1 & 1 & 2 \end{array} \right)
  2. Forward elimination: R2−R1R_2 - R_1:(111001)\left( \begin{array}{cc|c} 1 & 1 & 1 \\ 0 & 0 & 1 \end{array} \right)

  3. Analysis:

    • The rank of the coefficient matrix is 1
    • The rank of the augmented matrix is 2
    • The rank of the coefficient matrix is less than the rank of the augmented matrix

Answer: there is no solution

Exercise 4

Solve the system {x+y+z=62x+3y+z=13x−y+2z=4\begin{cases} x + y + z = 6 \\ 2x + 3y + z = 13 \\ x - y + 2z = 4 \end{cases} by Gauss-Jordan elimination.

Gaussian eliminationelementary row operationsaugmented matrixmatrix

Approach: First reduce to row echelon form by Gaussian elimination, then reduce to reduced row echelon form by Gauss-Jordan elimination.

Steps:

  1. The augmented matrix:

    (1116231131−124)\left( \begin{array}{ccc|c} 1 & 1 & 1 & 6 \\ 2 & 3 & 1 & 13 \\ 1 & -1 & 2 & 4 \end{array} \right)
  2. Gaussian elimination:

    • R2−2R1R_2 - 2R_1:(111601−111−124)\left( \begin{array}{ccc|c} 1 & 1 & 1 & 6 \\ 0 & 1 & -1 & 1 \\ 1 & -1 & 2 & 4 \end{array} \right)
    • R3−R1R_3 - R_1:(111601−110−21−2)\left( \begin{array}{ccc|c} 1 & 1 & 1 & 6 \\ 0 & 1 & -1 & 1 \\ 0 & -2 & 1 & -2 \end{array} \right)
    • R3+2R2R_3 + 2R_2:(111601−1100−10)\left( \begin{array}{ccc|c} 1 & 1 & 1 & 6 \\ 0 & 1 & -1 & 1 \\ 0 & 0 & -1 & 0 \end{array} \right)
  3. Gauss-Jordan elimination:

    • R3×(−1)R_3 \times (-1):(111601−110010)\left( \begin{array}{ccc|c} 1 & 1 & 1 & 6 \\ 0 & 1 & -1 & 1 \\ 0 & 0 & 1 & 0 \end{array} \right)
    • R2+R3R_2 + R_3:(111601010010)\left( \begin{array}{ccc|c} 1 & 1 & 1 & 6 \\ 0 & 1 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{array} \right)
    • R1−R2−R3R_1 - R_2 - R_3:(100501010010)\left( \begin{array}{ccc|c} 1 & 0 & 0 & 5 \\ 0 & 1 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{array} \right)
  4. Read off the solution directly: x=5x = 5, y=1y = 1, z=0z = 0

Answer: x=5x = 5, y=1y = 1, z=0z = 0

Exercise 5

Prove that: elementary row operations do not change the rank of a matrix.

Gaussian eliminationelementary row operationsaugmented matrixrank of a matrix

Approach: Prove separately that each of the three elementary row operations leaves the rank unchanged.

Steps:

  1. Interchanging two rows: does not change linear dependence, so it does not change the rank
  2. Multiplying by a scalar: does not change linear dependence, so it does not change the rank
  3. Adding a multiple: does not change linear dependence, so it does not change the rank

Answer: the proof is complete

Summary

Symbols Used in This Article

SymbolTypePronunciation / NoteMeaning in This Article
Ri+kRjR_i + kR_jMathematical symbolrow i plus k row jThe shear operation: add kk times row jj to row ii
EijE_{ij}Mathematical symbolE sub i jThe elementary matrix that interchanges rows ii and jj
Ei(k)E_i(k)Mathematical symbolE sub i of kThe elementary matrix that multiplies row ii by the nonzero constant kk
Eij(k)E_{ij}(k)Mathematical symbolE sub i j of kThe elementary matrix for the shear operation
kkMathematical symbolkThe nonzero scalar multiplier used in a row operation

Found an issue with this content?

Tell us what could be improved.