Matrices and Matrix Operations

Learning Objectives

In this section, you will:

  • Find the sum and difference of two matrices.
  • Find scalar multiples of a matrix.
  • Find the product of two matrices.

Figure 1. (credit: “SD Dirk,” Flickr)

Two club soccer teams, the Wildcats and the Mud Cats, are hoping to obtain new equipment for an upcoming season. (Figure) 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 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.

Finding the Sum and Difference of Two 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 namedA,B,A,B,andCare shown below.

A=[1234],B=[127056782],C=[103321]

Describing Matrices

A matrix is often referred to by its size or dimensions: m × n indicatingmrows andncolumns. Matrix entries are defined first by row and then by column. For example, to locate the entry in matrixAidentified asaij,we look for the entry in rowi,columnj.In matrixA, \hspace{0.17em}shown below, the entry in row 2, column 3 isa23.

A=[a11a12a13a21a22a23a31a32a33]

A square matrix is a matrix with dimensions n × n,meaning that it has the same number of rows as columns. The3×3matrix above is an example of a square matrix.

A row matrix is a matrix consisting of one row with dimensions1 × n.

[a11a12a13]

A column matrix is a matrix consisting of one column with dimensionsm × 1.

[a11a21a31]

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:A,B,C,and so on. Each entry in a matrix is referred to asaij,such thatirepresents the row andjrepresents the column. Matrices are often referred to by their dimensions:m×nindicatingmrows andncolumns.

Finding the Dimensions of the Given Matrix and Locating Entries

Given matrixA:

  1. What are the dimensions of matrixA?
  2. What are the entries ata31anda22?
    A=[210247312]

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 matrix and another 3 × 3 matrix, but we cannot add or subtract a 2 × 3 matrix and a 3 × 3 matrix because some entries in one matrix will not have a corresponding entry in the other matrix.

Adding and Subtracting Matrices

Given matricesAandBof like dimensions, addition and subtraction ofAandBwill produce matrixCor

A+B=C such that aij+bij=cij

AB=D such that aijbij=dij

Matrix addition is commutative.

A+B=B+A

It is also associative.

(A+B)+C=A+(B+C)

Finding the Sum of Matrices

Find the sum ofAandB,given

A=[abcd] and B=[efgh]

Adding Matrix A and Matrix B

Find the sum ofAandB.

A=[4132] and B=[5907]

Finding the Difference of Two Matrices

Find the difference ofAandB.

A=[2301] and B=[8154]

Finding the Sum and Difference of Two 3 x 3 Matrices

GivenAandB:

  1. Find the sum.
  2. Find the difference.
A=[2102141210422] and B=[61020124522]

Try It

Add matrixAand matrixB.

A=[261013] and B=[321543]

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.

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 (Figure).

Lab A Lab B
Computers 15 27
Computer Tables 16 34
Chairs 16 34

Converting the data to a matrix, we have

C2013=[151616273434]

To calculate how much computer equipment will be needed, we multiply all entries in matrixCby 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]

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

[333566]

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

[151616273434]+[333566]=[181919324040]

This means

C2014=[181919324040]

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.

Scalar Multiplication

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

A=[a11a12a21a22]

the scalar multiplecAis

cA=c[a11a12a21a22] =[ca11ca12ca21ca22]

Scalar multiplication is distributive. For the matricesA,B,andC with scalarsaandb,

a(A+B)=aA+aB(a+b)A=aA+bA

Multiplying the Matrix by a Scalar

Multiply matrixAby the scalar 3.

A=[8154]

Try It

Given matrixB,find2Bwhere

B=[4132]

Finding the Sum of Scalar Multiples

Find the sum3A+2B.

A=[120012436] and B=[121032014]

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. IfAis an m × r matrix andBis an r × n matrix, then the product matrixABis an m × n matrix. For example, the productABis possible because the number of columns inAis the same as the number of rows inB.If the inner dimensions do not match, the product is not defined.

We multiply entries ofAwith entries ofBaccording 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 rowiofAB,we multiply the entries in rowiofA by columnjinBand add. For example, given matricesA andB,where the dimensions ofAare2 × 3and the dimensions ofBare3 × 3,the product ofABwill be a2 × 3matrix.

A=[a11a12a13a21a22a23] and B=[b11b12b13b21b22b23b31b32b33]

Multiply and add as follows to obtain the first entry of the product matrixAB.

  1. To obtain the entry in row 1, column 1 ofAB,multiply the first row inAby the first column inB,and add.
    [a11a12a13][b11b21b31]=a11b11+a12b21+a13b31
  2. To obtain the entry in row 1, column 2 ofAB,multiply the first row ofA by the second column inB,and add.
    [a11a12a13][b12b22b32]=a11b12+a12b22+a13b32
  3. To obtain the entry in row 1, column 3 ofAB,multiply the first row ofAby the third column inB,and add.
    [a11a12a13][b13b23b33]=a11b13+a12b23+a13b33

