CP 3.1, 3.2 - Matrix arithmetic, zero and identity matrices
A matrix keeps a whole collection of numbers in a useful order. You will add, subtract, scale and multiply matrices (CP 3.1), then use the zero and identity matrices to see which familiar algebraic rules survive and which need care (CP 3.2).
Rows, columns and conformability
Two cafés sell the same three drinks. Their prices and Monday's sales are recorded as
The rows of refer to the cafés; its columns refer, in order, to tea, coffee and chocolate. Both cafés sell the numbers in . Can one calculation find both cafés' takings? By the end you will find the answer without losing track of which price belongs to which drink.
A matrix is more than a bag of numbers. Moving an entry changes its meaning: the first café's coffee costs , while the second café's chocolate costs . The order matters even when no context is supplied.
Matrix and order
A matrix is a rectangular array of entries. Its order is the number of rows followed by the number of columns. Thus has order , and has order . The entry is in row , column ; for example, . A square matrix has the same number of rows as columns. A row matrix has one row; a column matrix has one column.
Two matrices are equal precisely when they have the same order and every corresponding entry agrees. For example,
The matrices and are not equal: one has order , the other . Before calculating, ask whether the shapes fit the operation.
Conformable matrices
Matrices are conformable for an operation when their orders allow it. Addition and subtraction require the same order. For multiplication, the number of columns of the left matrix must equal the number of rows of the right matrix.
For multiplication the matching middle numbers disappear from the order calculation:
This size rule is not in the formula booklet: learn it. It predicts the shape before you do any arithmetic.
Key idea
Read matrix orders as rows then columns. For a product, match the inner dimensions and keep the outer dimensions.
Test the shape first; there is no need to invent entries for this check.
Adding, subtracting and scaling
Addition combines corresponding entries; multiplication by a scalar changes every entry by the same factor.
For example, two days' sales tables can be added only if their rows and columns refer to the same things in the same order. Algebraically, equal shapes are essential. A scalar is simply an ordinary number, rather than a matrix.
Entrywise arithmetic
For matrices and of the same order and a scalar ,
Not in the formula booklet: learn it.
Treat each position as a separate small calculation. Subtracting a matrix means subtracting every one of its entries, including negative ones.
Worked example 1: a linear combination
Question. Given and , find .
Plan. Double every entry of , then subtract the corresponding entry of .
Why this step? Keeping the negative entries in brackets prevents from becoming .
Answer. .
Check. Adding to the answer gives .
The second example changes one feature: the matrix itself is unknown. The same entrywise rules let you rearrange a matrix equation.
Worked example 2: an unknown matrix
Question. Given , where and , determine .
Plan. Subtract , then multiply every entry by .
Why this step? Division by the scalar is ordinary scalar multiplication by ; no matrix division is involved.
Answer. .
Check. .
A minus sign outside a matrix acts on the entire array.
Watch out
Wrong: . Right: . Every entry changes sign.
The next equation changes the scalar coefficient, so divide only after collecting the matrices.
Multiplying matrices
Matrix multiplication pairs a row from the left matrix with a column from the right matrix: multiply matching entries and add the products.
The café question supplies a concrete reason. The first café's takings are ; the second café's are . Both calculations fit inside
The three entries of each price row match the three sales entries. This explains the conformability rule: each row-column calculation needs the same number of entries on both sides.
Row by column
If has order and has order , then has order , with
Not in the formula booklet: learn it.
A product of two matrices is usually not the matrix of entrywise products. Each output entry collects a whole row-column calculation.
Worked example 3: a rectangular product
Question. Find , where and .
Plan. The orders give a answer; calculate its four entries row by column.
Why this step? The upper-right entry uses row of and column of , so it is , not the product of the two upper-right entries.
Answer. .
Check. The answer has two rows and two columns, and its lower-left entry is .
The second product changes the left matrix from rectangular to square. The rule stays exactly the same, and now produces three rows.
Worked example 4: a three-row product
Question. Calculate .
Plan. Use each of the three left rows with each of the two right columns.
Why this step? There are two output columns because the right matrix has two columns. A left matrix does not force a square answer.
Answer. .
Check. The orders are , leaving . The middle-right entry is .
The order also matters algebraically. For and , row-column multiplication gives
Thus matrix multiplication is generally not commutative. It is associative, so when conformable, and distributive: . These rules are not in the formula booklet: learn them. You may change brackets, but you may not silently reverse factors.
Watch out
Wrong: “ because ordinary multiplication commutes.” The two products can differ, and one may not even exist. Right: keep the written order and use rows from the left factor.
Try the same three-term row-column sums with new entries.
Zero matrices, identity matrices and powers
The zero matrix plays the additive role of zero, while the identity matrix plays the multiplicative role of one.
For a example, adding leaves each entry unchanged. Multiplying on the right by selects the original first and second columns in turn.
Zero and identity matrices
A zero matrix, , has every entry zero; it can have any order. The identity matrix, , is square of order , with ones on the main diagonal and zeros elsewhere. For example,
The matrix is not an identity matrix.
Use the size needed for each operation: for an matrix , the identities on its two sides have different orders when .
Zero, identity and powers
For conformable matrices,
For square , and ; positive integer powers are repeated matrix products. Not in the formula booklet: learn it.
A scalar in a matrix polynomial means a scalar multiple of the identity: the matrix version of a constant term is .
Worked example 5: evaluating a matrix polynomial
Question. For , calculate .
Plan. Square by row-column multiplication, then subtract four times each entry.
Why this step? means , so its upper-right entry is , not .
Answer. .
Check. Adding to gives .
The next example changes one feature: an entry is unknown. An identity-matrix equation tells you that both off-diagonal entries must vanish.
Worked example 6: equating matrix entries
Question. Let . Given , determine and .
Plan. Multiply out and compare the off-diagonal entries with zero before finding the diagonal constant.
Why this step? An off-diagonal equation is linear in , and the second one checks it. Using only the lower-right entry can introduce an unwanted value.
Answer. and .
Check. The lower-left entry is ; the lower-right entry is .
Here is a small surprise: two non-zero matrices can multiply to zero. In fact,
So does not force either factor to be zero. Nor can you cancel an arbitrary non-zero matrix as though it were a non-zero number. Inverse matrices, studied later, tell you when cancellation is justified.
Watch out
Wrong: in Worked example 5. Squaring entries is a different operation. Right: calculate .
The opening café calculation is now ordinary matrix multiplication: . It gives both takings at once, with rows preserving the café labels.
Quick Recap
- Matrix orders count rows then columns; equal matrices have equal corresponding entries.
- Add, subtract and scale entry by entry. Multiply row by column, matching the inner dimensions.
- Matrix multiplication is associative and distributive, but generally not commutative.
- A zero matrix adds nothing; an identity matrix leaves a conformable factor unchanged. Matrix powers use repeated matrix multiplication.
- Non-zero matrices can multiply to zero, so ordinary cancellation needs care.
The two cafés take and : one product keeps both calculations organised.