We've updated our
Privacy Policy effective December 15. Please read our updated Privacy Policy and tap

Study Guides > College Algebra

Matrices and Matrix Operations

Two club soccer teams, the Wildcats and the Mud Cats, are hoping to obtain new equipment for an upcoming season. The table shows the needs of both teams.
Wildcats Mud Cats
Goals 6 10
Balls 30 24
Jerseys 14 20
Two teams playing soccer. (credit: "SD Dirk," Flickr)
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 this section, we 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.

Add and Subtract Matrices

To solve a problem like the one described for the soccer teams, 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 A,B,A,B,\text{} and CC are shown below.

A=[1234],B=[127056782],C=[103321]A=\left[\begin{array}{cc}1& 2\\ 3& 4\end{array}\right],B=\left[\begin{array}{ccc}1& 2& 7\\ 0& -5& 6\\ 7& 8& 2\end{array}\right],C=\left[\begin{array}{c}-1\\ 0\\ 3\end{array}\begin{array}{c}3\\ 2\\ 1\end{array}\right]

Describing Matrices

A matrix is often referred to by its size or dimensions:  m × n \text{ }m\text{ }\times \text{ }n\text{ } indicating mm rows and nn columns. Matrix entries are defined first by row and then by column. For example, to locate the entry in matrix AA identified as aij,{a}_{ij},\text{} we look for the entry in row i,i,\text{} column jj. In matrix AA\text{, \hspace{0.17em}} shown below, the entry in row 2, column 3 is a23{a}_{23}.

A=[a11a12a13a21a22a23a31a32a33]A=\left[\begin{array}{ccc}{a}_{11}& {a}_{12}& {a}_{13}\\ {a}_{21}& {a}_{22}& {a}_{23}\\ {a}_{31}& {a}_{32}& {a}_{33}\end{array}\right]

A square matrix is a matrix with dimensions  n × n,\text{ }n\text{ }\times \text{ }n,\text{} meaning that it has the same number of rows as columns. The 3×33\times 3 matrix above is an example of a square matrix. A row matrix is a matrix consisting of one row with dimensions 1 × n1\text{ }\times \text{ }n.

[a11a12a13]\left[\begin{array}{ccc}{a}_{11}& {a}_{12}& {a}_{13}\end{array}\right]

A column matrix is a matrix consisting of one column with dimensions m × 1m\text{ }\times \text{ }1.

[a11a21a31]\left[\begin{array}{c}{a}_{11}\\ {a}_{21}\\ {a}_{31}\end{array}\right]

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.

A General Note: Matrices

A matrix is a rectangular array of numbers that is usually named by a capital letter: A,B,C,A,B,C,\text{} and so on. Each entry in a matrix is referred to as aij{a}_{ij}, such that ii represents the row and jj represents the column. Matrices are often referred to by their dimensions: m×nm\times n indicating mm rows and nn columns.

Example: Finding the Dimensions of the Given Matrix and Locating Entries

Given matrix A:A:
  1. What are the dimensions of matrix A?A?
  2. What are the entries at a31{a}_{31} and a22?{a}_{22}?

A=[210247312]A=\left[\begin{array}{rrrr}\hfill 2& \hfill & \hfill 1& \hfill 0\\ \hfill 2& \hfill & \hfill 4& \hfill 7\\ \hfill 3& \hfill & \hfill 1& \hfill -2\end{array}\right]

Answer:

  1. The dimensions are  3 × 3 \text{ }3\text{ }\times \text{ }3\text{ } because there are three rows and three columns.
  2. Entry a31{a}_{31} is the number at row 3, column 1, which is 3. The entry a22{a}_{22} 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  3 × 3 \text{ }3\text{ }\times \text{ }3\text{ } matrix and another  3 × 3 \text{ }3\text{ }\times \text{ }3\text{ } matrix, but we cannot add or subtract a  2 × 3 \text{ }2\text{ }\times \text{ }3\text{ } matrix and a  3 × 3 \text{ }3\text{ }\times \text{ }3\text{ } matrix because some entries in one matrix will not have a corresponding entry in the other matrix.

A General Note: Adding and Subtracting Matrices

