Gaussian elimination transforms a general matrix into upper triangular form using row operations. Combined with back substitution, this solves any invertible linear system.
Elementary Row Operations¶
Three operations that preserve the solution of a linear system:
Multiply a row by a nonzero scalar:
Add a multiple of one row to another:
Interchange two rows:
The Algorithm¶
Transform the augmented matrix to upper triangular form by eliminating entries below the diagonal, column by column.
Algorithm 1 (Gaussian Elimination)
Input: ,
Output: Upper triangular , modified
for :
for :
(multiplier)
for :
Example 1 (Gaussian Elimination by Hand)
Computational Cost¶
At step , the elimination updates a submatrix. The total cost is:
Gaussian elimination is : cubic in the matrix size. The subsequent back substitution is only , so the elimination dominates.
Gaussian Elimination and LU Decomposition: implementation of GE, elementary matrices, the connection to LU, and visualization of structured LU factors.