We proceed the same way to obtain the second row ofAB.In other words, row 2 ofAtimes column 1 ofB;row 2 ofAtimes column 2 ofB;row 2 ofAtimes column 3 ofB.When complete, the product matrix will be

AB=[a11b11+a12b21+a13b31a21b11+a22b21+a23b31a11b12+a12b22+a13b32a21b12+a22b22+a23b32a11b13+a12b23+a13b33a21b13+a22b23+a23b33]

Properties of Matrix Multiplication

For the matricesA,B,andCthe following properties hold.

  • Matrix multiplication is associative:(AB)C=A(BC).
  • Matrix multiplication is distributive:C(A+B)=CA+CB,(A+B)C=AC+BC.

Note that matrix multiplication is not commutative.

Multiplying Two Matrices

Multiply matrixAand matrixB.

A=[1234] and B=[5678]

Multiplying Two Matrices

GivenAandB:

  1. FindAB.
  2. FindBA.
A=[123405] and B=[542103]

Analysis

Notice that the productsABandBAare not equal.

AB=[7103011][91010481210421]=BA

This illustrates the fact that matrix multiplication is not commutative.

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

Yes, consider a matrix A with dimension3×4and matrix B with dimension4×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.

Using Matrices in Real-World Problems

Let’s return to the problem presented at the opening of this section. We have (Figure), 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 (Figure).

Goal $300
Ball $10
Jersey $30

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

E=[63014102420]

The cost matrix is written as

C=[3001030]

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]

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],...
  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.

Using a Calculator to Perform Matrix Operations

FindABC given

A=[1525324172810342],B=[45213724521964831],and C=[1008998255674674275].

Access these online resources for additional instruction and practice with matrices and matrix operations.

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. A3×2matrix has three rows and two columns. See (Figure).
  • We add and subtract matrices of equal dimensions by adding and subtracting corresponding entries of each matrix. See (Figure), (Figure), (Figure), and (Figure).
  • Scalar multiplication involves multiplying each entry in a matrix by a constant. See (Figure).
  • Scalar multiplication is often required before addition or subtraction can occur. See (Figure).
  • 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,AandB,is obtained by multiplying each entry in row 1 ofAby each entry in column 1 ofB;then multiply each entry of row 1 ofAby each entry in columns 2 ofB,and so on. See (Figure) and (Figure).
  • Many real-world problems can often be solved using matrices. See (Figure).
  • We can use a calculator to perform matrix operations after saving each matrix as a matrix variable. See (Figure).

Section Exercises

Verbal

Can we add any two matrices together? If so, explain why; if not, explain why not and give an example of two matrices that cannot be added together.

Can we multiply any column matrix by any row matrix? Explain why or why not.

Can both the productsABandBAbe defined? If so, explain how; if not, explain why.

Can any two matrices of the same size be multiplied? If so, explain why, and if not, explain why not and give an example of two matrices of the same size that cannot be multiplied together.

Does matrix multiplication commute? That is, doesAB=BA?If so, prove why it does. If not, explain why it does not.

Algebraic

For the following exercises, use the matrices below and perform the matrix addition or subtraction. Indicate if the operation is undefined.

A=[1307],B=[214226],C=[15892126],D=[101472561],E=[612145],F=[097817154]

A+B

C+D

A+C

BE

C+F

DB

For the following exercises, use the matrices below to perform scalar multiplication.

A=[461312],B=[392112064],C=[163718905329],D=[18121381467421]
5A
3B

2B

4C

12C

100D

For the following exercises, use the matrices below to perform matrix multiplication.

A=[1532],B=[3648012],C=[4102659],D=[23129310810]

AB

BC

CA

BD

DC

CB

For the following exercises, use the matrices below to perform the indicated operation if possible. If not possible, explain why the operation cannot be performed.

A=[2567],B=[9642],C=[0971],D=[875432092],E=[453765109]

A+BC

4A+5D

2C+B

3D+4E

C0.5D

100D10E

For the following exercises, use the matrices below to perform the indicated operation if possible. If not possible, explain why the operation cannot be performed. (Hint:A2=AA)

A=[1020525],B=[40102030],C=[100110]
AB

BA

CA

BC

A2

B2

C2

B2A2

A2B2

(AB)2

(BA)2

For the following exercises, use the matrices below to perform the indicated operation if possible. If not possible, explain why the operation cannot be performed. (Hint:A2=AA)

A=[1023],B=[234115],C=[0.50.110.20.50.3],D=[101675421]

AB

BA

BD

DC

D2

A2

D3

(AB)C

A(BC)

Technology

For the following exercises, use the matrices below to perform the indicated operation if possible. If not possible, explain why the operation cannot be performed. Use a calculator to verify your solution.

A=[2091830.545],B=[0.530416872],C=[101010101]

AB

BA

CA

BC

ABC

Extensions

For the following exercises, use the matrix below to perform the indicated operation on the given matrix.

B=[100001010]

B2

B3

B4

B5

Using the above questions, find a formula forBn.Test the formula forB201andB202,using a calculator.

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