Given matrices AA and BB of like dimensions, addition and subtraction of AA and BB will produce matrix CC or matrix DD of the same dimension.

A+B=C such that aij+bij=cijA+B=C\text{ such that }{a}_{ij}+{b}_{ij}={c}_{ij}

AB=D such that aijbij=dijA-B=D\text{ such that }{a}_{ij}-{b}_{ij}={d}_{ij}

Matrix addition is commutative.

A+B=B+AA+B=B+A

It is also associative.

(A+B)+C=A+(B+C)\left(A+B\right)+C=A+\left(B+C\right)

Example: Finding the Sum of Matrices

Find the sum of AA and B,B,\text{} given

A=[abcd] and B=[efgh]A=\left[\begin{array}{cc}a& b\\ c& d\end{array}\right]\text{ and }B=\left[\begin{array}{cc}e& f\\ g& h\end{array}\right]

Answer: Add corresponding entries.

A+B=[abcd]+[efgh] =[a+eb+fc+gd+h]\begin{array}{l}A+B=\left[\begin{array}{cc}a& b\\ c& d\end{array}\right]+\left[\begin{array}{cc}e& f\\ g& h\end{array}\right]\hfill \\ \text{ }=\left[\begin{array}{ccc}a+e& & b+f\\ c+g& & d+h\end{array}\right]\hfill \end{array}

Products of Matrices

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. Consider a real-world scenario in which a university needs to add to its inventory of computers, computer tables, and chairs in two of the campus labs due to increased enrollment. They estimate that 15% more equipment is needed in both labs. The school’s current inventory is displayed in the table below.
Lab A Lab B
Computers 15 27
Computer Tables 16 34
Chairs 16 34
Converting the data to a matrix, we have

C2013=[151616273434]{C}_{2013}=\left[\begin{array}{c}15\\ 16\\ 16\end{array}\begin{array}{c}27\\ 34\\ 34\end{array}\right]

To calculate how much computer equipment will be needed, we multiply all entries in matrix CC by 0.15.

(0.15)C2013=[(0.15)15(0.15)16(0.15)16(0.15)27(0.15)34(0.15)34]=[2.252.42.44.055.15.1]\left(0.15\right){C}_{2013}=\left[\begin{array}{c}\left(0.15\right)15\\ \left(0.15\right)16\\ \left(0.15\right)16\end{array}\begin{array}{c}\left(0.15\right)27\\ \left(0.15\right)34\\ \left(0.15\right)34\end{array}\right]=\left[\begin{array}{c}2.25\\ 2.4\\ 2.4\end{array}\begin{array}{c}4.05\\ 5.1\\ 5.1\end{array}\right]

We must round up to the next integer, so the amount of new equipment needed is

[333566]\left[\begin{array}{c}3\\ 3\\ 3\end{array}\begin{array}{c}5\\ 6\\ 6\end{array}\right]

Adding the two matrices as shown below, we see the new inventory amounts.

[151616273434]+[333566]=[181919324040]\left[\begin{array}{c}15\\ 16\\ 16\end{array}\begin{array}{c}27\\ 34\\ 34\end{array}\right]+\left[\begin{array}{c}3\\ 3\\ 3\end{array}\begin{array}{c}5\\ 6\\ 6\end{array}\right]=\left[\begin{array}{c}18\\ 19\\ 19\end{array}\begin{array}{c}32\\ 40\\ 40\end{array}\right]

This means

C2014=[181919324040]{C}_{2014}=\left[\begin{array}{c}18\\ 19\\ 19\end{array}\begin{array}{c}32\\ 40\\ 40\end{array}\right]

Thus, Lab A will have 18 computers, 19 computer tables, and 19 chairs; Lab B will have 32 computers, 40 computer tables, and 40 chairs.

A General Note: Scalar Multiplication

Scalar multiplication involves finding the product of a constant by each entry in the matrix. Given

A=[a11a12a21a22]A=\left[\begin{array}{cccc}{a}_{11}& & & {a}_{12}\\ {a}_{21}& & & {a}_{22}\end{array}\right]

the scalar multiple cAcA is

