Chapter 5: Matrices Section 5.1-5.3 5.1 Introduction to Matrices A array of numbers. , A, also denoted by (aij )m×n or simply (aij ), is a rectangular of A is denoted by m × n where m is the number of rows and The n is the number of columns. The in the ith row and jth column is denoted by aij . Example 1 Determine the order of the following matrices. 1 4 2 a) A = 4 3 6 3 π −1 2 1 0 9 0 b) B = 23 0 3 1 1 1 − 6 −2 For the above matrices, what are a23 and b32 ? A matrix of order 1 × n (1 row and n columns) is called a matrix of dimension n. matrix or a row Example 2 The matrix −3 0 2 5 is a row matrix of dimension 4. A matrix of order m × 1 (m rows and 1 column) is called a or a column matrix of dimension m. 1 matrix Example 3 The matrix 4 1 0 is a column matrix of dimension 3. matrix if the number of rows is equal to the A matrix is called a number of columns. Example 4 The matrix −1 3 0 2 is a square matrix of order 2 × 2. Matrix Operations: 1. : If c is a number and A is a matrix, then the matrix cA is the matrix obtained by multiplying every entry in A by c. 2. : Two matrices of the same order can be added (or subtracted) to obtain another matrix of the same order by adding (or subtracting) corresponding entries. 3. : If A is an m × n matrix with elements aij then the transpose of A is the n × m matrix AT with elements aji . 2 Example 5 Consider the matrices 2 1 1 −2 A = −3 0 and B = 5 −3 1 4 −2 6 a) Compute 3A b) Compute A + B c) Compute 3A − 2B d) Compute B T 3 The matrix of order m × n is the matrix O with m rows and n columns all of whose entries are zero. 0 0 0 Example 6 The zero matrix of order 2 × 3 is O = . 0 0 0 Properties of Matrix Operations: If A, B, and C are all matrices of order m × n and O is the zero matrix of order m × n, then (1) A + O = O + A = A (2) A − A = O (3) A + B = B + A (commutative property) (4) A + (B + C) = (A + B) + C (associative property) Two matrices are entries are equal. if they have the same order and all corresponding Example 7 Find a, b, c, and d so that the following is true: 2 a+3 4 2 6 −1 6 3 d = 9 7b − 1 c −8 4 Matrices are often used to organize and work with data, not solely for solving systems of equations. Example 8 (Tan) The following table gives the number of shares of certain corporations held by Olivia and Max in their stock portfolios at the beginning of September and at the beginning of October: September IBM Google Boeing Olivia 800 500 1200 Max 500 600 2000 IBM Olivia 900 Max 700 GM 1500 800 October Google Boeing 600 1000 500 2100 GM 1200 900 a) Write matrices A and B giving the stock portfolios of Olivia and Max at the beginning of September and the beginning of October, respectively. b) Find a matrix C reflecting the change in the stock portfolios of Olivia and Max between the beginning of September and the beginning of October. c) Find a matrix D that gives the average number of each stock portfolio for Olivia and tha average number of each stock portfolio for Max over these two months. 5 5.2 Matrix Multiplication Multiplying a row by a column matrix: If A = a1 a2 ... an is a row matrix b1 b2 matrix and B = .. is a column matrix of the same length, then . bn −2 Example 9 Multiply 2 3 −1 × 4 0 Multiplying two matrices: Given two matrices A = (aij )m×p and B = (bij )q×n , the product AB = C = (cij ) is defined if p = q, that is, if the number of columns of A equals the number of rows of B. matrix. The resulting matrix, AB, is an 6 Example 10 Determine the order of the following matrices. a) A has order 3 × 2 and B has order 2 × 2, then AB has order . b) A has order 2 × 2 and B has order 3 × 2, then AB has order . c) A has order 5 × 4 and B has order 4 × 3, then AB has order . The element in the ith row and jth column, cij , of the product matrix C = AB is obtained by multiplying the ith row of A and the jth column of B. 2 1 −1 3 −2 4 7 2 3 −4 −1 0 Example 11 Let A = Example 12 Let A = −3 2 and let B = 1 −4 . What is AB? 5 −1 and let B = 7 −3 0 3 . What is AB? 7 −4 1 Example 13 Let A = 1 2 3 4 and let B = a b . c d a) Find AB. b) Find BA. Note: In general, AB does NOT equal BA. So matrix multiplication is not commutative. Properties of Matrix Multiplication: For any matrices, A, B, and C, (1) A(BC) = (AB)C (Associative Property) (2) A(B + C) = AB + AC (Distributive Property) whenever the indicated properties are defined. We need to know how to multiply matrices by hand, but you can also use the calculator when all the entries are numbers. Matrix multiplication can also be used in word problems. When multiplying matrices where the matrices have meaning, you need to keep two things in mind: 1. Size: Make sure the sizes of the matrices allow you to multiply them. 2. Meaning: Label your matrices, and then make sure the labels on the columns of the first matrix match the labels on the rows of the second matrix. Otherwise the multiplication does not make sense. 8 Example 14 My cheesecake company sells three types of cheesecake: • Regular cheesecakes sell for $15 each • Special cheesecakes sell for $25 each • Super-special cheesecakes sell for $40 each Further, our daily sales are as follows: Regular Special Super-Special Mon 13 8 6 Tues 9 7 4 What was our revenue for each day? 9 Wed 7 4 0 Thur 5 6 3 Example 15 (Tan) A university admissions committee anticipates an enrollment of 8000 students next year. To satisfy admission quotas, incoming students have been categorized according to their gender and place of residence. The number of students in each category is given in the table In-state Out-of-state Foreign Male 2700 800 500 Female 3000 700 300 By using data accumulated in previous years, the admissions committee has determined that these students will elect to enter the College of Letters and Science, the College of Fine Arts, the School of Business Administration, and the School of Engineering according to the percentages that appear in the following table: Male Female L&S 0.25 0.30 Fine Arts 0.20 0.35 Bus. Adm. 0.30 0.25 Eng. 0.25 0.10 Find the matrix AB that shows the number of in-state, out-of-state, and foreign students expected to enter each discipline. 10 5.3 Inverse of a Square Matrix The n × n matrix, In , is the square matrix of order n × n with ones down the main diagonal and zeros elsewhere. Example 16 The following are some identity matrices: 1 1 0 0 0 1 0 I2 = , I3 = 0 1 0 , I4 = 0 0 1 0 0 1 0 Example 17 Let A = 0 1 0 0 0 0 1 0 0 0 0 1 3 4 . Find I2 A. 2 9 Multiplication Property of the Identity Matrix: If A is a square matrix of order n × n, then of the n × n matrix A if The n × n matrix B is said to be the If the inverse matrix B exists, we write . Example 18 Verify that the following matrices are inverses. A= 2 1 ,B= −1 3 3 7 1 7 − 17 2 7 11 Note: We NEVER divide matrices. Not all matrices have inverses. Square matrices that have inverses are said to be Square matrices that do NOT have inverses are said to be . . If a matrix is not square, it CANNOT have an inverse. If a matrix is square, it may or may not have an inverse. For this class, we will find matrix inverses on the calculator. Just call up the matrix and then press x−1 . Example 19 Find the inverse of each of the following matrices if it exists. 1 1 1 a) A = 1 −1 1 1 −2 −1 1 2 3 b) B = 2 4 6 3 6 2 Example 20 Solve the following matrix equations for X. (Assume all matrix operations are defined.) a) AX = B 12 b) CX + D = F X + G c) 3X − K = N − XA Example 21 Let A = 2 1 3 5 and X = x . y 1. Find AX. 2. If B = −2 , what must be true if AX = B? −4 13 We can also use inverse matrices to solve systems of equations. Our first step is to rewrite the system of equations as a matrix equation: AX = B where A is the coefficient matrix, X is the variable matrix, and B is the constant matrix. We can then solve the matrix equation by multiplying (on the left) by the inverse of the coefficient matrix, if it exists. If the inverse exists, this will give the unique solution. If the inverse does not exist, there are either infinitely many solutions or no solutions. Example 22 Given is a system of equations: x + y + 2z + w 4x + 5y + 9z + w 3x + 4y + 7z + w 2x + 3y + 4z + 2w =3 =6 =5 =7 a) Write a matrix equation that is equivalent to the system of linear equations. b) Solve the system of equations using matrix inverses. In practice, it is usually easier to solve a system of equations using rref because a matrix does not always have an inverse. 14