Lecture 11: Solving Systems of Linear Equations by Gaussian Elimination Winfried Just, Ohio University February 3, 2016
Review: The coefficient matrix Consider a system of m linear equations in n variables. a 11 x 1 + a 12 x 2 + + a 1n x n = b 1 a 21 x 1 + a 22 x 2 + + a 2n x n = b 2. a m1 x 1 + a m2 x 2 + + a mn x n = b m The coefficient matrix of this system is a 11 a 12... a 1n a 21 a 22... a 2n A =... a m1 a m2... a mn
Review: The extended matrix a 11 x 1 + a 12 x 2 + + a 1n x n = b 1 a 21 x 1 + a 22 x 2 + + a 2n x n = b 2 a m1 x 1 + a m2 x 2 + + a mn x n = b m The coefficient matrix A does not give us complete information about this system. But the extended aka augmented matrix A b does: a 11 a 12... a 1n b 1 A b a 21 a 22... a 2n b 2 =.... a m1 a m2... a mn b m.
Review: Equivalent systems and their augmented matrices We will say that two systems of m linear equations in n variables are equivalent if they have the same sets of solutions. Similarly, we will say that two matrices A b 1 1, A b 2 2 of order m (n + 1) are equivalent if they represent equivalent systems of linear equations. Here a matrix A b is said to represent a system of linear equations if it is the augmented matrix of the system. Note that any matrix with at least two columns represents some system of linear equations.
Review: What do we do when we solve a system? Essentially, solving a linear system that has exactly one solution boils down to transforming a system of the form a 11 x 1 + a 12 x 2 + + a 1n x n = b 1 a 21 x 1 + a 22 x 2 + + a 2n x n = b 2 a m1 x 1 + a m2 x 2 + + a mn x n = b m. into an equivalent system of the form: x 1 = c 1 x 2 = c 2. x n = c n where c 1, c 2,..., c n are numbers.
Elementary operations on systems of linear equations Consider a system of m linear equations in n variables. Each of the following operations preserves the set of solutions and thus transforms the system into an equivalent one: (i) Interchanging the positions of any two equations. (ii) Multiplying an equation by a nonzero scalar. (iii) Adding to one equation a scalar times another equation.
Elementary row operations on matrices Consider a matrix A b of order m (n + 1). Each of the following elementary row operations transforms A b into an equivalent matrix: (E1) Interchanging any two rows. (E2) Multiplying any row by a nonzero scalar. (E3) Adding to one row of the matrix a scalar times another row of the matrix.
Where do we want to go? An example. Solving systems of linear equations boils down to transforming them (or their extended matrices) into forms that clearly show the solution. Consider the following system and its augmented matrix: x 1 + 2x 2 3x 3 = 17 x 2 4x 3 = 5 x 3 = 3 1 2 3 17 A b = 0 1 4 5 0 0 1 3 For this system it is trivial to determine the unique solution x = [12 7 3] T by back-substitution, starting from the last equation.
Where do we want to go? A second example. x 1 + 2x 2 3x 3 = 17 x 3 x 4 = 13 x 4 = 33 1 2 3 0 17 A b = 0 0 1 1 13 0 0 0 1 33 The set of solutions of this system consists of all vectors 77 2x 2 x = x 2 20 33 It is still very easy to determine the set of solutions by back-substitution, starting from the last equation.
Where do we want to go? A third example. Consider the following system of m = 3 equation with n = 2 variables and its augmented matrix: x 1 + 2x 2 = 1.5 x 2 = 0.25 0 = 0 1 2 1.5 A b = 0 1 0.25 0 0 0 For this [ system ] it is trivial to determine the unique solution 1 x = by back-substitution, starting from the last equation. 0.25
Where do we want to go? A fourth example. Consider the following system of m = 3 equation with n = 3 variables and its augmented matrix: x 1 + 2x 2 + 3x 3 = 1.5 x 2 x 3 = 0.25 0 = 1 A b = 1 2 3 1.5 0 1 1 0.25 0 0 0 1 We see immediately that this system has no solutions and is inconsistent.
What do all of these augmented matrices have in common? We have seen four examples for which the solution is very easy to read off the system. Their augmented matrices are: 1 2 3 17 1 2 3 0 17 0 1 4 5 0 0 1 1 13 0 0 1 3 0 0 0 1 33 1 2 1.5 1 2 3 1.5 0 1 0.25 0 1 1 0.25 0 0 0 0 0 0 1 What do all of these augmented matrices have in common?
Row-reduced matrices A matrix is in row-reduced form aka row echelon form, or simply a row-reduced matrix if: (R1) All zero rows appear below all nonzero rows when both types are present. (R2) The first nonzero entry in any nonzero row is 1. (R3) All elements in the same column below the first nonzero element of a nonzero row are 0. (R4) The first nonzero element in a nonzero row appears in a column further to the right of the first nonzero element in any preceding row.
The method of Gaussian elimination Gaussian elimination is a method for solving systems of linear equations. The method is named after Carl Friedrich Gauss (1777 1855). It usually works better for numerical solutions on the computer than the method of substitution. We will see later that it also gives us some additional insights. The method relies on transforming the augmented matrix of a given system into and equivalent row-reduced matrix by successive elementary row operations.
The method of Gaussian elimination: Example 1 Consider the following system of linear equations: 0.5x 1 x 2 + x 3 = 2 2x 1 7x 2 3x 3 = 0 x 1 + x 2 + x 3 = 5 The augmented matrix is 0.5 1 1 2 A b = 2 7 3 0 1 1 1 5
Gaussian elimination for Example 1 0.5 1 1 2 2 7 3 0 1 1 1 5 1 2 2 4 2 7 3 0 1 1 1 5 1 2 2 4 0 3 7 8 1 1 1 5 multiply row 1 by 2 subtract 2(row 1) from row 2 subtract row 1 from row 3 1 2 2 4 2 7 3 0 1 1 1 5 1 2 2 4 0 3 7 8 1 1 1 5 1 2 2 4 0 3 7 8 0 3 1 1
Gaussian elimination for Example 1, continued 1 2 2 4 0 3 7 8 0 3 1 1 1 2 2 4 0 3 7 8 0 0 8 7 1 2 2 4 7 8 0 1 3 3 0 0 8 7 add row 2 to row 3 divide row 2 by -3 divide row 3 by -8 1 2 2 4 0 3 7 8 0 0 8 7 1 2 2 4 7 8 0 1 3 3 0 0 8 7 1 2 2 4 7 8 0 1 3 3 7 0 0 1 8
Example 1: Reading off the solution We have transformed the augmented matrix of the original system into an equivalent matrix in row-reduced form: 1 2 2 4 7 8 0 1 3 3 7 0 0 1 8 It represents the following equivalent system: x 1 2x 2 + 2x 3 = 4 x 2 + 7 3 x 3 = 8 3 x 3 = 7 8 Back-substitution gives the solution: x 3 = 7 8, x 2 = 5 8, x 1 = 7 2.