MAC 2103 Module 1 Systems of Linear Equations and Matrices I 1
Learning Objectives Upon completing this module, you should be able to: 1. Represent a system of linear equations as an augmented matrix. 2. Identify whether the matrix is in row-echelon form, reduced row-echelon form, both, or neither. 3. Solve systems of linear equations by using the Gaussian elimination and Gauss-Jordan elimination methods. 4. Perform matrix operations of addition, subtraction, multiplication, and multiplication by a scalar. 5. Find the transpose and the trace of a matrix. 2
Systems of Linear Equations and Matrices I There are three major topics in this module: Introduction to Systems of Linear Equations Gaussian Elimination Matrices and Matrix Operations Rev.09 3
A Quick Review A linear equation in two variables can be written in the form ax + by = k, where a, b, and k are constants, and a and b are not equal to 0. Note: The power of the variables is always 1. Two or more linear equations is called a system of linear equations because they involve solving more than one linear equation at once. A system of linear equations can have either exactly one solution (unique), no solution, or infinitely many solutions. 4
Let s Look at a System of Two Linear Equations in Two Variables 5
Remember How to Use the Elimination Method to Solve a System of Linear Equations? Example: Use elimination to solve each system of equations, if possible. Identify the system as consistent or inconsistent. If the system is consistent, state whether the equations are dependent or independent. Support your results graphically. a) 3x y = 7 b) 5x y = 8 c) x y = 5 5x + y = 9 5x + y = 8 x y = 2 6
Solving a System of Linear Equations Using the Elimination Method (Cont.) Solution a) Eliminate y by adding the equations. Find y by substituting x = 2 in either equation. The solution is (2, 1). The system is consistent and the equations are independent. 7
b) Solving a System of Linear Equations Using the Elimination Method (Cont.) If we add the equations we obtain the following result. The equation 0 = 0 is an identity that is always true. The two equations are equivalent. There are infinitely many solutions. {(x, y) 5x y = 8} 8
Solving a System of Linear Equations Using the Elimination Method (Cont.) c) If we subtract the second equation from the first, we obtain the following result. The equation 0 = 7 is a contradiction that is never true. Therefore, there is no solution, and the system is inconsistent. 9
Let s Look at Solving a System of Linear Equations with Three Variables Solve the following system. Solution Step 1: Eliminate the variable z from equation one and two and then from equation two and three. Equation 1 Equation 2 times 6 Add Equation 2 Equation 3 Add 10
Solving a System of Linear Equations with Three Variables Using the Elimination Method (Cont.) Step 2: Take the two new equations and eliminate either variable. Find x using y = 2. Do you remember using this method before? 11
Solving a System of Linear Equations with Three Variables Using the Elimination Method (Cont.) Step 3: Substitute x = 1 and y = 2 in any of the given equations to find z. The solution is (1, 2, 2). Simple? Let s move on. 12
Solve the system. Solution One More Example Step 1 Multiply equation one by 2 and add to equation two. Subtract equation three from equation two. Step 2 The two equations are inconsistent because the sum of 10x + 9y cannot be both 3 and 0. Step 3 is not necessary - the system of equations has no solution. 13
How to Represent a System of Linear Equations in an Augmented Matrix? Let s represent the previous system of linear equations in an Augmented Matrix. Just keep two items in mind: How? Basically, we just need to write down the coefficients of the variables and the constants in an rectangular array of numbers. That s it. 3 9 6 2 1 1 1 1 1 3 2 1 1. The constants must be on the right most column. 2. The coefficients of the variables must be in the same order for each equation (or each row). 14
How to Solve a System of Linear Equations Using an Augmented Matrix? Let s start by labeling our augmented matrix with r1 (row 1), r2 (row 2), and r3 (row 3). Each row corresponds to an equation. What s next? r1 r2 r3 3 9 6 2 1 1 1 1 1 3 2 1 We want to simplify the augmented matrix into either a row-echelon form or a reduced row-echelon form. What method(s) can we use to accomplish this? We can use: 1. Gauss-Jordan Elimination method to obtain a reduced rowechelon form. 2. Gaussian Elimination Method to obtain a row-echelon form. 15
How to Identify a Matrix that is in a Row-Echelon Form or a Reduced Row-Echelon Form? Pictures are worth a thousand words. Here are two pictures. Picture 1 shows a reduced row-echelon form matrix, and Picture 2 shows a row-echelon form matrix. represents any numbers. See the basic differences? The reduced row-echelon form shown in Picture 1 has a leading 1 in each row with zero(s) above it and below it when possible. 1 0 0 0 1 0 0 0 1 1 0 1 0 0 1 Picture 1 Picture 2 What are those s? can be any numbers. The row-echelon form has a leading 1 with zero(s) below it, but it can have any numbers above it. 16
Properties for a Matrix in Reduced Row-Echelon Form The four basic properties: 1. The first nonzero number in a nonzero row has to be a 1. 2. Any row with all zeros is below all nonzero rows. 3. For nonzero rows, the leading 1 in the next row has to be farther to the right than the leading 1 in the previous row. 4. Each column that has a leading 1 can only have zeros everywhere else in that column. Note: A matrix that meets only the first three properties is a matrix in row-echelon form. 17
How to Solve a System of Linear Equations Using an Augmented Matrix? (Cont.) Let s look at our augmented matrix. r1 r2 r3 We can simplify our augmented matrix into a reduced row-echelon form - through a stepby-step elimination process. Step 1: We want a leading 1 in row 1. We can scale row 1 to accomplish this. 1 3 3 9 6 2 1 1 1 1 1 r1 r1 r2 r3 3 2 1 1 3 2 2 1 1 1 1 1 1 2 1 We want to reduce our augmented matrix into something like this. 1 0 0 0 1 0 0 0 1 18
How to Solve a System of Linear Equations Using an Augmented Matrix? (Cont.) Step 2: We need zeros below our leading 1 in row 1. How to make 2 and 1 become zeros? r1 2r1+ r2 r2 r1 + r3 r3 1 3 2 0 5 5 0 2 1 Step 3: We need a leading 1 in row 2. How? 1 5 r1 r2 r2 r3 1 3 2 0 1 1 0 2 1 1 0 2 1 0 2 r1 r2 r3 From Step 1: We want to reduce our augmented matrix into something like this. 1 3 2 2 1 1 1 1 1 1 0 0 0 1 0 0 0 1 1 2 1 19
How to Solve a System of Linear Equations Using an Augmented Matrix? (Cont.) Step 4: We need a zero below our leading 1 in row 2. r1 r2 2r2 + r3 r3 1 3 2 0 1 1 0 0 1 Alright, we have a row-echelon form matrix. Gaussian elimination stops at this step but then requires back-substitution to find the solution. 1 0 2 r1 r2 r3 From Step 3: We want to reduce our augmented matrix into something like this. 1 3 2 0 1 1 0 2 1 1 0 0 0 1 0 0 0 1 1 0 2 20
How to Solve a System of Linear Equations Using an Augmented Matrix? (Cont.) Step 5: We need zeros above our leading 1 in row 3 from step 4. Step 6: We need a zero above our leading 1 at row 2. How? 2r3 + r1 r1 r3 + r2 r2 r3 1 3 0 0 1 0 0 0 1 5 2 2 3r2 + r1 r1 1 0 0 1 r2 0 1 0 2 r3 0 0 1 2 Now, we have a reduced row-echelon form matrix. From Step 4: 1 3 2 0 1 1 0 0 1 We want to reduce our augmented matrix into a reduced row-echelon form. 1 0 0 0 1 0 0 0 1 21 1 0 2
How to Solve a System of Linear Equations Using an Augmented Matrix? (Cont.) What does our matrix say? 1 0 0 0 1 0 0 0 1 Can you identify the solution? 1 2 2 1.x + 0.y + 0.z = 1 x = 1 0.x + 1.y + 0.z = 2 y = 2 0.x + 0.y + 1.z = 2 z = 2 We have just obtained the solution of the system of linear equations by using the Gauss-Jordan Elimination Method. The Gauss-Jordan Elimination method has reduced the augmented matrix into its reduced row-echelon form. Note: If you remember, we have already obtained the rowechelon form in step 4. Can we stop there and find the solutions for the system of Linear Equations? We will look at this situation next. 22
How to Solve a System of Linear Equations Using an Augmented Matrix? (Cont.) Let s say we stop at Step 4. Then, we will have the following equations to solve: 1 1 1 0 1 3 0 0 1 1 4 2 1.x + 1.y + 1.z = 1 x + y + z = 1 0.x + 1.y + 3.z = 4 y + 3z = 4 0.x + 0.y + 1.z = 2 z = 2 In this case, we can solve the system of equations by using back-substitution. Step 1: Substitute z = 2 to the second equation, we will obtain y = 4-3 (2) = -2 Step 2: Substitute z = 2 and y = -2 to the first equation, we will obtain x = 1. Note: This method is the so called Gaussian Elimination Method with backsubstitution. 23
Matrix Notation and Terminology A matrix is a rectangular array of numbers. The numbers in the array are called the entries in the matrix. The size of the matrix is described in terms of the number of rows and the number of columns. The entry that occurs in row i and column j of a matrix A will be denoted by a ij. An example of a 3 x 3 matrix will have the following entries: a 11 a 12 a 13 A = a 21 a 22 a 23 = a ij a 31 a 32 a 33 Here is an example of size 2 X 3 matrix, a matrix with two rows and three columns. for i, j = 1, 2, 3. 10 2 1 0 5 8 24
Matrix Notation and Terminology (Cont.) Column Matrix: A matrix with only one column. Example: 2 x 1 matrix Row Matrix: A matrix with only one row. Example: 1 x 3 matrix 4 3 1 Square Matrix: A matrix with the same number of rows and columns. Example: 2 x 2 matrix Two matrices are defined to be equal if they have the same size and their corresponding entries are equal. Example: a = 1,, b = 2,, c = 3, and, d = 4, 4 1 a c b d = 1 2 3 4 25
Matrix Operations Let A, B, and C be matrices. A = 3 0 5 7 B = 1 5 0 2 C = 2 3 4 0 1 1 Addition: If A and B are the same size, then A + B is the matrix obtained by adding the entries of B to the entries of A. Example: A + B = a ij + b ij = a + b ij ij 3 0 5 7 + 1 5 0 2 = 3 + 1 0 + ( 5) 5 + 0 7 + ( 2) = 4 5 5 5 26
Matrix Operations (Cont.) Let A, B, and C be matrices. A = 3 0 5 7 B = Subtraction: If A and B are the same size, then A - B is the matrix obtained by subtracting the entries of B from the entries of A. Example: A - B = 1 5 0 2 a ij C = b ij = a ij b ij 2 3 4 0 1 1 3 0 5 7 1 5 0 2 = 3 1 0 ( 5) 5 0 7 ( 2) = 2 5 5 9 27
Matrix Operations (Cont.) Multiplication: If B is an m x r and C is an r x n, then the product BC is the m x n matrix. To find the entry in row m and column n of BC, we multiply the corresponding entries from the row and column together, and then add up the resulting products. = Example: BC = b ij c jk = b c ij jk = d ik 1 5 2 3 4 BC = 0 2 0 1 1 (1)(2) + ( 5)(0) (1)(3) + ( 5)(1) (1)(4) + ( 5)( 1) (0)(2) + ( 2)(0) (0)(3) + ( 2)(1) (0)(4) + ( 2)( 1) r j =1 [ ] = D = 2 2 9 0 2 2 = D 28
Matrix Operations (Cont.) Scalar Multiple: If C is any matrix and s is any scalar, then the product of sc is the matrix obtained by multiplying each entry of the matrix by s. Example: 2C = 2 = 4 6 8 2 3 4 0 2 2 sc = sc jk 0 1 1 (2)(2) (2)(3) (2)(4) = (2)(0) (2)(1) (2)( 1) 29
What is a Linear Combination? A = 3 0 5 7 B = 1 5 0 2 E = 2 0 0 1 Linear Combination: If A, B, and E are matrices, then 3A - B + 2E is called a linear combination. Example: 3A B + 2E = 3a ij = 3 = 3 0 5 7 9 0 15 21 + ( 1) + + b ij + 2e ij = 3a ij b ij + 2e ij 1 5 0 2 1 5 0 2 + + 2 4 0 0 2 2 0 0 1 = 12 5 15 25 30
What is the Transpose of a Matrix? Transpose of a matrix: If A is any m x n matrix, then the transpose, denoted by A T, is defined to be the n x m matrix that results from interchanging the rows and columns of A. Example: A = a ij = 2 4 6 8 4 x 2 1 3 5 9 A T = a ji = 2 4 6 8 1 3 5 9 2 x 4 31
What is the Trace of a Matrix? Trace of a matrix: If A is any square matrix, then the trace of A, denoted by tr(a), is defined to be the sum of the entries on the main diagonal of A. If A is not a square matrix, then the trace of A is undefined. Example: A = 2 4 6 8 1 3 5 9 1 1 7 1 2 4 2 0 = a ij for i, j = 1, 2, 3, 4. 4 tr(a) = a ii = 2 + 3 + 7 + 0 = 12 i=1 32
We have learned to: What have we learned? 1. Represent a system of linear equations as an augmented matrix. 2. Identify whether the matrix is in row-echelon form, reduced row-echelon form, both, or neither. 3. Solve systems of linear equations by using the Gaussian elimination and Gauss-Jordan elimination methods. 4. Perform matrix operations of addition, subtraction, multiplication, and multiplication by a scalar. 5. Find the transpose and the trace of a matrix. 33
Credit Some of these slides have been adapted/modified in part/whole from the text or slides of the following textbooks: Anton, Howard: Elementary Linear Algebra with Applications, 9th Edition Rockswold, Gary: Precalculus with Modeling and Visualization, 3th Edition 34