680 likes | 847 Views
Chapter 6. System of linear equations and Matrices. Instructor: Nguyen Ngoc Trung nguyenngoctrung.dhsp@gmail.com. Contents. System of Linear Equations The Gauss-Jordan Method Basic Matrix Operations Matrix Products and Inverses Applications of Matrices. Section 6.1.
E N D
Chapter 6 System of linear equations and Matrices Instructor: Nguyen Ngoc Trung nguyenngoctrung.dhsp@gmail.com
Contents • System of Linear Equations • The Gauss-Jordan Method • Basic Matrix Operations • Matrix Products and Inverses • Applications of Matrices Finite Maths
Section 6.1 System of linear equations Instructor: Nguyen Ngoc Trung nguyenngoctrung.dhsp@gmail.com
Linear equations • Linear equation = first degree equation • Example: 2x + 3y = 14 4x – 2y + 5z = 8 5x + 3y -7x + 8k = 17 • A solution of a linear equation is an ordered list of numbers that, when substituted for the variables, produces a true statement. Finite Maths
Linear equations (cont.) • System of linear equations: • Example: • A solution of a system of linear equations is solution that satisfies all the equations. • Example • (1,0,1,3) is a solution of the second system. • (1,1,0,3) is not a solution of the second system though it is solution of the first two equation in that system. Finite Maths
2x+3y=12 -x + y = 2and2x – 2y = -4 (3,2) -x + y = 2 -x + y = -1 3x-4y=1 Systems of 2 equations in 2 variables • Graph technique: • A graph of an linear equation in 2 variables is a line • Each point on the line represent a solution • The solution of the system is represented by the point where two lines intersect. Independent system(exactly one solution) Dependent system(infinitely many solutions) Inconsistent system(no solution) Finite Maths
Systems of 2 equations in 2 variables • Algebraic technique: substitution method • Example: solve the following system • Steps: • Solve (1) for y: y = 2x-1 • Substitute y into (2) to get x: • Substitute x into (1) to get y: Finite Maths
Systems of 2 equations in 2 variables • Algebraic technique: Elimination method • Example: solve the following system • Multiply (1) by 2 and (2) by -3 • Substitute y = 2 into either of equations to get x • Any solution of equations must also be a solution of their sum: Finite Maths
Systems of 2 equations in 2 variables • Algebraic technique: Elimination method (cont) • Example: Finite Maths
How? Larger system of linear equations • The two system of equations are said to be equivalent if they have the same solution • Key idea: • Transform the system into a simpler, equivalent system • Solve the simpler system. Applying elementary operations Finite Maths
Elementary operations • Interchange any two equations • Multiply both sides of an equation by a non-zero constant. • Replace an equation by the sum of itself and a constant multiple of another equation in the system. Finite Maths
Example. Interchange (1), (2) (3) = (3) + 2*(2) (2)=(2)-2*(1)(3) = (3) – (1) • Back substitutions: • Subs (3) to (2): y = -1 • Subs z=1 and y=-1 into (1): x = 2 (2) = -1/5 * (2) Finite Maths
Elimination Method • Make the leading coefficient of the first equation 1. • Eliminate the leading variable of the first equation from each later equation. • Repeat steps 1 and 2 for the second equation. • Repeat steps 1 and 2 for the third, fourth equation and so on, till the last equation. • Then solve the resulting system by back substitution. Finite Maths
Matrix methods • Variables in a system of linear equations remain unchanged during the solution process. • We keep track only the coefficients and the constants • Example: is represented by Matrix Finite Maths
Matrix methods (cont) • Matrix: rectangular array of numbers, consisting of rows and columns • Each number in the array is an element or entry • Note: sometimes we use vertical line to separate coefficients of the variables: Augmented matrix Finite Maths
Matrix methods Rows operations in Matrix method Elementary operations in Elimination method • Interchange any two equations • Multiply both sides of an equation by a non-zero constant. • Replace an equation by the sum of itself and a constant multiple of another equation in the system. • Interchange any two rows • Multiply each element of a row by a non-zero constant. • Replace a row by the sum of itself and a constant multiple of another row of the matrix. Finite Maths
Example R2 = R2+(-1)*R1 R3 = R3 + (-2)*R2 R2 = 1/3 * R2 R3 = R3+2*R1 • Back substitutions: • z=2 • Subs z=2 into R2: y = -6 • Subs z=2 and y=-6 into R1: x = -14 Finite Maths
Example (cont) • Row echelon form: • All rows consisting entirely of 0’s are at the bottom (if any). • The first nonzero entry in each row is 1 (called a leading 1). • Each leading 1 appears to the right of the leading’s in any preceding rows. Finite Maths
Dependent and Inconsistent system • Consider a system of linear equations: • Case 1: The system has exactly one solution (independence system) • Case 2: The system has infinite number of solution (dependent system) • Case 3: The system has no solution (inconsistent system) Finite Maths
Dependent and Inconsistent system • Example: solve the system … Finite Maths
Dependent and Inconsistent system • Example (cont) • There is a variable (namely, z) that is not leading variable of an equation -> cannot solve for it • y=-2z-12 and x = -5z-15 • Both x and y depend on z -> Dependent system • Solution (infinite number): (-5z-15, -2z-12, z) • z is called “parameter” • Note: a system can have more than one parameter Finite Maths
Dependent and Inconsistent system • Example: solve the system … No solution!!! Inconsistent system Finite Maths
REVIEW System of linear equations Instructor: Nguyen Ngoc Trung nguyenngoctrung.dhsp@gmail.com
Review Substitution method: • Calculate a variable by others variables from a equation • Substitute it into another equation to find value of a variable • Substitute the value back into the first equation to find solution Graph technique: • Apply for equations in 2 variables • Sketch graphs and find the intersection Elimination method: • Make the leading coefficient of the first equation 1. • Eliminate the leading variable of the first equation from each later equation. • Repeat steps 1 and 2 for the second equation. • Repeat steps 1 and 2 for the third, fourth equation and so on, till the last equation. • Then solve the resulting system by back substitution. Matrix method: • Working with coefficients only • Using the same technique as Elimination method. Finite Maths
Review • Problem 85 and 89 Finite Maths
Section 6.2 The Gauss-Jordan Method Instructor: Nguyen Ngoc Trung nguyenngoctrung.dhsp@gmail.com
Example R2 = R2+(-1)*R1 R3 = R3 + (-2)*R2 R2 = 1/3 * R2 R3 = R3+2*R1 • Back substitutions: • z=2 • Subs z=2 into R2: y = -6 • Subs z=2 and y=-6 into R1: x = -14 Row echelon form Finite Maths
Example (cont) • Reduced Rows Echelon Form • Satisfy row echelon form • Each row has a leading 1 and has 0s in all other entries R1 = R1+2*R2 R1 = R1+(-10)*R3 Solution R2 = R2+(-3)*R3 Finite Maths
Example (cont) R1 = R1+(-5)*R3 R2 = (1/6)*R2 R2 = R2+(8/3)*R3 R3 = R3+(-4)*R2 R1 = R1+R2 R2 = R2+(-3)*R1 R3 = R3+(-1)*R1 Solution R3 = (3/23)*R3 Finite Maths
Example (cont) • Solve following systems: Finite Maths
Gauss-Jordan Method • Arrange the equations with the variables terms in the same order on the left of the equal sign and the constants on the right. • Write the augmented matrix of the system. • Use the row operations to transform the augmented matrix into reduced row echelon form • Stop the process in step 3 if you obtain a row whose elements are all zero except the last one. In this case, the system is inconsistent and has no solutions. Otherwise, finish Step 3 and read the solutions of the system from the final matrix. Finite Maths
Application An animal feed is to be made from corn, soybean, and cottonseed. Determine how many units of each ingredient are needed to make a feed that supplies 1800 units of fiber, 2800 units of fat, and 2200 units of protein, given the information below: Finite Maths
Application (cont) • Let x be the required number of units of corn • Let y be the required number of units of soybeans • Let z be the required number of units of cottonseed Solve it Solution:x = 30, y = 15, z = 40 Finite Maths
Section 6.3 Basic Matrix Operations Instructor: Nguyen Ngoc Trung nguyenngoctrung.dhsp@gmail.com
Example • See example 1 (textbook, page 325) • A matrix with m rows and n columns has size mn. • Example: the matrix M above has size 23. • Note: the number of rows is always given first in the size of matrices Finite Maths
Matrix • A matrix with only one row is called a row matrix or vector. • A matrix with only one column is called a column matrix or column vector. • A matrix with same number of rows as columns is called a square matrix. • When matrix is denoted by a single letter (e.g. A), the element in row i and column I is denoted: Aij M13 = 5 M22 = 20 Finite Maths
Matrix addition • Consider again Example 1. August September Total shipment for each item of furniture for August and September Taking the sum of the 2 matrices Finite Maths
Matrix addition (cont) • The sum of two mn matrices A and B is the mn matrix C in which each element is the sum of the corresponding elements of A and B • Note: only matrices that are the same size can be added. Finite Maths
Negative of a matrix Matrix A Negative of A • The negative (or additive inverse) of a matrix A is the matrix –A in which each element is the additive inverse of the corresponding element of A • Zero matrix O: all elements are zeros. • Identity property: A + O = O + A = O, A is any matrix. Finite Maths
Matrix subtraction A – B = A + (-B) • The difference of X and Y (same size) is matrix Z, in which each element is the difference of the corresponding elements of X and Y • Example: Finite Maths
Product of a scalar k and a matrix • Productof a scalar k and a matrix X is the matrix kX, each of whose elements is k times the corresponding element of X. • Example: • Exercise: • Let: • Find each of the following: a. 2A b. –3B c. 3A – 10B Finite Maths
Section 6.4 Matrix Product and Inverse Instructor: Nguyen Ngoc Trung nguyenngoctrung.dhsp@gmail.com
Example • Consider example about EZ Life Company: Number of chair sets of each model are sold for cities: • The selling price for a set of chairs: • Model A: 800$, Model B: 1000$, Model C: 1200$ • Total value for sets in New York??? • 10x800 + 7x1000 + 3x1200 = 18,600 $ • Chicago??? San Francisco??? • Just do the same!!! Chicago: 20,200 $ San Francisco: 13,600 $ Finite Maths
10x800+7x1000+3x1200 = 18,600 5x800+9x1000+6x1200 = 20,200 4x800+8x1000+2x1200 = 13,600 Example (cont) • Represent prices and total values in matrices: • Calculate total values by matrix operations: Finite Maths
Multiplying Matrices • Product of a row of a matrix and a column of another matrix (with the same number of elements) Finite Maths
Multiplying matrices (cont) Matrix multiplication: • Let A be an mxn matrix, B is an nxp matrix. • The product AB (denoted C) is the mxp matrix whose elements in the ith row and jth column is the product of the ith row of A and jth column of B Finite Maths
Multiplying matrices (cont) Note: If the number of columns in A does not equal the number of rows in B, then the matrix product AB is not defined. Finite Maths
a. b. c. Example: • Find the product of 2 matrices A and B: Task: Read Example 4, page 337 in the text book Finite Maths
Properties of multiplication matrices • Matrix multiplication is associative: A.(B.C) = (A.B).C • Matrix multiplication is distributive: A.(B+C) = A.B + A.C (B+C).A = B.A + C.A • Matrix multiplication is not commutative: AB may not equal BA Finite Maths
Identity matrices • Recall: 1 is identity element for multiplication of real numbers • Problem: Is there a identity element for multiplication of matrices??? • The identity matrix is a square matrix in which elements in its diagonal are 1’s and other elements are 0’s Finite Maths