Linear Algebra

1.2 Gaussian Elimination

Imron Rosyadi

Introduction to Gaussian Elimination

In the previous section, we saw how elementary row operations can transform a linear system’s augmented matrix into a simpler form from which solutions are evident. This section formalizes that process.

We will cover:

  • Defining Row Echelon Form (REF) and Reduced Row Echelon Form (RREF).
  • Interpreting solutions from REF/RREF matrices.
  • The systematic procedures: Gaussian Elimination and Gauss-Jordan Elimination.
  • Special considerations for homogeneous linear systems.

Echelon Forms of Matrices

A matrix is in Row Echelon Form (REF) if it has the following properties:

  1. If a row doesn’t consist entirely of zeros, its first nonzero number (called a leading 1) is 1.
  2. Any rows consisting entirely of zeros are grouped at the bottom.
  3. In any two successive non-zero rows, the leading 1 in the lower row is farther to the right than the leading 1 in the higher row.

A matrix in Reduced Row Echelon Form (RREF) has all three REF properties, plus:

  1. Each column containing a leading 1 has zeros everywhere else in that column (above and below the leading 1).

Example 1: Row Echelon vs. Reduced Row Echelon Forms

Reduced Row Echelon Form Examples: (All follow properties 1-4) \[ \left[{\begin{array}{r r r | r}{1}&{0}&{0}&{4}\\ {0}&{1}&{0}&{7}\\ {0}&{0}&{1}&{-1}\end{array}}\right] \] \[ \left[{\begin{array}{r r r}{1}&{0}&{0}\\ {0}&{1}&{0}\\ {0}&{0}&{1}\end{array}}\right] \] \[ \left[{\begin{array}{r r r r | r}{0}&{1}&{-2}&{0}&{1}\\ {0}&{0}&{0}&{1}&{3}\\ {0}&{0}&{0}&{0}&{0}\\ {0}&{0}&{0}&{0}&{0}\end{array}}\right] \]

Row Echelon Form Examples (NOT Reduced): (Follow properties 1-3, but NOT 4) \[ \left[{\begin{array}{r r r | r}{1}&{4}&{-3}&{7}\\ {0}&{1}&{6}&{2}\\ {0}&{0}&{1}&{5}\end{array}}\right] \]

\[ \left[{\begin{array}{r r r}{1}&{1}&{0}\\ {0}&{1}&{0}\\ {0}&{0}&{0}\end{array}}\right] \]

\[ \left[{\begin{array}{r r r r | r}{0}&{1}&{2}&{6}&{0}\\ {0}&{0}&{1}&{-1}&{0}\\ {0}&{0}&{0}&{0}&{1}\end{array}}\right] \]

Solving Systems from Echelon Forms

Once an augmented matrix is in REF or RREF, the solution to the linear system can be obtained.

Example 3: Unique Solution (From RREF)

Suppose RREF of augmented matrix for \(x_1, x_2, x_3, x_4\) is: \[ \left[{\begin{array}{c c c c | c}{1}&{0}&{0}&{0}&{3}\\ {0}&{1}&{0}&{0}&{-1}\\ {0}&{0}&{1}&{0}&{0}\\ {0}&{0}&{0}&{1}&{5}\end{array}}\right] \] This directly translates to: \[ x_1 = 3, \quad x_2 = -1, \quad x_3 = 0, \quad x_4 = 5 \] This is a unique solution.

Solving Systems from Echelon Forms (Cont.)

Example 4(a): No Solution

Suppose RREF of augmented matrix for \(x, y, z\) is: \[ \left[{\begin{array}{l l l | l}{1}&{0}&{0}&{0}\\ {0}&{1}&{2}&{0}\\ {0}&{0}&{0}&{1}\end{array}}\right] \] The last row corresponds to the equation: \[ 0x + 0y + 0z = 1 \implies 0=1 \] This is a contradiction. The system is inconsistent and has no solution.

Solving Systems from Echelon Forms (Cont.)

Example 4(b): Infinitely Many Solutions

Suppose RREF of augmented matrix for \(x, y, z\) is: \[ \left[{\begin{array}{l l l | l}{1}&{0}&{3}&{-1}\\ {0}&{1}&{-4}&{2}\\ {0}&{0}&{0}&{0}\end{array}}\right] \] The last row \(0=0\) can be omitted. The corresponding system is: \[ \begin{array}{r}x + 3z = -1 \\ y - 4z = 2 \end{array} \] Variables corresponding to leading 1s (\(x, y\)) are leading variables. Others (\(z\)) are free variables. Solve for leading variables in terms of free variables: \[ \begin{array}{l}x = -1 - 3z \\ y = 2 + 4z \end{array} \] Assign an arbitrary value (parameter) \(t\) to the free variable \(z\). The general solution (parametric equations) is: \[ x = -1 - 3t, \quad y = 2 + 4t, \quad z = t \] Specific solutions can be found by choosing values for \(t\). For example, if \(t=0\), then \((x,y,z)=(-1,2,0)\). If \(t=1\), then \((x,y,z)=(-4,6,1)\).

