Ruled

Matrix operations

Addition, subtraction, scalar multiplication and the row-by-column product — with the conformability rules, the algebraic laws that survive and the ones that fail.

Four operations, three of them easy and one of them the reason matrices exist.

Addition and subtraction

Conformable for addition means: same order. Then add element by element.

If the orders differ, the sum is simply not defined — that is the whole answer, and it earns marks.

Laws of addition

LawStatement
Closure is a matrix of the same order
Commutative
Associative
Additive identity
Additive inverse, where
Cancellation

Scalar multiplication

Multiply every element by the scalar :

Compare with determinants. multiplies every one of the elements, but , because a determinant only takes one factor of out of each row. Mixing these two up is a classic exam loss.

Properties: , , , , .

Matrix multiplication

This is the operation that does real work, and its rule is not element-by-element.

Conformability

is defined only when the number of columns of equals the number of rows of .

The inner dimensions must match and they vanish; the outer dimensions survive as the order of the product.

The rule

In words: the element in row , column of the product is row of dotted with column of .

A reliable procedure

  1. Write both orders. Check inner dimensions match. Write down the order of the answer and draw an empty frame of that size.
  2. Fill the frame one position at a time. For position : cover everything except row of and column of .
  3. Multiply the pairs in order and add.

Working position by position, in order, is what stops the errors.

Laws of multiplication — and the three that fail

LawHolds?
Associative
Distributive
Distributive
Identity
Scalar
Commutative
Zero product or
Cancellation

These three failures are where exam questions live.

Non-commutativity. Usually ; often one is defined and the other is not. Matrices for which are said to commute.

Zero divisors. With and , though neither is .

No cancellation. does not give unless is non-singular (then multiply through by ).

The consequence for algebra

Familiar identities have to be re-derived. For instance

which equals only if and commute. Likewise

which is only when .

Transpose and its laws

The order reverses. Extending: .

Powers of a square matrix

Only square matrices can be raised to powers, since needs the column count to equal the row count.

Cost, and why it matters in computing

Computing an product by the definition performs multiplications and about additions. Doubling makes the work eight times larger. That single fact drives a large part of numerical computing — blocked algorithms, GPU kernels and Strassen-type methods all exist to fight the .

Worked examples

4 solved

Every step is shown, in the order you would write it in an answer book.

Example 1

Checking conformability before computing

Question

is , is , is . Which of , , , , , are defined, and of what order?

  1. — inner dimensions match. Defined, order .

  2. . Not defined.

  3. — match. Defined, order .

  4. — match. Defined, order .

  5. is ; then — match. Defined, order .

  6. is ; then — match. Defined, order — the same as , as associativity demands.

Answer

, , , are defined. is not.

NoteWrite orders under the letters before doing any arithmetic. Two seconds here saves a whole wrong page.

Example 2

A full 3 × 3 product, position by position

Question

Find where and .

  1. Order check

    — defined, result is .

  2. Row 1 of =

    Against column 1 :

    Against column 2 :

    Against column 3 :

  3. Row 2 of =

    Column 1:

    Column 2:

    Column 3:

  4. Row 3 of =

    Column 1:

    Column 2:

    Column 3:

  5. Assemble

Answer

Example 3

Demonstrating that AB ≠ BA

Question

For and , compute and and comment.

  1. Compute

  2. Compute

  3. Compare

    Reading the result: is a swap matrix. Multiplying on the right by swapped the columns of ; multiplying on the left by swapped the rows. Side of multiplication decides what happens — this is exactly why order matters.

Answer

, , so .

Example 4

Expanding a matrix expression correctly

Question

If and , verify that .

  1. Compute and its square

  2. Compute the pieces on the right

    Note immediately that .

  3. Evaluate the false right-hand side

    This is not , so the identity fails.

  4. Confirm the correct expansion

    which matches exactly.

Answer

but . The correct expansion is .

NoteNever write 2AB when expanding (A+B)² for matrices unless you have first shown AB = BA.

Practice problems

6 with solutions

Work each one on paper first. The full solution — not just the answer — is one click away.

Problem 1Basic

Given and , find .

Show solution

Answer
Problem 2Basic

Find and where and .

Show solution

: gives a matrix.

: gives a matrix.

Both products exist but they are not even the same order — the sharpest possible illustration that .

Answer (order ); (order ).
Problem 3Exam level

If , show that .

Show solution

Step 1 — compute .

Row 1 : , ,
Row 2 : , ,
Row 3 : , ,

Step 2 — compute .

Row 1 : , ,
Row 2 : , ,
Row 3 : , ,

Step 3 — assemble term by term.

Step 4 — add position by position.

:    :    :

:    :    :

:    :    :

(This is the Cayley–Hamilton theorem in action — the polynomial is the characteristic polynomial of .)

AnswerAll nine positions evaluate to , so the expression equals .
Problem 4Exam level

Find a matrix such that , where and .

Show solution

Rearrange first, then substitute — never the other way round.

Check:

Answer
Problem 5Exam level

Verify for and .

Show solution

Left side. is , is , so is .

Row 1 : , ,
Row 2 : , ,
Row 3 : , ,

Right side. is , is , so is

Row 1 : , ,
Row 2 : , ,
Row 3 : , ,

Both sides agree. ∎ (Note is not even defined here: would be — wrong order. The reversal is not optional.)

Answer
Problem 6Challenge

Find all matrices that commute with .

Show solution

Let and impose .

Equate corresponding elements:

:
:
: — no information
: — consistent

So , , and is free:

Equivalently where . Every such matrix commutes with ; nothing else does.

Sanity check with : and

Answer for any scalars .