• Gaussian elimination is a powerful and widely-used method for solving systems of linear equations. It is used across many fields, from engineering to economics, for finding the values of variables that satisfy a system of equations. Whether you’re working with data science models, electrical circuits, or optimization problems, understanding this technique is crucial.

    Row Echelon Form

    For each row in a matrix, if the row does not consist of only zeros, then the leftmost nonzero entry is called the pivot of that row.

    If two leading entries are in the same column, then a row replacement operation can be used to make one of those entries zero.

    Then by using the row swapping operation, one can always order the rows so that for every non-zero row, the leading entry is to the right of the leading entry of the row above.

    The following matrix is in echelon form

    (112305670010110000)\begin{pmatrix} 1 & 1 & 2 & 3 \\ 0 & 5 & 6 & 7 \\ 0 & 0 & 10 & 11 \\ 0 & 0 & 0 & 0 \end{pmatrix}

    Reduced Row Echelon Form (RREF)

    A matrix is said to be in reduced row echelon form if

    1. Leading entries are 1’s
    2. Leading 1’s are to the right of those above
    3. Rows with all zeroes are at the bottom
    4. Each leading 1’s must be the only non-zero entry in its column

    (100122501657500111100000)\begin{pmatrix} 1 & 0 & 0 & -\frac{12}{25} \\ 0 & 1 & \frac{6}{5} & \frac{7}{5} \\ 0 & 0 & 1 & \frac{11}{10} \\ 0 & 0 & 0 & 0 \end{pmatrix}

    Row Echelon Form Example

    Suppose the goal is to find and describe the set of solutions to the following system of linear equations

    2x+yz=8(L1)3xy+2z=11(L2)2x+y+2z=3(L3)\begin{aligned} 2x + y – z &= 8 \quad & (L_1) \\ -3x – y + 2z &= -11 \quad & (L_2) \\ -2x + y + 2z &= -3 \quad & (L_3) \end{aligned}

    Then it’s associated augmented matrix is

    [2118312112123]\left[ \begin{array}{ccc|c} 2 & 1 & -1 & 8 \\ -3 & -1 & 2 & -11 \\ -2 & 1 & 2 & -3 \\ \end{array} \right]

    Applying R2+32R1R2R_2 + \frac{3}{2} R_1 \rightarrow R_2 and R3+R1R3R_3 + R_1 \rightarrow R_3

    [21180121210215]\left[ \begin{array}{ccc|c} 2 & 1 & -1 & 8 \\ 0 & \frac{1}{2} & \frac{1}{2} & 1 \\ 0 & 2 & 1 & 5 \\ \end{array} \right]

    Applying R34R2R3R_3 – 4 R_2 \rightarrow R_3

    [21180121210011]\left[ \begin{array}{ccc|c} 2 & 1 & -1 & 8 \\ 0 & \frac{1}{2} & \frac{1}{2} & 1 \\ 0 & 0 & -1 & 1 \\ \end{array} \right]

    Row Echelon Form Example

    We will continue from the previous example

    Applying 12R1R1\frac{1}{2}R_1 \rightarrow R_1

    [1121240121210011]\left[ \begin{array}{ccc|c} 1 & \frac{1}{2} & -\frac{1}{2} & 4 \\ 0 & \frac{1}{2} & \frac{1}{2} & 1 \\ 0 & 0 & -1 & 1 \\ \end{array} \right]

    Applying 2R2R22R_2 \rightarrow R_2 and R112R2R1R_1 – \frac{1}{2} R_2 \rightarrow R_1

    [101301120011]\left[ \begin{array}{ccc|c} 1 & 0 & -1 & 3 \\ 0 & 1 & 1 & 2 \\ 0 & 0 & -1 & 1 \\ \end{array} \right]

    Applying R2R3R2 R_2 – R_3 \rightarrow R_2 and R1+R3R1R_1 + R_3 \rightarrow R_1

    [100201030011]\left[ \begin{array}{ccc|c} 1 & 0 & 0 & 2 \\ 0 & 1 & 0 & 3 \\ 0 & 0 & 1 & -1 \\ \end{array} \right]

    Therefore the solution is x=2,y=3,z=1x = 2, y = 3, z = -1

  • Elementary Row Operations (ERO)

    Elementary row operations are fundamental tools in linear algebra used to manipulate matrices. These operations are critical in solving systems of linear equations, finding determinants, and performing matrix factorizations, such as Gaussian elimination.

    In this article, we will explore the three main types of elementary row operations: row switching, row scaling, and row replacement, along with how to apply them using matrix multiplication.

    There are three row operations:

    Row Switching

    The row switching operation swaps two rows of a matrix. This is represented as

     RiRjR_i \leftrightarrow R_j

    where rows i i and jj are exchanged. For example, if we have the following matrix AA:

    A=(123456789)A = \begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{pmatrix}

    And if we want to swap rows 1 and 2 (RiRjR_i \leftrightarrow R_j), the new matrix will look like

    A=(456123789)A’ = \begin{pmatrix} 4 & 5 & 6 \\ 1 & 2 & 3 \\ 7 & 8 & 9 \end{pmatrix}

    Row Scaling

    Row scaling refers to multiplying all elements in a row by a scalar. This operation is represented as 

    kRiRikR_i \rightarrow R_i

    For example, consider the matrix AA where k0k \ne 0 is a non-zero scalar and i i is the row index.

    A=(123456789)A = \begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{pmatrix}

    And if we want to scale first row R1R_1 by a factor of 3, the new matrix will look like:

    A=(369456789)A’ = \begin{pmatrix} 3 & 6 & 9 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{pmatrix}

    Row Replacement

    In row replacement, we add a scalar multiple of one row to another row. This operation is represented as where ij i \ne j and kk is a scalar. For example, given the matrix AA:

    A=(123456789)A = \begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{pmatrix}

    If we want to replace the first row R1R_1 by adding 2 times the second row (R2R_2), the operation is R1+2R2R1R_1 + 2R_2 \rightarrow R_1 , resulting in:

    (91215456789)\begin{pmatrix} 9 & 12 & 15 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{pmatrix}

    Matrix Multiplication

    In order to apply the elementary row operations, we often represent these transformations using matrix multiplication. Here, we will show how each of the elementary row operations is represented as a multiplication of the original matrix by an elementary matrix.

    Row Switching

    For example, if we want to swap rows 1 and 2, we use the elementary matrix EE

    E=(010100001)E = \begin{pmatrix} 0 & 1 & 0\\ 1 & 0 & 0\\ 0 & 0 & 1 \end{pmatrix}

    By multiplying EE by AA we get the result

    A=E×AA=(010100001)×(123456789)(456123789)=(010100001)×(123456789)\begin{align*} A’ &= E \times A \\ A’ &= \begin{pmatrix} 0 & 1 & 0\\ 1 & 0 & 0\\ 0 & 0 & 1 \end{pmatrix} \times \begin{pmatrix} 1 & 2 & 3\\ 4 & 5 & 6\\ 7 & 8 & 9 \end{pmatrix}\\ \begin{pmatrix} 4 & 5 & 6\\ 1 & 2 & 3\\ 7 & 8 & 9 \end{pmatrix} &= \begin{pmatrix} 0 & 1 & 0\\ 1 & 0 & 0\\ 0 & 0 & 1 \end{pmatrix} \times \begin{pmatrix} 1 & 2 & 3\\ 4 & 5 & 6\\ 7 & 8 & 9 \end{pmatrix}\\ \end{align*}

    Row Scaling

    For example, scaling row 1 by 3 would look like

    E=(200010001)E = \begin{pmatrix} 2 & 0 & 0\\ 0 & 1 & 0\\ 0 & 0 & 1 \end{pmatrix}

    By multiplying EE by AA we get the result

    A=E×AA=(200010001)×(123456789)(246123789)=(200010001)×(123456789)\begin{align*} A’ &= E \times A \\ A’ &= \begin{pmatrix} 2 & 0 & 0\\ 0 & 1 & 0\\ 0 & 0 & 1 \end{pmatrix} \times \begin{pmatrix} 1 & 2 & 3\\ 4 & 5 & 6\\ 7 & 8 & 9 \end{pmatrix}\\ \begin{pmatrix} 2 & 4 & 6\\ 1 & 2 & 3\\ 7 & 8 & 9 \end{pmatrix} &= \begin{pmatrix} 2 & 0 & 0\\ 0 & 1 & 0\\ 0 & 0 & 1 \end{pmatrix} \times \begin{pmatrix} 1 & 2 & 3\\ 4 & 5 & 6\\ 7 & 8 & 9 \end{pmatrix}\\ \end{align*}

    Row Replacement

    For example, replacing row 1 with R1+2R2R_1 + 2R_2 would look like

    E=(100210001)E = \begin{pmatrix} 1 & 0 & 0\\ 2 & 1 & 0\\ 0 & 0 & 1 \end{pmatrix}

    By multiplying EE by AA we get the result

    A=E×AA=(100210001)×(123456789)(91215456789)=(100210001)×(123456789)\begin{align*} A’ &= E \times A \\ A’ &= \begin{pmatrix} 1 & 0 & 0\\ 2 & 1 & 0\\ 0 & 0 & 1 \end{pmatrix} \times \begin{pmatrix} 1 & 2 & 3\\ 4 & 5 & 6\\ 7 & 8 & 9 \end{pmatrix}\\ \begin{pmatrix} 9 & 12 & 15\\ 4 & 5 & 6\\ 7 & 8 & 9 \end{pmatrix} &= \begin{pmatrix} 1 & 0 & 0\\ 2 & 1 & 0\\ 0 & 0 & 1 \end{pmatrix} \times \begin{pmatrix} 1 & 2 & 3\\ 4 & 5 & 6\\ 7 & 8 & 9 \end{pmatrix}\\ \end{align*}