2.1 Matrices Reminder: A matrix with m rows and n columns has size m x n. (This is also sometimes referred to as the order of the matrix.) The entry in the ith row and jth column of a matrix A is denoted by a ij. If the number of rows equals the number of columns, we call the matrix a. 1 7 3 3 Consider the matrix: A = 9 1 2 11 4 6 2 8 What is the size of A? What is a 23? What is a 12? Two matrices are equal if they have the same size and all their corresponding entries are equal. We can add or subtract two matrices only if they have the same size. If they are the same size, we add or subtract them by adding or subtracting all their corresponding entries. If we multiply a matrix by a scalar (constant), then every entry in the matrix is multiplied by this scalar. Multiplying by a scalar does NOT change the size of the matrix. 3 1 2 6 Example: Consider the matrices A = 2 4 and B = 1 3. Compute 2A + 3B. 4 0 5 2 If A is an m x n matrix with entries a ij, the transpose of A, denoted A T, is the n x m matrix found by making the rows of A the columns of A T. 1 4 Example: Let A = 2 8. What is A T? 3 5 Solve for the variables in the following matrix equation. [ [ [ T a + 3 4 1 6 3 d 2 = 2 6 9 7b 1 c 8 1
2.2 Matrix Multiplication Multiplying matrices is not as easy as adding and subtracting them. If A is an m x n matrix and B is an r x s matrix, then for the matrix product AB to make sense, we must have that n = r. In other words, the number of columns in A MUST equal the number of rows in B. The resulting matrix, AB, is an m x s matrix. To multiply AB, we move across the rows of A as we move down the columns of B. We multiply the corresponding entries and add them up. Use the ROWS of the first matrix and the COLUMNS of the second matrix. Example: Let A = [ 2 1 1 3 2 a and let B = 3 b 1 4. What is AB? 5 1 BA= 3 b 1 4 5 1 [ 2 1 1 3 2 a = 6 + 3b 3 + ab 10 9 7 5 a 2
Example: Let A = [ 7 1 3 9 8 4 and let B = [ 3 2 4 1 4 6. What is AB? You can multiply matrices on the calculator as long as there are no variable entries. Is it true that AB = BA? NO, matrix multiplication is NOT commutative. [ [ 1 2 3 1 Let A = and let B =. Find AB and BA. 3 5 1 4 If A is 2 3, B is 4 4 and C is 3 4, determine if the following operations are possible. If so, give the resulting size. 4AC + B BC T A T 3
Matrix multiplication is used when dealing with matrices that represent data. If you are organizing data in a matrix, USE LABELS!!!! 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 doesn t make sense. The number of children, students, and adults who attended movie I, II, and III on a given Friday are given in the matrix A below. The admission price is $2 for children, $3 for students, and $4 for adults. C S A I 225 110 50 A = II 75 180 225 III 280 85 110 Come up with a matrix B to multiply A by where the product matrix will give the amount of money brought in by each movie on that Friday. There are 4 possibilities: B = and multiply B = and multiply B = and multiply B = and multiply 4
Example: The matrix P below gives the number of units of rice, beef, and lamb per serving of three different types of dog food. Matrix Q gives the number of servings of each type of dog food that are fed to three large dogs: Brutus, Max, and Atom. P = rice beef lamb F ood I 5 9 12 F ood II 4 8 3 Q = F ood III 7 10 11 What is the meaning of the product P Q? F ood I F ood II F ood III Brutus 3 5 6 Max 4 1 8 Atom 7 2 3 What is the meaning of the product QP? The Identity Matrix, I n is the n x n matrix that has 1 s all along the diagonal and 0 s everywhere else. [ 1 0 0 1 0 For example, I 2 = and I 0 1 3 = 0 1 0. I 4 = 0 0 1 The identity matrix for matrices acts like the number 1 for numbers. We know that for any real number a, 1 a = a and a 1 = a. For any matrix A, I n A = A and AI n = A (assuming the identity matrix is the appropriate size). 5
2.3 Inverse of a Square Matrix Let A be a square matrix of size n. The inverse of A, denoted A 1, is the matrix such that A 1 A = AA 1 = I n [ [ 4 5 Verify that the following two matrices are inverses of each other: A = and B = 2 3 3 2 5 2 1 2 AB = BA = Not all matrices have inverses. Square matrices that have inverses are said to be nonsingular. Matrices that do NOT have inverses are said to be singular. 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. Find the inverse, if it exists, of each of the following matrices. A = 1 1 3 2 1 2 2 2 1 ; A 1 = B = 1 2 0 3 4 2 5 0 2 ; B 1 = Inverses are necessary when solving equations involving matrices because we cannot divide by a matrix. Solve the matrix equation AX = B for X. Solve the matrix equation XB XE = D for X. 6
Solve the matrix equation HX + X = F for X. There is another way to solve systems of equations that uses inverses. It involves first writing the system as a martix equation AX = B. Example: Write the following system of equations as a matrix equation AX = B. 2x 3y + 4z = 6 2y 3z = 7 x y + 2z = 4 To solve the system using inverses, we already saw that if AX = B, then X = A 1 B. Solve the above system. In practice, it is usually much easier to solve a system of equations using rref because not all matrices have inverses. 7
2.4 Applications: Leontief Input-Output Model Leontief models are an application of matrices. These models relate industrial production and consumer demand in a simplified economy. In order to produce goods in an economy, some of those goods must be used up during production. We relate the use/consumption of resources with the output of resources using an Input-Output matrix. The rows reprsent input and the columns represent output. Example: Consider the input-output matrix A below for a simple economy consisting of three sectors: food, clothing, and shelter. A = F C S F 0.4 0.3 0.3 C 0.2 0.2 0.4 S 0.1 0.3 0.2 How many units of clothing are required to produce one unit of food? How many units of shelter are needed to produce one unit of clothing? If we respresent the total output of the sectors by a 3 x 1 column matrix X = x y z, then the matrix AX represents the amount of goods consumed in the production of that output. In other words, the matrix X represents the total gross production or output, and the matrix AX represents the amount of internal consumption/required resources to produce that output. However, there are also the needs of the community to be considered, which we call demand and represent by a matrix D. The goal is to figure out how much of each sector needs to be produced in order to satisfy both the consumption during production as well as the demand required by consumers. X AX = D For the input-output matrix above, how much total output must be produced to satisfy an external demand of $350 worth of food, $200 worth of clothing, and $100 worth of sheleter? (Round answers to the nearest whole number.) 8
Example: An economy consists of two sectors: Agricultural and Mechanical. To produce one unit of agricultural goods requires 0.4 units of agricultural goods and 0.1 units of mechanical goods. One unit of mechanical goods requires 0.2 units of agricultural goods and 0.3 units of mechanical goods. How much of each sector must be produced to satisfy demand of $300 worth of agricultural and $250 worth of mechanical goods? (Round answers to the nearest whole number.) Example: Suppose an economy consists of the 3 sectors: agricultural, manufacturing, and service. Production of one unit of agricultural products requires the consumption of 0.4 unit of agricultural products, 0.1 unit of manufacturing products, and 0.2 unit of services. Production of one unit of manufacturing products requires the use of 0.1 unit of agricultural products, 0.4 unit of manufacturing products, and 0.2 unit of service products. Production of one unit of service products consumes 0.1 unit of agricultural products, 0.3 unit of manufacturing products, and 0.2 unit of services. Find the gross output of goods needed to satisfy a consumer demand for 200 units of agricultural products, 100 units of manufactured products, and 600 units of service. (Round answers to the nearest whole number.) 9