cA=c[a11a12a21a22] =[ca11ca12ca21ca22]\begin{array}{l}cA=c\left[\begin{array}{ccc}{a}_{11}& & {a}_{12}\\ {a}_{21}& & {a}_{22}\end{array}\right]\hfill \\ \text{ }=\left[\begin{array}{ccc}c{a}_{11}& & c{a}_{12}\\ c{a}_{21}& & c{a}_{22}\end{array}\right]\hfill \end{array}

Scalar multiplication is distributive. For the matrices A,BA,B, and CC with scalars aa and bb,

a(A+B)=aA+aB(a+b)A=aA+bA\begin{array}{l}\\ \begin{array}{c}a\left(A+B\right)=aA+aB\\ \left(a+b\right)A=aA+bA\end{array}\end{array}

Example: Multiplying the Matrix by a Scalar

Multiply matrix AA by the scalar 3.

A=[8154]A=\left[\begin{array}{cc}8& 1\\ 5& 4\end{array}\right]

Answer: Multiply each entry in AA by the scalar 3.

3A=3[8154]=[38313534]=[2431512]\begin{array}{l}3A=3\left[\begin{array}{rr}\hfill 8& \hfill 1\\ \hfill 5& \hfill 4\end{array}\right]\hfill \\ = \left[\begin{array}{rr}\hfill 3\cdot 8& \hfill 3\cdot 1\\ \hfill 3\cdot 5& \hfill 3\cdot 4\end{array}\right]\hfill \\ = \left[\begin{array}{rr}\hfill 24& \hfill 3\\ \hfill 15& \hfill 12\end{array}\right]\hfill \end{array}

Try It

Given matrix B,B,\text{} find 2B-2B where

B=[4132]B=\left[\begin{array}{cc}4& 1\\ 3& 2\end{array}\right]

Answer: 2B=[8264]-2B=\left[\begin{array}{cc}-8& -2\\ -6& -4\end{array}\right]

Example: Finding the Sum of Scalar Multiples

Find the sum 3A+2B3A+2B.

A=[120012436] and B=[121032014]A=\left[\begin{array}{rrr}\hfill 1& \hfill -2& \hfill 0\\ \hfill 0& \hfill -1& \hfill 2\\ \hfill 4& \hfill 3& \hfill -6\end{array}\right]\text{ and }B=\left[\begin{array}{rrr}\hfill -1& \hfill 2& \hfill 1\\ \hfill 0& \hfill -3& \hfill 2\\ \hfill 0& \hfill 1& \hfill -4\end{array}\right]

Answer: First, find 3A,3A,\text{} then 2B2B.

3A=[313(2)30303(1)3234333(6)]=[36003612918]\begin{array}{l}\begin{array}{l}\hfill \\ \hfill \\ 3A=\left[\begin{array}{lll}3\cdot 1\hfill & 3\left(-2\right)\hfill & 3\cdot 0\hfill \\ 3\cdot 0\hfill & 3\left(-1\right)\hfill & 3\cdot 2\hfill \\ 3\cdot 4\hfill & 3\cdot 3\hfill & 3\left(-6\right)\hfill \end{array}\right]\hfill \end{array}\hfill \\ =\left[\begin{array}{rrr}\hfill 3& \hfill -6& \hfill 0\\ \hfill 0& \hfill -3& \hfill 6\\ \hfill 12& \hfill 9& \hfill -18\end{array}\right]\hfill \end{array} 2B=[2(1)2221202(3)2220212(4)]=[242064028]\begin{array}{l}\begin{array}{l}\hfill \\ \hfill \\ 2B=\left[\begin{array}{lll}2\left(-1\right)\hfill & 2\cdot 2\hfill & 2\cdot 1\hfill \\ 2\cdot 0\hfill & 2\left(-3\right)\hfill & 2\cdot 2\hfill \\ 2\cdot 0\hfill & 2\cdot 1\hfill & 2\left(-4\right)\hfill \end{array}\right]\hfill \end{array}\hfill \\ =\left[\begin{array}{rrr}\hfill -2& \hfill 4& \hfill 2\\ \hfill 0& \hfill -6& \hfill 4\\ \hfill 0& \hfill 2& \hfill -8\end{array}\right]\hfill \end{array}

Now, add 3A+2B3A+2B.

