Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Chapter 1: Matrices Introduction Matrices and the operations associated with matrices play an important role in the social and biological sciences as well as in mathematics and the physical sciences because, among other things, they provide a simple way of organizing and manipulating data. Moreover, matrix operations can be (and are) programmed easily on a computer and so one has a means of handling large amounts of data. In this chapter a matrix and the various operations on matrices will be defined, and ways of solving systems of equations using matrix methods will be demonstrated. In addition, several examples illustrating applications of matrices to a wide variety of “real world” problems will be looked at. Later on in the course these techniques will be used in other topics. In particular, matrix methods are crucial in using the simplex method for solving linear programming problems (Chapter 3) and in working with Markov Chains (Chapter 6). 1.1 Definition and Operations Definition: Matrix A matrix is a rectangular array of real numbers. To see what that really means, consider the following examples: ⎛ A = ⎝ 2 4.2 –5/6 20 0 4 ⎞ ⎠ ⎛ 03 B = ⎜ –3 ⎝ 2 4/3 5 1 0 ⎞ ⎟ ⎠ 2 Chapter 1: Matrices C = (π 3 –2.6) D= ⎛ 80 ⎞ ⎜ ⎟ ⎜ –12 ⎟ ⎝ 4 ⎠ In each case, numbers have been arranged in a box–like fashion, in rows and columns and parentheses have been put around the array. A matrix can have any number of rows or columns, but in an individual matrix it’s necessary to have the same number of entries in each row (or it could also be said that every column has to have the same number of entries). The size of the matrix is described by stating how many rows it has and how many columns. For example, A has 2 rows and 3 columns so the size of A is said to be 2 × 3. (It’s important to note that the number of rows is always stated first.) So B is 4 × 2, C is 1 × 3 and D is 5 × 1. (Capital letters will usually be used to denote a matrix.) Often it’s useful to be able to specify a particular entry within a given matrix. This can be done if the row and column in which the entry appears is known. So if A is the matrix then aij is the entry in the ith row and the jth column, where the lower case letter “a” indicates an entry from A and the subscripts ij are used to specify the row and column of the entry. The first subscript always labels the row in which the entry appears and the second subscript always labels the column in which the entry appears. In the examples above, a12 = 4.2, a22 = 0, b32 = 1, and c13 = –2.6. Thus, a general n × m matrix A has the form: ⎛ aa ⎜ A= ⎜ ...... ⎝ a 11 a12 a13 ... a1m 21 a22 a23 ... a2m n1 ... ... an2 an3 ... anm ⎞ ⎟ ⎟ ⎠ A is often written as A = (aij) instead of writing A in the expanded form above. Note that there’s a big difference between aij and (aij). (aij) is the matrix and aij is just a particular component of (aij). A few special terms apply to certain kinds of matrices. Definition: Vector If a matrix has exactly one row, then it is called a row vector. If a matrix has exactly one column, it is called a column vector. In the examples given above, C is a row vector having size 1 × 3 and D is a column Section 1.1: Definition and Operations 3 vector having size 5 × 1. Definition: Square matrix A matrix is said to be square if it has the same number of rows as columns. Note that none of the matrices at the beginning of the chapter are square, but all of the following are square. ⎛ 2 –1 ⎞ ⎝ 0 0 ⎠ 2×2 ⎛ 30 ⎜ 2 ⎝ –1 –2 1 0 4 3 –6 1 1 3 1 –1 1 ⎞ ⎟ ⎠ 4×4 (3) ⎛ 2 0 –1 ⎞ ⎜ 1 0 0 ⎟ ⎝ 3 0 –5 ⎠ 1×1 3×3 Before this initial discussion of matrices is concluded it’s necessary to define what is meant when two matrices are said to be equal. Definition: Equality of matrices Two matrices, A and B, are said to be equal (written A = B) if: 1. A and B are the same size. 2. Corresponding entries are equal, i.e. aij = bij for every i and j. So, in the matrices that follow, A = B but A ≠ C and A ≠ D. Why? ⎛ 3 –4/2 ⎞ A = ⎜ 1 0 ⎟ ⎝ 4 2 ⎠ ⎛ 3 –2 ⎞ B = ⎜ –6/–6 0 ⎟ ⎝ 4 2 ⎠ ⎛ 3 1 4 ⎞ C = ⎝ –2 0 2 ⎠ ⎛ 3 –2 ⎞ D = ⎜ 0 1 ⎟ ⎝ 4 2 ⎠ Now that several of the basic definitions have been stated, let’s take a look at how these ideas can be used. In fact, you’ve most likely already seen and used tables of numbers arranged as matrices without recognizing them by their formal mathematical name. For instance, a chain of stores may wish to inventory the materials it has on hand. Depending on the number of stores in the chain and the number of different materials it wants to keep records of, the volume of data could be quite large and unwieldy so let’s look at a simplified situation. Example 1.1. Suppose Marx Brothers Costume Shop has outlets in Raleigh, Durham, Chapel Hill and Winston–Salem and wants to inventory the number of witch costumes, Dracula costumes, and devil costumes in each of the stores to see what’s 4 Chapter 1: Matrices available for Halloween. The matrix below summarizes the data in a very neat fashion. witch Dracula devil Raleigh Durham Chapel Hill Winston–Salem ⎛ 25 ⎜ 30 ⎜ 20 ⎝ 22 16 14 10 18 18 21 15 17 ⎞ ⎟ ⎟ ⎠ Example 1.2. Suppose you decide to do a little price comparison before you go grocery shopping. If you wanted to get eggs, bread, hamburger and beer, you might decide to check prices at Harris Teeter, Food Lion, Winn Dixie and the A&P before you go. The prices for each item at each of the different stores could be listed in tabular form in a matrix of the following type. eggs bread beer hamburger (1 doz.) (1 loaf) (1 case) (1 lb.) Harris Teeter Food Lion Winn–Dixie A&P ⎛ .79 ⎜ .73 ⎜ .75 ⎝ .75 .95 .89 .99 1.09 10.99 10.49 9.98 11.49 1.79 1.69 1.39 1.29 ⎞ ⎟ ⎟ ⎠ While arranging of numbers in these arrays can obviously be very useful in organizing data, you’re going to see that after some basic operations and procedures on matrices are defined you’ll have some extremely powerful tools. The rest of this chapter concentrates on those operations and procedures. Operations on Matrices Just as with real numbers, some of the standard operations, such as adding, subtracting, multiplying and dividing, can be performed on matrices. But it’s necessary to be careful because these operations are defined only under certain circumstances. Let’s look at the problem of adding two matrices together. Consider the following matrices. Which pairs does it make sense to consider adding together and how would you do it? ⎛ 3 2 –4 ⎞ A = ⎝ 1 6 1 ⎠ ⎛ 2 4 ⎞ B = ⎝ –3 5 ⎠ ⎛ –1 6 ⎞ C = ⎝ 0 2 ⎠ ⎛ –3 2 ⎞ D = ⎜ 6 0 ⎟ ⎝ 4 1 ⎠ If you think about it, you’ll probably quickly conclude that addition makes sense and can be done easily if the two matrices are the same size. (Remember, that means the two matrices have the same number of rows and the same number of columns.) In that case, the two matrices are added by adding corresponding entries or components (sometimes referred to as adding componentwise). Section 1.1: Definition and Operations 5 Definition: Addition of matrices If A = (aij) is an n x m matrix and B = (bij) is an n x m matrix, then A + B = (aij + bij), when i = 1, 2, . . . , n and j = 1, 2, . . . , m ⎛ 2 0 3 ⎞ ⎛ –3 1 3 ⎞ ⎜ ⎟ Example 1.3. Suppose that A = 3 1 0 and B = ⎜ 0 2 0 ⎟ ⎝ –1 4 2 ⎠ ⎝ 5 –6 –2 ⎠ Then ⎛ –1 1 6 ⎞ A + B = ⎜ 3 3 0 ⎟ ⎝ 4 –2 0 ⎠ ⎛ 0 –2 3 ⎞ ⎛ 1 2 –4 ⎞ ⎛ 1 0 –1 ⎞ Example 1.4. If A = ⎝ 4 0 2 ⎠ and B = ⎝ 6 –5 3 ⎠ then A + B = ⎝ 10 –5 5 ⎠ ⎛ 2 1 ⎞ ⎛ 0 2 –3 ⎞ Example 1.5. If A = ⎜ –2 3 ⎟ and B = ⎝ 1 –1 4 ⎠ then A + B is not defined. ⎝ 0 1 ⎠ Subtraction is very similar to addition. Two matrices of the same size can be subtracted by simply subtracting the entries in the corresponding locations in the two matrices. Another operation that’s useful is multiplying a matrix by a number. Definition: A number times a matrix If k is any real number and A = (aij) is a matrix then kA = (kaij).1 1Multiplication of a matrix by a constant is defined in this way so that operations like A + A = 2A and C + C + C = 3C make sense. i.e. A + A = (aij) + (aij) = (aij + aij) = (2aij) = 2(aij) = 2A. 6 Chapter 1: Matrices ⎛ 4 –2 ⎞ Example 1.6. Let A = ⎜ 1 0 ⎟ . ⎝ 3 2 ⎠ Example 1.7. ⎛ 16 –8 ⎞ Then 4A = ⎜ 4 0 ⎟ . ⎝ 12 8 ⎠ ⎛ 3 –2 1 0 ⎞ Let B = ⎜ 0 4 3 –6 ⎟ . ⎝ 2 1 1 4 ⎠ Then 3 2 ⎛ 9/2 –3 3/2 0 ⎞ B = ⎜ 0 6 9/2 –9 ⎟ . ⎝ 3 3/2 3/2 6 ⎠ Example 1.8: With A as in Example 1.6, ⎛ –6 4 ⎞ ⎛ 16 –8 ⎞ ⎛ –12 8 ⎞ ⎛ 28 –16 ⎞ ⎜ ⎟ ⎜ ⎟ ⎜ ⎟ 0 3 4 0 0 6 if C = then 4A – 2C = – = ⎜ 4 –6 ⎟ ⎝ 5 –4 ⎠ ⎝ 12 8 ⎠ ⎝ 10 –8 ⎠ ⎝ 2 16 ⎠ Example 1.9. In Example 1.1, suppose the inventory of all the stores needed to be increased by 20%. To find the number of costumes the stores would then have, you must compute ⎛ 25 30 1.2 × ⎜ 20 ⎝ 22 16 14 10 18 18 21 15 17 ⎞ ⎟ ⎠ = ⎛ 30 ⎜ 36 24 ⎝ 26.4 19.2 21.6 16.8 25.2 12 18 21.6 20.4 ⎞ ⎟ ⎠ Of course, whoever is making the decisions here will have to figure out how to deal with fractions of a costume. Relative to this definition the question could very well be asked “What happens if k = 0?” If k = 0 in the definition, then 0A = (0aij) = (0) which is a matrix whose components are all zero. How does this matrix behave? In working with real numbers you know that 0 × a = 0. Zero is the “additive identity” for the real numbers, in other words 0+a=a+0=a Does this matrix whose components are all zero act in the same way? In other words, if 0 is a matrix whose components are all zero, is it true that 0 + A = A + 0 = A? Section 1.1: Definition and Operations 7 It’s clear that this statement is true if the zero matrix is the right size so that it can be added to A. But that means that there are an infinite number of possible matrices that could be “additive identities” for matrices in general because there are an infinite number of possible sizes of matrices. That’s all right as long as you recognize the situation and realize you have to choose the “additive identity” or “zero matrix”, as it is usually called, to fit the specific problem you’re working on. The formal definition of the zero matrix is: Definition: Zero matrix The n x m zero matrix is a matrix with n rows and m columns, all of whose entries are zero, and it is denoted by 0. Example 1.10. All these are zero matrices: ⎛ 0 0 ⎞ ⎜ 0 0 ⎟ ⎝ 0 0 ⎠ ⎛ 0 0 0 ⎞ ⎜ 0 0 0 ⎟ ⎝ 0 0 0 ⎠ 3×2 3×3 (0) 1×1 ⎛ 0 ⎜ 0 ⎜ 0 ⎝ 0 0 0 0 0 0 0 0 0 0 0 0 0 4×5 0 0 0 0 ⎞ ⎟ ⎟ ⎠ ⎛ 1 2 ⎞ Thus, if A = ⎜ –3 4 ⎟ and you want to write A + 0, then 0 in this context is the ⎝ 0 5 ⎠ ⎛ 0 0 ⎞ 3 × 2 zero matrix, i.e. 0 = ⎜ 0 0 ⎟ . ⎝ 0 0 ⎠ Problems In Exercises 1-3, let 2 ⎛ 0 ⎛ 0 –3 ⎞ ⎛ –2 4 5 ⎞ 5 –2 0 ⎞ ⎛ ⎜ ⎟ A = ⎜ 6 0 7 ⎟ , B = ⎝ 0 3 4 ⎠ , C = 2 1 , and D = ⎜ 1 ⎝ 0 –1 ⎠ ⎝ 3 2 0 ⎠ ⎝ 5 ⎞ ⎟ ⎠ 1. Find the size of each matrix. 2. Find a31, b23, c13, d41, if possible. If not possible, explain why not. 8 3. Chapter 1: Matrices Find 2A, –3/4 C, –6D. In exercises 4-8, do the computations, if possible, where ⎛ 2 1 4 ⎞ ⎛ 1 –1 3 ⎞ ⎛ –1 2 0 ⎞ ⎛ 2 –4 0 ⎞ A = ⎝ –1 3 2 ⎠ , B = ⎝ 2 –3 0 ⎠ , C = ⎝ 3 0 –2 ⎠ , and D = ⎝ –6 0 4 ⎠ If the computations can not be done, explain why not. 4. A+B 5. 2A – 3B 6. 6C + D 7. –3C + B 8. 2D – 4C In exercises 9-11, find x, y, z, and u if possible. If not possible, explain why not. 9. ⎛ x y ⎞ ⎛ 0 x ⎞ ⎛ 3 2y ⎞ ⎜ ⎟ ⎜ ⎟ ⎜ ⎟ ⎝ –1 z ⎠ + 2 ⎝ –1 y ⎠ = ⎝ –x 8 ⎠ ⎛ y 4 ⎞ ⎛ 1 4 ⎞ ⎛ –1 –x ⎞ ⎜ ⎟ ⎜ ⎟ ⎜ ⎟ 10. 3 ⎜ 0 2z ⎟ = 4 ⎜ u z ⎟ – 2 ⎜ –2 –3 ⎟ ⎝ x 2 ⎠ ⎝ 2 2 ⎠ ⎝ 7 u ⎠ ⎛ z –12 x ⎞ ⎛ –2 2u –6 ⎞ ⎛ x –1 2 ⎞ ⎛ 3 –6 x ⎞ 11. 2 ⎜⎝ 3 y z ⎟⎠ – ⎜⎝ x 2y 1 ⎟⎠ = 3 ⎜⎝ y 0 –1 ⎟⎠ + 4 ⎜⎝ x 0 u ⎟⎠ 12. A women’s clothing store has stores, one in Cameron Village and one in Crabtree Valley Mall. The buyer has ordered a women’s suit in 3 colors, navy, gray and beige and 5 sizes, 6, 8, 10, 12, and 14. The Cameron Village store receives two navy suits and one gray suit in size 6, three navy, two gray and two beige suits in size 8, four navy, three gray and two beige suits in size 10, three navy, three gray and two beige suits in size 12 and two navy, one gray and one beige suit in size 14. The Crabtree store receives one suit of each color in size 6, two navy, one gray and one beige suit in size 8, three navy, two gray and one beige suit in size 10 and three navy, two gray and one beige suit in size 12 and one navy and one gray suit in size 14. (a) Write matrices that summarize the data on the size and color of the suits received by each of the stores. (b) Use matrix operations to determine a matrix that has as entries the number of each color and size of suit that was ordered by the buyer. (c) Before their midseason sale, both the Cameron Village and the Crabtree store inventory their remaining stock. The number and types of unsold suits at the Cameron Village store are summarized in the matrix Section 1.1: Definition and Operations Navy Gray Beige ⎛ ⎜ ⎜ ⎝ 6 8 10 12 1 0 2 1 0 0 1 1 0 1 1 1 9 14 0 0 1 ⎞ ⎟ ⎟ ⎠ and the number and types of unsold suits at the Crabtree store are summarized in the matrix Navy Gray Beige ⎛ ⎜ ⎜ ⎝ 6 8 10 12 0 1 2 1 1 0 0 1 0 0 1 1 14 1 0 0 ⎞ ⎟ ⎟ ⎠ Write a matrix that summarizes the total number of each size and color of suit that the two stores will have to put on sale. How many suits of each size and color were sold by the two stores? 13. The Pulverizer Gravel Company produces at its Duraleigh Road quarry 15 tons of pea rock gravel, 40 tons of crusher run gravel and 10 tons of washed coarse gravel per hour. At its Highway 1S quarry, it produces 18 tons of pea rock, 50 tons of crusher run and 14 tons of washed coarse gravel per hour. (a) Write a matrix that summarizes the above data, labeling rows and columns. (b) If both quarries operate 8 hours a day, use matrix operations to find a matrix that gives the amount of each type of gravel produced at each quarry per day. 14. If a23 = 5, a12 = 0, a21 = –1, a22 = 4, a11 = 3, a13 = –5, write A. 15. Suppose A = (aij), i = 1, 2, 3, 4, j = 1, 2, 3, and aij = i × j – j. Write A. 16. (a) Show that A + B = B + A if ⎛ 2 3 –1 ⎞ ⎛ –3 0 5 ⎞ A = ⎜⎝ 0 1 4 ⎟⎠ and B = ⎜⎝ 6 –4 0 ⎟⎠ (b) Show that (A + B) + C = A + (B + C ) if ⎛ –2 3 ⎞ ⎛ 5 6 ⎞ ⎛ 4 1 ⎞ A = ⎜⎝ 4 –1 ⎟⎠ B = ⎜⎝ –3 2 ⎟⎠ and C = ⎜⎝ –2 3 ⎟⎠ (c) Can the results in (a) and (b) be generalized? How and why? 10 Chapter 1: Matrices 1.2 Multiplication of Matrices So far you’ve seen several operations that can be performed on matrices. You’ve looked at how matrices can be added (or subtracted), how to multiply a matrix by a constant and how to deal with a combination of the two operations. Multiplication of matrices is also very useful. What conditions do you think are needed in order to multiply two matrices? If those conditions are satisfied, how would you go about doing the multiplication? If you answered that the two matrices need to be the same size and the multiplication would be done componentwise, you would have made a very reasonable guess. However, a different form of matrix multiplication turns out to be much more useful, not just in mathematics and the sciences but also in a lot of other areas. In fact, the method that’s used to multiply matrices probably will look a little strange to you, so let’s take a look at an example to see at least one reason why matrix multiplication is defined the way it is. Example 1.11. Let D be the matrix discussed in Example 1.2 of the previous section and let’s assume that when you go shopping you want to buy 2 dozen eggs, 3 loaves of bread, 1 case of beer and 4 lbs of hamburger. If you wanted to compute your grocery bill at each of the four stores to see which is the cheapest store at which to shop, you would, for each store, perform the following multiplication procedure: price of eggs/doz. × 2 doz. eggs + price of bread/loaf × 3 loaves of bread + price of beer/case × 1 case of beer + price of hamburger/lb × 4 lbs. of hamburger. and then you would compare the answers, getting a cost for the items as $22.58 $21.38 $20.01 $21.42 at Harris Teeter at Food Lion at Winn–Dixie at A&P However, exactly the same procedure can be done in the context of matrix multiplication. First create a matrix B which has as its components the amounts of each item to be purchased. B is set up as a 4 × 1 column vector. Then, in finding the cost of the items at Harris Teeter, the cost can be thought of as the product of the row vector (.79 .95 10.99 1.79) with the column vector B where the product of a row vector and a column vector is defined in the following way: Section 1.2: Multiplication of Matrices Definition: 11 Multiplication of a row vector times a column vector If A = (a11, a12, . . . , a1m) is a 1 × m row vector and ⎛ bb ⎜ ⎜ .. ⎝ b 11 21 B= m1 ⎞ ⎟ ⎟ is an m × 1 column vector, ⎠ then the product of A and B is the 1 × 1 matrix whose single entry is computed as follows: a11b11 + a12b21 + . . . + a1mbm1 Example 1.11 (continued). If this definition is used on the following matrices where A gives the price of each item and B gives the quantity being purchased, then you can see that the cost of the items at Harris Teeter is computed in exactly the same way as it was without the use of matrices. eggs bread beer hamburger A = (.79 .95 10.99 1.79), and eggs bread B= beer hamburger ⎛ 23 ⎞ ⎜ 1 ⎟ ⎝ 4 ⎠ Now remember the matrix D which gave the price data from all four stores: eggs bread beer hamburger (1 doz.) (1 loaf) (1 case) (1 lb.) D = Harris Teeter Food Lion Winn–Dixie A&P ⎛ .79 ⎜ .73 ⎜ .75 ⎝ .75 .95 .89 .99 1.09 10.99 10.49 9.98 11.49 1.79 1.69 1.39 1.29 ⎞ ⎟ ⎟ ⎠ To determine the comparative costs at all 4 stores each row of D could be multiplied by B in turn and the results arranged as a 4 × 1 matrix C, where c11 = cost at 12 Chapter 1: Matrices Harris Teeter, c21 = cost at Food Lion, c31= cost at Winn–Dixie, and c41 = cost at A&P, i.e. Harris Teeter Food Lion C = Winn–Dixie A&P ⎛ 22.58 ⎞ ⎜ 21.38 ⎟ ⎜ 20.01 ⎟ ⎝ 21.42 ⎠ Now suppose three different people, say Ann, Bob and Casey, went shopping and Ann wanted to buy the amounts given above but Bob wanted 1 dozen eggs, 2 loaves of bread, 1 case of beer, and 2 lbs of hamburger and Casey wanted 1 dozen eggs, 3 loaves of bread, 2 cases of beer and 3 lbs of hamburger. Their respective grocery bills at each of the stores could be computed by finding the product of D and E where Ann dozen eggs loaves of bread E = cases of beer lbs. of hamburger ⎛ 2 ⎜ 3 ⎜ 1 ⎝ 4 Bob Casey 1 2 1 2 1 3 2 3 ⎞ ⎟ ⎟ ⎠ DE is obtained by multiplying each row of D by the first column of E, to get the numbers in the first column of the new matrix. Then multiplying each row of D by the second column of E gives the second column of the new matrix and finally multiplying each row of D by the third column of E gives the third column of the new matrix. Thus Harris Teeter Food Lion DE = Winn–Dixie A&P Ann Bob ⎛ 22.58 ⎜ 21.38 ⎜ 20.01 ⎝ 21.42 17.26 16.38 15.49 17.00 Casey 30.99 29.45 27.85 30.87 ⎞ ⎟ ⎟ ⎠ The entries of DE give the grocery bills of each of the people at each of the four stores. The formal definition of matrix multiplication is: Section 1.2: Multiplication of Matrices 13 Definition: Multiplication of matrices If A is an n × k matrix and B is a k × m matrix then AB is the n × m matrix AB = C = (cij), for i = 1, 2, . . . , n and j = 1, 2, . . . , m; where cij is the product of row i of A and column j of B and this product is defined as ⎛ bb ⎜ ...a ) ⎜ .. ⎝ b 1j 2j cij = (ai1 ai2 ai3 ik kj ⎞ ⎟ ⎟ ⎠ = ai1b1j + ai2b2j + ai3b3j + ... + aikbkj, when i = 1,2,....,n and j =1,2,...,m. Note that the number of columns of A has to be the same as the number of rows of B. If you look carefully at the definition of cij you can see why this requirement is necessary but you can also see from the grocery store example why it makes sense from a practical angle. Take a look at the following examples to make sure you understand the matrix multiplication technique. ⎛ 2 3 ⎞ ⎛ 2 –1 0 ⎞ Example 1.12. If A = ⎜⎝ –1 2 ⎟⎠ and B = ⎜⎝ 4 0 6 ⎟⎠ then c11 = 2 × 2 + 3 × 4 = 16, c12 = 2 × (–1) + 3 × 0 = –2, c13 = 2 × 0 + 3 × 6 = 18, c21 = (–1) × 2 + 2 × 4 = 6, c22 = (–1) × (–1) + 2 × 0 = 1, and c23 = (–1) × 0 + 2 × 6 = 12. ⎛ 16 –2 18 ⎞ So AB = C = ⎜⎝ 6 1 12 ⎟⎠ ⎛ –1 3 ⎞ ⎛ –2 6 0 ⎞ ⎜ ⎟ Example 1.13. If A = ⎜ 2 6 ⎟ and B = ⎜⎝ 1 2 3 ⎟⎠ ⎝ –4 3 ⎠ 14 Chapter 1: Matrices ⎛ 5 0 9 ⎞ ⎛ 14 30 ⎞ ⎜ ⎟ then AB = ⎜ 2 24 18 ⎟ and BA = ⎜⎝ –9 24 ⎟⎠ ⎝ 11 –18 9 ⎠ This last example points out an interesting result of this way of defining matrix multiplication. While some of the standard properties for addition and multiplication of real numbers hold in the case of matrix addition and multiplication, others do not. Specifically, it’s possible to show 1. 2. 3. 4. A + B = B + A (commutative law for addition) A + (B + C) = (A + B) + C (associative law for addition) A(BC) = (AB)C (associative law for multiplication) A(B + C) = AB + AC (distributive law) However, in most cases it is NOT true that AB = BA. Matrix multiplication is usually not commutative. In particular, even if AB is defined, there’s no guarantee that BA will be defined. This is easily seen by looking at the grocery store example. DE makes perfectly good sense but ED can’t be computed since E is a 4 × 3 matrix and D is a 4 × 4 matrix. Suppose another person was added to the list, say Donna, and thus E was converted to a 4 × 4 matrix. Then the computations necessary to find ED could be done but if you consider the quantities that would be multiplied together you’d find they didn’t make sense. For example, the second row of E multiplied by the third column of D would be (# loaves of bread Ann buys) × (price of beer at Harris Teeter) + (# loaves of bread Bob buys) × (price of beer at Food Lion) + ( # loaves of bread Casey buys) × (price of beer at Winn Dixie) + (# loaves of bread Donna buys) × (price of beer at A&P). The result is absolute garbage (literally as well as mathematically). Even if the matrices you’re multiplying don’t reflect a situation like the one above where you have to worry about the units, there’s no guarantee that you can multiply both ways; even if you can multiply both ways there’s no guarantee the resulting matrices will be the same size; and even if the resulting matrices are the same size there’s no reason to expect them to be equal. Consider the following examples to see what happens. ⎛ 2 –1 0 ⎞ ⎛ 3 2 ⎞ Example 1.14. If A = ⎜⎝ 0 4 2 ⎟⎠ and B = ⎜⎝ –4 1 ⎟⎠ ⎛ 6 5 4 ⎞ then BA = ⎜⎝ –8 8 2 ⎟⎠ but AB is not defined so AB ≠ BA. Section 1.2: Multiplication of Matrices 15 ⎛ 2 ⎞ ⎜ ⎟ Example 1.15. If A = (1 3 –1) and B = ⎜ –3 ⎟ ⎝ 4 ⎠ ⎛ 2 6 –2 ⎞ ⎜ ⎟ then AB = (–11) and BA = ⎜ –3 –9 3 ⎟ and again AB ≠ BA. ⎝ 4 12 –4 ⎠ ⎛ 2 1 ⎞ Example 1.16. If A = ⎜⎝ 0 –3 ⎟⎠ ⎛ 2 5 ⎞ then AB = ⎜⎝ 12 –3 ⎟⎠ ⎛ 3 2 ⎞ and B = ⎜⎝ –4 1 ⎟⎠ ⎛ 6 –3 ⎞ and BA = ⎜⎝ –8 –7 ⎟⎠ so AB ≠ BA. One other aspect of matrix multiplication needs to be considered. When matrix addition was defined, you saw that matrices had an identity element for the operation of addition, namely the zero matrix, just as the real numbers have zero as an additive identity. The real numbers also have an identity element for the operation of multiplication, namely the number 1, which means the following equation is true for any number a: a × 1 = 1 × a = a. Is there a matrix, say I, for which a corresponding equation holds for matrices, i.e., for a given matrix A is there a matrix I so that AI = IA = A? The answer is yes. If ⎛ aa ⎜ A= ⎜ ...... ⎝ a 11 a12 a13 ... a1m 21 a22 a23 ... a2m n1 ... ... an2 an3 ... anm and if I is the m × m matrix: I = ⎛ 10 ⎜ ⎜ ...... ⎝ 0 0 0 ... 0 1 0 ... 0 ... ... 0 0 ... 1 ⎞ ⎟ ⎟ ⎠ ⎞ ⎟ ⎟ ⎠ 16 Chapter 1: Matrices then AI = A.. However, there’s one slight hitch. If A is n × m and n ≠ m, then using an m × m matrix I of the form above gives AI = A but IA can’t be multiplied so it’s not possible for IA = A. In order to have an identity matrix I that allows IA to be computed, it would be necessary for I to be n × n (I would still have the same form — “ones” on the diagonal from the upper left to the bottom right and zeroes in the other positions). Thus, just as was true for the zero matrix, it turns out that the identity matrix for multiplication is not unique and, in particular, it’s necessary to have identity matrices of all possible square sizes. So the identity matrix is defined as: Definition: Identity matrix If m is a positive integer, then the m × m identity matrix I is defined by: I= ⎛ 10 ⎜ ... ⎝ ...0 0 0 ... 0 1 0 ... 0 ... ... 0 0 ... 1 ⎞ ⎟ ⎠ Again, just as with the zero matrix, you need to look at the individual problem you’re working with and use that to determine the size of the identity matrix needed for the problem. As a minor point, if A is a square matrix, say n × n, and if I is the n × n identity matrix, then IA = AI = A where I is the same in both cases. Problems In exercises 1-4 determine the size of AB and also of BA if the product is defined. If it is not defined, explain why not. Section 1.2: Multiplication of Matrices 17 1. A has size 3 × 4, B has size 4 × 2. 2. A has size 5 × 2, B has size 2 × 5. 3. A has size 4 × 2, B has size 4 × 4. 4. A has size 1 × 3, B has size 3 × 1. In exercises 5-12, perform the indicated computations if possible. If not possible, explain why not. 5. ⎛ 3 1 ⎞ ⎛ –1 –2 0 ⎞ ⎜ ⎟ ⎜ ⎟ ⎝ –2 0 ⎠ ⎝ 0 1 0 ⎠ 6. 1 0 ⎛ 2 –4 1 0 ⎞ ⎛ ⎜ ⎜ ⎟ 3 2 ⎜ 0 2 3 0 ⎟ ⎜ 2 3 ⎝ –1 –5 0 2 ⎠ ⎝ 0 1 7. ⎛ 2 –1 4 0 ⎞ ⎛ 4 1 –3 0 ⎞ ⎜ ⎟ ⎜ ⎟ ⎝ 3 0 –2 –1 ⎠ ⎝ –2 0 1 3 ⎠ 8. ⎛ –2 ⎞ ⎜ ⎟ ⎝ 3 ⎠ (–2 1) 9. ⎞ ⎟ ⎟ ⎠ ⎛ –2 ⎞ (–2 1) ⎜⎝ 3 ⎟⎠ 10. 2 ⎛ –1 4 ⎞ ⎛ 5 0 –1 ⎞ ⎜ ⎟ ⎛⎜ 2 1 –3 4 ⎞⎟ ⎜ ⎟ ⎝ 1 3 2 ⎠ ⎜ 2 0 ⎟ ⎝ 0 0 1 2 ⎠ ⎝ 1 –1 ⎠ ⎛ 0 –1 ⎞ ⎛ 2 1 ⎞ ⎜ ⎟ ⎛⎜ 3 4 ⎞⎟ ⎜ ⎟ 11. 3 ⎜ 5 3 ⎟ ⎝ –1 2 ⎠ – 4 ⎜ 0 –1 ⎟ ⎝ 1 2 ⎠ ⎝ 4 1 ⎠ ⎛ 0 –2 ⎞ ⎛ 4 0 ⎞ 2 ⎜ ⎟ ⎜ ⎟ 12. –5 ⎜ 1 3 ⎟ + 2 ⎜ 1 0 ⎟ ⎝ 2 0 ⎠ ⎝ –2 2 ⎠ ⎛ 2x 3 ⎞ ⎛ 6+z 20 ⎞ ⎜ ⎟ ⎛⎜ 3 x ⎞⎟ ⎜ ⎟ 13. Solve for x, y and z if possible: ⎜ 1 y ⎟ ⎝ y 4 ⎠ = ⎜ 4 z–5 ⎟ ⎝ 2 4 ⎠ ⎝ 2 20 ⎠ 14. Verify the associative law of multiplication for matrices, using ⎛ 1 2 ⎞ A = ⎜⎝ –3 4 ⎟⎠ ⎛ 3 –1 4 ⎞ B = ⎜⎝ 0 2 1 ⎟⎠ ⎛ 6 0 ⎞ ⎜ ⎟ C = ⎜ –2 4 ⎟ ⎝ 3 2 ⎠ ⎛ 2 –1 ⎞ ⎛ –1 2 ⎞ ⎛ 0 3 ⎞ 15. Let A = ⎜⎝ –4 2 ⎟⎠ , B = ⎜⎝ 2 –3 ⎟⎠ , and C = ⎜⎝ 4 –1 ⎟⎠ Show that AB = AC but that B ≠ C. (So you can’t “cancel” the A on both sides of the equation the way you could if A, B, and C were nonzero numbers.) 18 Chapter 1: Matrices ⎛ 2 –1 ⎞ ⎛ –1 3 ⎞ 16. Let A = ⎜⎝ –4 2 ⎟⎠ and B = ⎜⎝ –2 6 ⎟⎠ . Show AB = 0 but neither A = 0 nor B = 0. 17. Show that the system of linear equations x + 2y + z = 3 2x + 5y = 11 3x + 6y + 2z = 10 can be written in the matrix form AX = B ⎛ 1 2 1 ⎜ where A = ⎜ 2 5 0 ⎝ 3 6 2 ⎞ ⎛ x ⎞ ⎛ 3 ⎞ ⎟ ⎜ ⎟ ⎜ ⎟ ⎟ , X = ⎜ y ⎟ , and B = ⎜ 11 ⎟ . ⎠ ⎝ z ⎠ ⎝ 10 ⎠ 18. Find matrices A, B and X so the system of equations 2x – y + 2z = –2 2x + 3y + z = 1 –3x + 2y – 2z = 0 can be written in the matrix form AX = B. ⎛ x 2 ⎞ ⎛ –3 4 ⎞ 19. Let A = ⎜⎝ –3 4 ⎟⎠ . Find all values of x for which A2 – I = ⎜⎝ –6 9 ⎟⎠ . 20. The Yummynut Nut Company produces three types of cans of assorted nuts: the Custom can, the Deluxe can and the Extra Fancy can. The Custom can contains 8 ounces of peanuts, 2 ounces of cashews and 2 ounces of almonds. The Deluxe can contains 5 ounces of peanuts, 4 ounces of cashews and 3 ounces of almonds. The Extra Fancy can contains 6 ounces of cashews and 6 ounces of almonds. In processing the raw nuts the company uses 1 unit of electricity, 1 unit of oil and 2 units of salt for each ounce of peanuts, 2 units of electricity, 1 unit of oil and 2 units of salt for each ounce of cashews and 1 unit of electricity, 1 unit of oil and 1 unit of salt for each ounce of almonds. If a unit of electricity costs .1 cents, a unit of oil costs .3 cents and a unit of salt costs .2 cents, use matrix methods to find a matrix which has as entries the amount it costs to produce each type of can of nuts. If the company produces 10,000 Custom cans, 8000 Deluxe cans and 6000 Extra Fancy cans each day, use matrix methods to find out the amount it costs each day to produce the cans of nuts. 21. Each unit of food I contains .4 units of the minimum daily requirement (m.d.r.) of vitamin A, .3 units of the m.d.r. of vitamin B and .5 units of the m.d.r. of vitamin C. Each unit of food II contains .6 units of the m.d.r. of vitamin A, .2 units of the m.d.r. of vitamin B and .3 units of the m.d.r. of vitamin C. Each unit of food III contains .4 units of the m.d.r. of vitamin A, .8 units of the m.d.r. of vitamin B and no vitamin C. (a) Set up a matrix representing the above data, labeling the rows and columns. Section 1.2: Multiplication of Matrices 19 (b) If a person eats 6 units of food I, 4 units of food II and 2 units of food III, use matrix methods to determine how much of each type of vitamin is consumed. 22. Bob makes American and European style beer. His recipe for 2 cases of beer is outlined in the following matrix: American ⎛ A = European ⎜⎝ malt (lbs.) 3.5 4 hops (oz.) 10 15 sugar (cups) 5 3 yeast (pkgs.) ⎞ 1 ⎟ ⎠ 1 Bob buys his ingredients at Noah’s Food Co-op when the Co-op has them in stock. Otherwise he orders the ingredients from De Falco's in Houston, Texas. The prices are summarized in the matrix Noah’s malt hops B = sugar yeast ⎛ $1/lb. ⎜ $.04/oz. ⎜ $.10/cup ⎝ $.25/pkg. De Falco’s $1.75/lb. $.06/oz. $.15/cup $.50/pkg. ⎞ ⎟ ⎟ ⎠ Compute AB and interpret the result. 23. Wendy’s has two restaurants in Bismarck, N.D., one on the north side and one on the south side of the city. Each sells four kinds of hamburgers: singles, doubles, triples, and bacon cheeseburgers. (a) Last week the restaurant on the north side sold 400 singles, 275 doubles, 150 triples, and 200 bacon cheeseburgers. The restaurant on the south side sold 500 singles, 325 doubles, 225 triples and 275 bacon cheeseburgers. Write a matrix summarizing this information. (b) Singles sold for $1.20, doubles for $1.75, triples for $2.25, and bacon cheeseburgers for $1.90. Write a matrix summarizing this information and use matrix methods to compute matrices giving the gross revenue for each restaurant. 24. A-1 Lawn Care contracts with 2 chemical companies to produce the additives for their 3 lawn products. They arranged with Eastern Chemical to produce the additives for 30 units of Brand A, 15 units of Brand B, and 25 units of Brand C; with American Chemical, they arranged for the additives for 40 units of Brand A, 30 units of Brand B, and 20 units of Brand C. (a) Express the above information in matrix form. (b) The amounts of additives in a unit of Brand A are 3 parts of fertilizer, 2 of weed killer and 5 of insecticide. The amounts of additives in a unit of Brand B are 6 parts of fertilizer, 3 of weed killer and 1 of insecticide. The amounts of additives in a unit of Brand C are 8 parts of fertilizer, 2 of weed killer and no insecticide. Write a matrix summarizing this information. 20 Chapter 1: Matrices (c) Use the matrices in (a) and (b) to compute a third matrix representing the number of parts of additives required from each chemical company. (d) The weight for each part of fertilizer is .5 kg; for weed killer it is 2 kg and for insecticide it is .1 kg. Express this information in matrix form and determine a matrix which represents the total weight of the additives from each chemical company. 25. The admissions committee of a 4-year college expects the following enrollment figures for next year: freshmen: 800 male and 1000 female sophomore: 600 male and 700 female junior: 550 male and 620 female senior 470 male and 580 female (a) Set up the data in a matrix A with columns labeled male and female. (b) The students are expected to divide up as follows for their major: Males: 20% in science, 30% in humanities, 40% in business and 10% in education. Females: 15% in science, 30% in humanities, 30% in business and 25% in education. Set up the data in a matrix B in such a way that the matrix product AB can be computed. Interpret what the entries in AB represent. 1.3 Solving Systems of Equations In this section, matrix methods will be applied to the problem of solving systems of linear equations. The methods are based on one of the procedures you learned in high school, that of solving systems by progressively eliminating variables. This procedure will be reviewed with a simple system of two linear equations involving two unknowns, x and y. Example 1.17. Suppose for the following two equations, values of x and y that satisfy both equations must be found. x – 3y = 4 2x + 5y = –3 The variable which is probably easiest to eliminate is x, so the first equation is multiplied by –2 and then the new equation is added to the second equation. Thus, the system now looks like: –2x + 6y = –8 2x + 5y = –3 Section 1.3: Solving Systems of Equations 21 Adding the two equations together gives: 11y = –11 To solve for y, divide both sides by 11: y = –1 Of course, both of the original equations are still true. In high school you probably would have solved for x by substituting the value for y back in one of those equations (let’s use the first one since it’s a little simpler). Then: x – 3y = 4 so x = 3y + 4 and x = 3(–1) + 4 = 1 However, another way to find x would be to continue using the method of eliminating variables. Since the original system of equations is equivalent to the following system, x – 3y = 4 0x + y = –1 y could be eliminated between the two equations by multiplying the second equation by 3 and adding it to the first equation. Thus x – 3y = 4 0x + 3y = –3 x + 0y = 1 or x = 1 The important thing to realize from all these manipulations is that all of the decisions that were made about which variables to eliminate and which equations to multiply by the various constants were based entirely on the coefficients of x and y. The results which were obtained depended both on the coefficients of x and y and the constant terms on the right sides of the equations. To utilize that idea a matrix can be written which is equivalent to the system of equations and contains all the essential information (the coefficients of x and y and the constant terms) but doesn’t bother with writing down the x’s and y’s. This matrix is called the augmented matrix. Of course, it’s necessary to have some way of keeping track of which coefficient belongs to which variable; that is done by insisting that the first column of the augmented matrix consists of the coefficients of the x variable, the second column consists of the coefficients of the y variable, etc. (if there’s more than two variables then there’ll just be more columns in the augmented matrix). The last column consists of the constant terms and it’s separated from the matrix of coefficients by a vertical line. Thus for the original system, the augmented matrix is: ⎛ 1 –3 ⎪ 4 ⎞ ⎝ 2 5 ⎪ –3 ⎠ Note that the first row of the augmented matrix corresponds to the equation x – 3y = 4 and the second row of the augmented matrix corresponds to the equation 2x + 5y = –3. 22 Chapter 1: Matrices Now let’s simply redo the operations on the original system of equations but apply them to the augmented matrix instead. Multiplying the first row by –2 yields ⎛ –2 6 ⎪ –8 ⎞ ⎝ 2 5 ⎪ –3 ⎠ Notice that all the arithmetic is the same as when the first equation was multiplied by –2 a moment ago. Then the first equation was added to the second; in the augmented matrix, this amounts to adding the first row to the second, resulting in a new second row. ⎛ –2 6 ⎪ –8 ⎞ ⎝ 0 11 ⎪ –11 ⎠ Then the second equation was divided by 11 so in the augmented matrix the second row is divided by 11. In addition the first row will be divided by –2 to get back to the original first row. ⎛ 1 –3 ⎪ 4 ⎞ ⎝ 0 1 ⎪ –1 ⎠ Now rather than going through the substitution that was done at first on the system let’s continue the technique of eliminating variables. To do that the second equation was multiplied by 3 (multiply the second row by 3) and added to the first equation (add the new second row to the first row). Thus the augmented matrix now looks like ⎛ 1 0 ⎪ 1 ⎞ ⎝ 0 3 ⎪ –3 ⎠ Finally the second row is divided by 3 to get ⎛ 1 0 ⎪ 1 ⎞ ⎝ 0 1 ⎪ –1 ⎠ This matrix is equivalent to the system 1x + 0y = 1 0x + 1y = –1 or x= 1 y = –1 which is the solution obtained earlier. There are several things to mention about this procedure. First, the following rules are valid for manipulating equations: 1. Multiplying an equation by a nonzero number results in an equivalent equation. 2. In a system of equations, interchanging equations results in an equivalent system (i.e., a system of equations that has the same solution set as the original system). Section 1.3: Solving Systems of Equations 23 While this rule may seem obvious and quite unnecessary, its analog for augmented matrices can be very useful as you’ll see in later examples. 3. In a system of equations, multiplying an equation by a nonzero number and adding it to another equation results in an equivalent system of equations. However, these three rules have analogs when dealing with augmented matrices. These analogs are called elementary row operations and are as follows: Row Operations 1. Any row of the augmented matrix can be multiplied by a nonzero constant. 2. Any two rows can be interchanged. 3. Any row of the augmented matrix can be multiplied by a constant and added to another row. It’s helpful in solving systems using these methods to keep track of what you’ve done in going from one matrix to the next. The following notation is used to represent the above row operations: Notation for Row Operations 1. cRi : multiply row i by c 2. Ri ↔ Rj: interchange row i and row j 3. Ri + cRj: replace row i with Ri + cRj, where c is a constant. Thus, a complete solution of the original system of equations using these matrix methods (known as the Gauss–Jordan row reduction method) would look like: 24 Chapter 1: Matrices 1 11 R2 R2 – 2R1 ⎛ 1 –3 ⎪ 4 ⎞ ⎝ 2 5 ⎪ –3 ⎠ ⎛ 1 –3 ⎪ 4 ⎞ ⎝ 0 11 ⎪ –11 ⎠ ⎛ 1 –3 ⎪ 4 ⎞ ⎝ 0 1 ⎪ –1 ⎠ R1 + 3R2 ⎛ 1 0 ⎪ 1 ⎞ ⎝ 0 1 ⎪ –1 ⎠ In following this procedure, notice that the final coefficient matrix (the part on the left) has the form ⎛ 1 0 ⎞ ⎝ 0 1 ⎠ which is the 2 × 2 identity matrix. So it was easy to read off the final solution since the first row of the augmented matrix has the equivalent equation 1x + 0y = 1, and the second row has the equivalent equation 0x + 1y = –1 In solving any system of equations, you should attempt to get the coefficient matrix reduced to the identity matrix using the row operations described above. However, you won’t always be able to do that. You know from high school that a geometric interpretation of the solution of two linear equations in two unknowns is the point that lies on both of the lines (the point of intersection). But you also know that it’s possible for two lines not to intersect (i.e. if they’re parallel) and so, of course, there’s no point of intersection. It’s also possible to have the two lines lie on top of one another in which case you have an infinite number of points of intersection. Algebraically, solving a system that represents two parallel lines leads to an obvious contradiction at some point in the procedure. Similarly, when solving a system that represents two lines that lie on top of one another, the two equations reduce to one equation in two unknowns and there’s no way to eliminate either of the variables. These sorts of situations can be handled easily using the Gauss–Jordan row reduction method as you’ll see in some later examples. Section 1.3: Solving Systems of Equations 25 Using the augmented matrix to solve a system of equations 1. Use an appropriate row operation to get a 1 in the upper left hand corner of the augmented matrix. 2. Get zeroes for the other entries in the first column. 3. Get a 1 in the a22 position of the augmented matrix (second row and second column) 4. Get zeroes in the rest of the second column. 5. Continue to the third column, if you have one, getting a 1 in the third row and third column and then getting zeroes in the remainder of that column. 6. Continue to subsequent columns until either (a) the coefficient matrix is reduced to the identity matrix, in which case you can read off your solution, or (b) the coefficient matrix has one or more zero rows. In this case translate those rows to their equivalent equations. Then either (1) All of those rows have 0 = 0 as their equivalent equations. Translate the remaining rows to their equivalent equations. See Examples 1.20 and 1.22 below. (2) One (or more) of the rows has 0 = nonzero number as its equivalent equation. Write “no solution”. See Examples 1.19 and 1.23 below. The Gauss-Jordan row reduction method works just as well with many equations and many unknowns, although computers are used to apply the method to very large systems of linear equations. The box on the preceding page summarizes the steps to be used. Remember that the goal is to reduce (if possible) the coefficient matrix to the identity matrix. Let’s apply the above procedure to several examples. (You might also make a quick sketch for each of the next three examples to see what’s happening geometrically.) Example 1.18. 2x – y = –7 26 Chapter 1: Matrices –x + 3y = 11 The augmented system is as follows: ⎛ 2 –1 ⎪ –7 ⎞ ⎝ –1 3 ⎪ 11 ⎠ . Applying Gauss–Jordan row reduction to the augmented system gives R1 + R2 ⎛ 2 –1 ⎪ –7 ⎞ ⎝ –1 3 ⎪ 11 ⎠ ⎛ 1 2 ⎪ 4 ⎞ ⎝ –1 3 ⎪ 11 ⎠ 1 5 R2 R2 + R1 ⎛ 1 2 ⎪ 4 ⎞ ⎝ 0 5 ⎪ 15 ⎠ R1 – 2R2 ⎛ 1 2 ⎪ 4 ⎞ ⎝ 0 1 ⎪ 3 ⎠ ⎛ 1 0 ⎪ –2 ⎞ ⎝ 0 1 ⎪ 3 ⎠ It’s a good idea to check the answer by substituting back in the original system. 2(–2) –3 = –7 –(–2) + 3(3) = 11 Example 1.19. 3x – 2y = –1 –6x + 4y = 4 ⎛ 3 –2 ⎪ –1 ⎞ The augmented matrix is ⎝ –6 4 ⎪ 4 ⎠ . Applying Gauss–Jordan row reduction gives R2 + 2R1 ⎛ 3 –2 ⎪ –1 ⎞ ⎝ –6 4 ⎪ 4 ⎠ ⎛ 3 –2 ⎪ –1 ⎞ ⎝ 0 0 ⎪ 2 ⎠ The last row is equivalent to the equation 0x + 0y = 2 or 0 = 2 which is an obvious contradiction. Thus, there is no solution for this system. Example 1.20. 3x – 2y = –1 Section 1.3: Solving Systems of Equations ⎛ The augmented system is ⎝ 3 –2 –6 4 27 –6x + 4y = 2 ⎪ –1 ⎞ ⎪ 2 ⎠ . Now observe the row operations: R2 + 2R1 ⎛ 3 –2 ⎪ –1 ⎞ ⎝ –6 4 ⎪ 2 ⎠ ⎛ 3 –2 ⎪ –1 ⎞ ⎝ 0 0 ⎪ 0 ⎠ This is equivalent to the system of equations ⎪⎧3x ⎨ ⎩⎪0x – 2y = –1 + 0y = 0 or ⎪⎧3x – 2y ⎨ ⎩⎪0 = 0 = –1 Solving for x in terms of y, gives 2 1 x = 3 y – 3 , where y can be any real number. Since y can be any real number there are an infinite number of choices for the value of y and thus there are an infinite number of values of x and y that satisfy the system of equations. Now let’s take a look at applying Gauss–Jordan row reduction to systems of three equations in three unknowns. You’ll see that the basic procedure is the same, although there are generally more computations involved. To save time in writing down the augmented matrices, several row operations are often applied in the course of one step. In that case, as can be seen in the example below, the row operations are listed sequentially, from top to bottom. Thus, in step 1 below, R2 first is replaced by R2 – 3R1 and then R3 is replaced by R3 – 4R1. Similarly, in step 2, R1 first is replaced by R1 + 5R2 and then R3 is replaced by R3 – 2R2 Example 1.21. x – 5y + 2z = –5 3x – 14y + 3z = –8 4x – 18y + 3z = –8 R2 – 3R1 ⎛ 1 –5 2 ⎪ –5 ⎞ ⎜ 3 –14 3 ⎪ –8 ⎟ ⎝ 4 –18 3 ⎪ –8 ⎠ ⎛ 1 –5 2 ⎪ –5 ⎞ ⎜ 0 1 –3 ⎪ 7 ⎟ ⎝ 0 2 –5 ⎪ 12 ⎠ R3 – 4R1 28 Chapter 1: Matrices R1 + 5R2 R1 + 13R3 ⎛ 1 0 –13 ⎪ 30 ⎞ ⎜ 0 1 –3 ⎪ 7 ⎟ ⎝ 0 0 1 ⎪ –2 ⎠ R3 – 2R2 ⎛ 1 0 0 ⎪ 4 ⎞ ⎜ 0 1 0 ⎪ 1 ⎟ ⎝ 0 0 1 ⎪ –2 ⎠ R2 + 3R3 So x = 4, y = 1 and z = –2. Example 1.22. x – y + 2z = 6 –x – y + 4z = 8 2x – y + z = 5 1 R2 + R1 ⎛ 1 –1 2 ⎪ 6 ⎞ ⎜ –1 –1 4 ⎪ 8 ⎟ ⎝ 2 –1 1 ⎪ 5 ⎠ – 2 R2 ⎛ 1 –1 2 ⎪ 6 ⎞ ⎜ 0 –2 6 ⎪ 14 ⎟ ⎝ 0 1 –3 ⎪ –7 ⎠ ⎛ 1 –1 2 ⎪ 6 ⎞ ⎜ 0 1 –3 ⎪ –7 ⎟ ⎝ 0 1 –3 ⎪ –7 ⎠ R3 – 2R1 R1 + R2 ⎛ 1 0 –1 ⎪ –1 ⎞ ⎜ 0 1 –3 ⎪ –7 ⎟ ⎝ 0 0 0 ⎪ 0 ⎠ R3 – R2 so x = z – 1, y = 3z –7. Just as in Example 1.20, there are an infinite number of solutions since there are an infinite number of choices for the value of z. Example 1.23. 3x – 2y + 3z = 4 4x + y + 4z = 19 5x + 4y + 5z = 28 R2 – 4R1 –R1 + R2 ⎛ 3 –2 3 ⎪ 4 ⎞ ⎜ 4 1 4 ⎪ 19 ⎟ ⎝ 5 4 5 ⎪ 28 ⎠ ⎛ 1 3 1 ⎪ 15 ⎞ ⎜ 4 1 4 ⎪ 19 ⎟ ⎝ 5 4 5 ⎪ 28 ⎠ ⎛ 1 3 1 ⎪ 15 ⎞ ⎜ 0 –11 0 ⎪ –41 ⎟ ⎝ 0 –11 0 ⎪ –47 ⎠ R3 – 5R1 Section 1.3: Solving Systems of Equations 29 R3 – R2 ⎛ 1 3 1 ⎪ 15 ⎞ ⎜ 0 –11 0 ⎪ –41 ⎟ ⎝ 0 0 0 ⎪ –6 ⎠ The last row of this matrix says 0 = –6, which is obviously impossible, so there's no solution for this system. It’s worth noting that systems of three equations in three unknowns can also be interpreted geometrically. The graph of a linear equation of the form ax + by + cz = d is a plane in three dimensional space. If you mentally visualize how three planes in space can intersect, you’ll realize that they can intersect in a single point (algebraically that corresponds to getting a unique solution to the system) OR they can intersect in a straight line (which corresponds to an infinite number of solutions) OR they can all lie on the same plane (which also corresponds to an infinite number of solutions) OR the three planes may not have any points of intersection (which corresponds to the situation where the system of equations has no solution). In fact, for any system of m linear equations in n unknowns, there are three possible situations for solutions, only one of which holds for a given system: 1. Exactly one solution. 2. An infinite number of solutions 3. No solution The following examples deal with the situation where the number of equations is different from the number of unknowns. Example 1.24. x + 2y – 2z – t = 2 2x + 5y – 3z + 2t = 4 4x + 11y – 5z + 8t = 8 R2 – 2R1 ⎛ 1 2 –2 –1 ⎪ 2 ⎞ ⎜ 2 5 –3 2 ⎪ 4 ⎟ ⎝ 4 11 –5 8 ⎪ 8 ⎠ ⎛ 1 2 –2 –1 ⎪ 2 ⎞ ⎜ 0 1 1 4 ⎪ 0 ⎟ ⎝ 0 3 3 12 ⎪ 0 ⎠ R3 – 4R1 30 Chapter 1: Matrices R1 – 2R2 ⎛ 1 0 –4 –9 ⎪ 2 ⎞ ⎜ 0 1 1 4 ⎪ 0 ⎟ ⎝ 0 0 0 0 ⎪ 0 ⎠ R3 – 3R2 The solutions can be described in the following way where z and t may be any real numbers: x = 4z + 9t + 2 y = –z – 4t Example 1.25. 2x + 2y – z = 5 –x – 3y + z = –8 –2x + z = –1 3x + 2y – z = 4 R1 + R2 ⎛ –12 ⎜ –2 ⎝ 3 2 –1 –3 1 0 1 2 –1 ⎪ –85 ⎞ ⎪ –1 ⎟ ⎪ 4 ⎠ ⎛ –11 ⎜ –2 ⎝ 3 R2 + R1 R3 + 2R1 –1 0 –3 1 0 1 2 –1 ⎪ –3 ⎞ ⎪ –8 ⎟ –1 ⎪ 4 ⎠ ⎛ 10 ⎜ 0 ⎝ 0 –1 0 1 0 –2 1 5 –1 ⎛ 10 ⎜ 0 ⎝ 0 0 1 0 0 R2 + R4 ⎛ 10 ⎜ 0 ⎝ 0 –1 0 –4 1 –2 1 5 –1 –3 ⎪ –11 ⎞ ⎪ –7 ⎟ ⎪ 13 ⎠ ⎪ –32 ⎞ ⎪ –7 ⎟ ⎪ 13 ⎠ R4 – 3R1 R1 + R2 R3 + 2R2 R4 + R3 ⎛ 10 ⎜ 0 ⎝ 0 R4 – 5R2 0 0 1 0 0 1 0 –1 ⎪ –12 ⎞ ⎪ –3 ⎟ ⎪ 3 ⎠ 0 0 1 0 ⎪ –12 ⎞ ⎪ –3 ⎟ ⎪ 0 ⎠ Section 1.3: Solving Systems of Equations 31 So x = –1, y = 2, and z = –3. Problems In Exercises 1-4, write the augmented matrix for the system of equations. 1. 2x + 5y = –1 3x – 4y = 10 2. –x + 4y = 10 2x + y = 7 3. –3x + y = –10 x + 3y – 10z = 6 x + 2y + z = 9 4. –4x + y – z = –3 –x + 5y + 2z = –8 2x + 5z = 5 x–y+z=3 In Exercises 5-13, each matrix is an augmented matrix in row-reduced form for a system of equations. State the solution (or solutions) if one exists. If no solution exists, write "no solution". 5. ⎛ 1 0 0 ⎪ –1 ⎞ ⎜ 0 1 0 ⎪ 2 ⎟ ⎝ 0 0 1 ⎪ 0 ⎠ 6. ⎛ 1 0 2 ⎪ 4 ⎞ ⎜ 0 1 –3 ⎪ 0 ⎟ ⎝ 0 0 0 ⎪ 0 ⎠ 7. ⎛ 1 0 1 ⎪ 2 ⎞ ⎜ 0 0 0 ⎪ 0 ⎟ ⎝ 0 0 0 ⎪ 0 ⎠ 8. ⎛ 1 0 ⎪ 3 ⎞ ⎜ 0 1 ⎪ –1 ⎟ ⎝ 0 0 ⎪ 0 ⎠ 9. ⎛ 1 0 0 ⎪ 3 ⎞ ⎜ 0 1 0 ⎪ 0 ⎟ ⎝ 0 0 0 ⎪ –1 ⎠ ⎛ 1 0 0 ⎪ 2 ⎞ 10. ⎝ 0 1 –3 ⎪ 1 ⎠ 11. ⎛ 10 ⎜ 0 ⎝ 0 0 1 0 0 0 0 1 0 13. ⎛ 10 ⎜ 0 ⎝ 0 0 1 0 0 0 0 1 0 ⎪ 00 ⎞ ⎪ 0 ⎟ ⎪ 0 ⎠ 0 0 0 0 ⎪ 32 ⎞ ⎪ 1 ⎟ ⎪ 4 ⎠ 12. ⎛ 10 ⎜ 0 ⎝ 0 0 0 0 1 –1 0 0 0 1 0 0 0 ⎪ 20 ⎞ ⎪ 1 ⎟ ⎪ 0 ⎠ 32 Chapter 1: Matrices In Exercises 14-19, determine if the augmented matrix is in row-reduced form. If it isn’t in row-reduced form, put it in row-reduced form. Then state the solution or solutions if they exist. If no solution exists, write “no solution”. ⎛ 1 0 ⎪ 0 ⎞ 14. ⎝ 0 1 ⎪ 0 ⎠ ⎛ 1 0 ⎪ –2 ⎞ 15. ⎝ 0 1 ⎪ –3 ⎠ ⎛ 1 –3 ⎪ 2 ⎞ 16. ⎝ 0 1 ⎪ 1 ⎠ ⎛ 1 2 0 ⎪ 1 ⎞ 17. ⎜ 0 1 –3 ⎪ 0 ⎟ ⎝ 0 0 1 ⎪ 2 ⎠ ⎛ 1 0 –1 ⎪ 2 ⎞ 18. ⎜ 0 1 0 ⎪ 1 ⎟ ⎝ 0 0 0 ⎪ 2 ⎠ ⎛ 3 0 0 ⎪ –6 ⎞ 19. ⎜ 0 4 1 ⎪ 10 ⎟ ⎝ 0 0 –2 ⎪ 4 ⎠ In Exercises 20-37, solve the system of linear equations, using the Gauss-Jordan row reduction method. 20. 4x + 3y = 3 3x + 2y = 1 21. 2x – 3y = 7 –3x + 5y = –11 22. x + y + 4z =2 2y + 5z = 4 3x + 2y + 4z = –7 23. 2x + 2y –z = –3 x – y + 2z = 2 –3x – 6y + 5z = 9 24. x + 2y – 4z = 3 –2x + 5y – z = 3 –2x – y + 5z = 0 25. x + 3y – 2z = –4 –3x – 5y + 2z = 4 5x + y + 4z = 8 26. 2x – y – z = 3 x + y – 5z = 0 –3x + 2y = –5 27. 2x + 3y –2z = –7 x – 2y + 3z = 5 3x + y + 2z = 1 28. 2x + y =3 x + 3y + 4z = 2 y + 2z = –1 29. 3x – y + 2z = 3 2x + 2y + z = 2 x – 3y + z = 4 30. 2x + 4y + 5z = 1 x + y + 2z = 2 3x + 6y + 8z = 3 31. x – 2y + 3z = 4 2x –6y + z = 2 –x + 6y + z = 4 32. 2x + 4y – 3z = 5 –x – 2y + 4z = –5 33. 3x + 4y + 2z + 2u = 1 2x + 3y + z + u = 1 3x + 5y + z + u = 2 Section 1.3: Solving Systems of Equations 33 34. 2x + 5z = 5 x–y+z=3 4x – y + z = 3 x – 5y – 2z = 8 35. 2x – 3y + z = 2 3x + y – 2z = 5 – 11y + 7z = –4 –5x – 9y + 8z = –12 36. x + 3y + 4z – 2t = –5 – 2y + 2z = 7 – 10z + 2t = –5 3x + 9y + 6z – 4t = –18 37. 2x – y + 3z + t = 4 x + 2y – 2z – 3t = –5 x – 7y + 12z + 11t = 23 4x + 3y – z – 5t = –6 38. Consider the following systems of equations which have right hand sides given by (a), (b), (c), and (d) respectively. (a) 2x + y = 3 x + 3y + 4z = 2 y + 2z = –1 (b) 0 4 2 (c) 0 0 0 (d) 2 1 3 Rather than solving each system separately, you can solve the four different systems at the same time by first forming the matrix augmented by the four columns (a), (b), (c), and (d) ⎛ 2 1 0 ⎪ ⎜ 1 3 4 ⎪ ⎝ 0 1 2 ⎪ (a) (b) (c) (d) 3 0 0 2 ⎞ 2 4 0 1 ⎟ –1 2 0 3 ⎠ and then doing Gauss-Jordan row-reduction on this matrix. Then determine the solutions to each of the systems in turn by using the appropriate column. 39. Follow the directions in Exercise 38, for the systems of equations given below. (a) y – z = 3 3x + 2y = 2 x+ z = 1 (b) 0 2 1 (c) –1 2 0 (d) 1/2 –3/2 5/2 ⎛ 2 –1 ⎞ ⎛ 1 0 ⎞ ⎛ 1 0 ⎞ 40. Let A = ⎝ 3 –2 ⎠ . Find B so that AB = ⎝ 0 1 ⎠ . Show that BA = ⎝ 0 1 ⎠ as ⎛ x y ⎞ well. [Hint: Let B = ⎜⎝ z w ⎟⎠ and use matrix methods to solve the systems of equations that result.] 41. L.L. Carrot, a mail-order firm, makes 3 kinds of women’s t-shirts: long-sleeved turtleneck, short-sleeved turtleneck and sleeveless shell. The time required to produce 100 of each type of t-shirt is summarized in the table below. LS turtleneck SS turtleneck Sleeveless shell 34 Chapter 1: Matrices cutting sewing packaging ⎛ ⎜ ⎝ 125 min. 240 min. 80 min. 100 min. 200 min. 80 min. 75 min. 120 min. 60 min. ⎞ ⎟ ⎠ A maximum of 105, 196 and 76 labor hours are available each day for cutting, sewing, and packaging respectively. How many hundreds of each type of shirt can be produced each day if all the labor is to be utilized? 42. A university decides it needs to build more married student housing. It determines that a total of 222 units are needed, consisting of efficiency, one-bedroom and twobedroom apartments. From past experience, the university plans to have the number of one-bedroom units equal the total of efficiency and two-bedroom units. It also plans to have twice the number of two-bedroom as efficiency apartments. How many of each type has the university planned to build? 43. An investor has $20,000 to invest. She wishes to invest in AAA bonds, moneymarket funds and blue-chip stocks. The AAA bonds return 10%, while the moneymarket funds and the blue-chip stocks return 8% and 7% respectively. She wants to invest three times as much in the sum of money-market funds and stocks as in bonds and she wants her average return on her investments to be 8.25%. How much should she put in each type of investment? 44. A dietitian is preparing a meal consisting of foods A, B, and C. Each ounce of food A contains 2 units of protein, 3 units of fat, and 4 units of carbohydrate. Each ounce of food B contains 3 units of protein, 2 units of fat, and 1 unit of carbohydrate. Each ounce of food C contains 3 units of protein, 3 units of fat and 2 units of carbohydrate. If the meal must provide exactly 25 units of protein, 23 units of fat and 18 units of carbohydrate, how many ounces of each food should be served? 1.4 Inverses of Matrices You have seen in Sections 1 and 2 of this chapter how to perform two basic operations on matrices, namely addition and multiplication of two matrices. Addition has an obvious inverse operation, that of subtraction, i.e. A – A = A + (–A) = 0. Is there an inverse operation for multiplication of matrices that corresponds in some way to the operation of division of real numbers? (Division is the operation that’s inverse to multiplication.) In other words, when a is a (nonzero) real number, there is another real number, call it a–1 or 1/a, so that a × a–1 = a–1 × a = 1. Section 1.4: Inverses of Matrices 35 For example 5–1 = 1/5, (1.3)–1 = 1/1.3, and (2/3)–1 = 3/2 That means an equation of the type ax = b can be solved by multiplying both sides of the equation by 1/a to get 1 (a–1)ax = a ax = x = (a–1)b = b/a or b x=a That suggests that if a multiplicative inverse for a matrix A can be found, then the matrix equation AX = B could be solved for the matrix X. (In Exercises 17 and 18 of Section 1.2 you saw that a system of linear equations could be written in this form where A is the coefficient matrix, X is the column vector whose entries are the unknown variables and B is the column vector of constant terms.) But finding a multiplicative inverse for A means finding another matrix, (which is denoted A–1), so that the following equation holds: A(A–1) = (A–1)A = I, where I is the identity matrix. A is forced to be a square matrix since the matrix multiplication must be commutative in this definition. (If you don’t see why that’s true, think about what happens if A isn’t square, say A is a 2 × 3 matrix. Then A(A–1) = I says A–1 has to be 3 × 2 since I is a 2 × 2 square matrix. But then (A–1)A = I forces I to be 3 × 3 which is a contradiction.) So in order that A have an inverse, A is required to be a square matrix. Let’s consider a simple example to try to come up with a method of finding inverses for square matrices. Suppose ⎛ 1 2 ⎞ A = ⎜⎝ 1 3 ⎟⎠ Then it’s necessary to find a 2 × 2 matrix A–1, ⎛ x y ⎞ A–1 = ⎜⎝ z w ⎟⎠ so that ⎛ 1 0 ⎞ A(A–1) = ⎜⎝ 0 1 ⎟⎠ ⎛ 1 2 ⎞ ⎛ x y ⎞ ⎛ x + 2z or ⎜⎝ 1 3 ⎟⎠ ⎜⎝ z w ⎟⎠ = ⎜⎝ x + 3z ⎛ 1 0 ⎞ y + 2w ⎞ ⎟ = ⎜ ⎟ ⎠ ⎝ 0 1 ⎠ y + 3w 36 Chapter 1: Matrices To find x, y, z, and w satisfying this matrix equation requires solving the equations: x + 2z = 1 y + 2w = 0 x + 3z = 0 y + 3w = 1. Solving the system of equations involving x and z amounts to row reducing the augmented matrix ⎛ 1 2 ⎪ 1 ⎞ ⎜ ⎪ ⎟ ⎝ 1 3 ⎪ 0 ⎠ However, putting the equations involving y and w in matrix form means the augmented matrix ⎛ 1 2 ⎪ 0 ⎞ ⎜ ⎪ ⎟ ⎝ 1 3 ⎪ 1 ⎠ must be row-reduced and you can see that the same coefficient matrix occurs in each case. The ideas discussed in Exercises 38 and 39 in Section 1.3 can then be used to solve both systems at the same time. The problem becomes one of attempting to row–reduce the augmented matrix ⎛ 1 2 ⎪ 1 0 ⎞ ⎜ ⎪ ⎟ ⎝ 1 3 ⎪ 0 1 ⎠ In so doing, the goal is to row–reduce to get the coefficient matrix down to the 2 × 2 identity matrix. What will the matrix of constants then represent? Let’s do it and find out. R2 – R1 ⎛ 1 2 ⎪ 1 0 ⎞ ⎜ ⎪ ⎟ ⎝ 1 3 ⎪ 0 1 ⎠ R1 – 2R2 ⎛ 1 2 ⎪ 1 0 ⎞ ⎜ ⎪ ⎟ ⎝ 0 1 ⎪ –1 1 ⎠ ⎛ 1 0 ⎪ 3 –2 ⎞ ⎜ ⎪ ⎟ ⎝ 0 1 ⎪ –1 1 ⎠ As you can see, the first column in the matrix of constants represents the solution of the set of equations x + 2z = 1 x + 3z = 0 So x = 3 and z = –1. The second column in the matrix of constants represents the solution of the set of equations y + 2w = 0 y + 3w = 1 Section 1.4: Inverses of Matrices 37 So y = –2 and w = 1. ⎛ 3 –2 ⎞ This means that A–1 = ⎜⎝ –1 1 ⎟⎠ . But that’s precisely the matrix of constants obtained when the augmented matrix ⎛ 1 2 ⎪ 1 0 ⎞ ⎜ ⎪ ⎟ ⎝ 1 3 ⎪ 0 1 ⎠ was row-reduced. So to find an inverse for a matrix A it looks like all that needs to be done is take A, augment it with the identity matrix, row-reduce that augmented matrix, and the resulting matrix of constants ought to be the inverse. Let’s look at a few more examples to get some practice with the procedure. Comment: The matrix A–1 has the property that A × A–1 = I and A–1 × A = I. To check whether you have correctly found the inverse matrix, however, it is necessary to verify only one of these matrix equations. If one of the equations is true, the other will be true automatically. ⎛ 2 –3 ⎞ Example 1.26. Find the inverse of A = ⎝ 1 4 ⎠ . Solution: R1 – R2 ⎛ 2 –3 ⎪ 1 0 ⎞ ⎝ 1 4 ⎪ 0 1 ⎠ R2 – R1 ⎛ 1 –7 ⎪ 1 –1 ⎞ ⎝ 1 4 ⎪ 0 1 ⎠ 1 11 R2 ⎛ 1 –7 ⎪ 1 –1 ⎞ ⎝ 0 11 ⎪ –1 2 ⎠ R1 + 7R2 –1 ⎞ ⎛ 1 –7 ⎪ 1 ⎝ 0 1 ⎪ –1/11 2/11 ⎠ ⎛ 1 0 ⎪ 4/11 3/11 ⎞ ⎝ 0 1 ⎪ –1/11 2/11 ⎠ ⎛ 4/11 3/11 ⎞ So A–1 = ⎝ –1/11 2/11 ⎠ . Checking the answer by computing A A–1 gives: ⎛ 2 –3 ⎞ ⎛ 4/11 3/11 ⎞ ⎛ 1 0 ⎞ A A–1 = ⎝ 1 4 ⎠ ⎝ –1/11 2/11 ⎠ = ⎝ 0 1 ⎠ 38 Chapter 1: Matrices ⎛ 1 –5 2 ⎞ Example 1.27. Find the inverse of A = ⎜ 3 –14 3 ⎟ ⎝ 4 –18 3 ⎠ R2 – 3R1 ⎛ 1 –5 2 ⎪ 1 0 0 ⎞ Solution: ⎜ 3 –14 3 ⎪ 0 1 0 ⎟ ⎝ 4 –18 3 ⎪ 0 0 1 ⎠ ⎛ 1 –5 2 ⎪ 1 0 0 ⎞ ⎜ 0 1 –3 ⎪ –3 1 0 ⎟ ⎝ 0 2 –5 ⎪ –4 0 1 ⎠ R3 – 4R1 R1 + 5R2 R1 + 13R3 ⎛ 1 0 –13 ⎪ –14 5 0 ⎞ ⎜ 0 1 –3 ⎪ –3 1 0 ⎟ ⎝ 0 0 1 ⎪ 2 –2 1 ⎠ R3 – 2R2 Thus A–1 ⎛ 12 –21 13 ⎞ = ⎜ 3 –5 3 ⎟ ⎝ 2 –2 1 ⎠ ⎛ 1 0 0 ⎪ 12 –21 13 ⎞ ⎜ 0 1 0 ⎪ 3 –5 3 ⎟ ⎝ 0 0 1 ⎪ 2 –2 1 ⎠ R2 + 3R3 and AA–1 ⎛ 1 –5 2 ⎞ ⎛ 12 –21 13 ⎞ ⎛ 1 0 0 ⎞ = ⎜ 3 –14 3 ⎟ ⎜ 3 –5 3 ⎟ = ⎜ 0 1 0 ⎟ . ⎝ 4 –18 3 ⎠ ⎝ 2 –2 1 ⎠ ⎝ 0 0 1 ⎠ ⎛ 3 –1 4 ⎞ Example 1.28: Find the inverse of A = ⎜ 1 0 2 ⎟ . ⎝ 5 3 –2 ⎠ Solution: R2 – 3R1 R1 ↔ R2 ⎛ 3 –1 4 ⎪ 1 0 0 ⎞ ⎜ 1 0 2 ⎪ 0 1 0 ⎟ ⎝ 5 3 –2 ⎪ 0 0 1 ⎠ ⎛ 1 0 2 ⎪ 0 1 0 ⎞ ⎜ 3 –1 4 ⎪ 1 0 0 ⎟ ⎝ 5 3 –2 ⎪ 0 0 1 ⎠ ... R3 – 5R1 (Finish this computation as an exercise) A–1 ⎛ 1/3 –5/9 1/9 ⎞ = ⎜ –2/3 13/9 1/9 ⎟ ⎝ –1/6 7/9 –1/18 ⎠ The following example shows another situation that can arise and one you need to Section 1.4: Inverses of Matrices 39 be prepared for. ⎛ 1 2 –3 ⎞ Example 1.29. Find the inverse of A = ⎜ 3 –1 0 ⎟ ⎝ 5 3 –6 ⎠ R2 – 3R1 ⎛ 1 2 –3 ⎪ 1 0 0 ⎞ Solution: ⎜ 3 –1 0 ⎪ 0 1 0 ⎟ ⎝ 5 3 –6 ⎪ 0 0 1 ⎠ ⎛ 1 2 –3 ⎪ 1 0 0 ⎞ ⎜ 0 –7 9 ⎪ –3 1 0 ⎟ ⎝ 0 –7 9 ⎪ –5 0 1 ⎠ R3 – 5R1 R3 – R2 ⎛ 1 2 –3 ⎪ 1 0 0 ⎞ ⎜ 0 –7 9 ⎪ –3 1 0 ⎟ ⎝ 0 0 0 ⎪ –2 –1 1 ⎠ So what does this mean? Well, in referring back to the original example in this section, A was augmented by the identity matrix because it was necessary to solve a couple of different systems of equations, where the systems had the same coefficient matrix (namely A) and the constant terms were columns of the identity matrix. So in trying to solve ⎛ 1 2 –3 ⎪ 1 ⎞ ⎜ 3 –1 0 ⎪ 0 ⎟ ⎝ 5 3 –6 ⎪ 0 ⎠ the procedure above produces a last row that says 0 = –2. This means there is no solution to this system and thus this matrix A has no inverse. (Of course, the system represented by the augmented matrix ⎛ 1 2 –3 ⎪ 0 ⎞ ⎜ 3 –1 0 ⎪ 1 ⎟ ⎝ 5 3 –6 ⎪ 0 ⎠ could have been looked at just as easily . That system results in a last row that says 0 = – 1. Or the system represented by the augmented matrix ⎛ 1 2 –3 ⎪ 0 ⎞ ⎜ 3 –1 0 ⎪ 0 ⎟ ⎝ 5 3 –6 ⎪ 1 ⎠ could have been used since it results in a last row that says 0 = 1.) In any case it turns 40 Chapter 1: Matrices out that this matrix doesn’t have an inverse. So even if a matrix is square, you can’t count on its having an inverse. The way to determine if a matrix (square) has an inverse is to go through the procedure illustrated above. If the matrix A can be row–reduced to the identity matrix, then it’ll have an inverse and the procedure above will have determined it. If A can’t be row–reduced to the identity matrix since a row of zeros shows up in the coefficient matrix at some point in the procedure, then A doesn’t have an inverse. It was suggested at the beginning of this section that if an inverse for a matrix A could be found then the matrix equation AX = B could be solved for the matrix X. That’s because if A has an inverse both sides of the equation could be multiplied by A–1 on the left to get A–1(AX) = A–1B so (A–1A)X = A–1B and IX = X = A–1B. Consider the following examples: Example 1.30. 2x – 3y = –6 x + 4y = 19 ⎛ 2 –3 ⎞ ⎛ x ⎞ ⎛ –6 ⎞ Let A = ⎜⎝ 1 4 ⎟⎠ , X = ⎜⎝ y ⎟⎠ , and B = ⎜⎝ 19 ⎟⎠ Then the matrix equation AX = B says ⎛ 2 –3 ⎞ ⎛ x ⎞ ⎛ 2x – 3y ⎞ ⎛ –6 ⎞ AX = ⎜⎝ 1 4 ⎟⎠ ⎜⎝ y ⎟⎠ = ⎜⎝ x + 4y ⎟⎠ = ⎜⎝ 19 ⎟⎠ = B which clearly leads to the above system of equations. But since ⎛ 4/11 3/11 ⎞ A–1 = ⎜⎝ –1/11 2/11 ⎟⎠ (see Example 1.26) then ⎛ x ⎞ ⎛ 4/11 3/11 ⎞ ⎛ –6 ⎞ ⎛ 3 ⎞ X = ⎜⎝ y ⎟⎠ = A–1B = ⎜⎝ –1/11 2/11 ⎟⎠ ⎜⎝ 19 ⎟⎠ = ⎜⎝ 4 ⎟⎠ , so x = 3 and y = 4. Section 1.4: Inverses of Matrices Example 1.31. 41 x – 5y + 2z = 1 3x – 14y + 3z = 0 4x – 18y + 3z = 2 The coefficient matrix is the same matrix used in Example 1.27, so ⎛ x ⎞ ⎜ ⎟ X = ⎜ y ⎟ = A–1B = ⎝ z ⎠ = 4. ⎛ 12 –21 13 ⎞ ⎛ 1 ⎞ ⎜ ⎟ ⎜ ⎟ ⎜ 3 –5 3 ⎟ ⎜ 0 ⎟ ⎝ 2 –2 1 ⎠ ⎝ 2 ⎠ Example 1.32. = ⎛ 38 ⎞ ⎜ ⎟ ⎜ 9 ⎟ . Thus, x = 38, y = 9, and z ⎝ 4 ⎠ x + 2y – 3z = 0 3x – y = 1 5x + 3y – 6z = –4 Here the coefficient matrix A is the one from example 1.29, which doesn’t have an inverse. So this method can’t be applied to solve for X. In particular, it means the system doesn’t have a unique solution and thus, there is either no solution or an infinite number of solutions. To determine which situation you’re dealing with, you’ll have to fall back on the methods of Section 3, Gauss–Jordan row reduction. Problems In Exercises 1-13, find the inverse of the matrix if it exists. If it doesn't exist, say so. For those which do exist check your answer by computing AA-1. 1. ⎛ 1 –3 ⎞ ⎝ 1 –2 ⎠ 4. ⎛ 3 2 ⎞ ⎝ 4 2 ⎠ 7. ⎛ 2 –5 3 ⎞ ⎜ 1 3 –4 ⎟ ⎝ –1 –4 5 ⎠ ⎛ 1 1 1 ⎞ 10. ⎜ 2 3 0 ⎟ ⎝ 6 8 2 ⎠ 2. ⎛ 4 3 ⎞ ⎝ –2 –1 ⎠ 5. (–5) 8. ⎛ 3 –1 1 ⎞ ⎜ 2 1 0 ⎟ ⎝ 1 2 –1 ⎠ ⎛ 3 2 3 ⎞ 11. ⎜ 2 2 1 ⎟ ⎝ 2 1 1 ⎠ 3. ⎛ 5 2 ⎞ ⎝ –1 1 ⎠ 6. ⎛ 1 1 2 ⎞ ⎜ 2 1 2 ⎟ ⎝ 1 1 1 ⎠ 9. ⎛ 2 1 1 ⎞ ⎜ 1 –1 1 ⎟ ⎝ 2 2 1 ⎠ ⎛ 1 2 3 ⎞ 12. ⎜ 2 3 4 ⎟ ⎝ 1 2 1 ⎠ 42 Chapter 1: Matrices ⎛ 1 1 2 ⎞ 13. ⎜ –1 0 3 ⎟ ⎝ 5 2 –5 ⎠ 14. ⎛ 10 ⎜ 1 ⎝ 0 0 1 1 1 1 0 1 1 0 1 0 1 ⎞ ⎟ ⎠ 15. ⎛ 12 ⎜ 3 ⎝ –1 1 4 1 –3 4 1 –4 6 2 0 –2 –1 ⎞ ⎟ ⎠ In Exercises 14-18, solve the systems of equations by using matrix inversion. Check your answers. 16. 2x + 3y = 3 4x + 2y = 7 17. 2x + y – z = 2 x–y+z=7 2x + 2y + z = 4 18. x 19. 3x + 2y + 2z = 2 x + y + 2z = 3 x + y + 6z = –1 – z=3 2y – 2z = 2 2x + z=3 20. x – z + u = 2 –2x + 3y + 3z + 7u = 3 2x – 6z = –1 –x + y + 2z + 2u = –2 21. For a particular production, Stewart Theater charges $12/ticket to nonstudents and $8/ticket to students. Records show that 600 people attended Friday night and 750 people attended Saturday night. Total receipts were $6480 on Friday and $8000 on Saturday. How many students and how many nonstudents attended each night? 22. A nutritionist has available three foods, containing the following percentages of protein, fat, and carbohydrate. A(%) B(%) C(%) protein .3 .4 ⎞ ⎛ .5 ⎜ ⎟ fat .3 .2 ⎟ ⎜ .1 carbohydrate ⎝ .2 .3 .2 ⎠ How many ounces of each food should be used to prepare each of the diets in the following table? Diet 1 (oz.) Diet 2 (oz.) protein 6.2 10 ⎛ ⎞ ⎜ ⎟ fat 2.8 4.4 ⎜ ⎟ ⎠ carbohydrate ⎝ 3.4 5.4 23. A manufacturer makes 3 products, A, B, and C at three different locations, I, II, and III. The manufacturing process gives off three pollutants, methylene chloride, carbon monoxide and freon. Each day, at each of the plants, the production of product A results in 3 metric tons of methylene chloride Section 1.4: Inverses of Matrices 43 2 metric tons of carbon monoxide 2 metric tons of freon. Producing product B results in 2 metric tons of methylene chloride 2 metric tons of carbon monoxide 1 metric ton of freon, and producing product C results in 2 metric tons of methylene chloride 1 metric ton of carbon monoxide 1 metric ton of freon. (a) Put the above information in a matrix. (b) Suppose the daily budget for removing these pollutants from each plant and for each product is I ($) II ($) III ($) A ⎛ 2500 3000 2200 ⎞ ⎜ ⎟ B ⎜ 2000 2200 1500 ⎟ C ⎝ 1400 1600 1200 ⎠ Use matrix methods to find the matrix of unit costs for removing methylene chloride, carbon monoxide and freon from plants I, II, and III. (Costs for removing a unit of each pollutant are the same at each plant.) Chapter 1 Review Problems ⎛ 2 0 ⎞ ⎛ 1 –1 4 ⎞ ⎛ 4 –1 ⎞ ⎛ –2 1 ⎞ 1. If A = ⎝ 0 2 0 ⎠ , B = ⎜ 0 3 ⎟ , C = ⎝ 2 0 ⎠ , and D = ⎝ 3 4 ⎠ perform the ⎝ 1 –2 ⎠ following computations, if possible. If the computations cannot be done, explain why not. (a) 2AB – 3C (b) D + ABC (c) 2BC – 3CD (d) (2C – 4D)A 2. Solve the following systems of equations, if possible. If not possible, write “no solution”. (a) 3x + 4y = 2 (b) 4x –5y – 2z = –4 2x – y = 5 –2x + 4y + 3z = 11 2x – y + z = 9 44 Chapter 1: Matrices (c) 2x –4y + 2z = –16 3x + 2y + z = 8 –2x + y –3z = 11 3. Find the inverses of the following matrices, if possible. ⎛ –2 3 0 ⎞ (a) ⎜ 0 –4 1 ⎟ ⎝ 1 3 0 ⎠ 4. (d) x – y + 2z = 4 3x + y + 4z = 6 x+y+z=1 x + 3y = 4 ⎛ 4 –3 1 ⎞ (b) ⎜ –3 1 –5 ⎟ ⎝ –5 0 –14 ⎠ ⎛ 0 2 –3 ⎞ (c) ⎜ 2 0 –3 ⎟ ⎝ 1 –1 1 ⎠ (a) Find all values of x and y that satisfy the matrix equation ⎛ .2 .8 ⎞ (x y) ⎝ .4 .6 ⎠ = (x y) (b) If, in addition, x + y = 1, then find x and y. 5. (a) Find all values of x, y, and z that satisfy the matrix equation ⎛ 1/3 1/3 1/3 ⎞ (x y z) ⎜ 2/3 0 1/3 ⎟ = (x y z) ⎝ 1 0 0 ⎠ (b) If, in addition, x + y + z = 1, then find x, y, and z. 6. Dr. Conrad bought 5000 shares of stock A, 8000 shares of stock B, and 10,000 shares of stock C. One share of stock A cost $25, a share of stock B cost $30 and a share of stock C cost $20. One year later, stocks A, B and C cost $30, $25 and $25 per share respectively. Use matrix methods to compare the amount she invested originally and the total value of her stocks after one year. How much was her profit or loss? 7. A movie theater chain has three different locations, A, B, and C, in a certain city. At each of the locations, the theaters sell 3 different sizes of soft-drinks, small, medium and large. On a certain evening, A sold 50 small drinks, 100 medium drinks and 75 large drinks. B sold 100 small, 150 medium and 200 large drinks and C sold 80 small, 200 medium and 130 large drinks. If the price of a small drink is $1, the price of a medium drink is $1.30 and the price of a large drink is $1.50, use matrix methods to find the total revenue at each theater for the drinks. 8. A refinery produces kerosene, gasoline and fuel oil from crude oil. Suppose the refinery receives 150,000 barrels of crude oil and is required to produce as much Chapter 1 Review Problems 45 gasoline as the combined total of fuel oil and kerosene. Also suppose the refinery needs to produce 40,000 more barrels of fuel oil than kerosene. Find out how many barrels of each product the refinery must produce. (Assume there is no waste in the refining of the crude oil into the three products.)