Overview Yesterday: systems of equations and rowreduction. 1 2 1 x 12 For example, the system 4 3 −11 y = 13 5 −1 −28 z −17 has the same solutions as the reduced system −2 x 1 0 −5 3 y = 7. 0 1 0 z 0 0 0 Math 311-102 Harold P. Boas boas@tamu.edu Today: matrix algebra (sums, products, inverses). For example, find a matrix M such thatthe matrix product 1 2 1 1 0 −5 M 4 3 −11 = 0 1 3. 5 −1 −28 0 0 0 Math 311-102 June 2, 2005: slide #1 Math 311-102 Componentwise operations Matrix multiplication Sums and differences of matrices are computed componentwise. Example. à 10 30 20 40 ! − à 1 3 2 4 ! = à 9 27 The product of a matrix with a column vector is a new vector obtained by with the rows of the matrix: taking dot products 1 2 3 1 321 4 5 6 10 = 654. 987 7 8 9 100 ! 18 . 36 The product of a matrix with another matrix is computed similarly by letting act oneachcolumn of the the firstmatrix 1 0 2 201 1005 1 5 second matrix: 0 3 4 10 50 = 430 2150. 5 6 0 65 325 100 500 Multiplication of a matrix by a scalar is computed componentwise. Example. 10 à 1 3 2 4 ! = à 10 30 ! 20 . 40 The product of matrices makes sense only if the rows of the first matrix have the same number of entries as the columns of the second matrix. The product of a matrix with a matrix, however, is not computed componentwise. Math 311-102 June 2, 2005: slide #2 June 2, 2005: slide #3 Math 311-102 June 2, 2005: slide #4 Multiplication is not commutative! Example. à !à 1 0 1 0 −1 0 à !à 1 1 1 0 0 −1 1 0 ! 0 0 ! = à 1 −1 = à 0 0 Identity and inverses 1 0 0 For 3 × 3 matrices, the identity matrix I = 0 1 0 has the 0 0 1 property that I A = A and AI = A for every 3 × 3 matrix A (and similarly for square matrices of other sizes). ! 1 , but −1 ! 0 . 0 Two matrices A and B are inverses if AB = I and BA = I. The order of multiplication matters: AB 6= BA. For 2 × 2 matrices, there is a simple rule for the inverse of a matrix: à !−1 à ! 1 a b d −b = . ad − bc −c c d a On the other hand, matrix multiplication is associative: A(BC) = (AB)C. Notice in the above example that the product of two non-zero matrices can be the zero matrix. In particular, only certain matrices have multiplicative inverses. Math 311-102 June 2, 2005: slide #5 Computing inverses in general Method: write the matrix next to an identity matrix and do row operations on both matrices simultaneously. When the initial matrix has been turned into the identity matrix, the identity matrix will have been turned into the inverse matrix. Example: ¯ 1 0 −1 ¯¯ 1 0 0 ¯ row reduce → 0 ¯ 0 1 0 2 1 ¯ ¯ 0 0 1 −2 0 1 ¯ ¯ 1 0 0 1 0 0 ¯¯ −1 0 −1 1 0 −1 ¯¯ ¯ ¯ 2 2 ¯−2 1 0 → 0 1 0 ¯ 2 1 0 1 ¯ ¯ ¯ ¯ −2 0 −1 2 0 1 0 0 1 0 0 −1 −1 1 0 −1 −1 0 −1 Conclusion: 2 1 0 = 2 1 2. −2 0 1 −2 0 −1 Math 311-102 June 2, 2005: slide #7 This inverse exists if and only if the determinant (ad − bc) 6= 0. Math 311-102 June 2, 2005: slide #6