3A+2B=[36003612918]+[242064028] =[326+40+20+0366+412+09+2188] =[1220910121126]\begin{array}{l}\hfill \\ \hfill \\ 3A+2B=\left[\begin{array}{rrr}\hfill 3& \hfill -6& \hfill 0\\ \hfill 0& \hfill -3& \hfill 6\\ \hfill 12& \hfill 9& \hfill -18\end{array}\right]+\left[\begin{array}{rrr}\hfill -2& \hfill 4& \hfill 2\\ \hfill 0& \hfill -6& \hfill 4\\ \hfill 0& \hfill 2& \hfill -8\end{array}\right]\hfill \\ \text{ }=\left[\begin{array}{rrr}\hfill 3 - 2& \hfill -6+4& \hfill 0+2\\ \hfill 0+0& \hfill -3 - 6& \hfill 6+4\\ \hfill 12+0& \hfill 9+2& \hfill -18 - 8\end{array}\right]\hfill \\ \text{ }=\left[\begin{array}{rrr}\hfill 1& \hfill -2& \hfill 2\\ \hfill 0& \hfill -9& \hfill 10\\ \hfill 12& \hfill 11& \hfill -26\end{array}\right]\hfill \end{array}

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 AA is an  m × r \text{ }m\text{ }\times \text{ }r\text{ } matrix and BB is an  r × n \text{ }r\text{ }\times \text{ }n\text{ } matrix, then the product matrix ABAB is an  m × n \text{ }m\text{ }\times \text{ }n\text{ } matrix. For example, the product ABAB is possible because the number of columns in AA is the same as the number of rows in BB. If the inner dimensions do not match, the product is not defined. A has two rows and three columns and B has three rows and three columns. Because the number of columns in A matches the number of rows in B, the product of A and B is defined. We multiply entries of AA with entries of BB 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 ii of AB,AB,\text{} we multiply the entries in row ii of AA by column jj in BB and add. For example, given matrices AA and B,B,\text{} where the dimensions of AA are 2 × 32\text{ }\times \text{ }3 and the dimensions of BB are 3 × 3,3\text{ }\times \text{ }3,\text{} the product of ABAB will be a 2 × 32\text{ }\times \text{ }3 matrix.

A=[a11a12a13a21a22a23] and B=[b11b12b13b21b22b23b31b32b33]A=\left[\begin{array}{rrr}\hfill {a}_{11}& \hfill {a}_{12}& \hfill {a}_{13}\\ \hfill {a}_{21}& \hfill {a}_{22}& \hfill {a}_{23}\end{array}\right]\text{ and }B=\left[\begin{array}{rrr}\hfill {b}_{11}& \hfill {b}_{12}& \hfill {b}_{13}\\ \hfill {b}_{21}& \hfill {b}_{22}& \hfill {b}_{23}\\ \hfill {b}_{31}& \hfill {b}_{32}& \hfill {b}_{33}\end{array}\right]

Multiply and add as follows to obtain the first entry of the product matrix ABAB.
  1. To obtain the entry in row 1, column 1 of AB,AB,\text{} multiply the first row in AA by the first column in BB, and add.
    [a11a12a13][b11b21b31]=a11b11+a12b21+a13b31\left[\begin{array}{ccc}{a}_{11}& {a}_{12}& {a}_{13}\end{array}\right]\cdot \left[\begin{array}{c}{b}_{11}\\ {b}_{21}\\ {b}_{31}\end{array}\right]={a}_{11}\cdot {b}_{11}+{a}_{12}\cdot {b}_{21}+{a}_{13}\cdot {b}_{31}
  2. To obtain the entry in row 1, column 2 of AB,AB,\text{} multiply the first row of AA by the second column in BB, and add.
    [a11a12a13][b12b22b32]=a11b12+a12b22+a13b32\left[\begin{array}{ccc}{a}_{11}& {a}_{12}& {a}_{13}\end{array}\right]\cdot \left[\begin{array}{c}{b}_{12}\\ {b}_{22}\\ {b}_{32}\end{array}\right]={a}_{11}\cdot {b}_{12}+{a}_{12}\cdot {b}_{22}+{a}_{13}\cdot {b}_{32}
  3. To obtain the entry in row 1, column 3 of AB,AB,\text{} multiply the first row of AA by the third column in BB, and add.
    [a11a12a13][b13b23b33]=a11b13+a12b23+a13b33\left[\begin{array}{ccc}{a}_{11}& {a}_{12}& {a}_{13}\end{array}\right]\cdot \left[\begin{array}{c}{b}_{13}\\ {b}_{23}\\ {b}_{33}\end{array}\right]={a}_{11}\cdot {b}_{13}+{a}_{12}\cdot {b}_{23}+{a}_{13}\cdot {b}_{33}