Solving Systems from Echelon Forms (Cont.)

Example 4(c): Infinitely Many Solutions (Another form)

Suppose RREF of augmented matrix for \(x, y, z\) is: \[ \left[{\begin{array}{l l l | l}{1}&{-5}&{1}&{4}\\ {0}&{0}&{0}&{0}\\ {0}&{0}&{0}&{0}\end{array}}\right] \] The system reduces to a single equation: \[ x - 5y + z = 4 \] Here, \(x\) is the only leading variable. \(y\) and \(z\) are free variables. Let \(y = s\) and \(z = t\) (parameters). Then \(x = 4 + 5y - z \implies x = 4 + 5s - t\).

The general solution is: \[ x = 4 + 5s - t, \quad y = s, \quad z = t \] This represents a plane in 3D space.

Gauss-Jordan Elimination: Step-by-Step Procedure

This algorithm reduces any matrix to its unique Reduced Row Echelon Form.

Phase 1: Forward Elimination (Gaussian Elimination to REF) Goal: Create leading 1s and zeros below them.

  1. Locate Leftmost Non-Zero Column: This will be your first pivot column.
  2. Move Non-Zero Entry to Top: If needed, interchange the top row with another row to get a non-zero entry at the top of the pivot column.
  3. Create Leading 1: Multiply the top row by the reciprocal of its new leading entry to make it 1.
  4. Create Zeros Below Leading 1: Add suitable multiples of the new first row to rows below it to make all entries below the leading 1 zero.
  5. Repeat for Submatrix: Cover the top row and repeat steps 1-4 on the remaining (sub)matrix. Continue until the entire matrix is in Row Echelon Form.

Gauss-Jordan Elimination: Step-by-Step Procedure

Phase 2: Backward Elimination (To RREF) Goal: Create zeros above the leading 1s.

  1. Create Zeros Above Leading 1s: Starting with the last non-zero row and working upwards, add suitable multiples of each row to the rows above to introduce zeros above the leading 1s.

The final matrix is in Reduced Row Echelon Form.

Interactive Example: Gauss-Jordan Elimination

Let’s apply Gauss-Jordan Elimination to the augmented matrix for the system: \(x + y + 2z = 9\)
\(2x + 4y - 3z = 1\)
\(3x + 6y - 5z = 0\)

Initial Augmented Matrix: \[ \left[ \begin{array}{r r r | r}{1} & 1 & 2 & 9\\ {2} & 4 & {-3} & 1\\ {3} & 6 & {-5} & 0 \end{array} \right] \]

Interactive Example: Gauss-Jordan Elimination

Interactive: Reduced Row Echelon Form Calculator

Homogeneous Linear Systems

A system of linear equations is homogeneous if all constant terms are zero: \[ \begin{array}{r l} a_{11}x_{1} + \dots +a_{1n}x_{n} &= 0\\ a_{21}x_{1} + \dots +a_{2n}x_{n} &= 0\\ \vdots\qquad\vdots\qquad\vdots\qquad\vdots \\ a_{m1}x_{1} + \dots +a_{mn}x_{n} &= 0 \end{array} \]

Homogeneous Linear Systems

Key properties of homogeneous systems:

  • Always consistent: \(x_1=0, x_2=0, \ldots, x_n=0\) is always a solution (the trivial solution).
  • Can have only two types of solutions:
    1. Only the trivial solution.
    2. Infinitely many solutions (including the trivial solution, which are then called nontrivial solutions).

Homogeneous Linear Systems

Geometrically: For 2D, lines pass through the origin. If they’re distinct and intersect only at origin \(\implies\) trivial solution. If they coincide \(\implies\) infinitely many solutions.

Homogeneous System Geometry

Homogeneous Linear Systems (Cont.)

Theorem 1.2.1: Free Variable Theorem for Homogeneous Systems

If a homogeneous linear system has \(n\) unknowns, and if the reduced row echelon form of its augmented matrix has \(r\) nonzero rows, then the system has \(n - r\) free variables.

Theorem 1.2.2: Existence of Nontrivial Solutions

A homogeneous linear system with more unknowns than equations (i.e., \(n > m\)) has infinitely many solutions.

  • Proof Sketch: If \(m < n\) (equations < unknowns), then when reducing to RREF, the number of leading 1s (\(r\)) must be less than or equal to \(m\). So, \(r \le m < n\). This means \(n - r > 0\), guaranteeing at least one free variable. Since free variables can take infinite values, there are infinitely many solutions (including the trivial one).

