Lesson 3 · Properties of Matrix Multiplication

Operation on Matrices

Optional MathematicsSubject
8 minEstimated read

Matrices and Their Order

A matrix is a rectangular arrangement of numbers in rows and columns, closed inside brackets. The numbers inside it are called its entries or elements. A matrix with \( m \) rows and \( n \) columns has order \( m \times n \), read as "m by n". The number of rows is always written first.

\[ A = \begin{pmatrix} 14 & 6 \\ 30 & 4 \\ 36 & 5 \end{pmatrix}_{3 \times 2} \]

This matrix has 3 rows and 2 columns, so its order is \( 3 \times 2 \). The entry in the second row and the first column is 30. The entry in the third row and the second column is 5.

Definition

Corresponding entries: entries of two matrices that sit in the same position, that is, in the same row and the same column of each matrix.

Numbers can be added, subtracted and multiplied, and matrices can be too, as long as a few rules are obeyed. Addition and subtraction are the simplest of these operations, because both of them work one entry at a time. Multiplication of matrices follows different rules and is learnt separately.

Adding Matrices: Nepal Airlines Flights

Nepal Airlines runs two kinds of flight service. Domestic services fly between places inside Nepal, and international services fly to other countries. The number of flights in the first three days of a week was recorded in one table, called Lot A, and the number in the last three days of the same week was recorded in another table, called Lot B.

Lot A: domestic and international flights on Sunday, Monday and Tuesday.
Lot A: domestic and international flights on Sunday, Monday and Tuesday.
Lot B: domestic and international flights on Wednesday, Thursday and Friday.
Lot B: domestic and international flights on Wednesday, Thursday and Friday.

How many flights of each kind were made in these six days? The two tables have exactly the same shape: three rows of days and two columns of services. So the first row of Lot A is added to the first row of Lot B, the second row to the second row, and the third row to the third row. Domestic flights are added only to domestic flights, and international flights only to international flights.

DaysDomestic flightsInternational flights
Sunday + Wednesday14 + 40 = 546 + 5 = 11
Monday + Thursday30 + 42 = 724 + 7 = 11
Tuesday + Friday36 + 38 = 745 + 6 = 11

The same working can be written much more neatly with matrices. Each lot becomes a matrix, keeping its rows and columns in the same order as the table:

\[ A = \begin{pmatrix} 14 & 6 \\ 30 & 4 \\ 36 & 5 \end{pmatrix}, \quad B = \begin{pmatrix} 40 & 5 \\ 42 & 7 \\ 38 & 6 \end{pmatrix} \]

Step 1: Writing the sum of the two matrices:

\[ A + B = \begin{pmatrix} 14 & 6 \\ 30 & 4 \\ 36 & 5 \end{pmatrix} + \begin{pmatrix} 40 & 5 \\ 42 & 7 \\ 38 & 6 \end{pmatrix} \]

Step 2: Adding each entry of A to the entry in the same position of B:

\[ = \begin{pmatrix} 14 + 40 & 6 + 5 \\ 30 + 42 & 4 + 7 \\ 36 + 38 & 5 + 6 \end{pmatrix} \]

Step 3: Working out each sum:

\[ = \begin{pmatrix} 54 & 11 \\ 72 & 11 \\ 74 & 11 \end{pmatrix} \]

Reading the answer back as a table, there were \( 54 + 72 + 74 = 200 \) domestic flights and \( 11 + 11 + 11 = 33 \) international flights, so 233 flights in all. Look at the orders too. A and B are both \( 3 \times 2 \) matrices, and their sum is also a \( 3 \times 2 \) matrix.

The Rule for Adding Matrices

Definition

Addition of matrices: two matrices of the same order are added by adding their corresponding entries. The sum is a matrix of that same order.

\[ A_{m \times n} + B_{m \times n} = (A + B)_{m \times n} \]

Written with letters for two matrices of order \( 2 \times 3 \), the rule looks like this:

\[ \begin{pmatrix} a & b & c \\ d & e & f \end{pmatrix} + \begin{pmatrix} p & q & r \\ s & t & u \end{pmatrix} \]

\[ = \begin{pmatrix} a + p & b + q & c + r \\ d + s & e + t & f + u \end{pmatrix} \]

Each entry is added only to the entry in the same row and the same column of the other matrix.
Each entry is added only to the entry in the same row and the same column of the other matrix.

Every entry of the first matrix needs exactly one partner in the second matrix. That is only possible when the two matrices have the same number of rows and the same number of columns.

Common mistake

Matrices of different orders cannot be added. A \( 2 \times 2 \) matrix and a \( 2 \times 3 \) matrix cannot be added, because the third column of the second matrix has no partner. Their sum is not defined. Check the orders before adding anything.

Adding in Either Order: the Commutative Property

Does it matter which matrix is written first? Take two matrices of order \( 2 \times 3 \) and add them both ways.

\[ M = \begin{pmatrix} 3 & 7 & 9 \\ 11 & 13 & 15 \end{pmatrix}, \quad N = \begin{pmatrix} 2 & 4 & 6 \\ 8 & 10 & 12 \end{pmatrix} \]

Step 1: Adding corresponding entries with M written first:

\[ M + N = \begin{pmatrix} 3 + 2 & 7 + 4 & 9 + 6 \\ 11 + 8 & 13 + 10 & 15 + 12 \end{pmatrix} \]

Step 2: Working out each sum:

\[ M + N = \begin{pmatrix} 5 & 11 & 15 \\ 19 & 23 & 27 \end{pmatrix} \]

Step 3: Adding corresponding entries with N written first:

\[ N + M = \begin{pmatrix} 2 + 3 & 4 + 7 & 6 + 9 \\ 8 + 11 & 10 + 13 & 12 + 15 \end{pmatrix} \]