We proceed the same way to obtain the second row of ABAB. In other words, row 2 of AA times column 1 of BB; row 2 of AA times column 2 of BB; row 2 of AA times column 3 of BB. When complete, the product matrix will be

AB=[a11b11+a12b21+a13b31a21b11+a22b21+a23b31a11b12+a12b22+a13b32a21b12+a22b22+a23b32a11b13+a12b23+a13b33a21b13+a22b23+a23b33]AB=\left[\begin{array}{c}\begin{array}{l}{a}_{11}\cdot {b}_{11}+{a}_{12}\cdot {b}_{21}+{a}_{13}\cdot {b}_{31}\\ \end{array}\\ {a}_{21}\cdot {b}_{11}+{a}_{22}\cdot {b}_{21}+{a}_{23}\cdot {b}_{31}\end{array}\begin{array}{c}\begin{array}{l}{a}_{11}\cdot {b}_{12}+{a}_{12}\cdot {b}_{22}+{a}_{13}\cdot {b}_{32}\\ \end{array}\\ {a}_{21}\cdot {b}_{12}+{a}_{22}\cdot {b}_{22}+{a}_{23}\cdot {b}_{32}\end{array}\begin{array}{c}\begin{array}{l}{a}_{11}\cdot {b}_{13}+{a}_{12}\cdot {b}_{23}+{a}_{13}\cdot {b}_{33}\\ \end{array}\\ {a}_{21}\cdot {b}_{13}+{a}_{22}\cdot {b}_{23}+{a}_{23}\cdot {b}_{33}\end{array}\right]

A General Note: Properties of Matrix Multiplication

For the matrices A,B,A,B,\text{} and CC the following properties hold.
  • Matrix multiplication is associative:
    (AB)C=A(BC)\left(AB\right)C=A\left(BC\right)
  • Matrix multiplication is distributive:
    C(A+B)=CA+CB,(A+B)C=AC+BC.\begin{array}{l}\begin{array}{l}\\ C\left(A+B\right)=CA+CB,\end{array}\hfill \\ \left(A+B\right)C=AC+BC.\hfill \end{array}
Note that matrix multiplication is not commutative.

Example: Multiplying Two Matrices

Multiply matrix AA and matrix BB.

A=[1234] and B=[5678]A=\left[\begin{array}{cc}1& 2\\ 3& 4\end{array}\right]\text{ and }B=\left[\begin{array}{cc}5& 6\\ 7& 8\end{array}\right]

Answer: First, we check the dimensions of the matrices. Matrix AA has dimensions 2×22\times 2 and matrix BB has dimensions 2×22\times 2. The inner dimensions are the same so we can perform the multiplication. The product will have the dimensions 2×22\times 2. We perform the operations outlined previously. The first column of the product of A and B is defined as the result of matrix -vector multiplication of A and the first column of B. Column two of the product of A and B is defined as the result of the matrix-vector multiplication of A and the second column of B.

 

Example: Multiplying Two Matrices

Given AA and B:B:
  1. Find ABAB.
  2. Find BABA.

A=[123405] and B=[542103]A=\left[\begin{array}{l}\begin{array}{ccc}-1& 2& 3\end{array}\hfill \\ \begin{array}{ccc}4& 0& 5\end{array}\hfill \end{array}\right]\text{ and }B=\left[\begin{array}{c}5\\ -4\\ 2\end{array}\begin{array}{c}-1\\ 0\\ 3\end{array}\right]