This theorem is very powerful and has applications in fields like signal processing (e.g., finding the null space of a matrix where the outputs of a system are zero) and control theory (e.g., determining system stability).

Example 6: A Homogeneous System

Solve the homogeneous linear system: \[ \begin{array}{r r r r r r} {x_{1} + 3x_{2}} & {-2x_{3}} & {} & {+2x_{5}} & {} & = 0\\ {2x_{1} + 6x_{2}} & {-5x_{3}} & {-2x_{4}} & {+4x_{5}} & {- 3x_{6}} & = 0\\ {} & {5x_{3}} & {+10x_{4}} & {} & {+15x_{6}} & = 0\\ {2x_{1} + 6x_{2}} & {} & {+8x_{4}} & {+4x_{5}} & {+18x_{6}} & = 0 \end{array} \] This is the same system as in Example 5, but with zeros on the right-hand side. The augmented matrix is: \[ \left[{\begin{array}{r r r r r r | r}{1}&{3}&{-2}&{0}&{2}&{0}&{0}\\ {2}&{6}&{-5}&{-2}&{4}&{-3}&{0}\\ {0}&{0}&{5}&{10}&{0}&{15}&{0}\\ {2}&{6}&{0}&{8}&{4}&{18}&{0}\end{array}}\right] \] Note that elementary row operations will preserve the column of zeros.

Example 6: A Homogeneous System

Its RREF (from Example 5’s reduction) will be: \[ \left[{\begin{array}{r r r r r r | r}{1}&{3}&{0}&{4}&{2}&{0}&{0}\\ {0}&{0}&{1}&{2}&{0}&{0}&{0}\\ {0}&{0}&{0}&{0}&{0}&{1}&{0}\\ {0}&{0}&{0}&{0}&{0}&{0}&{0}\end{array}}\right] \] The corresponding system of equations is: \[ \begin{array}{r r r r r r} {x_{1} + 3x_{2}} & {} & {+4x_{4}} & {+ 2x_{5}} & {} & {= 0}\\ {} & {x_{3}} & {+2x_{4}} & {} & {} & {= 0}\\ {} & {} & {} & {} & {x_{6}} & {= 0} \end{array} \] Leading variables: \(x_1, x_3, x_6\). Free variables: \(x_2, x_4, x_5\). Let \(x_2 = r, x_4 = s, x_5 = t\). Solution: \[ x_{1} = -3r - 4s - 2t, \quad x_{2} = r, \quad x_{3} = -2s, \quad x_{4} = s, \quad x_{5} = t, \quad x_{6} = 0 \] Since there are free variables, this homogeneous system has infinitely many solutions. The trivial solution is when \(r=s=t=0\).

Gaussian Elimination and Back-Substitution

For computer-based solutions of large systems, Gaussian Elimination (reducing to Row Echelon Form) followed by back-substitution is generally more efficient than full Gauss-Jordan elimination.

Procedure:

  1. Use elementary row operations to reduce the augmented matrix to Row Echelon Form (REF) (Forward Elimination).
  2. Write the corresponding system of equations.
  3. Solve the equations for the leading variables.
  4. Starting from the bottom equation and working upwards, substitute the values of determined variables (or parametric expressions) into the equations above.
  5. Assign arbitrary values to any remaining free variables to get the general solution.

Gaussian Elimination and Back-Substitution

Example 7: Example 5 Solved by Back-Substitution

REF from Example 5: \[ \left[{\begin{array}{r r r r r r | r}{1}&{3}&{-2}&{0}&{2}&{0}&{0}\\ {0}&{0}&{1}&{2}&{0}&{3}&{1}\\ {0}&{0}&{0}&{0}&{0}&{1}&{{\frac{1}{3}}}\\ {0}&{0}&{0}&{0}&{0}&{0}&{0}\end{array}}\right] \] Corresponding system: \[ \begin{array}{l} x_1 + 3x_2 - 2x_3 + 2x_5 = 0 \\ x_3 + 2x_4 + 3x_6 = 1 \\ x_6 = \frac{1}{3} \end{array} \] Solving for leading variables (\(x_1, x_3, x_6\)): \[ \begin{array}{l} {x_1 = -3x_2 + 2x_3 - 2x_5} \\ {x_3 = 1 - 2x_4 - 3x_6} \\ {x_6 = \frac{1}{3}} \end{array} \]

Gaussian Elimination and Back-Substitution

Now, back-substitute:

  1. Substitute \(x_6 = \frac{1}{3}\) into the second equation: \(x_3 = 1 - 2x_4 - 3\left(\frac{1}{3}\right) \implies x_3 = 1 - 2x_4 - 1 \implies x_3 = -2x_4\)
  2. Substitute \(x_3 = -2x_4\) into the first equation: \(x_1 = -3x_2 + 2(-2x_4) - 2x_5 \implies x_1 = -3x_2 - 4x_4 - 2x_5\)

