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

Study Guides > Finite Math

Reading: Matrices and Matrix Operations

 
Two club soccer teams, the Wildcats and the Mud Cats, are hoping to obtain new equipment for an upcoming season. Table 1 shows the needs of both teams.
Table 1
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 named and are shown below. [latex-display]A=\matrix{{1}&{2}\\{3}&{4}}[/latex-display] [latex-display]\displaystyle{B = \left[\matrix{{1}&{2}&{7}\\{0}&{5}&{6}\\{7}&{8}&{2}}\right][/latex-display] [latex-display]\displaystyle{C = \left[\matrix{{1}&{3}\\{0}&{2}\\{3} & {1}}\right][/latex-display]

Describing Matrices

A matrix is often referred to by its size or dimensions: m × indicating m rows and n columns. Matrix entries are defined first by row and then by column. For example, to locate the entry in matrix A identified as aij we look for the entry in rowcolumnj.  In the matrix shown below, the entry in row 2, column 3 is a23 = [latex]\displaystyle{A}={\left[\matrix{{a}_{{11}}&{a}_{{12}}&{a}_{{13}}\\{a}_{{21}}&{a}_{{22}}&{a}_{{23}}\\{a}_{{31}}&{a}_{{32}}&{a}_{{33}}}\right][/latex] 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 1 × n [latex-display]\displaystyle{\left[\matrix{{a}_{11}&{a}_{{21}}&{a}_{{31}}\dots&{a}_{{n1}}\right][/latex-display] A column matrix is a matrix consisting of one column with dimensions m × 1 [latex-display]\displaystyle{\left[\matrix{{a}_{11}\\{a}_{{21}}\\{a}_{{31}}\right][/latex-display]   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

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 as aij, such that represents the row and represents the column. Matrices are often referred to by their dimensions: m × n indicating m rows and n columns.

Example 1

Given matrix find the dimensions of the given matrix and locating entries: [latex-display]\displaystyle{A}={\left[\matrix{{2}&{1}&{0}\\{2}&{4}&{7}\\{3}&{1}&-{2}}\right]}[/latex-display]
  1. What are the dimensions of matrix A
  2. What are the entries at and a31 and a22

Solutions

  1. The dimensions are 3 × 3 because there are three rows and three columns.
  2. Entry a31 is the number at row 3, column 1, which is 3. The entry a22 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 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.

A General Note

Given matrices A and B of like dimensions, addition and subtraction of A and B will produce matrix C or matrix of the same dimension. A + B = C such that aij + bij = cij A B = D such that aijbij= dij Matrix addition is commutative. A + B = B + A It is also associative. (A + B) + C = A + (B + C)

Example 2

  1. Find the sum of A and B given[latex]\displaystyle{A}={\left[\matrix{{a}&{b}\\{c}&{d}}\right]{\text{and}} {B}={\left[\matrix{{e}&{f}\\{g}&{h}}\right][/latex]
  2. Find the sum of A and B, given[latex]\displaystyle{A}={\left[\matrix{{4}&{1}\\{3}&{2}}\right] {\text{and}} {B}={\left[\matrix{{5}&{9}\\{0}&{7}}\right][/latex]
  3. Find the difference of A and B [latex]\displaystyle{A}={\left[\matrix{-{2}&{3}\\{0}&{1}}\right]{\text{and}} {B}={\left[\matrix{{8}&{1}\\{5}&{4}}\right]}[/latex]
  4. Given A and B: [latex]\displaystyle{A}={\left[\matrix{{2}&-{10}&-{2}\\{14}&{12}&{10}\\{4}&-{2}&{2}}\right]} {\text{and}} {B}={\left[\matrix{{6}&{10}&-{2}\\{0}&-{12}&-{4}\\-{5}&{2}&-{2}}\right]}[/latex]
 
  1. Find the sum.
  2. Find the difference.
  • Add matrix A and matrix B [latex]\displaystyle{A}={\left[\matrix{{2}&{6}\\{1}&{0}\\{1}&-{3}}\right]}{\text{and}}{B}={\left[\matrix{{3}&-{2}\\{1}&{5}\\-{4}&{3}}\right]}[/latex]

Solutions

  1. [latex]\displaystyle{A}+{B}={\left[\matrix{{a}&{b}\\{c}&{d}}\right]}+{\left[\matrix{{e}&{f}\\{g}&{h}}\right]}={\left[\matrix{{a}+{e}&{b}+{f}\\{c}+{g}&{d}+{h}}\right]}[/latex]
  2. Add corresponding entries. Add the entry in row 1, column 1, a11, of matrix A to the entry in row 1, column 1, b11, of B. Continue the pattern until all entries have been added. [latex]\displaystyle{A}+{B}={\left[\matrix{{4}&{1}\\{3}&{2}}\right]}+{\left[\matrix{{5}&{9}\\{0}&{7}}\right]}={\left[\matrix{{4}+{5}&{1}+{9}\\{3}+{0}&{2}+{7}}\right]}={\left[\matrix{{9}&{10}\\{3}&{9}}]\right}[/latex]
  3. We subtract the corresponding entries of each matrix. [latex]\displaystyle{A}-{B}={\left[\matrix{-{2}&{3}\\{0}&{1}}\right]}-{\left[\matrix{{8}&{1}\\{5}&{4}}\right]}={\left[\matrix{-{2}-{8}&{3}-{1}\\{0}-{5}&{1}-{4}}\right]}={\left[\matrix{-{10}&{2}\\-{5}&-{3}}\right]}[/latex]
    1. Add the corresponding entries [latex]\displaystyle{A}+{B}={\left[\matrix{{2}&-{10}&-{2}\\{14}&{12}&{10}\\{4}&-{2}&{2}}\right]}+{\left[\matrix{{6}&{10}&-{2}\\{0}&-{12}&-{4}\\-{5}&{2}&-{2}}\right]}[/latex]
    2. Subtract the corresponding entries [latex]\displaystyle{A}-{B}={\left[\matrix{{2}&-{10}&-{2}\\{14}&{12}&{10}\\{4}&-{2}&{2}}\right]}-{\left[\matrix{{6}&{10}&-{2}\\{0}&-{12}&-{4}\\-{5}&{2}&-{2}}\right]}[/latex]
  4. [latex]\displaystyle{A}+{B}={\left[\matrix{{2}&{6}\\{1}&{0}\\{1}&-{3}}\right]}+{\left[\matrix{{3}&-{2}\\{1}&{5}\\-{4}&{3}}\right]}={\left[\matrix{{2}+{3}&{6}+{(-{2})}\\{1}+{1}&{0}+{5}\\{1}+{(-{4})}&-{3}+{3}}\right]}={\left[\matrix{{5}&{4}\\{2}&{5}\\-{3}&{0}}\right]}[/latex]

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 Table 2.
Table 2
Lab A Lab B
Computers 15 27
Computer Tables 16 34
Chairs 16 34
Converting the data to a matrix, we have [latex-display]\displaystyle{C}_{{2013}}={\left[\matrix{{15}&{27}\\{16}&{34}\\{16}&{34}}\right]}[/latex-display] To calculate how much computer equipment will be needed, we multiply all entries in matrix C by 0.15. [latex-display]\displaystyle{({0.15})}{C}_{{2013}}={\left[\matrix{{({0.15})}{15}&{({0.15})}{27}\\{({0.15})}{16}&{({0.15})}{34}\\{({0.15})}{16}&{({0.15})}{34}}\right]}={\left[\matrix{{2.25}&{4.05}\\{2.4}&{5.1}\\{2.4}&{5.1}}\right]}[/latex-display] We must round up to the next integer, so the amount of new equipment needed is [latex-display]\displaystyle{\left[\matrix{{3}&{5}\\{3}&{6}\\{3}&{6}}\right]}[/latex-display] Adding the two matrices as shown below, we see the new inventory amounts. [latex-display]\displaystyle{\left[\matrix{{15}&{27}\\{16}&{34}\\{16}&{34}}\right]}+{\left[\matrix{{3}&{5}\\{3}&{6}\\{3}&{6}}\right]}={\left[\matrix{{18}&{32}\\{19}&{40}\\{19}&{40}}\right]}[/latex-display] This means [latex-display]\displaystyle{C}_{{2014}}={\left[\matrix{{18}&{32}\\{19}&{40}\\{19}&{40}}\right]}[/latex-display] 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 [latex-display]\displaystyle{A}={\left[\matrix{{a}_{{11}}&{a}_{{12}}\\{a}_{{21}}&{a}_{{22}}}\right]}[/latex-display] the scalar multiple cA is [latex-display]\displaystyle{c}{A}={c}{\left[\matrix{{a}_{{11}}&{a}_{{12}}\\{a}_{{21}}&{a}_{{22}}}\right]}={\left[\matrix{{c}{a}_{{11}}&{c}{a}_{{12}}\\{c}{a}_{{21}}&{c}{a}_{{22}}}\right]}[/latex-display] Scalar multiplication is distributive. For the matrices A, B, and C with scalars a and b [latex-display]\displaystyle{a}{({A}+{B})}={a}{A}+{a}{B}[/latex-display] [latex-display]\displaystyle{({a}+{b})}{A}={a}{A}+{b}{A}[/latex-display]

Example 3

  1. Multiply matrix by the scalar 3.
[latex-display]\displaystyle{A}={\left[\matrix{{8}&{1}\\{5}&{4}}\right]}[/latex-display]

2. Given matrix B find –2B where

[latex-display]\displaystyle{B}={\left[\matrix{{4}&{1}\\{3}&{2}}\right]}[/latex-display]

3.  Find the sum 3A + 2B

[latex-display]\displaystyle{A}={\left[\matrix{{1}&-{2}&{0}\\{0}&-{1}&{2}\\{4}&{3}&-{6}}\right]} {\text{and}}{B}={\left[\matrix{-{1}&{2}&{1}\\{0}&-{3}&{2}\\{0}&{1}&-{4}}\right]}[/latex-display]

Solutions

  1. [latex]\displaystyle{3}{A}={3}{\left[\matrix{{8}&{1}\\{5}&{4}}\right]}={\left[\matrix{{3}\cdot{8}&{3}\cdot{1}\\{3}\cdot{5}&{3}\cdot{4}}\\right]}={\left[\matrix{{24}&{3}\\{15}&{12}}\right]}[/latex]
  2. [latex]\displaystyle-{2}{B}={\left[\matrix{-{8}&-{2}\\-{6}&-{4}}\right]}[/latex]
  3. First, find 3A then 2B [latex]\displaystyle{3}{A}={\left[\matrix{{3}\cdot{1}&{3}{(-{2})}&{3}\cdot{0}\\{3}\cdot{0}&{3}{(-{1})}&{3}\cdot{2}\\{3}\cdot{4}&{3}\cdot{3}&{3}{(-{6})}}\right]}={\left[\matrix{{3}&-{6}&{0}\\{0}&-{3}&{6}\\{12}&{9}&-{18}}\right]}[/latex].  Now, add 3A + 2B.[latex]\displaystyle{3}{A}+{2}{B}={\left[\matrix{{3}&-{6}&{0}\\{0}&-{3}&{6}\\{12}&{9}&-{18}}\right]}+{\left[\matrix{-{2}&{4}&{2}\\{0}&-{6}&{4}\\{0}&{2}&-{8}}\right]}[/latex]

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 A is an m × r matrix and B is an r × n matrix, then the product matrix AB is an m × n matrix. For example, the product AB is possible because the number of columns in A is the same as the number of rows in B. If the inner dimensions do not match, the product is not defined. A times B when A is a 2 by 3 and B is a 3 by 3. The number of columns in A is the same number of rows in B. We multiply entries of A with entries of B 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 i of AB we multiply the entries in row i of A by column j in B and add. For example, given matrices A and B where the dimensions of A are 2 × 3 and the dimensions of B are 3 × 3, the product of AB will be a 2 × 3 matrix. [latex-display]\displaystyle{A}={\left[\matrix{{a}_{{11}}&{a}_{{12}}&{a}_{{13}}\\{a}_{{21}}&{a}_{{22}}&{a}_{{23}}}\right]} {\text{and}} {B}={\left[\matrix{{b}_{{11}}&{b}_{{12}}&{b}_{{13}}\\{b}_{{21}}&{b}_{{22}}&{b}_{{23}}\\{b}_{{31}}&{b}_{{32}}&{b}_{{33}}}\right]}[/latex-display] Multiply and add as follows to obtain the first entry of the product matrix AB.
  1. To obtain the entry in row 1, column 1 of AB, multiply the first row in A by the first column in B, and add [latex]\displaystyle{[{a}_{{11}} {a}_{{12}} {a}_{{13}}]}\cdot{\left[\matrix{{b}_{{11}}\\{b}_{{21}}\\{b}_{{31}}}\right]={a}_{{11}}\cdot{b}_{{11}}+{a}_{{12}}\cdot{b}_{{21}}+{a}_{{13}}\cdot{b}_{{31}}[/latex]
  2. To obtain the entry in row 1, column 2 of AB, multiply the second row in A by the second column in B, and add [latex]\displaystyle{[{a}_{{11}} {a}_{{12}} {a}_{{13}}]}\cdot{\left[\matrix{{b}_{{12}}\\{b}_{{22}}\\{b}_{{32}}}\right]={a}_{{11}}\cdot{b}_{{12}}+{a}_{{12}}\cdot{b}_{{22}}+{a}_{{13}}\cdot{b}_{{32}}[/latex]
  3. To obtain the entry in row 1, column 3 of AB, multiply the third row in A by the third column in B, and add [latex]\displaystyle{[{a}_{{11}} {a}_{{12}} {a}_{{13}}]}\cdot{\left[\matrix{{b}_{{13}}\\{b}_{{23}}\\{b}_{{33}}}\right]={a}_{{11}}\cdot{b}_{{13}}+{a}_{{12}}\cdot{b}_{{23}}+{a}_{{13}}\cdot{b}_{{33}}[/latex]
We proceed the same way to obtain the second row of AB. In other words, row 2 of A times column 1 of B; row 2 of A times column 2 of B; row 2 of Atimes column 3 of B. When complete, the product matrix will be [latex-display]\displaystyle{A}{B}={\left[\matrix{{a}_{{11}}\cdot{b}_{{11}}+{a}_{{12}}\cdot{b}_{{21}}+{a}_{{13}}\cdot{b}_{{31}}&{a}_{{11}}\cdot{b}_{{12}}+{a}_{{12}}\cdot{b}_{{22}}+{a}{13}\cdot{b}_{{32}}&{a}_{{11}}\cdot{b}_{{13}}+{a}_{{12}}\cdot{b}_{{23}}+{a}_{{13}}\cdot{b}_{{33}}\\{a}_{{21}}\cdot{b}_{{11}}+{a}_{{22}}\cdot{b}_{{21}}+{a}_{{23}}\cdot{b}_{{31}}&{a}_{{21}}\cdot{b}_{{12}}+{a}_{{22}}\cdot{b}_{{22}}+{a}_{{23}}\cdot{b}_{{32}}&{a}_{{21}}\cdot{b}_{{13}}+{a}_{{22}}\cdot{b}_{{23}}+{a}_{{23}}\cdot{b}_{{33}}}\right]}[/latex-display]

Properties of Matrix Multiplication

For the matrices A, B, and C the 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.

Example 4

  1. Multiply matrix A and matrix B. [latex]\displaystyle{A}={\left[\matrix{{1}&{2}\\{3}&{4}}\right]}{\text{and}}{B}={\left[\matrix{{5}&{6}\\{7}&{8}}\right]}[/latex]
  2. Given A and B: [latex-display]\displaystyle{A}={\left[\matrix{-{1}&{2}&{3}\\{4}&{0}&{5}}\right]}{\text{and}}{B}={\left[\matrix{{5}&-{1}\\-{4}&{0}\\{2}&{3}}\right]}[/latex-display]
    1. Find AB
    2. Find BA

Solutions

  1. First, we check the dimensions of the matrices. Matrix A has dimensions 2 × 2 and matrix B has dimensions 2 × 2. The inner dimensions are the same so we can perform the multiplication. The product will have the dimensions 2 × 2. We perform the operations outlined previously.[latex]\displaystyle{A}{B}={\left[\matrix{{1}&{2}\\{3}&{4}}\right]}\cdot{\left[\matrix{{5}&{6}\\{7}&{8}}\right]}={\left[\matrix{{1}{({5})}+{2}{({7})}&{1}{({6})}+{2}{({8})}\\{3}{({5})}+{4}{({7})}&{3}{({6})}+{4}{({8})}}\right]}={\left[\matrix{{19}&{22}\\{43}&{50}}\right]}[/latex]
  2. Notice that the products AB and BA are not equal.[latex]\displaystyle{A}{B}={\left[\matrix{-{7}&{10}\\{30}&{11}}\right]}\neq{\left[\matrix{-{9}&{10}&{10}\\{4}&-{8}&-{12}\\{10}&{4}&{21}}\right]}={B}{A}[/latex]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 × 4 and matrix B with dimension 4 × 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 5

Using Matrices in Real-World Problems Let's return to the problem presented at the opening of this section. We have Table 3, representing the equipment needs of two soccer teams.
Table 3
Wildcats Mud Cats
Goals 6 10
Balls 30 24
Jerseys 14 20
We are also given the prices of the equipment, as shown in Table 4.
Table 4
Goal $300
Ball $10
Jersey $30
We will convert the data to matrices. Thus, the equipment need matrix is written as [latex-display]\displaystyle{E}={\left[\matrix{{6}&{10}\\{30}&{24}\\{14}&{20}}\right]}[/latex-display] The cost matrix is written as [latex-display]\displaystyle{C}={[{300} {10} {30}]}[/latex-display] We perform matrix multiplication to obtain costs for the equipment. [latex-display]\displaystyle{C}{E}={[{300} {10} {30}]}\cdot{\left[\matrix{{6}&{10}\\{30}&{24}\\{14}&{20}}\right]}={[{300}{({6})}+{10}{({30})}+{30}{({14})} {300}{({10})}+{10}{({24})}+{30}{({20})}]}={[{2},{520} {3},{840}]}[/latex-display] 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
  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 6

Using a calculator to perform matrix operations, find ABC given [latex-display]\displaystyle{A}={\left[\matrix{-{15}&{25}&{32}\\{41}&-{7}&-{28}\\{10}&{34}&-{2}}\right]},{B}={\left[\matrix{{45}&{21}&-{37}\\-{24}&{52}&{19}\\{6}&-{48}&-{31}}\right]},{\text{and}}{C}={\left[\matrix{-{100}&-{89}&-{98}\\{25}&-{56}&{74}\\-{67}&{42}&-{75}}\right]}[/latex-display]

Solutions

On the matrix page of the calculator, we enter matrix above as the matrix variablematrix above as the matrix variableand matrix above as the matrix variable On the home screen of the calculator, we type in the problem and call up each matrix variable as needed. [ A] × [B] − [C] The calculator gives us the following matrix. [latex-display]\displaystyle{\left[\matrix{-{983}&-{462}&{136}\\{1820}&{1897}&-{856}\\-{311}&{2032}&{413}}\right]}[/latex-display]

Media

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. A 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, and is obtained by multiplying each entry in row 1 of by each entry in column 1 of then multiply each entry of row 1 of by each entry in columns 2 of 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.

OpenStax, Precalculus, "Matrices and Matrix Operations," licensed under a CC BY 3.0 license. SD Dirk, "UCSD Trition Womens Soccer 005," licensed under a CC-BY license. Mathispower4u, "Dimensions of a Matrix," licensed under a Standard YouTube license. Mathispower4u, "Ex: Matrix Addition and Subtraction," licensed under a Standard YouTube license. Mathispower4u, "Ex: Matrix Operations—Scalar Multiplication, Addition, and Subtraction," licensed under a Standard YouTube license. Mathispower4u, "Ex 1: Matrix Multiplication," licensed under a Standard YouTube license.