Modeling Real-World Data with Matrices Section 2-3 Before finishing this section you should be able to: • Model data using matrices • Add, subtract, and multiply matrices Remember: Your textbook is your friend! This presentation is just a supplement to the text. BEFORE you view this, make sure you read this section in your textbook and look at all the great examples that are also worked there for you. Intro to Matrices A matrix is a rectangular array of terms called elements arranged in rows and columns. These rows and columns make up the dimensions of the matrix. A matrix with m rows and n columns is a matrix. 3 0 5 1 6 8 This matrix has 2 rows and 3 columns. The dimensions are 2 x 3 There are several special matrices. A matrix with only one row is called a row matrix. For example: 1 3 7 A matrix with only one column is a column matrix. For example: 6 2 A matrix with the same number of rows as columns is called a square matrix, also called matrices of the nth order, where n is the number of rows and columns. For example: 4 5 3 3 This is a 2 x 2 matrix, so it is of order 2. Two matrices are equal matrices if they have the same dimensions and are identical, element by element. Matrices may be easily added and subtracted by simply adding or subtraction the corresponding elements. The dimensions of the two matrices must be the same. A matrix whose elements are all zeros is a zero matrix. A zero matrix is an additive identity matrix because adding a zero matrix to any matrix will not change that matrix. zero matrix (identity matrix) 0 1 0 1 1 0 1 0 1 1 A number called a scalar may also multiply matrices. Each element is multiplied by the scalar. 2 6 A 4 5 6 18 3A 12 15 Multiply each element in matrix A by the scalar 3. You can also find the product of two matrices. This is only possible when the number of columns in the first is equal to the number of rows in the second. Each element in the first row of the first matrix is multiplied by each corresponding element in the first column of the second matrix. Then add all of these products together. 3x3 2x2 2x3 4 1 2 4 2 1 2 3 A 0 1 0 B C 2 3 3 1 0 3 2 4 Find the product AB. AB is impossible because the dimensions of matrix A are 3 x 3 and the dimensions of matrix B are 2 x 2. In order to multiply two matrices the number of columns in the first matrix must match the number of rows in the second matrix. A has 3 columns and B has 2 rows so we have a dimension mismatch and we cannot multiply these two matrices. Find the product BC. B is a 2 x 2 matrix and C is a 2 x 3 matrix. The number of columns in B is 2 and the number of rows in C is 2, therefore we can multiply these two matrices. 4 2 1 2 3 BC 3 1 0 2 3 Multiply each row in B by each column in C. (4 1) (2 3) (4 2) (2 1) (4 3) (2 0) 10 10 12 BC BC 7 1 6 ( 2 1) (3 3) ( 2 2) (3 1) ( 2 3) (3 0) DESSERT Jessica does a survey on the cost of four different desserts at three local restaurants. At restaurant A, a slice of apple pie is priced at $2.25, a brownie sundae is priced at $2.95, a slice of apple cobbler is priced at $1.95, and an ice cream cone is priced at $1.10. At restaurant B, apple pie is $2.75, a brownie sundae is $3.45, apple cobbler is $2.50, and an ice cream cone is $1.65. At restaurant C, apple pie is $2.40, a brownie sundae is $2.70, apple cobbler is $2.35, and an ice cream cone is $1.15. a. Use a matrix to represent the data. b. Use a symbol to represent the price of a brownie sundae at restaurant C. a. To represent data using a matrix, choose which category will be represented by the columns and which will be represented by the rows. Let’s use the columns to represent the prices at each restaurant and the rows to represent the prices of each dessert. Then write each data piece as you would if you were placing the data in a table. A apple pie $2.25 brownie sundae $2.95 $1.95 apple cobbler $1.10 ice cream B $2.75 $3.45 $2.50 $1.65 Notice that the category names appear outside of the matrix. C $2.40 $2.70 $2.35 $1.15 b. The price of a brownie sundae at restaurant C is found in row 2, column 3 of the matrix. This element is represented by the symbol a23. Find the values of x and y for which the matrix equation is true. y 3 x + 16 x 3 y Since the corresponding elements are equal, we can express the equality of the matrices as two equations. y = 3x + 16 x = 3y Solve the system of equations by using substitution. y = 3x + 16 y = 3(3y) + 16 y = -2 Solve for y. x = 3(-2) x = -6 Substitute 3y for x. Substitute –2 for y in the second equation to find x. The matrices are equal if x = -6 and y = -2. Check by substituting into the matrices. More Examples 4 -2 6 Find A + B if A = 1 3 -3 -1 2 5 and B = -4 1 7 A + B = 4 (1) 2 2 6 5 1 (4) 3 1 3 7 = 3 0 11 3 4 4 Find C – D if C = C – D = C + -D = = 5 2 8 1 and D = -4 3 2 -1 2 5 -3 4 6 -8 3 5 5 2 2 5 8 1 3 4 4 3 6 8 2 1 3 5 5 (2) 2 (5) 3 -3 83 11 -3 1 ( 4) or 4 (6) -10 11 38 2 (3) 1 (5) -1 -6 1 3 4 If A = , find 2A. 2 5 0 3 6 2 1 3 4 2 2 5 0 = 3 6 2 2 6 8 4 10 0 6 12 4 2(1) 2(3) 2(4) 2(2) 2(5) 2(0) 2(3) 2(6) 2(2) = Multiply each element by 2. 2 4 Use matrices A = 0 1 and C = -3 4 2 1 5 0 ,B= 3 1 -2 4 0 -1 , to find each product. Find the product AB AB = 2 4 3 1 2 0 1 4 0 1 2(3) 4(4) 2(1) 4(0) 2(2) 4(1) 22 2 -8 0(3) 1(4) 0(1) 1(0) 0(2) 1(1) = 4 0 -1 Find the product BC B is a 2 3 matrix and C is a 2 3 matrix. Since B does not have the same number of columns as C has rows, the product BC does not exist. BC is undefined. Calculator Instructions http://helmet.stetson.edu/~mhale/teach/ti83 .htm#matrices http://dwb.unl.edu/calculators/activities/Matr ices.html http://occawlonline.pearsoned.com/bookbin d/pubbooks/pirnot_awl/chapter1/medialib /tech/ti83tutorial.pdf Helpful Websites MATRICES: http://www.ping.be/~ping1339/matr.htm http://www.purplemath.com/modules/matrices2.htm http://www.purplemath.com/modules/mtrxadd.htm http://www.purplemath.com/modules/mtrxmult.htm http://www.purplemath.com/modules/mtrxmult2.htm 2-3 Self-Check Quiz: http://www.glencoe.com/sec/math/studytools/cgibin/msgQuiz.php4?isbn=0-07-8608619&chapter=2&lesson=3&quizType=1&headerFile=4&state=