Answer:

  1. As the dimensions of AA are 2×32\text{}\times \text{}3 and the dimensions of BB are 3×2,3\text{}\times \text{}2,\text{} these matrices can be multiplied together because the number of columns in AA matches the number of rows in BB. The resulting product will be a 2×22\text{}\times \text{}2 matrix, the number of rows in AA by the number of columns in BB.
    AB=[123405] [514023] =[1(5)+2(4)+3(2)1(1)+2(0)+3(3)4(5)+0(4)+5(2)4(1)+0(0)+5(3)] =[7103011]\begin{array}{l}\hfill \\ AB=\left[\begin{array}{rrr}\hfill -1& \hfill 2& \hfill 3\\ \hfill 4& \hfill 0& \hfill 5\end{array}\right]\text{ }\left[\begin{array}{rr}\hfill 5& \hfill -1\\ \hfill -4& \hfill 0\\ \hfill 2& \hfill 3\end{array}\right]\hfill \\ \text{ }=\left[\begin{array}{rr}\hfill -1\left(5\right)+2\left(-4\right)+3\left(2\right)& \hfill -1\left(-1\right)+2\left(0\right)+3\left(3\right)\\ \hfill 4\left(5\right)+0\left(-4\right)+5\left(2\right)& \hfill 4\left(-1\right)+0\left(0\right)+5\left(3\right)\end{array}\right]\hfill \\ \text{ }=\left[\begin{array}{rr}\hfill -7& \hfill 10\\ \hfill 30& \hfill 11\end{array}\right]\hfill \end{array}
  2. The dimensions of BB are 3×23\times 2 and the dimensions of AA are 2×32\times 3. The inner dimensions match so the product is defined and will be a 3×33\times 3 matrix.
    BA=[514023] [123405] =[5(1)+1(4)5(2)+1(0)5(3)+1(5)4(1)+0(4)4(2)+0(0)4(3)+0(5)2(1)+3(4)2(2)+3(0)2(3)+3(5)] =[91010481210421]\begin{array}{l}\hfill \\ BA=\left[\begin{array}{rr}\hfill 5& \hfill -1\\ \hfill -4& \hfill 0\\ \hfill 2& \hfill 3\end{array}\right]\text{ }\left[\begin{array}{rrr}\hfill -1& \hfill 2& \hfill 3\\ \hfill 4& \hfill 0& \hfill 5\end{array}\right]\hfill \\ \text{ }=\left[\begin{array}{rrr}\hfill 5\left(-1\right)+-1\left(4\right)& \hfill 5\left(2\right)+-1\left(0\right)& \hfill 5\left(3\right)+-1\left(5\right)\\ \hfill -4\left(-1\right)+0\left(4\right)& \hfill -4\left(2\right)+0\left(0\right)& \hfill -4\left(3\right)+0\left(5\right)\\ \hfill 2\left(-1\right)+3\left(4\right)& \hfill 2\left(2\right)+3\left(0\right)& \hfill 2\left(3\right)+3\left(5\right)\end{array}\right]\hfill \\ \text{ }=\left[\begin{array}{rrr}\hfill -9& \hfill 10& \hfill 10\\ \hfill 4& \hfill -8& \hfill -12\\ \hfill 10& \hfill 4& \hfill 21\end{array}\right]\hfill \end{array}

Analysis of the Solution

Notice that the products ABAB and BABA are not equal.

AB=[7103011][91010481210421]=BAAB=\left[\begin{array}{cc}-7& 10\\ 30& 11\end{array}\right]\ne \left[\begin{array}{ccc}-9& 10& 10\\ 4& -8& -12\\ 10& 4& 21\end{array}\right]=BA

This illustrates the fact that matrix multiplication is not commutative.

Q & A

Is it possible for AB to be defined but not BA?

Yes, consider a matrix A with dimension 3×43\times 4 and matrix B with dimension 4×24\times 2. For the product AB the inner dimensions are 4 and the product is defined, but for the product BA the inner dimensions are 2 and 3 so the product is undefined.

Example: Using Matrices in Real-World Problems

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, as shown in the table below.
Goal $300
Ball $10
Jersey $30
We will convert the data to matrices. Thus, the equipment need matrix is written as

E=[63014102420]E=\left[\begin{array}{c}6\\ 30\\ 14\end{array}\begin{array}{c}10\\ 24\\ 20\end{array}\right]

The cost matrix is written as

