Skip to content

MANE 3351

Lecture 23

Classroom Management

Agenda

  • Gauss Jordan Elimination, Partial Pivoting, Matrix Inversion using Gauss Jordan
  • Homework 7 (assigned 11/20/24, due 12/2/24 - no late submissions)
  • Lab today for those who did not finish

Resources

Handouts

Calendar

Date Lecture Topic Lab Topic
11/18 Lecture 22 - Row Echelon Form Lab 10 - Row Echelon Form/ChatGPT
11/20 Lecture 23 - Gaussian Elimination
11/25
11/27
12/2
12/4 Review
12/9 Final exam 1:15 - 3:00 pm

Assignments

  • Homework 6 (assigned 11/13, due 11/20)
  • Lab 10 (assigned 11/18, due 11/25 (before lab))
  • Homework 7 (assigned 11/20, due 12/2 - no late submissions)

Gauss-Jordan Elimination

  • A Step-by-Step Method for Solving Linear Systems
  • An extension of row-echelon form

Introduction to Gauss-Jordan Elimination

  • Gauss-Jordan elimination is a method to solve systems of linear equations.
  • Goal: Transform the matrix into reduced row-echelon form (RREF).
  • Key feature: The solution is read directly from the matrix.
  • Distinguish from Row Echelon Form

Key Steps in Gauss-Jordan Elimination

  1. Row Operations:
  2. Swap two rows.
  3. Multiply a row by a nonzero scalar.
  4. Add or subtract multiples of one row to another.
  5. Transform to RREF:
  6. Each leading entry is 1 (pivot).
  7. Pivots are the only nonzero entries in their column.

Example Problem

Solve the system:

\[ \begin{aligned} x + y + z &= 6 \\ 2x + 3y + z &= 14 \\ y + 2z &= 8 \end{aligned} \]

Step-by-Step Solution

  1. Convert the system to an augmented matrix.
  2. Use row operations to make the first pivot 1.
  3. Eliminate all other entries in the pivot column.
  4. Repeat for each subsequent pivot.

Final Result

  • Matrix in reduced row-echelon form (RREF):
\[ \begin{bmatrix} 1 & 0 & 0 & a \\ 0 & 1 & 0 & b \\ 0 & 0 & 1 & c \end{bmatrix} \]
  • Solution: \(x = a\), \(y = b\), \(z = c\).

Applications of Gauss-Jordan Elimination

  • Solving systems of linear equations.
  • Finding inverse matrices.
  • Used in engineering, physics, computer science, etc.

Summary of Gauss-Jordan Elimination

  • Gauss-Jordan elimination simplifies solving linear systems.
  • Three row operations ensure clarity and consistency.
  • Matrix RREF provides direct solutions.

Partial Pivoting

  • A pivot is the leading non-zero element in a row used to simplify the matrix.
  • Pivoting ensures numerical stability during elimination.
  • Types of pivoting:

  • Partial Pivoting: Swap rows to place the largest absolute value in the pivot position.

  • Complete Pivoting: Reorder rows and columns to place the largest value in the pivot position.

Why Pivoting is Necessary

  • Avoid division by small numbers (reduce round-off errors).
  • Improve accuracy in solving systems.
  • Ensure numerical stability for ill-conditioned matrices.

Example Problem

Solve the system of equations:

\[ \begin{aligned} 0.0001x + y + z &= 1 \\ x + y + z &= 6 \\ 2x + y + 10z &= 20 \end{aligned} \]

Form the Augmented Matrix

Represent the system as an augmented matrix:

\[ \begin{bmatrix} 0.0001 & 1 & 1 & | & 1 \\ 1 & 1 & 1 & | & 6 \\ 2 & 1 & 10 & | & 20 \end{bmatrix} \]
  • The first three columns are the coefficients of the variables \(x, y, z\).
  • The fourth column is the constants on the right-hand side.

Perform Partial Pivoting

  1. Compare the absolute values in the first column:
\[ \text{Column 1: } |0.0001|, |1|, |2| \]

Largest value: 2.

  1. Swap row 1 with row 3:
\[ \begin{bmatrix} 2 & 1 & 10 & | & 20 \\ 1 & 1 & 1 & | & 6 \\ 0.0001 & 1 & 1 & | & 1 \end{bmatrix} \]

Elimination Step-by-Step

  1. Eliminate entries below the pivot in the first column:
\[ R_2 \to R_2 - \frac{1}{2} R_1, \quad R_3 \to R_3 - \frac{0.0001}{2} R_1 \]
  1. Resulting matrix:
