MATRICES
Chapter 3: Matrices
Chapter 3
Matrices
Big idea: a whole table of numbers can be treated as one object, and then added, scaled, multiplied, flipped and undone, just like a single number.
3.1 Introduction
A matrix is a table of numbers that is treated as one single object. Tables like this are everywhere:
- A spreadsheet: every number has a row and a column.
- A photo on a screen: the screen is a grid of tiny dots (pixels), and every dot has a number for its brightness.
- A game scoreboard: players go down the side and rounds go across the top.
- A weather chart: cities go down the side and days go across the top.
For example, here is a tiny picture. Each number tells how bright a pixel is, from 0 (black) to 255 (white):
A computer stores and changes the whole picture by working with this one table. To make the picture brighter, it changes every number in a single step. This is the power of a matrix: we can work with a whole table at once.
Matrices are used to:
- store and combine large tables of data (sales, scores, measurements);
- move, turn and resize shapes in computer graphics and games;
- solve many equations at the same time;
- send secret messages in cryptography;
- describe how a system changes from one step to the next, in science and economics.
Think about it: which table of numbers do you use most often in daily life? How many rows and columns does it have?
3.2 Matrix
Three students, A, B and C, take two tests. Their marks are shown in this table:
| Student | Test 1 | Test 2 |
|---|---|---|
| A | 72 | 65 |
| B | 58 | 81 |
| C | 90 | 77 |
If we agree that rows are students (in the order A, B, C) and columns are tests (in the order 1, 2), we do not need the labels. We can keep only the numbers and put them inside brackets:
This arrangement is a matrix.
Definition. A matrix is a rectangular arrangement of numbers (or expressions) in rows and columns, written inside brackets. Each number in it is called an element or entry. We name matrices with capital letters such as , and .
- A row is a horizontal line of entries. Rows are counted from the top.
- A column is a vertical line of entries. Columns are counted from the left.
In above, row 1 is and column 2 is .
has 2 rows and 3 columns. has 3 rows and 2 columns. has 1 row and 4 columns. Entries can be positive, negative, zero, fractions or decimals.
- In matrix above, which student got the highest mark in Test 1, and what was it?
- How many rows and columns does have?
- Write the marks of the three students in Test 2 as a column.
Answers
- Student C, with 90 (the largest entry in column 1).
- 4 rows and 3 columns.
3.2.1 Order of a matrix
The order of a matrix tells us its size. A matrix with rows and columns has order , read " by ". The number of rows always comes first.
For example, has order and has entries.
We write for the entry in row and column . A matrix of order can then be written as :
Example 1. Construct a matrix whose entries are given by .
Solution. A matrix has entries . Put in the row number and the column number each time:
So .
Example 2. A matrix has 12 entries. What orders can it have?
Solution. We need with and natural numbers. The pairs are , , , , , . So the possible orders are , , , , , .
Example 3. A matrix can store the corners of a shape. The corners of a four-sided figure PQRS are , , and . Write them as the columns of a matrix, so that the first row holds the -coordinates and the second row holds the -coordinates.
Solution. This matrix has order .
Graph of the four-sided figure PQRS with corners P (0, 0), Q (4, 1), R (5, 4) and S (1, 3). The x-coordinates of the corners are the first row of matrix X and the y-coordinates are the second row.
Computer graphics programs store every shape this way. To move or turn the shape, they change the numbers in this one matrix.
- What is the order of , and how many entries does it have?
- A matrix has 15 entries. List all possible orders.
- Write the matrix with .
- In a matrix of order , how many entries lie in row 3?
Answers
- Order ; 8 entries.
- , , , .
- 5 entries (one for each column).
3.3 Types of Matrices
Some matrices have a special shape or a special pattern, and each has its own name. Knowing the names helps us spot shortcuts later.
| Type | What makes it special | Everyday picture |
|---|---|---|
| Column matrix | Only one column | Prices of four items listed one below the other |
| Row matrix | Only one row | One player's scores in four rounds, side by side |
| Square matrix | Number of rows = number of columns | A 3 by 3 tic-tac-toe grid |
| Diagonal matrix | Square, with 0 everywhere off the diagonal | A table where only the diagonal cells are used |
| Scalar matrix | Diagonal matrix with the same number all along the diagonal | A diagonal where every cell holds the same value |
| Identity matrix | Scalar matrix with 1 on the diagonal | The number 1 of the matrix world |
| Zero matrix | Every entry is 0 | An empty score sheet |
(i) Column matrix
A matrix with only one column is a column matrix. Its order is .
Example: the prices of four items listed one below the other form the column matrix , of order .
(ii) Row matrix
A matrix with only one row is a row matrix. Its order is .
Example: one player's scores in five rounds, written side by side, form the row matrix , of order .
(iii) Square matrix
A matrix with the same number of rows and columns is a square matrix. If it has rows and columns, we say it is a square matrix of order .
Example: is a square matrix of order 3. A tic-tac-toe board and a sudoku grid are square.
The entries of a square matrix form its diagonal. In the diagonal entries are 4, 5 and −6.
(iv) Diagonal matrix
A square matrix in which every entry off the diagonal is 0 is a diagonal matrix. In symbols, whenever .
Example: is a diagonal matrix of order 3.
(v) Scalar matrix
A diagonal matrix whose diagonal entries are all equal is a scalar matrix. So for and for one fixed number .
Example: is a scalar matrix with .
(vi) Identity matrix
A scalar matrix with , that is, with 1 on the diagonal and 0 elsewhere, is an identity matrix. We write for the identity matrix of order , or simply when the order is clear.
Every identity matrix is a scalar matrix, but a scalar matrix is an identity matrix only when .
(vii) Zero matrix
A matrix whose entries are all 0 is a zero matrix (or null matrix). We write for it; its order is understood from the situation.
- Name the type of each matrix: (a) (b) (c) (d) (e) .
- Is every diagonal matrix a square matrix? Is every square matrix a diagonal matrix?
Answers
- (a) zero matrix (b) column matrix (c) scalar matrix (and diagonal, square) (d) identity matrix (and scalar, diagonal, square) (e) square matrix only (it has a non-zero entry off the diagonal).
- Yes, every diagonal matrix is square by definition. No, a square matrix such as the one in (e) is not diagonal.
3.3.1 Equality of matrices
Two matrices and are equal (we write ) when both of these are true:
- they have the same order, and
- every entry of equals the entry of in the same position, that is, for all and .
For example, , but , because the entries in row 1 are swapped. Also, because their orders differ.
- Pair up the entries that sit in the same position.
- Write one small equation for each pair.
- Solve each equation.
Example 1. Find and if .
Solution. Compare the entries in the same positions. Row 1, column 1 gives , so . Row 2, column 2 gives , so . The other two pairs ( and ) already match. Hence and .
Example 2. Find , and if .
Solution. Comparing entries gives three equations: , and . Adding the first and third equations gives , so . Then . Check: and . Hence , , .
- Are and equal? Why or why not?
- Find and if .
Answers
- No. The orders are different ( and ).
- and ; adding gives , so and .
EXERCISE 3.1
- For write: (a) the order of , (b) the number of entries, (c) the entries , and .
- List all possible orders of a matrix with (a) 18 entries (b) 7 entries.
- Construct the matrix with .
- Construct the matrix with .
- Find and if .
- Find , and if .
- Choose the correct answer. A matrix is a square matrix if (A) (B) (C) (D) none of these.
- How many different matrices can be made if every entry must be 0 or 1?
Answers
- (a) ; (b) 12; (c) , , .
- (a) , , , , , ; (b) , .
- , .
- , , .
- (C).
- matrices (each of the 4 entries has 2 choices).
3.4 Operations on Matrices
Just as we add, subtract and multiply numbers, we can combine matrices. In this section we learn four operations:
- Addition of matrices
- Multiplication of a matrix by a scalar (a scalar is an ordinary number)
- Subtraction of matrices
- Multiplication of two matrices
3.4.1 Addition of matrices
A warehouse supplies laptops, tablets and phones to two shops, Shop 1 and Shop 2. The tables show the number of devices delivered in Week 1 and in Week 2 (rows: shops; columns: laptops, tablets, phones):
To find the total delivered over the two weeks, we add the numbers that are in the same position:
So Shop 1 received 18, 18, 8 laptops, tablets and phones in total, and Shop 2 received 16, 18, 20.
Matrices of different orders cannot be added. A table and a table do not line up cell by cell, so their sum is not defined.
Example 1. Find if and .
Solution. Both matrices have order , so is defined:
Example 2. Can and be added?
Solution. No. The first has order and the second has order . The orders are different, so the sum is not defined.
- Find .
- Find .
- A matrix is added to a matrix. Is the sum defined?
Answers
- No, the orders differ.
3.4.2 Multiplication of a matrix by a scalar
A scalar is an ordinary number. Suppose a recipe table lists the amount of each of three ingredients needed for two dishes when cooking for 2 people. To cook for 6 people we need 3 times as much of everything:
We define . It is with the sign of every entry changed.
For two matrices of the same order, means subtract entry by entry. This is the same as .
where . Real-life use: this week's sales minus last week's sales shows how each number has changed.
Example. With and as above, find .
Solution. First multiply, then subtract:
- Find .
- If , find .
- Find .
Answers
3.4.3 Properties of matrix addition
Matrix addition obeys the same friendly rules as addition of numbers. Take , and of the same order.
- Commutative law: . The order does not matter.
- Associative law: . The grouping does not matter.
- Additive identity: , where is the zero matrix of the same order.
- Additive inverse: .
Let , and .
They are equal, as the commutative law says. For the associative law:
Also and .
Matrices are added entry by entry, so each rule for matrices comes from the same rule for the numbers inside them. For example, the entry in row , column of is . For it is . These are equal because adding numbers can be done in either order. Since this is true for every position, .
3.4.4 Properties of scalar multiplication of a matrix
Let and be matrices of the same order and let and be scalars. Then:
Check. Let , , and . Each pair matches.
Matrix equations are solved just like ordinary equations. We may add or subtract the same matrix on both sides, and multiply both sides by the same number.
Example 1. Find the matrix if , where and .
Solution. Subtract from both sides: . Then multiply both sides by : . Now , so and
Example 2. Find and if and .
Solution. Adding the two equations cancels : , so . Subtracting the second equation from the first cancels : , so .
Example 3. Two stores sell three products. Their sales (in the same currency) in March and April are and (rows: stores; columns: products): (a) Find the total sales for the two months. (b) Find the change from March to April. (c) The stores expect sales in the next period to be three times March's sales. Find that matrix.
Solution. (a) . (b) ; a negative entry means sales fell. (c) .
- If , find and . What do you notice?
- Find if .
Answers
- and . They are equal, as says.
3.4.5 Multiplication of matrices
Multiplying matrices is different from adding them. We do not multiply cell by cell. Instead, we combine a row of the first matrix with a column of the second. The easiest way to see why is to look at a bill.
A café sells coffee for 4, tea for 3 and juice for 5 (in the same currency). A customer orders 2 coffees, 1 tea and 3 juices. The bill is
We can write the order as a row and the prices as a column. Multiplying the pairs and adding gives one number:
A second customer orders 1 coffee, 4 teas and no juice. Their bill is . If we write each order as a row of one matrix (3 items), and keep the prices in a column, one multiplication gives both bills:
A second café charges 5 for coffee, 2 for tea and 4 for juice. Put the prices of the two cafés side by side as two columns of a matrix . One multiplication now gives every bill at every café:
Read the result like a table: row = which order, column = which café. For example, the entry 24 in row 1, column 2 is the bill for order 1 at the second café, .
Let be an matrix and let be an matrix. Then the product is defined, and it is a matrix of order . Its entry in row and column is
Example A. Find if and .
Solution. is and is . The middle numbers are both 3, so is defined and its order is . Each entry is a row of times a column of :
Example B. In each case, say whether the product is defined. If it is, give its order.
| First matrix | Second matrix | Product defined? | Order of product |
|---|---|---|---|
| Yes (2 = 2) | |||
| No (3 ≠ 2) | — | ||
| (a row) | (a column) | Yes (3 = 3) | |
| (a column) | (a row) | Yes (1 = 1) |
Notice the last two rows. The same two lists of numbers give a single number in one order and a whole table in the other order. This is the first sign that order matters in matrix multiplication.
Example C. A fitness app records the minutes a person spends on running, cycling and swimming on three days. Burning rates are 10, 8 and 9 calories per minute. Find the calories burned on each day.
Solution. Let be the minutes matrix (: days × activities) and the burning rates (: activities × calories per minute). Then is , one total for each day:
So the person burns 480, 630 and 360 calories on the three days.
- For each pair, say whether the product is defined and give its order: (a) and ; (b) and ; (c) and ; (d) and .
- Find if and .
- Find if and . What is the order of ?
- A school canteen sells sandwiches, salads and soups. The quantities sold on two days are given by (rows: days; columns: sandwiches, salads, soups). The prices are 3, 4 and 2. Let be the price column. Use matrix multiplication to find the income on each day.
- Let and . Find and . Are they equal?
Answers
- (a) defined, ; (b) not defined; (c) defined, ; (d) defined, .
- ; has order .
- , so the income is 78 on day 1 and 81 on day 2.
- and . They are not equal.
Non-commutativity of multiplication of matrices
With numbers, . With matrices, and are usually different, even when both can be calculated.
Example 1 (the orders differ). Let and . is and is , so both and are defined, but has order and has order .
They cannot be equal, because they are different sizes.
Example 2 (same order, still different). Let and . Both are , yet .
Sometimes . Two examples:
- Diagonal matrices of the same order: .
- Any square matrix and the identity matrix of the same order: .
- Find and for and .
- If is and is , what are the orders of and ?
Answers
- and . They are different.
- is and is .
Zero matrix as the product of two non zero matrices
For numbers, if then or . For matrices this is not true.
Example. Let and . Neither is the zero matrix, but
Interestingly, is not the zero matrix, which is another example of .
3.4.6 Properties of multiplication of matrices
Matrix multiplication follows most of the rules we know, with one big exception: order matters. Whenever the products are defined:
- Associative law: . We may regroup, but we may not reorder.
- Distributive laws: and .
- Multiplicative identity: for a square matrix and the identity matrix of the same order.
Let , and . In each case the two sides agree.
For a square matrix , we write and . For : Do you see the pattern? The top-right entry equals the power.
Example. For , show that .
Solution. , and . So .
Example. A course has three tests worth 1, 2 and 3 points per mark. Two students scored (rows: students; columns: tests). Find each student's weighted total.
Solution. Put the weights in a column . Then is : The weighted totals are 430 and 430.
- If , find .
- Is always true for matrices? (Hint: expand and remember that in general.)
Answers
- No. , and this equals only if .
EXERCISE 3.2
- Let and . Find (i) (ii) (iii) (iv) (v) .
- Let and . Find and describe the answer.
- Find the products (i) (ii) .
- Find if , where and .
- For and , find and . Are they equal? Why not?
- Find and if .
- A canteen sold sandwiches, salads and soups on two days: (rows: days). The prices are 2, 3 and 1. Use matrix multiplication to find the income on each day. Which day earned more?
- Let . Find and .
- Choose the correct answer. If has order and has order , then (A) only is defined (B) only is defined (C) both are defined (D) neither is defined.
Answers
- (i) (ii) (iii) (iv) (v)
- . It is a scalar matrix: times .
- (i) (a matrix) (ii) (a matrix).
- and . They are not equal, because .
- , .
- Incomes: 66 and 75. Day 2 earned more.
- and .
- (A) only is defined.
3.5. Transpose of a Matrix
The transpose of a matrix is the matrix you get by turning its rows into columns. We write the transpose of as or .
If (order ), then the first row of becomes the first column of , and the second row becomes the second column: which has order .
The transpose of a row matrix is a column matrix, and vice versa: .
- Find the transpose of .
- What is the order of the transpose of a matrix?
Answers
- .
3.5.1 Properties of transpose of the matrices
For matrices and of suitable orders and a scalar :
- : flipping a table twice brings you back.
- : multiplying by a number before or after flipping gives the same matrix.
- : the flip of a sum is the sum of the flips.
- : the flip of a product is the product of the flips in reverse order.
Let and . Then .
For the product rule, let . Then , so . Also . They match.
3.6 Symmetric and Skew Symmetric Matrices
A square matrix is symmetric if , that is, for all and .
Real-life picture. A table of distances between three towns is symmetric, because the distance from town 1 to town 2 equals the distance from town 2 to town 1.
A square matrix is skew symmetric if , that is, for all and . Putting gives , so : all diagonal entries of a skew symmetric matrix are 0.
Real-life picture. A table of points differences between three teams is skew symmetric: if team 1 is 3 points ahead of team 2, then team 2 is ahead of team 1, and each team is 0 ahead of itself.
Theorem 1. For any square matrix , the matrix is symmetric and is skew symmetric.
Proof. , so is symmetric. Also , so is skew symmetric.
Theorem 2. Every square matrix is the sum of a symmetric matrix and a skew symmetric matrix.
Proof. Write . By Theorem 1 and the rule , the first part is symmetric and the second part is skew symmetric.
Example. Express as the sum of a symmetric and a skew symmetric matrix.
Solution. . Then and . So is symmetric, is skew symmetric, and .
EXERCISE 3.3
- Find the transpose of (i) (ii) (iii) .
- Let and . Verify that .
- Let and . Verify that .
- Show that is symmetric and is skew symmetric.
- For , verify that is symmetric and is skew symmetric.
- Express as the sum of a symmetric and a skew symmetric matrix.
- Choose the correct answer. If and are symmetric matrices of the same order, then is (A) symmetric (B) skew symmetric (C) the zero matrix (D) the identity matrix.
- Prove that the diagonal entries of a skew symmetric matrix are all 0.
Answers
- (i) (ii) (iii)
- .
- , so , and . They match.
- The first matrix equals its transpose. For the second, (see 3.6).
- is symmetric; is skew symmetric.
- Symmetric part and skew symmetric part .
- (B). .
- If then , so and .
3.7 Invertible Matrices
With numbers, the reciprocal of 5 is , because . The matrix version of "1" is the identity matrix, so we define:
A square matrix of order is invertible if there is a square matrix of the same order with . Then is called the inverse of and is written .
Example 1. Show that is the inverse of .
Solution. and . Since , .
Example 2. Is the inverse of above? Solution. , so no.
- Only square matrices can have inverses. A rectangular matrix has none, because and would have different orders.
- If is the inverse of , then is the inverse of .
- Not every square matrix has an inverse, just as the number 0 has no reciprocal. For example, the zero matrix has none.
Theorem 3 (the inverse is unique). A square matrix has at most one inverse.
Proof. Suppose and are both inverses of . Then .
Theorem 4. If and are invertible matrices of the same order, then is invertible and .
Proof. , and similarly .
Check. Let be as above and with . Then and . Multiplying gives , so .
A message is turned into numbers, , and scrambled by multiplying by a coding matrix : . Anyone who knows can unscramble it: , the original message. Without the scrambled numbers are hard to read. This is the idea behind some codes in cryptography.
EXERCISE 3.4
- Show that is the inverse of .
- Show that and are not inverses of each other.
- The coding matrix is and its inverse is . Code the message , then decode it again.
- If and are invertible matrices of the same order, simplify .
- Choose the correct answer. Matrices and are inverses of each other only if (A) (B) (C) , (D) .
Answers
- and ; both are .
- , which is not .
- Coded: . Decoded: .
- .
- (D).
Miscellaneous Examples
Example 1. Let . Show that for every natural number .
Solution. First look at small cases: , , . The pattern suggests the formula, so we prove it by induction.
- Start: for , matches the formula.
- Step: assume for some . Then , which is the formula for .
Example 2. If and are symmetric matrices of the same order, show that is symmetric if and only if .
Solution. Since and , we have . Now is symmetric exactly when , that is, exactly when .
For instance, and are symmetric, but is not symmetric, and indeed .
Example 3. Find the matrix such that , where and .
Solution. must be . Let . Then . Equating entries with gives , , , . From the first pair, , so gives and . From the second pair, , so gives and . Hence .
*Miscellaneous Exercise on Chapter 3*
- If and are symmetric matrices of the same order, prove that is skew symmetric.
- If , show that .
- Find if .
- Two shops sell three products. The quantities sold are (rows: shops). The selling prices are 5, 4 and 3, and the costs are 3, 3 and 2 per unit. Use matrix multiplication to find the revenue, the cost and the profit of each shop.
- Find the matrix such that , where , and .
- Choose the correct answer. If is a square matrix with , then equals (A) (B) (C) (D) .
- Choose the correct answer. If is a skew symmetric matrix with , then is (A) (B) (C) (D) .
Answers
- .
- , , so .
- Multiplying out, , so or .
- Revenue , cost , profit (shop 1 and shop 2 in order).
- .
- (A). .
- (B). For skew symmetric , and the diagonal is 0.
Summary
The chapter in plain words
- A matrix is a rectangular table of numbers. Its order is "rows × columns", and is the entry in row , column .
- Special matrices: column, row, square, diagonal, scalar, identity () and zero ().
- Two matrices are equal if they have the same order and equal entries in every position.
- Addition and subtraction work entry by entry and need the same order. Scalar multiplication multiplies every entry.
- Addition is commutative and associative; is the additive identity and is the additive inverse. Also and .
- Multiplication needs (columns of ) = (rows of ). Each entry is a row of times a column of . In general , and does not force or . It is associative and distributive, and .
- The transpose swaps rows and columns. , , and .
- is symmetric if and skew symmetric if (diagonal all 0). Every square matrix is the sum of a symmetric and a skew symmetric matrix: .
- The inverse satisfies . It exists only for some square matrices, it is unique, and .
NOTES
This chapter covers the matrices topics of the Class 12 mathematics syllabus. The explanations, examples, figures and exercises were written for this library, and every worked answer was computed and checked by a program.