Assign free variables \(x_2=r, x_4=s, x_5=t\). Resulting general solution: \[ x_1 = -3r - 4s - 2t, \quad x_2 = r, \quad x_3 = -2s, \quad x_4 = s, \quad x_5 = t, \quad x_6 = \frac{1}{3} \] This confirms the same solution as Gauss-Jordan elimination for Example 5.

Example 8: Discussion on Solutions from REF

Suppose these are augmented matrices for systems in \(x_1, x_2, x_3, x_4\). All are in REF, but not RREF.

(a) No Solution \[ {\left[\begin{array}{l l l l | l}{1}&{-3}&{7}&{2}&{5}\\ {0}&{1}&{2}&{-4}&{1}\\ {0}&{0}&{1}&{6}&{9}\\ {0}&{0}&{0}&{0}&{1}\end{array}\right]} \] Last row: \(0=1\). Inconsistent.

(b) Infinitely Many Solutions \[ {\left[\begin{array}{l l l l | l}{1}&{-3}&{7}&{2}&{5}\\ {0}&{1}&{2}&{-4}&{1}\\ {0}&{0}&{1}&{6}&{9}\\ {0}&{0}&{0}&{0}&{0}\end{array}\right]} \] Last row: \(0=0\). Leading variables \(x_1, x_2, x_3\). Free variable \(x_4\). Infinitely many solutions.

Example 8: Discussion on Solutions from REF

(c) Unique Solution \[ {\left[\begin{array}{l l l l | l}{1}&{-3}&{7}&{2}&{5}\\ {0}&{1}&{2}&{-4}&{1}\\ {0}&{0}&{1}&{6}&{9}\\ {0}&{0}&{0}&{1}&{0}\end{array}\right]} \] Last row: \(x_4=0\). All variables are leading variables. Unique solution.

Important Facts About Echelon Forms

  1. Unique RREF: Every matrix has a unique reduced row echelon form. No matter what sequence of elementary row operations you use, you will always arrive at the same RREF for a given matrix.
  2. Non-Unique REF: Row echelon forms (REF) are not unique. Different sequences of elementary row operations can lead to different REF forms for the same matrix.
  3. Pivot Positions/Columns are Unique: Although REF can vary, the number of zero rows and the positions of the leading 1s (called pivot positions) are always the same for a given matrix. Columns containing pivot positions are called pivot columns.

Important Facts About Echelon Forms

Example 9: Pivot Positions and Columns

For the matrix \[ A = \begin{bmatrix} 0 & 0 & -2 & 0 & 7 & 12 \\ 2 & 4 & -10 & 6 & 12 & 28 \\ 2 & 4 & -5 & 6 & -5 & -1 \end{bmatrix} \] one possible REF is: \[ \left[ \begin{array}{cccccc}1 & 2 & -5 & 3 & 6 & 14 \\ 0 & 0 & 1 & 0 & -\frac{7}{2} & -6 \\ 0 & 0 & 0 & 0 & 1 & 2 \end{array} \right] \] The leading 1s are in positions (row 1, column 1), (row 2, column 3), and (row 3, column 5). These are the pivot positions. The pivot columns are columns 1, 3, and 5. In a linear system, pivot columns identify the leading variables. Here, \(x_1, x_3, x_5\) would be leading variables.

Roundoff Error and Stability

While Gaussian and Gauss-Jordan elimination are mathematically sound, their practical implementation on computers faces challenges:

  • Roundoff Errors: Computers use finite-precision arithmetic, leading to small errors in calculations.
  • Instability: Successive calculations can amplify these roundoff errors, rendering results inaccurate or “unstable.”

For large systems (e.g., in computational fluid dynamics, large-scale circuit simulations), specialized numerical techniques are used to minimize these errors. Gaussian elimination is generally preferred over Gauss-Jordan due to fewer operations, reducing error propagation.

Conclusion

  • Echelon Forms (REF & RREF): Provide structured representations of matrices for systematic problem-solving.
  • Gaussian Elimination & Gauss-Jordan Elimination: Algorithms for transforming matrices into echelon forms.
  • Solutions: Determined by the final echelon form (unique, infinite, or no solution).
  • Homogeneous Systems: Always consistent, trivial solution always exists, nontrivial solutions if free variables exist.
  • Practical Importance: These methods are fundamental to numerical algorithms for systems of equations in all ECE applications, from circuit analysis to control systems, signal processing, and machine learning.

Exercises

grasple_exercise_2_1_B

To perform row operations on a matrix.

Exercises

grasple_exercise_2_1_C

Checking whether a matrix is in (reduced) echelon form.

Exercises

grasple_exercise_2_1_E

Applying the algorithm to compute a solution of a linear system.