\[ \begin{bmatrix} 2 & 1 & 10 & | & 20 \\ 0 & 0.5 & -4 & | & -4 \\ 0 & 0.99995 & 0.9995 & | & 0.9995 \end{bmatrix} \]
  1. Repeat pivoting and elimination for columns 2 and 3.

Slide 8: Complete Solution

  • After performing Gauss-Jordan elimination with pivoting:
\[ \begin{bmatrix} 1 & 0 & 0 & | & 2 \\ 0 & 1 & 0 & | & 1 \\ 0 & 0 & 1 & | & 1 \end{bmatrix} \]
  • Solution:
\[ x = 2, \quad y = 1, \quad z = 1 \]

Slide 9: Challenges and Limitations

  • Pivoting increases computational complexity for larger matrices.
  • Requires additional bookkeeping for row swaps.
  • May not guarantee exact accuracy for ill-conditioned matrices.

Applications of Pivoting

  • Engineering: Solving large systems of linear equations.
  • Computer science: Numerical simulations and optimizations.
  • Physics: Stability in solving differential equations.

Summary

  • Pivoting improves the accuracy and stability of Gauss-Jordan elimination.
  • Partial pivoting is a practical and efficient choice.
  • Numerical stability is crucial for solving large or complex systems.

Using Gauss-Jordan Elimination to find Inverse Matrix

  • To find the inverse of a matrix \(A\), we augment it with the identity matrix \(I\).
  • Perform Gauss-Jordan elimination to transform \(A\) into \(I\), turning \(I\) into \(A^{-1}\).
  • Works only if the matrix \(A\) is invertible (determinant \(\neq 0\)).

Key Steps

  1. Write the augmented matrix \([A | I]\).
  2. Use row operations to transform \(A\) into the identity matrix \(I\).
  3. The resulting augmented matrix will be \([I | A^{-1}]\).

Example Problem

Find the inverse of:

\[ A = \begin{bmatrix} 2 & 1 \\ 5 & 3 \end{bmatrix} \]
  • Form augmented matrix:
\[ \begin{bmatrix} 2 & 1 & | & 1 & 0 \\ 5 & 3 & | & 0 & 1 \end{bmatrix} \]

Step-by-Step Solution

  1. Scale the first row to make the pivot 1:
\[ R_1 \to R_1 / 2 \]

Result:

\[ \begin{bmatrix} 1 & 0.5 & | & 0.5 & 0 \\ 5 & 3 & | & 0 & 1 \end{bmatrix} \]

  1. Eliminate the first column of \(R_2\):
\[ R_2 \to R_2 - 5 \cdot R_1 \]

Result:

\[ \begin{bmatrix} 1 & 0.5 & | & 0.5 & 0 \\ 0 & 0.5 & | & -2.5 & 1 \end{bmatrix} \]

  1. Scale the second row to make the pivot 1:
\[ R_2 \to R_2 / 0.5 \]

Result:

\[ \begin{bmatrix} 1 & 0.5 & | & 0.5 & 0 \\ 0 & 1 & | & -5 & 2 \end{bmatrix} \]

  1. Eliminate the second column of \(R_1\):
\[ R_1 \to R_1 - 0.5 \cdot R_2 \]

Result:

\[ \begin{bmatrix} 1 & 0 & | & 3 & -1 \\ 0 & 1 & | & -5 & 2 \end{bmatrix} \]

Final Result

  • The final augmented matrix is:
\[ \begin{bmatrix} 1 & 0 & | & 3 & -1 \\ 0 & 1 & | & -5 & 2 \end{bmatrix} \]
  • Inverse of \(A\):
\[ A^{-1} = \begin{bmatrix} 3 & -1 \\ -5 & 2 \end{bmatrix} \]

Conditions for Invertibility

  • A matrix \(A\) is invertible if:

  • It is square (\(n \times n\)).

  • Determinant of \(A \neq 0\).
  • For \(2 \times 2\):
\[ \text{det}(A) = ad - bc \neq 0 \]

Summary

  • Gauss-Jordan elimination transforms \(A\) into \(I\), revealing \(A^{-1}\).
  • Method highlights the importance of row operations.
  • Verifiable through matrix multiplication: \(A \cdot A^{-1} = I\).

Discussion of ChatGPT

  • These slides were prepared using ChatGPT
  • The partial pivoting slides contained an error that required a prompt to be modified
  • There was one lab on Monday that created coded that gave a wrong answer