3. Matrices
3.1 Chapter Opener: Introduction and Matrix Representation
Chapter 3
Matrices
Big idea: organise a collection of quantities as one object, then use well-defined operations to combine or transform the whole collection.
- Read a matrix using row and column indices.
- Compute sums, scalar multiples and compatible products.
- Explain why product order matters and why ordinary cancellation can fail.
- Use transpose, symmetric decomposition and two-sided inverses.
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?
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 .
- [Board Standard] A row is a horizontal line of entries. Rows are counted from the top.
- [HOTS] 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.
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.
3.2 Matrix Notation, Order and Elements
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.
3.3 Types of Matrices and Equality
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 | Four file sizes 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 |
A matrix with only one column is a column matrix. Its order is .
Example: four file sizes in the same unit form the column matrix , of order .
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 .
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.
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.
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 .
A scalar matrix can be written . Multiplying a compatible vector by it scales every coordinate by the same factor.
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 .
For a rectangular matrix, the identity on the left and the identity on the right may have different sizes: when has order .
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.
Two matrices and are equal (we write ) when both of these are true:
- [Board Standard] they have the same order, and
- [HOTS] 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.
- [Concept] Pair up the entries that sit in the same position.
- [Board Standard] Write one small equation for each pair.
- [HOTS] 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 , , .
3.4 Exercise 3.1: Matrix Construction and Equality
3.5 Operations on Matrices: Addition and Scalar Multiplication
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
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.
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:
Matrix addition obeys the same friendly rules as addition of numbers. Take , and of the same order.
- [Concept] Commutative law: . The order does not matter.
- [Board Standard] Associative law: . The grouping does not matter.
- [Board Standard] Additive identity: , where is the zero matrix of the same order.
- [HOTS] 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, .
Let and be matrices of the same order and let and be scalars. Then:
- [Board Standard]
- [HOTS]
Check. Let , , and . Each pair matches.
For equations involving addition and scalar multiplication, we may add or subtract the same matrix on both sides and multiply both sides by the same number. Matrix products need more care: changing factor order or cancelling a non-invertible matrix can give a wrong result.
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. The numbers of units sold in two consecutive periods are and (rows: stores; columns: products): (a) Find the total quantities for the two periods. (b) Find the change from the first period to the second. (c) The stores plan to handle three times the first period's quantities. Find that matrix.
Solution. (a) . (b) ; a negative entry means sales fell. (c) .
3.6 Matrix Multiplication and Its Properties
Two production lines handle three kinds of batch. Each kind needs a different combination of materials. We want one table showing the total material requirement of each line. This requires combining information across two tables, rather than multiplying entries in matching positions.
| Line | Batch A count | Batch B count | Batch C count |
|---|---|---|---|
| Line 1 | 4 | 2 | 3 |
| Line 2 | 1 | 5 | 2 |
| Batch type | Sheets per batch | Sleeves per batch |
|---|---|---|
| A | 2 | 1 |
| B | 3 | 0 |
| C | 1 | 4 |
Write the counts as and the material requirements as . The columns of and the rows of use the same batch order. That shared meaning is what lets us combine the tables.
For Line 1 sheets, multiply each batch count by its sheets-per-batch requirement and add. The first row of meets the first column of : . The same row with the second column gives sleeves.
Repeat for Line 2. The complete result is Rows still identify the lines; columns now identify sheets and sleeves. Multiplying a count of batches by materials per batch gives a count of materials.
If has order and has order , the product exists and has order . The inner sizes must agree because each row–column calculation needs the same number of paired entries. The outer sizes give the order of the answer.
In the batch example, a matrix multiplies a matrix to produce a matrix. A matrix cannot multiply a matrix in that order: a row would have three entries but the chosen column only two.
For the general entry of , the rule is . The index moves across the shared dimension; and locate the result.
Let and . Both have order , so Work through all four row–column calculations. The top-right entry comes from the first row of and the second column of , not from the two top-right entries.
The product has order : its single entry is a sum. Reversing the factors gives , with order . Neither multiplication is wrong; they answer different questions.
Store point coordinates as columns of . The repeated last column closes the triangle. Multiplication by sends each point to : This is a quarter-turn anticlockwise about the origin. Each output column comes from applying the same rule to one input point.
A triangle with vertices (0,0), (2,0), (0,1), and its anticlockwise quarter-turn with vertices (0,0), (0,2), (-1,0).
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:
- [Board Standard] Diagonal matrices of the same order: .
- [HOTS] Any square matrix and the identity matrix of the same order: .
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 .
This also explains why ordinary cancellation can fail. In the example, , but is not . Knowing is non-zero is insufficient to cancel it. Cancellation becomes valid when an appropriate inverse exists.
Matrix multiplication follows most of the rules we know, with one big exception: order matters. Whenever the products are defined:
- [Concept] Associative law: . We may regroup, but we may not reorder.
- [Board Standard] Distributive laws: and .
- [HOTS] 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.
3.7 Exercise 3.2: Multiplication and Matrix Polynomials
3.8 Transpose of a Matrix, Symmetric and Skew-Symmetric Matrices
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: .
For matrices and of suitable orders and a scalar :
- [Concept] : flipping a table twice brings you back.
- [Board Standard] : multiplying by a number before or after flipping gives the same matrix.
- [Board Standard] : the flip of a sum is the sum of the flips.
- [HOTS] : 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.
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 .
3.9 Invertible Matrices, Miscellaneous Review and Chapter Summary
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.
- [Concept] Only square matrices can have inverses. A rectangular matrix has none, because and would have different orders.
- [Board Standard] If is the inverse of , then is the inverse of .
- [HOTS] 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 .
Represent a message by numbers, , and apply a coding matrix : . Its inverse recovers the input: . This is a learning model for reversible encoding. A simple linear transformation does not provide modern cryptographic security; known input–output pairs can reveal the transformation.
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.
- [Board Standard] Start: for , matches the formula.
- [HOTS] 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 .
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 .