Sections¶
- 5.1. Matrix Operations
- 5.2. Transpose and Special Matrices
- 5.3. Rank and Column Space
- 5.4. Null Space and the Rank-Nullity Theorem
Summary¶
5.1 Matrix Operations¶
has rows and columns; is in row , column . Adding and scaling are entrywise.
Golden rule: is defined only when the inner dimensions match: .
Interpretation 1: is a linear combination of ’s columns, , weighted by the entries in :
Interpretation 2: contains the dot products of ’s rows with :
Matrix multiplication is associative, , and distributive, , but generally not commutative, .
In NumPy, use
A @ Bfor matrix multiplication, notA * B.
5.2 Transpose and Special Matrices¶
; ; (order reverses).
The dot product is a scalar, but is a matrix called the outer product of and .
.
Identity: , . Diagonal: for (scales each component). Upper (lower) triangular: square, zeros below (above) the diagonal.
Symmetric: . is always symmetric (), with entry equal to , where is the -th column of .
Orthogonal: square with (orthonormal columns and rows); preserves length, . A non-square with only has orthonormal columns.
5.3 Rank and Column Space¶
= maximum number of linearly independent columns = = maximum number of linearly independent rows, so .
Full rank: .
One way to create a basis for : keep each column that isn’t a combination of the columns kept before it. (Remember, every subspace has infinitely many bases.)
A matrix with rows and has rank 2 iff . A diagonal matrix’s rank is its number of nonzero diagonal entries.
has rank 1 for nonzero .
5.4 Null Space and the Rank-Nullity Theorem¶
The null space is the set of inputs that get sent to by :
Rank-nullity theorem:
Linearly independent columns .
Column relationships give null space vectors, e.g. if col 3 = col 1 − col 2, then
| Subspace (assuming ) | Lives in | Dimension | Orthogonal complement |
|---|---|---|---|
| column space | left null space | ||
| row space | null space | ||
| null space | row space | ||
| left null space | column space |
.
: they share a null space, since .
CR decomposition : () is ’s linearly independent columns; column of () builds column of from them. It shows row rank = column rank.