Step 4: Working out each sum:

\[ N + M = \begin{pmatrix} 5 & 11 & 15 \\ 19 & 23 & 27 \end{pmatrix} \]

Both answers are the same matrix, so \( M + N = N + M \). This is no accident. Each entry of the sum is the sum of two ordinary numbers, and ordinary numbers give the same total in either order: \( 3 + 2 \) and \( 2 + 3 \) are both 5. Since every entry stays the same, the whole matrix stays the same.

Definition

Commutative property of matrix addition: for any two matrices A and B of the same order, A + B = B + A. The order in which two matrices are added does not matter.

Subtracting Matrices

Definition

Subtraction of matrices: two matrices of the same order are subtracted by subtracting each entry of the second matrix from the corresponding entry of the first. The difference has the same order.

Subtraction is carried out exactly like addition, one position at a time, with a minus sign in place of the plus sign. Take these two matrices of order \( 3 \times 3 \):

\[ A = \begin{pmatrix} 5 & 7 & 3 \\ 4 & 6 & -5 \\ -7 & 3 & 10 \end{pmatrix}, \quad B = \begin{pmatrix} 3 & 4 & -1 \\ -3 & 4 & 2 \\ 5 & 1 & -8 \end{pmatrix} \]

Step 1: Subtracting each entry of B from the matching entry of A. Taking away a negative number is the same as adding its positive, so \( 3 - (-1) \) is written as \( 3 + 1 \):

\[ A - B = \begin{pmatrix} 5 - 3 & 7 - 4 & 3 + 1 \\ 4 + 3 & 6 - 4 & -5 - 2 \\ -7 - 5 & 3 - 1 & 10 + 8 \end{pmatrix} \]

Step 2: Working out each entry:

\[ A - B = \begin{pmatrix} 2 & 3 & 4 \\ 7 & 2 & -7 \\ -12 & 2 & 18 \end{pmatrix} \]

Careful with signs

Most wrong answers in matrix subtraction come from negative entries. When the entry being taken away is negative, the two minus signs make a plus: \( 10 - (-8) = 18 \), not 2. Write the brackets in before simplifying.

Step 3: Now subtracting the other way round, each entry of A from the matching entry of B:

\[ B - A = \begin{pmatrix} 3 - 5 & 4 - 7 & -1 - 3 \\ -3 - 4 & 4 - 6 & 2 + 5 \\ 5 + 7 & 1 - 3 & -8 - 10 \end{pmatrix} \]

Step 4: Working out each entry:

\[ B - A = \begin{pmatrix} -2 & -3 & -4 \\ -7 & -2 & 7 \\ 12 & -2 & -18 \end{pmatrix} \]

Subtraction Is Not Commutative

Put the two answers side by side. The entry 2 in A minus B has become -2 in B minus A, the entry -7 has become 7, the entry 18 has become -18, and so on for every entry. The two matrices are not equal, so \( A - B \neq B - A \). Ordinary numbers behave the same way: \( 5 - 3 = 2 \) but \( 3 - 5 = -2 \).

Key idea

Subtraction of matrices does not obey the commutative rule. Swapping the two matrices changes the sign of every entry in the answer, so B - A is A - B with every sign turned round.

Subtraction in Daily Life

A stationery shop keeps blue and black pens and pencils. At the start of the month its stock was recorded in matrix S, and the number sold during the month in matrix D. The rows are pens and pencils, and the columns are blue and black.

\[ S = \begin{pmatrix} 50 & 40 \\ 60 & 35 \end{pmatrix}, \quad D = \begin{pmatrix} 32 & 25 \\ 41 & 20 \end{pmatrix} \]

Step 1: The stock left is what was there minus what was sold, so subtracting corresponding entries:

\[ S - D = \begin{pmatrix} 50 - 32 & 40 - 25 \\ 60 - 41 & 35 - 20 \end{pmatrix} \]

Step 2: Working out each entry:

\[ S - D = \begin{pmatrix} 18 & 15 \\ 19 & 15 \end{pmatrix} \]

So 18 blue pens, 15 black pens, 19 blue pencils and 15 black pencils are left. Here the order of subtraction clearly matters: D minus S would give negative stock, which makes no sense for the shop.

Finding a Missing Entry

Because a sum is worked out entry by entry, an unknown entry can be found by comparing positions. Find x and y if:

\[ \begin{pmatrix} x & 3 \\ 4 & y \end{pmatrix} + \begin{pmatrix} 2 & 1 \\ 0 & 5 \end{pmatrix} = \begin{pmatrix} 7 & 4 \\ 4 & 9 \end{pmatrix} \]

Step 1: Adding the corresponding entries on the left side:

\[ \begin{pmatrix} x + 2 & 4 \\ 4 & y + 5 \end{pmatrix} = \begin{pmatrix} 7 & 4 \\ 4 & 9 \end{pmatrix} \]

Step 2: Two equal matrices have equal corresponding entries, so the first entries give:

\[ x + 2 = 7, \quad x = 5 \]

Step 3: The entries in the second row and second column give:

\[ y + 5 = 9, \quad y = 4 \]

A quick check: with \( x = 5 \) and \( y = 4 \), the first matrix becomes \( \begin{pmatrix} 5 & 3 \\ 4 & 4 \end{pmatrix} \), and adding it to the second matrix does give \( \begin{pmatrix} 7 & 4 \\ 4 & 9 \end{pmatrix} \).

🔐

The full lesson is waiting for you

The notes are free to read in full. A free account opens the rest of the practice, and tracks your progress and confidence score for every subject. Presentations and videos need approval from Learn Yeti.