C=[3001030]C=\left[\begin{array}{ccc}300& 10& 30\end{array}\right] We perform matrix multiplication to obtain costs for the equipment. CE=[3001030][61030241420] =[300(6)+10(30)+30(14)300(10)+10(24)+30(20)] =[2,5203,840]\begin{array}{l}\hfill \\ \hfill \\ CE=\left[\begin{array}{rrr}\hfill 300& \hfill 10& \hfill 30\end{array}\right]\cdot \left[\begin{array}{rr}\hfill 6& \hfill 10\\ \hfill 30& \hfill 24\\ \hfill 14& \hfill 20\end{array}\right]\hfill \\ \text{ }=\left[\begin{array}{rr}\hfill 300\left(6\right)+10\left(30\right)+30\left(14\right)& \hfill 300\left(10\right)+10\left(24\right)+30\left(20\right)\end{array}\right]\hfill \\ \text{ }=\left[\begin{array}{rr}\hfill 2,520& \hfill 3,840\end{array}\right]\hfill \end{array}

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

How To: Given a matrix operation, evaluate using a calculator.

  1. Save each matrix as a matrix variable
    [A],[B],[C],..\left[A\right],\left[B\right],\left[C\right],..
  2. Enter the operation into the calculator, calling up each matrix variable as needed.
  3. If the operation is defined, the calculator will present the solution matrix; if the operation is undefined, it will display an error message.

Example: Using a Calculator to Perform Matrix Operations

Find ABCAB-C given

A=[1525324172810342],B=[45213724521964831],and C=[1008998255674674275]A=\left[\begin{array}{rrr}\hfill -15& \hfill 25& \hfill 32\\ \hfill 41& \hfill -7& \hfill -28\\ \hfill 10& \hfill 34& \hfill -2\end{array}\right],B=\left[\begin{array}{rrr}\hfill 45& \hfill 21& \hfill -37\\ \hfill -24& \hfill 52& \hfill 19\\ \hfill 6& \hfill -48& \hfill -31\end{array}\right],\text{and }C=\left[\begin{array}{rrr}\hfill -100& \hfill -89& \hfill -98\\ \hfill 25& \hfill -56& \hfill 74\\ \hfill -67& \hfill 42& \hfill -75\end{array}\right].

Answer: On the matrix page of the calculator, we enter matrix AA above as the matrix variable [A]\left[A\right], matrix BB above as the matrix variable [B]\left[B\right], and matrix CC above as the matrix variable [C]\left[C\right]. On the home screen of the calculator, we type in the problem and call up each matrix variable as needed.

[A]×[B][C]\left[A\right]\times \left[B\right]-\left[C\right] The calculator gives us the following matrix. [9834621361,8201,8978563112,032413]\left[\begin{array}{rrr}\hfill -983& \hfill -462& \hfill 136\\ \hfill 1,820& \hfill 1,897& \hfill -856\\ \hfill -311& \hfill 2,032& \hfill 413\end{array}\right]

Key Concepts

  • A matrix is a rectangular array of numbers. Entries are arranged in rows and columns.
  • The dimensions of a matrix refer to the number of rows and the number of columns. A 3×23\times 2 matrix has three rows and two columns.
  • We add and subtract matrices of equal dimensions by adding and subtracting corresponding entries of each matrix.
  • Scalar multiplication involves multiplying each entry in a matrix by a constant.
  • Scalar multiplication is often required before addition or subtraction can occur.
  • Multiplying matrices is possible when inner dimensions are the same—the number of columns in the first matrix must match the number of rows in the second.
  • The product of two matrices, AA and BB, is obtained by multiplying each entry in row 1 of AA by each entry in column 1 of BB; then multiply each entry of row 1 of AA by each entry in columns 2 of B,B,\text{} and so on.
  • Many real-world problems can often be solved using matrices.
  • We can use a calculator to perform matrix operations after saving each matrix as a matrix variable.

Glossary

column a set of numbers aligned vertically in a matrix entry an element, coefficient, or constant in a matrix matrix a rectangular array of numbers row a set of numbers aligned horizontally in a matrix scalar multiple an entry of a matrix that has been multiplied by a scalar

Licenses & Attributions