# 3.3 Matrix Operations

Two club soccer teams, the Wildcats and the Mud Cats, are hoping to obtain new equipment for an upcoming season. The table below shows the needs of both teams.

 Wildcats Mud Cats Goals 6 10 Balls 30 24 Jerseys 14 20

A goal costs $300; a ball costs$10; and a jersey costs 30. How can we find the total cost for the equipment needed for each team? In the last section we learned how matrices can be used to solve systems of linear equations. In this section, we will explore other uses of matrices, and discover a method in which the data in the soccer equipment table can be displayed and used for calculating other information. Then, we will be able to calculate the cost of the equipment in a way that can be easily translated to a computer or calculator. #### Finding the Sum and Difference of Two Matrices To solve a problem like the one in the section opener, we can use a matrix, which is a rectangular array of numbers. A row in a matrix is a set of numbers that are aligned horizontally. A column in a matrix is a set of numbers that are aligned vertically. Each number is an entry, sometimes called an element, of the matrix. Matrices (plural) are enclosed in [ ] or ( ), and are usually named with capital letters. For example, three matrices named , , and are shown below. ##### Describing Matrices A matrix is often referred to by its size or dimensions: indicating rows and columns. Matrix entries are defined first by row and then by column. For example, to locate the entry in matrix identified as , we look for the entry in row , column . In matrix , shown below, the entry in row 2, column 3 is . A square matrix is a matrix with dimensions , meaning that it has the same number of rows as columns. The matrix above is an example of a square matrix. A row matrix is a matrix consisting of one row with dimensions A column matrix is a matrix consisting of one column with dimensions . A matrix may be used to represent a system of equations. In these cases, the numbers represent the coefficients of the variables in the system. Matrices often make solving systems of equations easier because they are not encumbered with variables. We will investigate this idea further in the next section, but first we will look at basic matrix operations. Matrices A matrix is a rectangular array of numbers that is usually named by a capital letter: and so on. Each entry in a matrix is referred to as such that represents the row and represents the column. Matrices are often referred to by their dimensions: indicating rows and columns. Example of a Matrix Given matrix a. What are the dimension of matrix ? b. What are the entries at and ? a. The dimensions are because there are 3 rows and 2 columns. b. Entry is the number at row 3 column 1, which is 3. The entry at is the number at row 2, column 2, which is 4. Remember, the row comes first, then the column. #### Adding and Subtracting Matrices We use matrices to list data or to represent systems. Because the entries are numbers, we can perform operations on matrices. We add or subtract matrices by adding or subtracting corresponding entries. In order to do this, the entries must correspond. Therefore, addition and subtraction of matrices is only possible when the matrices have the same dimensions. We can add or subtract a matrix and another matrix, but we cannot add or subtract a matrix and a matrix because some entries in one matrix will not have a corresponding entry in the other matrix. Adding and Subtracting Matrices Given matrices and of like dimensions, addition and subtraction of and will produce matrix or matrix of the same dimensions. such that such that Matrix addition is commutative: It is also associative: Example Adding and Subtracting Matrices Given and : a. Find the sum. b. Find the difference. a. Add the corresponding entries: b. Subtract the corresponding entries: Try it Now 1 Add matrix and matrix . #### Finding Scalar Multiples of a Matrix Besides adding and subtracting whole matrices, there are many situations in which we need to multiply a matrix by a constant called a scalar. Recall that a scalar is a real number quantity that has magnitude, but not direction. For example, time, temperature, and distance are scalar quantities. The process of scalar multiplication involves multiplying each entry in a matrix by a scalar. A scalar multiple is any entry of a matrix that results from scalar multiplication. Scalar Multiplication Scalar multiplication involves finding the product of a constant by each entry in the matrix. Given : the scalar multiple is: Scalar multiplication is distribute. For the matrices and and with scalars and : Example Multiplying a Matrix by a Scalar Multiply matrix by the scalar 3. Multiply each entry in by the scalar 3. Try it Now 2 Given matrix find where Example with Scalars and Matrix Addition Find the sum given the following matrices and . First, find , then . Now,add . #### Finding the Product of Two Matrices In addition to multiplying a matrix by a scalar, we can multiply two matrices. Finding the product of two matrices is only possible when the inner dimensions are the same, meaning that the number of columns of the first matrix is equal to the number of rows of the second matrix. If is an matrix and is an matrix, then the product matrix is an matrix. For example, the product is possible because the number of columns in is the same as the number of rows in . If the inner dimensions do not match, the product is not defined. We multiply entries of with entries of according to a specific pattern as outlined below. The process of matrix multiplication becomes clearer when working a problem with real numbers. To obtain the entries in row of , we multiply the entries in row of by column in and add. For example, given matrices and where the dimensions of are and the dimensions of are the product of will be a matrix. Multiplying Matrices To obtain the entry in row 1, column 1 of , multiply the first row in by the first column in and add. To obtain the entry in row 1, column 2 of , multiply the first row of by the second column in , and add. To obtain the entry in row 1, column 3 of multiply the first row of by the third column in , and add. We proceed the same way to obtain the second row of . In other words, row 2 of times column 1 of ; row 2 of times column 2 of ; row 2 of times column 3 of . When complete, the product matrix will be Properties of Matrix Multiplication For the matrices and the following properties hold. • Matrix Multiplication is associative: • Matrix Multiplication is distributive: and . Matrix Multiplication is NOT commutative. In other words, for matrices and . While they are equal is some specific cases, it is not always true. Examples of Multiplying Matrices a. Find First, we check the dimensions of the matrices. Matrix has dimensions and matrix has dimensions . The inner dimensions are the same so we can perform the multiplication. The product will have the dimensions . We perform the operations outlined previously. b. Given and : i. Find . ii. Find . i. As the dimensions of are and the dimensions of are , these matrices can be multiplied together because the number of columns in matches the number of rows in . The resulting product will be a matrix, the number of rows in by the number of columns in . ii.The dimensions of are and the dimensions of are . The inner dimensions match so the product is defined and will be a matrix. Notice in the example above that the products and are not equal. This illustrates the fact that matrix multiplication is not commutative. Also, this means that it is possible for to be defined but not . Consider a matrix with dimension and matrix with dimension . For the product the inner dimensions are 4 and the product is defined, but for the product the inner dimensions are 2 and 3 so the product is undefined. Try it Now 3 Multiply: Example of a Matrix Application Let’s return to the problem presented at the opening of this section. We have the table below representing the equipment needs of two soccer teams.  Wildcats Mud Cats Goals 6 10 Balls 30 24 Jerseys 14 20 We are also given the prices of the equipment,300 for Goals, $10 for Balls and$30 for Jerseys.

We will convert the data to matrices. Thus, the equipment need matrix is written as:

The cost matrix is written as

We perform matrix multiplication to obtain costs for the equipment.

The total cost for equipment for the Wildcats is $2,520, and the total cost for equipment for the Mud Cats is$3,840.

The calculation in the last example could easily be calculated using a calculator and computer, which would also easily handle a version of the problem with dozens of teams and hundreds of expenses.  Representing the problem as matrix operations allows us to utilize technology to help solve this type of problem.