674 9 Matrices and Determinants Cereal A 4 g/oz 2 g/oz M 20 g/oz 16 g/oz 3 g/oz 1 g/oz N Protein Carbohydrate Fat Mix X Mix Y Mix Z 155 ozoz 10 oz 10 oz 5 oz 15 oz SECTION (A) Find the amount of protein in mix X. (B) Find the amount of fat in mix Z. (C) Discuss possible interpretations of the elements in the matrix products MN and NM. (D) If either of the products MN or NM has a meaningful interpretation, find the product and label its rows and columns. Cereal B 9-2 Cereal A Cereal B Inverse of a Square Matrix • Identity Matrix for Multiplication • Inverse of a Square Matrix • Application: Cryptography In this section we introduce the identity matrix and the inverse of a square matrix. These matrix forms, along with matrix multiplication, are then used to solve some systems of equations written in matrix form in Section 9-3. • Identity Matrix for We know that for any real number a Multiplication (1)a a(1) a The number 1 is called the identity for real number multiplication. Does the set of all matrices of a given dimension have an identity element for multiplication? That is, if M is an arbitrary m n matrix, does M have an identity element I such that IM MI M? The answer in general is no. However, the set of all square matrices of order n (matrices with n rows and n columns) does have an identity. DEFINITION 1 Identity Matrix The identity matrix for multiplication for the set of all square matrices of order n is the square matrix of order n, denoted by I, with 1’s along the principal diagonal (from upper left corner to lower right corner) and 0’s elsewhere. For example, 1 0 0 1 and 1 0 0 0 1 0 0 0 1 are the identity matrices for all square matrices of order 2 and 3, respectively. 9-2 Inverse of a Square Matrix 675 Most graphing calculators have a built-in command for generating the identity matrix of a given order (see Fig. 1). FIGURE 1 Identity matrices. EXAMPLE 1 Identity Matrix Multiplication Matched Problem 1 1 (A) 0 0 0 1 0 0 0 1 a d g b e h c a f d i g b e h c f i a (B) d g b e h c f i 1 0 0 0 1 0 0 a 0 d 1 g b e h c f i b e c a f d 1 0 0 0 1 0 (C) 10 01 ad (D) a d b e c f b e c f 0 a 0 d 1 b e c f Multiply: (A) 10 01 34 5 6 (B) 5 2 6 1 0 0 0 1 0 0 0 1 7 4 8 and and 34 5 6 10 01 7 4 8 5 2 6 10 01 In general, we can show that if M is a square matrix of order n and I is the identity matrix of order n, then IM MI M If M is an m n matrix that is not square (m n), then it is still possible to multiply M on the left and on the right by an identity matrix, but not with the samesize identity matrix (see Examples 1C and 1D). In order to avoid the complications involved with associating two different identity matrices with each nonsquare matrix, we restrict our attention in this section to square matrices. 676 9 Matrices and Determinants EXPLORE-DISCUSS 1 The only real number solutions to the equation x2 1 are x 1 and x 1. (A) Show that A 01 10 satisfies A (B) Show that B 10 2 I, where I is the 2 2 identity. 1 satisfies B2 I. 0 (C) Find a 2 2 matrix with all elements nonzero whose square is the 2 2 identity matrix. • Inverse of a Square Matrix In the set of real numbers, we know that for each real number a, except 0, there exists a real number a1 such that a1a 1 The number a1 is called the inverse of the number a relative to multiplication, or the multiplicative inverse of a. For example, 21 is the multiplicative inverse of 2, since 21(2) 1. We use this idea to define the inverse of a square matrix. DEFINITION 2 Inverse of a Square Matrix If M is a square matrix of order n and if there exists a matrix M1 (read “M inverse”) such that M1M MM1 I then M1 is called the multiplicative inverse of M or, more simply, the inverse of M. The multiplicative inverse of a nonzero real number a also can be written as 1/a. This notation is not used for matrix inverses. Let’s use Definition 2 to find M1, if it exists, for M 21 32 We are looking for M1 ab dc such that MM1 M1M I 9-2 Inverse of a Square Matrix 677 Thus, we write M1 M I 21 32 ab dc 10 01 and try to find a, b, c, and d so that the product of M and M1 is the identity matrix I. Multiplying M and M1 on the left side, we obtain 3b) (2a (a 2b) (2c 3d) 1 (c 2d) 0 0 1 which is true only if 2a 3b 1 2c 3d 0 a 2b 0 c 2d 1 Solving these two systems, we find that a 2, b 1, c 3, and d 2. Thus, M1 12 3 2 as is easily checked: M M1 21 32 12 M1 I 3 1 2 0 0 2 1 1 M 3 2 21 32 Unlike nonzero real numbers, inverses do not always exist for nonzero square matrices. For example, if N 24 12 then, proceeding as before, we are led to the systems 2a b 1 2c d 0 4a 2b 0 4c 2d 1 These systems are both inconsistent and have no solution. Hence, N1 does not exist. Being able to find inverses, when they exist, leads to direct and simple solutions to many practical problems. In the next section, for example, we will show how inverses can be used to solve systems of linear equations. The method outlined above for finding the inverse, if it exists, gets very involved for matrices of order larger than 2. Now that we know what we are looking for, we can use augmented matrices as in Section 8-2 to make the process more efficient. Details are illustrated in Example 2. 678 9 Matrices and Determinants EXAMPLE 2 Finding an Inverse Find the inverse, if it exists, of 1 2 3 1 M 0 2 Solution 1 1 0 We start as before and write M1 M 1 1 2 1 3 0 1 0 2 a b c I d e f g 1 h 0 i 0 0 1 0 0 0 1 This is true only if a bc1 d ef0 g hi0 a 2b c 0 d 2e f 1 g 2h i 0 2a 3b c 0 2d 3e f 0 2g 3h i 1 Now we write augmented matrices for each of the three systems: First 1 0 2 1 2 3 1 1 0 Second 1 2 3 1 0 0 1 0 2 1 1 0 Third 0 1 0 1 0 2 1 1 2 1 3 0 0 0 1 Since each matrix to the left of the vertical bar is the same, exactly the same row operations can be used on each augmented matrix to transform it into a reduced form. We can speed up the process substantially by combining all three augmented matrices into the single augmented matrix form 1 0 2 1 2 3 1 1 0 1 0 0 0 1 0 0 0 M I 1 (1) We now try to perform row operations on matrix (1) until we obtain a row-equivalent matrix that looks like matrix (2): I 1 0 0 0 1 0 0 0 1 B a b c d e f g h I B i (2) If this can be done, then the new matrix to the right of the vertical bar is M1! Now let’s try to transform (1) into a form like (2). We follow the same sequence of steps 9-2 Inverse of a Square Matrix 679 as in the solution of linear systems by Gauss–Jordan elimination (see Section 8-2): M I 1 0 2 1 2 3 1 1 0 1 0 0 1 2 5 1 1 1 0 2 2 1 0 0 1 1 5 1 1 1 0 2 2 2 0 1 0 1 2 12 1 2 1 0 0 0 1 0 1 2 12 1 0 0 0 1 0 1 0 0 1 0 0 0 1 0 0 0 1 0 1 0 0 0 0 1 0 0 1 1 2 0 (2)R1 R3 → R3 → R2 1 2 R2 R2 R1 → R1 (5)R2 R3 → R3 1 0 2 1 2 1 2 52 0 0 1 1 0 1 4 1 2 1 2 5 0 0 2 0 3 0 2 1 4 3 2 5 2R3 → R3 (12 )R3 R1 → R1 1 2 R3 R2 → R2 1 1 I B 2 Converting back to systems of equations equivalent to our three original systems (we won’t have to do this step in practice), we have a 3 d g 1 3 b 2 e 2 h 1 c 4 f 5 i 2 And these are just the elements of M1 that we are looking for! Hence, 3 M1 2 4 3 2 5 1 1 2 Note that this is the matrix to the right of the vertical line in the last augmented matrix. Check Since the definition of matrix inverse requires that M1M I and MM1 I (3) it appears that we must compute both M1M and MM1 to check our work. However, it can be shown that if one of the equations in (3) is satisfied, then the other is also satisfied. Thus, for checking purposes it is sufficient to compute either M1M or MM1—we don’t need to do both. 680 9 Matrices and Determinants 3 M M 2 4 1 Matched Problem 2 3 Let: M 1 1 1 1 0 1 0 1 3 1 2 1 5 2 1 2 3 1 0 2 1 1 1 0 0 0 0 1 0 0 0 I 1 (A) Form the augmented matrix M I. (B) Use row operations to transform M I into I B. (C) Verify by multiplication that B M1. The procedure used in Example 2 can be used to find the inverse of any square matrix, if the inverse exists, and will also indicate when the inverse does not exist. These ideas are summarized in Theorem 1. Theorem 1 Inverse of a Square Matrix M If M I is transformed by row operations into I B, then the resulting matrix B is M1. If, however, we obtain all 0’s in one or more rows to the left of the vertical line, then M1 does not exist. EXPLORE-DISCUSS 2 EXAMPLE 3 (A) Suppose that the square matrix M has a row of all zeros. Explain why M has no inverse. (B) Suppose that the square matrix M has a column of all zeros. Explain why M has no inverse. Finding a Matrix Inverse Find M1, given: M Solution 64 1 2 64 1 2 61 14 10 2 14 1 2 1 4 3 2 1 0 0 1 1 4 0 1 0 0 1 1 4 R1 → R1 6R1 R2 → R2 2R2 → R2 9-2 Inverse of a Square Matrix 1 0 14 1 1 0 0 1 1 3 1 4 1 4 R2 0 2 3 681 R1 → R1 1 2 2 Thus, M1 Matched Problem 3 EXAMPLE 4 Find M1, given: M 21 1 3 1 2 Check by showing M1M I. 2 6 2 Finding an Inverse Find M1, if it exists, given: M Solution 10 5 2 1 1 0 510 2 1 0 1 1 5 15 1 1 0 15 0 1 10 0 0 1 1 10 1 2 0 1 We have all 0’s in the second row to the left of the vertical line. Therefore, M1 does not exist. Matched Problem 4 Find M1, if it exists, given: M 26 3 1 Most graphing utilities and computers can compute matrix inverses and can identify those matrices that do not have inverses (see Fig. 2). A matrix that does not have an inverse is often referred to as a singular matrix. FIGURE 2 Finding matrix inverses on a graphing calculator. (a) Example 3 (b) Example 4 682 9 Matrices and Determinants • Application: Cryptography Matrix inverses can be used to provide a simple and effective procedure for encoding and decoding messages. To begin, we assign the numbers 1 to 26 to the letters in the alphabet, as shown below. We also assign the number 27 to a blank to provide for space between words. (A more sophisticated code could include both uppercase and lowercase letters and punctuation symbols.) A 1 B 2 C 3 D 4 E 5 F 6 G 7 H 8 I 9 J 10 K 11 L 12 M 13 N 14 O P 15 16 Q 17 R 18 S 19 T 20 U 21 V 22 W X 23 24 Y 25 Z Blank 26 27 Thus, the message I LOVE MATH corresponds to the sequence 9 27 12 15 22 5 27 13 1 20 8 Any matrix whose elements are positive integers and whose inverse exists can be used as an encoding matrix. For example, to use the 2 2 matrix A 45 34 to encode the above message, first we divide the numbers in the sequence into groups of 2 and use these groups as the columns of a matrix with 2 rows. (Notice that we added an extra blank at the end of the message to make the columns come out even.) Then we multiply this matrix on the left by A: 45 34 279 12 15 22 5 27 13 1 20 8 117 27 153 93 120 103 130 147 187 64 85 113 148 The coded message is 117 153 93 120 103 130 147 187 64 85 113 148 This message can be decoded simply by putting it back into matrix form and multiplying on the left by the decoding matrix A1. Since A1 is easily determined if A is known, the encoding matrix A is the only key needed to decode messages encoded in this manner. Although simple in concept, codes of this type can be very difficult to crack. Answers to Matched Problems 34 1. (A) (C) 3. 1 0 1 1 1 1 1 2 1 1 1 2 7 4 8 5 2 6 (B) 1 1 0 3 1 1 1 2 3 1 1 2. (A) 5 6 1 0 0 3 1 1 0 1 0 0 0 1 1 1 0 4. Does not exist (B) 1 1 0 0 1 0 1 0 0 0 1 0 0 1 0 0 0 1 0 0 1 1 1 1 1 2 1 1 1 2 683 9-2 Inverse of a Square Matrix 9-2 EXERCISE A Perform the indicated operations in Problems 1–8. 3 8 1. 65 3. 10 01 28 5 4 2 0 2 5 3 7 10 01 4 6 5. 1 1 6. 0 0 0 1 0 0 0 1 1 7. 0 0 0 1 0 0 0 1 5 8. 1 0 1 4 1 1 0 0 0 1 0 0 0 1 8 2 4 0 1 6 3 3 1 3 4 3 2 1 4 5 6 2 0 1 0 0 1 9 1 0 0 0 0 1 2. 10 01 47 4. 72 9 2 1 23. 3 1 10 01 0 6 9. 11. 6 1 4 3 35 47 57 1 13. 0 0 1 14. 2 6 3 1 0 5 4 1 0 1 3 1 0 0 0 0 1 3 1 0 1 2 0 0 1 3 1 3 3 1 24. 2 3 1 2 2 32 96 26. 32 4 6 27. 23 35 28. 54 4 3 Find the inverse of each matrix in Problems 29–34, if it exists. 10. 12. 5 4 6 5 4 5 17 4 1 0 1 1 25. 29. 5 9 2 1 1 0 2 22. 0 1 C 6 1 1 0 2 5 1 0 1 1 Find the inverse of each matrix in Problems 25–28, if it exists. For Problems 9–14, show that the two matrices are inverses of each other by showing that their product is the identity matrix I. 1 0 1 1 1 1 21. 1 0 1 3 0 1 1 3 0 1 31. 2 0 1 2 4 2 1 1 1 2 1 1 1 1 1 1 0 0 1 33. 0 1 5 6 5 1 6 10 4 15 30. 4 1 3 2 1 1 1 1 1 1 32. 2 0 1 1 1 0 1 1 1 34. 0 1 5 1 4 10 6 3 B 32 75 35. Show that (A1)1 A for 32 43 A 0 0 1 36. Show that (AB)1 B1A1 for A 32 43 and 37. Discuss the existence of M1 for 2 2 diagonal matrices of the form B Given M in Problems 15–24, find M1, and show that M1M I. 15. 10 91 18. 23 4 3 16. 10 1 3 19. 52 7 3 M 17. 12 2 5 20. 113 41 a0 0d 38. Discuss the existence of M1 for 2 2 upper triangular matrices of the form M a0 bd 684 9 Matrices and Determinants In Problems 39–42, use a graphing utility to find the inverse of each matrix, if it exists. 1 2 39. 3 4 41. 42. 5 7 5 1 2 0 2 2 2 1 0 0 1 2 40. 1 0 2 1 0 4 1 3 3 2 0 5 2 6 99 56 154 58 29 196 115 43 121 73 99 38 1 0 B 2 0 1 3 1 1 2 4 43 20 7 149 0 1 1 0 1 1 1 1 1 1 0 0 1 0 2 1 3 1 2 1 47. Cryptography. Encode the message DWIGHT DAVID EISENHOWER with the matrix B given above. 48. Cryptography. Encode the message JOHN FITZGERALD KENNEDY with the matrix B given above. APPLICATIONS Problems 43–46 refer to the encoding matrix A 31 52 43. Cryptography. Encode the message CAT IN THE HAT with the matrix A given above. 44. Cryptography. Encode the message FOX IN SOCKS with the matrix A given above. 45. Cryptography. The following message was encoded with the matrix A given above. Decode this message. 111 43 40 15 177 68 50 29 62 22 121 43 68 27 SECTION 38 86 Problems 47–50 require the use of a graphing utility. To use the 5 5 encoding matrix B given below, form a matrix with 5 rows and as many columns as necessary to accommodate each message. 1 3 1 6 0 4 4 2 6 1 3 4 1 2 2 3 5 1 4 3 1 2 1 2 4 1 1 6 1 2 2 0 2 4 2 0 3 1 3 1 4 1 3 1 1 46. Cryptography. The following message was encoded with the matrix A given above. Decode this message. 9-3 19 116 45 86 49. Cryptography. The following message was encoded with the matrix B given above. Decode this message. 41 89 81 84 82 44 74 25 56 67 20 54 43 54 39 102 44 67 86 44 90 68 135 136 149 50. Cryptography. The following message was encoded with the matrix B given above. Decode this message. 22 87 81 15 57 53 96 149 5 47 54 58 89 45 84 46 80 51 68 116 39 113 68 135 136 Matrix Equations and Systems of Linear Equations • Matrix Equations • Matrix Equations and Systems of Linear Equations • Application The identity matrix and inverse matrix discussed in the last section can be put to immediate use in the solving of certain simple matrix equations. Being able to solve a matrix equation gives us another important method of solving a system of equations having the same number of variables as equations. If the system either has fewer variables than equations or more variables than equations, then we must return to the Gauss–Jordan method of elimination.