244 Section 2.4 Algebra of Matrices Before we can discuss Matrix Algebra, we need to have a clear idea what it means to say that two matrices are equal. Let's start a definition. Equal Matrices Two matrices A and B are said to be equal, denoted A = B, if and only if both of the following conditions apply. ) Matrices A and B must have the same number of rows and the same number of columns. and 2) Each entry in matrix A is equal to the corresponding entry in matrix B. A matrix with that has zeros for all of its entries is called the zero matrix. Objective # The Sum and Difference of Two Matrices. In order to add or subtract two matrices, both matrices must have the same number of rows and the same number of columns. Addition and Subtraction of Matrices Let A and B two m by n matrices. Then a) C = A + B is the matrix found by adding the corresponding entries of matrices A and B (i.e., each entry c ij = a ij + b ij ). b) D = A B is the matrix found by subtracting each entry in matrix B from the corresponding entry in matrix A (i.e., each entry d ij = a ij b ij ). Properties of Matrix Addition: Let A and B two m by n matrices. Then ) Commutative Property: A + B = B + A 2) Associative Property: (A + B) + C = A + (B + C) ) Identity Property of Addition: A + 0 = 0 + A = A where 0 is the zero matrix with the same number of rows and columns as matrix A. Find the following: 2 4 5 8 9 A = 4 5 B = 0 4 5 8 2 9 0 2 6 8 Ex. a A + B Ex. B A B
245 + 5 2+ 8 + 4+9 a) A + B = 4 + 5+ 0 + 4 + 5 8+ 2+ 2 9+ 6 0+ 8 2 6 0 = 5 5 6 0 5 8 ( 5) 2 8 4 9 b) A B = 4 5 0 ( 4) 5 8 2 ( 2) 9 6 0 8 8 0 4 5 = 5 4 5 4 8 Objective #2 Scalar Multiplication of a Matrix In order to multiply a matrix by a number k, we must multiply each entry of the matrix by that number k. k is called the scalar and the matrix ka is the called the scalar multiple of A. Scalar Multiplication Let A be an m by n matrix and k be any real number. Then c) C = ka is the matrix found by multiplying each entry of matrix A by k (i.e., each entry c ij = ka ij ). Properties of Scalar Multiplication: Let A and B be two m by n matrices and h & k be any real numbers. Then 4) Associative Property of Scalar Multiplication: k(ha) = (kh)a 5) Distributive Properties: (k + h)a = ka + ha and k(a + B) = ka + kb Find the following: 4 2 4 A = B = 0 5 28 2 2 Ex. 2a 4B Ex. 2b A Ex. 2c 2A B
246 4 a) 4B = 4 = 2 2 4 4 4 4 = 2 4 4 2 4 4 6 2 8 28 8 b) A = 4 2 = 0 5 28 0 4 5 2 28 = 2 0 5 4 4 2 4 c) 2A B = 2 0 5 28 2 2 2 4 2 2 2 4 = 0 2 5 2 28 2 2 2 4 28 42 2 9 = 0 0 56 6 2 6 4 28 ( 2) 42 9 40 = = 0 ( 6) 0 2 56 6 6 49 50 Objective #: Finding the product of two matrices. Multiplying two matrices AB only works when the number of columns in the first matrix A is equal to the number of rows in the second matrix B. If we let b b R = [a a 2 a n ] be a row vector of matrix A and let C = 2 be a column b n vector of matrix B, then the inner product RC is a b + a 2 b 2 + + a n b n. 2 2 5 Thus, if R = [2 4 ] & C =, then RC = [2 4 ] 5 = 2( 2) (5) + 4() () = 4.
Matrix Multiplication Let A be an m n matrix and B be an n k matrix, then the product C = AB is the m k matrix where each entry c ij is the inner product of the i th row of matrix A and the j th column of B. Important if A is an m n matrix and B is an n k matrix: i) The number of columns in the first matrix A has to be equal to the number of rows in the second matrix B. (inner numbers) ii) The product will be an m k matrix (outer numbers). Properties of Matrix Multiplication: Let A, B, and C be three matrices where each product and sum is defined. 6) Associative Property of Matrices: A(BC) = (AB)C ) Distributive Property of Matrices: A(B + C) = AB + AC (B + C)A = BA + CA Note that matrix multiplication is not commutative. Find the following: 5 8 9 4 A = B = 0 4 5 2 2 2 6 8 Ex. a AB Ex. b BA a) Since A has columns and B has rows, the multiplication is defined and the product will be 2 4 matrix. 5 8 9 4 AB = 0 4 5 2 2 2 6 8 c is the inner product of st row of A and the st column of B 5 8 9 4 0 4 5 c = ( 5) 4() + () = 2 2 2 2 6 8 c 2 is the inner product of st row of A and the 2 nd column of B 24
248 5 8 9 4 0 4 5 c 2 = (8) 4(0) + ( 2) = 2 2 2 2 6 8 c is the inner product of st row of A and the rd column of B 5 8 9 4 0 4 5 c = () 4( 4) + (6) = 2 2 2 6 8 c 4 is the inner product of st row of A and the 4 th column of B 5 8 9 4 0 4 5 c 4 = (9) 4(5) + (8) = 2 2 2 6 8 c 2 is the inner product of 2 nd row of A and the st column of B 5 8 9 4 0 4 5 c 2 = 2( 5) + () + 2() = 2 2 2 6 8 c 22 is the inner product of 2 nd row of A and the 2 nd column of B 5 8 9 4 0 4 5 c 22 = 2(8) + (0) + 2( 2) = 20 2 2 2 6 8 c 2 is the inner product of 2 nd row of A and the rd column of B 5 8 9 4 0 4 5 c 2 = 2() + ( 4) + 2(6) = 22 2 2 2 6 8 c 24 is the inner product of 2 nd row of A and the 4 th column of B 5 8 9 4 0 4 5 c 24 = 2(9) + (5) + 2(8) = 2 2 2 6 8 2 2 Thus, AB =. 20 22 b) Since B has 4 columns and A has 2 rows, the multiplication is undefined.
249 Find the following: A = 2 4 9 B = 5 8 Ex. 4a AB Ex. 4b BA a) AB = 2 4 9 4 + 2 ( 5) 9 + 2 8 = 5 8 4 ( 5) 9 8 2 4 = 55 4 9 b) BA = 2 4 + 9 4 2 + 9 ( ) = 5 8 5 + 8 5 2 + 8 ( ) 5 = 4 8 Notice in the last example, AB BA which shows that matrix multiplication is not commutative. Ex. 5 A copier manufacturer has factories in Austin, Charlotte, and Seattle. Each plant produces three different models with the daily production during March and April given in the following matrix: Copiers produced per day Model Model Model 650 690 425 Austin 0 Charlotte 5 5 2 = A Seattle 8 Due to the sharp rise in the cost of petroleum products, April's profits were lower than March's profit. The profit per copier is given in the matrix below: March April Model 650 $25 $00 Model 690 $850 $5 = B Model 425 $800 $650 a) Calculate AB b) What was the daily profit in March of the Austin factory? c) What was the total daily profit from all three factories in April?
250 0 $25 $00 a) AB = 5 5 2 $850 $5 8 $800 $650 25 + 850 + 0 800 00 + 5 + 0 650 = 5 25 + 5 850 + 2 800 5 00 + 5 5 + 2 650 25 + 8 850 + 800 00 + 8 5 + 650 $,625 $0,625 = $2,45 $25,5 $28,85 $26,450 Since the rows in matrix A are the factories and the columns in matrix B are the daily profit then the product gives us the profits per day for each factory. March April Austin $,625 $0,625 Charlotte $2,45 $25,5 Seattle $28,85 $26,450 b) The daily profit in March for the Austin factory corresponds to the first row and first column of the product. Thus, the daily profit from the Austin factory in March was $,625. c) We need to add the entries in the 2 nd column: 0,625 + 25,5 + 26,450 = $62,250. Hence, the daily profit from all three plants in April was $62,250. For an n n matrix, the entries a ii (i th row, i th column) are called the main diagonal. Thus, matrix A in the previous example had diagonal entries of, 5, and. Notice that these entries stretch from the top-left to the bottom-right of matrix. Identity Matrix The identity matrix I n is the n n matrix where every main diagonal entry is and all the other entries are 0. For instance,
25 I 2 = 0 0 0 0 0 0 I = 0 0 I 4 = 0 0 0, etc. 0 0 0 0 0 0 0 0 0 Identity Property Let A be an m n matrix and let B be an n n square matrix, then 9) I m A = A and AI n = A 0) BI n = I n B = B Find the following: 4 A = 2 2 Ex. 6a AI Ex. 6b I 2 A a) 0 0 4 4 AI = 0 0 = = A 2 2 0 0 2 2 b) I 2 A = 0 4 4 = = A 0 2 2 2 2 Objective #4: The Inverse of a Matrix. In much of the same way we talked about finding the additive or multiplicative inverse of a number, we can discuss finding the inverse of a matrix if it exists. A matrix times its inverse will give us the identity matrix. Inverse Matrix Let A be an n n square matrix. The inverse matrix A, if it exists, has the property that: AA = A A = I n The matrix A is called nonsingular if it does have an inverse matrix A. If there is no inverse matrix, then A is called singular. Verify that matrix B is the inverse matrix of A: A = 2 B = 2 5 5 6 2
252 We need to show that AB and BA are equal to I 2. AB = 2 2 5 2( 2)+ ( 5 5 6 2 = ) 2()+ ( 2 ) 5( 2)+ 6( 5 ) 5()+ 6( 2 ) = 0 0 BA = 2 2 2(2)+(5) 2()+(6) 5 2 = 5 5 6 (2) 2 (5) 5 () 2 (6) = 0 0 Thus, B is the inverse matrix of A. Suppose we were not given the inverse matrix of A so we had to find it. If A is a square matrix, then A times its inverse has to be equal to the identity matrix. Suppose we let A be represented by: r s. Thus, t u 2 5 6 r s = 0 t u 0 Multiply the two matrices together yields: 2 5 6 r s 2r + t 2s+ u = = 0 t u 5r + 6t 5s+ 6u 0 This gives us two systems of two equations we need to solve: 2r + t = 2s + u = 0 5r + 6t = 0 5s + 6u = We can write an augmented matrix for each system. 2 2 0 5 6 0 5 6 Since we will be doing the same row operations on each matrix the get the matrix in reduced row echelon form, we can combine the two matrices into one augmented matrix and perform our row operations: 2 0 2 0 R 2 = r 2 2r 5 6 0 0 2 2 0 R R 2 0 2 0 2 2 0
25 0 2 R 2 = r 2 2r 2 0 0 2 R 2 = r 2 0 5 2 0 2 0 5 2 0 2 0 5 2 Now, let's write our matrices separately: 0 2 0 5 Thus, our systems of equations are: r = 2 s = 0 0 2 t = 5 u = 2 This means A = 2 5 2. Notice that it matches what was to the right of the vertical bar in the augmented matrix once we got it into reduced row echelon form. Finding Inverse Matrix of a Nonsingular Matrix Let A be a nonsingular n n matrix. ) Form the augmented matrix [A I n ] 2) Get the matrix in step # into reduced row echelon form ) The matrix you find in part two will be in the form [I n A ]. Everything to the right of the vertical bar is the inverse matrix. In the event that you cannot get the identity matrix to the left of the vertical bar, it means that A is singular and has no inverse. Find the inverse matrix of the following if it exist: Ex. A = 2 2
Write the augmented matrix [A I ]: 0 0 2 0 0 R 2 = r 2 r 2 0 0 R = r r 0 0 0 4 0 R 2 = r 2 0 2 0 0 0 0 4 0 R = r r 2 0 2 0 R = r + 2r 2 0 2 0 0 4 0 R = r 0 0 2 0 2 0 0 4 0 0 0 Thus, A = 5 9 2 2 4 R = r + r R 2 = r 2 4r Ex. 8 B = 6 9 4 6 Write the augmented matrix [B I 2 ]: 6 9 0 R = r 6 0 2 6 4 6 0 4 6 0 0 2 6 R 2 = r 2 4r 2 6 4 6 0 0 0 2 0 0 0 4 0 0 2 0 0 0 0 4 0 0 2 0 0 2 0 0 4 0 0 0 2 0 2 0 0 4 0 0 0 2 0 0 5 9 0 0 4 0 0 2 0 254
Since we are not going to be able to get the identity matrix on the left side of the vertical bar, then matrix B is singular and has no inverse. Theorem A matrix A is singular if and only if the determinant of A is 0. If we calculate the determinant of B in the last example, we get: 6 9 = 6(6) 4(9) = 6 6 = 0 4 6 255 Objective #5: Solving a system of linear equations using an inverse matrix. Using an inverse matrix to solve a system of linear equations is extremely useful if you are essentially solving the same system over and over again, but with different constant terms on the right side. Solve the following: Ex. 9 x + y + z = x + 2y z = 9 x + y + 2z = x Let A = 2 X = y B = 9 2 z Then we can write the original system as a matrix equation: AX = B (multiply both sides by A ) A (AX) = A B (regroup Associative Property) (A A)X = A B (apply the definition of the inverse) I X = A B (apply identity property) X = A B From example, we calculated A, so x 5 X = y = A B = 9 z 2 So, the solution is (, 2, 2). 4 9 = 2 2