Lecture 1 Systems of Linear Equations and Matrices Math 19620 Outline of Course Linear Equations and Matrices Linear Transformations, Inverses Bases, Linear Independence, Subspaces Abstract Vector Spaces Orthogonality and Least Squares Eigenvalues and Eigenvectors Systems of Linear Equations Our goal for today, will to be to understand how to find solutions to equations such as x + 3y + 2z = 3x + 2y + z = 11 Ideally, we will be able to understand the solutions to any system of linear equations: 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 where the a ij (the coeffiecients) and the b i (the constant terms) are fixed constants, and we are solving for the x i (the variables) in terms of the a ij and b i Let s start instead with a high school algebra problem: x + 3y = 7 x + y = 3 1
One method to solve this problem is to solve for for one variable in terms of the other, then plug this into the other equation Using the first equation, we have Plug this into the second equation to conclude: Plugging this into ( ), we have x = 7 3y ( ) (7 3y) + y = 3 2y = 3 7 y = 2 ( ) x = 7 3(2) = 1 Hence, the solution to the above system of linear equations is x = 1 y = 2 The issue with this method is that it becomes terrible to write out when you have more equations and variables The key to understanding how to generalize this method is to look at the second step of ( ) The equation 2y = 3 y is obtained from the second equation, by subtracting the first equation This was useful, because it canceled out the x term Let s use this strategy to solve the above 3 by 3 system: x + 3y + 2z = (I) (subtract row 1) 3x + 2y + z = 11 3x + 2y + z = 11 3(I) (subtract three times row 1) 4y + 8z = 28 +4(II) (add four times row 2) 12z = 36 ( 12) (divide this row by 12) z = 3 +(III) 2
y = 1 z = 3 x + 2y = 4 y = 1 z = 3 2(II) 3(III) x = 2 y = 1 z = 3 Matrices It might be clear: that although x,y,and z are what we really care about in the end, while we did the computation, the only role each of them played was as place holder Thus, for any system 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 we define the coefficient matrix A and constant column vector b to be a 11 a 12 a 1n b 1 a 21 a 22 a 2n A = b 2 b = a m1 a 1m2 a mn If x is any column vector with n entries, we define A x to be the column vector with entries given by the left hand side of the corresponding system of linear eq s That is, a 11 a 12 a 1n x 1 a 11 x 1 + a 12 x 2 + + a 1n x n a 21 a 22 a 2n x 2 A x = = a 21 x 1 + a 22 x 2 + + a 2n x n a m1 a 1m2 a mn x n a m1 x 1 + a m2 x 2 + + a mn x n Hence, we can rewrite the above system of linear equations as an equality of column vectors: A x = b b m 3
I call this the geometric form of a system of linear equations Each row corresponds to one of the linear equations in the system, and each column corresponds to one of the variables Let s solve the system I gave at the beginning of class again, using this more compact notation instead The matrix of coefficients and vector of constants are: 1 2 3 13 A = 1 3 2 b = 11 3 2 1 11 Thus, I m solving for x, y, z in 1 2 3 x 13 1 3 2 y = 11 3 2 1 z 11 The aim: arrive at something that looks like 1 0 0 x 0 1 0 y = some vector of constants 0 0 1 z The above square (ie number of rows = number of columns) matrix I with 1 s on the diagonal and 0 elsewhere is called the identity matrix Why? Because I x = x for all vectors x Ie, it corresponds to the easiest system of linear equations there is: the one that just tells you the answer right off the bat (Solving for x if your are given x = 2 is pretty easy!) The tools: When solving this problem as a collection of equations (instead of an equality of vectors), we had several tools at our disposal: we could Multiply both sides of an equation by a nonzero number Add/subtract a multiple of one row to another Swap two equations (Ie, the order you write them in doesn t matter) When we think in terms of matrices, these are called elementary row operations When we perform such an operation, we do it to both A and b You can imagine that you are multiplying both sides of the vector equation on the left by the row operation (In fact, in a very real sense that is what you are doing) Do it again, now with matrices Example with Infinitely Many Solutions 2x + 4y + 6z = 0 4x + 5y + 6z = 3 7x + 8y + 9z = 6 4
No Solutions x + 2y = 1 2x + 4y = 1 Row Reduced Echelon Form Luckily, there is an algorithm (called Gauss-Jordan elimination) for determining how many solutions (none, one, or infinitely many) a given system of linear equations has, and which explicitly gives the solutions (In case there are infinitely many, you still obtain an answer in terms of free variables) A matrix is in row reduced echelon form if it satisfies the following three conditions: a) If any row is nonzero (ie has some nonzero entry), its first nonzero entry is a 1, called the leading 1 The independent variable corresponding to the column is called a leading variable b) If a column contains a leading 1, then all other entries in that column are 0 c) If a row contains a leading 1, then each row above it contains a leading 1 further to the left Note that condition (c) implies that all zero rows appear at the bottom A variable which is not a leading variable is a free variable Example: The augmented matrix 2 4 2 2 4 1 2 1 2 0 3 6 2 1 9 5 10 4 5 9 x 1 x 2 x 3 x 4 x 5 2 4 2 2 4 2 1 2 1 2 0 4 3 6 2 1 9 1 5 10 4 5 9 9 2 = 4 1 9 Reduced: 1 2 0 0 3 2 0 0 1 0 1 4 0 0 0 1 2 3 0 0 0 0 0 0 5
The Number of Solutions to a System Consider the following examples: 1 2 0 0 a) 0 0 1 0 0 0 0 1 0 0 0 0 b) 1 2 0 1 0 0 1 2 0 0 0 0 c) 1 0 0 1 0 1 0 2 0 0 1 3 These augmented matrices are all in RREF, so it should be easy to determine the solutions The examples correspond to the systems thus a) has no solutions, b) has infinitely many solutions, and c) has a unique solution Definitions A system of linear equations is consistent if it has at least one solution Otherwise, it is inconsistent The rank rank(a) of a matrix A is the number of leading 1 s in rrefa Theorem 131 of the book: Suppose A x = b is a system of linear equations, with m equations and n variables (That is, A has m rows and n columns) This system is inconsistent if and only if rref(a b) contains the row [ 0 0 0 1 ] If a linear system is consistent, then it either has a unique solution, or it has infinitely many We have rank(a) m and rank(a) n If rank(a) = n, then the system is consistent If rank(a) = m, then the system has at most one solution If rank(a) < m, then the system has either infinitely many solutions, or none 6
7