LA 101
M02 · L02
Module 2

Matrix Operations

Knowing what a matrix is is just the start. Now we learn what we can do with them — the operations that make matrices the engine of modern science.

01 / 13
LA 101
M02 · L02
Addition

Matrix Addition

Add corresponding entries. Both matrices must have the same dimensions. The result has the same shape. Subtraction works identically. Simple, component-wise.

Matrix Addition
(A+B)_{ij} = a_{ij} + b_{ij}
02 / 13
LA 101
M02 · L02
Scaling

Scalar Multiplication

Multiply every entry by the scalar. This scales the matrix uniformly — think of stretching or compressing the whole grid. Works for any matrix shape.

Scalar Multiplication
(cA)_{ij} = c \cdot a_{ij}
03 / 13
LA 101
M02 · L02
Key Operation

Matrix–Vector Multiply

Ax is a linear combination of A's columns, weighted by x. This is the most important operation in linear algebra — it describes every linear transformation.

Column Combination View
A\mathbf{x} = x_1\mathbf{a}_1 + x_2\mathbf{a}_2 + \cdots + x_n\mathbf{a}_n
04 / 13
LA 101
M02 · L02
Matrix × Matrix

Matrix Multiplication

The (i,j) entry of AB is the dot product of row i of A and column j of B. For this to work, A must be m×k and B must be k×n — inner dimensions must match.

Entry Formula
(AB)_{ij} = \sum_{k=1}^{p} a_{ik}\, b_{kj}
05 / 13
LA 101
M02 · L02
Critical Property

Order Matters

Unlike numbers, matrix multiplication is NOT commutative: AB ≠ BA in general. But it IS associative: (AB)C = A(BC). And distributive: A(B+C) = AB + AC.

Commutative?
No — AB ≠ BA
Associative?
Yes — (AB)C
06 / 13
LA 101
M02 · L02
Operation

The Transpose

Swapping rows and columns gives the transpose AT. Key properties: (AB)T = BTAT (note the reversal!), and (AT)T = A.

Transpose Product Rule
(AB)^T = B^T A^T
07 / 13
LA 101
M02 · L02
Summary Statistic

The Trace

The trace of a square matrix is the sum of its diagonal entries. Simple but powerful: trace(AB) = trace(BA) even though AB ≠ BA. The trace equals the sum of eigenvalues.

Trace Definition
\operatorname{tr}(A) = \sum_{i=1}^{n} a_{ii}
08 / 13
LA 101
M02 · L02
Visualizing Mul

Row × Column Pattern

Entry (i,j) = dot product of row i of A with column j of B. Highlight shows how A's first row and B's first column combine:

[
1
2
3
4
]
×
[
5
6
7
8
]
=
[
19
22
43
50
]
09 / 13
LA 101
M02 · L02
Applications

Why This Matters

  • Neural networks: each layer is Ax + b
  • Computer graphics: 3D rotation = matrix multiply
  • Statistics: covariance = XTX
  • Signal processing: filters as matrix products
  • Physics: state evolution Ax = x’
10 / 13
LA 101
M02 · L02
Computation

Cost of Multiplication

Multiplying an m×k matrix by a k×n matrix takes O(mkn) operations — roughly m×k×n multiplications and additions. For n×n square matrices: O(n3). Large matrices are expensive!

Square n×n
O(n³)
GPUs help
Parallel
11 / 13
LA 101
Knowledge Check

Check what stuck

Four questions from this lesson. Answer to see why — the explanation appears whether you were right or wrong. Nothing is scored or saved.

Question 1 of 0
Score 0/0

12 / 13
LA 101
M02 · L02
Recap

What You Learned

Matrix addition is entry-wise. Scalar multiplication scales all entries. Matrix-vector and matrix-matrix products are dot-product operations. Multiplication is not commutative but is associative.

13 / 13