Matrix Decompositions, Vector Spaces, and Determinants
Prerequisite Knowledge
This lecture builds on the following concepts from earlier lectures. If any feel unfamiliar, review the linked notes before proceeding.
Previously Covered in This Subject
- Determinant — Lecture 1 (1.6)
- Eigenvectors and Eigenvalues — Lecture 1 (1.9, preview)
- Vector Spaces — Lecture 3 (3.3) and Lecture 4 (4.3)
- Span, Linear Combinations, Independence — Lecture 4 (4.6–4.8)
- Basis and Dimension — Lecture 1 (1.12) and Lecture 4 (4.9)
Matrix Decompositions, Vector Spaces, and Determinants
7.1 Determinants via Minors and Cofactors
A square matrix holds many numbers. Yet a single scalar — the determinant — decides whether that matrix can be inverted. It also measures how much the transformation stretches space.
You already know the 2×2 shortcut: for , the determinant is . That formula was not chosen at random. It emerges from a deeper recursive method that works on matrices of any size.
With that geometric picture in mind, let's build the method properly. You will see that the 2×2 formula is just the cofactor expansion applied to the smallest nontrivial case.
7.1.1 Minor: Shrinking the Matrix by One Element
Pick any square matrix . Zoom in on one entry — call it , the element in row and column . Now delete the entire row and the entire column . What remains is a smaller square matrix. Its determinant is called the minor, written .
The minor by itself is only half the story. The sign matters.
7.1.2 Cofactor: Attaching the Sign
A cofactor, written , is the minor with a positional sign attached:
The exponent depends on the element's position. When is even, the sign is positive. When is odd, the sign is negative.
For : (even), so .
For : (odd), so .
For : (odd), so .
This produces a checkerboard pattern across the matrix. For a 3×3:
The pattern starts with a plus at the top-left and alternates. Memorize this pattern — it is the single most common source of sign errors in determinant calculations.
7.1.3 The Cofactor Expansion
Now you can compute the full determinant. Pick any one row or one column. Multiply each element in that row (or column) by its cofactor. Sum the results. Every choice of row or column gives the same answer.
Expanding along row :
Expanding along column :
Each term pairs an element from the chosen line with the determinant of what remains when that element's row and column are removed, signed by position. The result is a scalar — the determinant.
For a 2×2 matrix , expand along the first row:
The 1×1 determinant of is just . The 1×1 determinant of is just . That is the full chain: the cofactor expansion collapses to the familiar formula.
7.1.4 Worked Example: 3×3 via First-Row Expansion
Compute the determinant of:
by expanding along the first row. The first-row elements are with checkerboard signs .
7.1.5 Worked Example: Same 3×3 via First-Column Cross-Check
The same matrix, expanded along the first column instead. The first-column elements are with checkerboard signs .
- Forgetting the checkerboard sign. Students often compute the correct minor but forget to attach . Double-check: position (1,1) is always positive; (1,2) is always negative.
- Using the wrong submatrix. When standing on , you must delete row and column — not row and column . The indices matter.
- Mixing signs within one column expansion. Every position has its own sign. For column 2 with a 3×3, the signs are — not all the same.
- Stopping the recursion too early. A 2×2 determinant must be resolved to a scalar using . A 1×1 determinant is just the element itself. Do not leave a 2×2 as an uncomputed expression.
7.1.6 Student Questions and Answers
The cofactor expansion is the foundation for practical determinant computation in machine learning pipelines. When you compute the Jacobian determinant in a change-of-variables formula for probability density functions, you apply this same recursive method under the hood.
Principal Component Analysis (PCA) checks whether a covariance matrix has zero determinant. A zero means one dimension is redundant, and PCA can safely discard it without losing information. Cramer's rule for solving small linear systems also rests on this framework, though iterative solvers replace it at scale.
7.2 Row Space and Column Space
7.2.1 Hook
7.2.2 Intuition and Analogy
7.2.3 Formal Definition
| Symbol | Meaning | Type |
|---|---|---|
| An matrix with real entries | Matrix | |
| Number of rows | Integer | |
| Number of columns | Integer | |
| The -th row vector of () | Row vector in | |
| The -th column vector of () | Column vector in | |
| Row space of | Subspace of | |
| Column space of | Subspace of | |
| Set of all linear combinations of the given vectors | Subspace | |
| Dimension of row space = dimension of column space | Integer |
7.2.4 Worked Example
Take the matrix :
Its rows are and .
Step 1 — Check for dependence. Compare to component by component: and . Every component of is exactly twice the corresponding component of . So . These rows are linearly dependent — row two contributes no new direction.
Step 2 — Determine the span. Any linear combination of the rows has the form:
The scalar factor can be any real number. Every combination is a scalar multiple of . The row space is a single line through the origin in the direction of :
Step 3 — Dimension. Only one independent direction exists.
Sense-check: A matrix with rank 1 is singular — its determinant must be zero. Compute: . ✓
Part B: Column Space of a Matrix with Independent ColumnsNow take a different matrix :
Its columns are and .
Step 1 — Check for dependence. Is there a scalar such that ? This requires , meaning and . The first equation gives . Plugging into the second: — a contradiction. No such exists. The columns are linearly independent.
Step 2 — Determine the span. Two independent vectors in span the entire plane. You can reach every point as a unique linear combination of these two columns:
Step 3 — Dimension. Two independent directions fill completely. — full rank.
Sense-check: A full-rank matrix has nonzero determinant. Compute: . ✓
Key insight across both parts: The row space of is a line (1D). Its columns are and , which are also dependent — the column space is also 1D. The column space of is (2D), and its rows and are independent — the row space is also 2D. In every case, row rank equals column rank.
7.2.5 Assumptions and Scope
7.2.6 Visualizing Row Space and Column Space
Picture two 2D coordinate grids side by side, both with axes on the horizontal and on the vertical.
On the left grid, plot the row vectors of matrix as arrows from the origin. points to . points to . Both arrows lie on the same straight line — the line slicing diagonally upward through quadrants I and III. Shade this line red.
That red line is the row space: a one-dimensional subspace cutting through the 2D plane. Every linear combination of the rows lands on this line. No point off it is reachable.
On the right grid, plot the column vectors of matrix as arrows from the origin. points to — steep and narrow, climbing quickly. points to — flat and wide, reaching far horizontally. These two arrows fan out in different, non-collinear directions. Shade the entire plane light blue.
The column space is the full . Any point in the plane is reachable as for some scalars .
The takeaway: the row space (a 1D red line) and the column space (a 2D blue plane) belong to different matrices in these visuals. But for any single matrix, the row space and column space always share the same dimension. If your rows span a line, your columns span a line too — just potentially in a different-looking direction. If your rows span a plane, so do your columns. The shapes may differ, but the dimension number is invariant.
7.2.7 Common Pitfalls
7.2.8 Recap and Bridge
7.2.9 Real-World and Domain Connections
In machine learning, your design matrix has one row per training example and one column per feature. The row space tells you the set of all possible sample profiles you can create by mixing existing training examples. This is critical for understanding dataset diversity and for techniques like data augmentation.
The column space tells you the set of all reachable prediction targets. If your target vector lies outside the column space of , no linear model can achieve zero training error. The dimension of the column space — the rank — reveals the effective number of independent features your data carries.
A rank-deficient design matrix (rank < number of columns) signals multicollinearity: some features are redundant linear combinations of others. This breaks ordinary least squares regression because the normal equations become singular. The matrix is rank-deficient and cannot be inverted.
Techniques like ridge regression, PCA-based dimension reduction, and feature selection all trace their motivation back to this observation. When your column space is cramped, your model is crippled. Understanding row and column spaces is the geometry of why your model can or cannot learn from the data you feed it.
7.3 Null Space and the Rank Nullity Theorem
7.3.1 Hook
7.3.2 Intuition and Analogy
7.3.3 Formal Definition
7.3.4 Worked Example — 2×2 Null Space
Find the null space of .
Step 1 — Set up .
Step 2 — Write the linear system.
Step 3 — Spot row dependency. The second row equals the first row. Both equations encode the same constraint: . The matrix has rank 1 — only one independent direction.
Step 4 — Solve. Isolate . Let be a free parameter sweeping all real numbers.
Answer. — a line through the origin along the direction . The nullity is 1.
Verify rank nullity. . . Sum: . ✓
Verify orthogonality. Dot product of row with null-space vector : . The row and the null-space direction are perpendicular. ✓
7.3.5 Assumptions and Scope
7.3.6 Geometric Intuition — Perpendicular Subspaces
Picture as your ambient space. The row space of sits inside it as a subspace — a line, a plane, or a higher-dimensional flat — always passing through the origin. The null space is another subspace, also through the origin. These two subspaces meet only at zero and sit at perfect right angles. Pick any vector from the row space and any vector from the null space; their dot product is always zero.
For a concrete 3D example: take a rank-2 matrix. Its row space spans a 2D plane through the origin. Its null space is a 1D line perpendicular to that plane, poking straight out like a flagpole. The entire 3D space is the direct sum of these two orthogonal pieces.
This geometric picture is why the dimensions add up to . The row space and null space form an orthogonal coordinate frame that exhausts . What one subspace misses, the other supplies — at a right angle.
7.3.7 Common Pitfalls
7.3.8 Student Questions and Answers
7.3.9 Exam Guidance
7.3.10 Recap and Bridge
The rank nullity theorem is the algebraic hinge between what a matrix preserves and what it destroys.
7.3.11 Real-World and Domain Connections
In machine learning, the null space surfaces wherever linear systems are underdetermined. Principal Component Analysis discards low-variance directions — those discarded eigenvectors form the null space of the reduced-rank approximation. In high-dimensional regression with more features than samples (), the design matrix has a non-trivial null space. That makes coefficients non-unique. Ridge regression penalizes large coefficients precisely in those null-space directions.
In compressed sensing, signals are recovered by exploiting their near-residence in the null space of a measurement matrix. In graph learning, the graph Laplacian's null space encodes the connected components. Its dimension equals the number of disconnected pieces in the graph. Recognizing what a matrix ignores is as powerful as understanding what it preserves.
7.4 Matrix Composition and Decomposition — The Big Picture
7.4.1 Hook + Intuition — Why Order Is Everything
Think of a cooking recipe. You crack eggs into a bowl. You whisk them. You pour the mixture into a hot pan. You cannot pour raw eggs into the pan before cracking them. You cannot whisk after the eggs are already cooking. Each step depends on the previous one. Matrix multiplication works the same way: means transforms your data first, then transforms the result. Decomposition is the reverse — given the finished omelette, identify the sequence of steps that produced it.
7.4.2 Formalize — What Composition and Decomposition Mean
7.4.3 Assumptions and Scope
7.4.4 Visual Intuition — A Cube Under Transformation
Picture a unit cube sitting at the origin. Its vertices mark the corners of a neat, axis-aligned box. Apply a shear matrix. The cube warps — its right angles stretch into oblique angles, and the whole shape tilts sideways. Now apply a rotation matrix. The tilted, warped cube spins around some axis, landing in a completely different orientation. Reverse the order. Rotate the original cube first — it spins cleanly. Then shear the already-rotated cube. The shear now pulls in a direction that is itself rotated, producing a visibly different final shape. Same cube, same two transformations, different order, different result. That is what composition captures.
Now imagine the reverse problem. Someone hands you a mangled, rotated, stretched cube and asks: "Find the stretch, the shear, and the rotation that produced this." Decomposition solves exactly that. It identifies the hidden sequence of simple steps behind any complex transformation.
7.4.5 Comparison — Three Decompositions at a Glance
| Decomposition | Form | What It Reveals | Key Requirement |
|---|---|---|---|
| Cholesky | Fast factorization into lower-triangular times its transpose | Matrix must be symmetric positive definite | |
| Eigendecomposition | Exposes eigenvalues and eigenvectors — the intrinsic stretch directions | Matrix must be square and diagonalizable | |
| SVD | Factors any rectangular matrix into rotation, scaling, rotation | None — works on every matrix |
Cholesky is specialized and fast. Eigendecomposition reveals intrinsic structure. SVD is the universal tool. Each serves a different purpose, and you will see all three in the sections ahead.
7.4.6 Pitfalls
7.4.7 Recap and Bridge to Cholesky
7.4.8 Real-World and Domain Connection
Decomposition powers nearly every corner of applied computation. In machine learning, SVD compresses images and reduces the dimensionality of feature spaces through Principal Component Analysis. In physics simulations, Cholesky factors solve the normal equations of least-squares regression in one efficient pass. In graph theory, Eigendecomposition of the Laplacian matrix reveals community structure via spectral clustering.
In computer graphics, any 3D object's movement comes from composing rotation, scaling, and translation matrices. This ranges from a video game character to a CAD model. Decomposition answers the inverse question: what sequence of moves brought this object here?
7.5 Cholesky Decomposition
7.5.1 The Matrix Square Root
Think of factoring a number into primes: 12 = 2 × 2 × 3. You break a complex object into simpler building blocks. Cholesky does the same for matrices — it factors a symmetric positive definite matrix A into L LT, where L is lower triangular. Each column of L acts like a cascade of simple operations, replacing one dense matrix with a product of two sparse, structured ones. Where prime factorization reveals the DNA of a number, Cholesky reveals the "skeleton" of a matrix.
7.5.2 Formal Definition
| Symbol | Meaning | Type |
|---|---|---|
| A | Original matrix, must be symmetric positive definite | n × n matrix |
| L | Cholesky factor, lower triangular | n × n matrix |
| LT | Transpose of L, upper triangular | n × n matrix |
| ℓij | Entry of L at row i, column j; zero when i < j | Scalar |
| xT A x > 0 | Positive definiteness condition for all nonzero x | Scalar inequality |
7.5.3 Worked Example: 2×2 Cholesky
Decompose A = [[2, 3], [3, 5]].
Step 1: Verify the conditions. A is symmetric because AT = A (the off-diagonal entries are both 3). To check positive definiteness, compute the eigenvalues: solve det(A − λI) = (2 − λ)(5 − λ) − 9 = λ2 − 7λ + 1 = 0. Both roots are positive (≈ 6.85 and ≈ 0.15). So A is symmetric positive definite — Cholesky applies.
Step 2: Set up the unknown L. Write L as a lower triangular matrix with unknowns:
Step 3: Match entries position by position. Equate L LT with A:
Step 4: The Cholesky factor.
Step 5: Apply the determinant shortcut. Compute det(A) directly from the diagonals of L:
Sense-check: The standard 2×2 determinant formula gives (2)(5) − (3)(3) = 10 − 9 = 1. The shortcut matches the direct calculation.
7.5.4 Scope and Pitfalls
Visualise the L matrix as a scaffolding that constructs A from the ground up. Each column adds one more "layer" of structure. Column 1 sets the scale of the first variable. Column 2 introduces a contribution that depends on variable 1. Column 3 depends on variables 1 and 2.
You build the complete matrix by stacking these triangular layers. Lower triangular means each new variable can depend only on variables that came before it. This cascading dependency structure is what makes triangular systems so efficient to solve.
7.5.5 Exam Guidance and Connections
Recap. You have seen that every symmetric positive definite matrix A factors uniquely as A = L LT with L lower triangular. The triangular structure of L delivers two practical wins. Determinants drop from O(n!) to O(n). Solving linear systems Ax = b splits into two cheap triangular solves — forward substitution (Ly = b) then backward substitution (LTx = y). This is Cholesky as the "matrix square root": a clean, structured decomposition that exposes the inner scaffolding of A.
Bridge to Eigen decomposition. Cholesky is a special case of a broader idea — factoring a matrix into simpler pieces. Eigen decomposition generalises this: A = QΛQT, where Q is orthogonal (a rotation) and Λ is diagonal (a pure scaling). Where Cholesky gives you one triangular factor, eigen decomposition gives you a rotation, a stretch, and a rotation back. This unlocks principal component analysis, spectral clustering, and the geometry of quadratic forms — all coming up next.
Real-world impact. In Monte Carlo simulations, you need correlated random variables. Stock prices move together. Sensor networks share noise. Bayesian prior samples have known covariance. You start with uncorrelated standard normal noise z. Given a target covariance matrix Σ, you compute its Cholesky factor: Σ = L LT. Then x = Lz produces a vector with covariance exactly Σ.
Every correlated simulation in quantitative finance, weather forecasting, and computational statistics leans on this technique. For solving large linear systems Ax = b, Cholesky is typically twice as fast as Gaussian elimination. That is why it underpins the numerical engines inside optimisation libraries, physics simulators, and machine learning frameworks.
7.6 Eigen Decomposition (Diagonalization)
7.6.1 Hook — What Stretches Without Turning?
Imagine stretching a rubber sheet. Pull one direction — the sheet elongates purely there. Pull another — it elongates purely there too. These special directions only stretch. But most directions on the sheet get sheared and stretched. A matrix is like that sheet. It twists most vectors. Yet hidden inside every square matrix are special directions that only get scaled — never rotated. Find those directions, and the entire transformation reduces to pure axis-aligned stretching after a simple change of viewpoint. That is eigen decomposition.
7.6.2 Formalizing Eigen Decomposition
- Solve the characteristic equation to find all eigenvalues .
- For each , solve the nullspace equation to find eigenvector .
- — the -th eigenvalue. A scalar. Tells how much the matrix stretches along .
- — the -th eigenvector. An vector. The invariant direction that only gets scaled.
- — the matrix whose columns are the eigenvectors .
- — the diagonal matrix. Entry . Every off-diagonal entry is zero.
- — the inverse of . Reverses the change of basis that performs.
- — the transpose of . Equals in the special symmetric-matrix case.
How does actually work? The transformation happens in three steps, applied right to left:
- applies first. It shears the eigenvectors so they snap onto the standard coordinate axes. The arrows that used to point in the eigenvectors' directions now point along and .
- applies next. Pure scaling. Axis stretches by . A diagonal matrix cannot shear or rotate — it can only scale each axis independently.
- applies last. It shears the axes back to point where the eigenvectors originally lived. The inverse of step 1.
Net effect: shear-to-axes → stretch → shear-back. Every linear transformation can be seen this way, provided is diagonalizable.
7.6.3 Worked Example — Full 2×2 Eigen Decomposition
Given the symmetric matrix
Step 1 — Characteristic equation. Solve :
Sense-check: sum . ✓
Step 2 — Eigenvector for . Solve :
Take , raw vector . Normalize:
Step 3 — Eigenvector for . Solve :
Take , raw vector . Normalize:
Sense-check: . Orthonormal. ✓
Step 4 — Assemble and :
Final answer: (spectral form — is symmetric). Multiply out to verify it recovers the original matrix.
When is symmetric (), the eigenvectors can be chosen orthonormal — unit length and mutually perpendicular. Then , and the decomposition simplifies to the spectral decomposition . This is not a separate topic. It is eigen decomposition applied to symmetric matrices. The formula is cleaner, but the computation is identical.
7.6.4 Dimension Reduction — Why Eigenvalues Matter
Eigenvalues measure importance. A large means stretches heavily along . That direction carries most of the transformation's energy. A small means barely any stretch. That direction barely matters.
Now think of data, not transformations. Your data matrix has samples as rows and features as columns — age, salary, account balance. Hundreds of features. Many are correlated. Age and experience move together. You do not need all of them.
Compute the data's covariance matrix. Find its eigenvectors. Each eigenvector is a new feature — a weighted combination of the originals. Its eigenvalue measures variance (spread) along that direction. Large eigenvalue = data varies heavily there. Small eigenvalue = data is nearly flat there.
Project onto the top few eigenvectors — those with the largest eigenvalues. You keep almost all the variance. You discard directions where the data barely moves. Result: 100 features become maybe 10. Faster models. Less noise. Minimal information loss.
This is the core of Principal Component Analysis (PCA). More on PCA in a later lecture.
7.6.5 Assumptions and Scope
Not all square matrices are diagonalizable. A defective matrix has fewer than linearly independent eigenvectors. Then is not invertible and fails. Example: has (a double eigenvalue) but only one eigenvector direction. It cannot be diagonalized.
For diagonalizable matrices, the decomposition is unique up to scaling of eigenvectors and ordering of eigenpairs. Reorder the columns of and you reorder the diagonal entries of the same way.
7.6.6 Visual Intuition — The 3D Cube
Picture a unit cube of vectors floating in 3D space. Apply and watch what happens — not all at once, but through the pipeline.
The cube first shears (tilts) under . Its volume stays constant — shear preserves volume. Then it stretches under along the principal axes, elongating or squashing. The volume changes here, and the change equals , the product of all eigenvalues. Finally the cube shears back under , tilting to its final orientation. The three-stage decomposition makes visible what the single matrix hides: the pure-stretch core sandwiched between two basis changes.
- Forgetting to normalize eigenvectors. Raw solutions from are not unit vectors. Always divide by the vector norm.
- Sign errors in the characteristic polynomial. Double-check , not .
- Mixing up eigenvalue–eigenvector ordering. must pair with in column 1 of , not column 3. Match them column-wise.
- Computing explicitly when is symmetric. Use instead. Saves time and avoids numerical error.
- Confusing eigen decomposition (square only) with SVD (any shape). They are different — learn both.
7.6.7 Student Questions
7.6.8 Exam Guidance and Recap
Real-world applications span PCA (dimensionality reduction — keeping top eigenvectors), image compression (discarding small-eigenvalue SVD components), and vibration analysis in mechanical engineering. There, natural frequencies are eigenvalues and mode shapes are eigenvectors. Google's original PageRank uses the dominant eigenvector of the web graph. Quantum mechanics treats measurement outcomes as eigenvalues of observables.
The idea is always the same: find the directions that matter, rank them by importance, and discard or downweight the rest.
7.7 Singular Value Decomposition (SVD)
7.7.1 The Rectangular Reality
Think of a rectangular photograph. You can still rotate it — stretch it — and rotate it back. The shape does not matter. SVD does exactly this: it decomposes any matrix into two rotations and one stretch. This holds no matter how tall or wide the matrix is.
7.7.2 Formal Definition
- — orthogonal matrix. Columns are left singular vectors. Rotation step one.
- — diagonal matrix. Entries are the singular values. Always nonnegative, sorted largest to smallest. Stretch step.
- — orthogonal matrix, transposed. Rows are right singular vectors. Rotation step two.
7.7.3 Connection to Eigen Decomposition
SVD is eigen decomposition cleverly repurposed. Start with a rectangular . Square it up:
Both are square. Both are symmetric. Apply eigen decomposition. The eigenvectors of become the right singular vectors . The eigenvectors of become the left singular vectors . The singular values are square roots:
and share the same nonzero eigenvalues. SVD takes a rectangle, makes it square, runs eigen decomposition, and takes square roots. That is why eigen comes first — SVD stands on its shoulders.
7.7.4 Dimension Reduction with SVD
The singular values in are your compression dials. The largest ones capture dominant structure. The smallest ones carry noise.
Keep the top singular values. Zero out the rest. Multiply back: . The result is a rank- approximation of . It is the best possible rank- approximation — minimal Frobenius norm error, guaranteed by the Eckart–Young theorem. This one idea powers image compression, PCA, LoRA, and recommender systems.
7.7.5 Assumptions & Scope
Singular values are always nonnegative: . For real matrices, and are real orthogonal matrices.
7.7.6 Visual Intuition
Imagine a 3D cloud of data points — a shapeless cluster. Apply : the cloud rotates in place. All relative distances stay fixed. Then : the cloud stretches along each coordinate axis. pulls hard. barely moves. The cloud flattens toward the dominant directions. Finally, rotates the flattened cloud to its final orientation.
The singular values tell you how much each axis stretches. If and , the first axis carries 50× more energy than the third. Discard the small axes and the cloud projects onto a lower-dimensional subspace — with almost nothing lost.
7.7.7 Common Pitfalls
- Confusing singular values with eigenvalues. Unless is symmetric positive semidefinite, singular values and eigenvalues are different numbers. Singular values are , not .
- Forgetting the transpose on . The factorization is , not . The superscript matters. Multiplying gives a wrong result.
- Using SVD on small square matrices. If is and symmetric, eigen decomposition is simpler and faster. SVD adds unnecessary steps.
- Truncating too aggressively. Dropping too many singular values discards real structure. Always check the singular value spectrum first — look for a gap.
7.7.8 Real-World Applications
SVD is everywhere once you look.
Image compression. A image is just a matrix. Keep 50 singular values instead of 1080. Reconstruct. The image is nearly identical; the storage cost drops by orders of magnitude.
LoRA — Low-Rank Adaptation. Fine-tuning an LLM modifies a weight matrix . Instead of retraining every entry, LoRA approximates the update as a product of two skinny matrices. These are where and with . This low-rank decomposition is directly inspired by SVD.
Recommender systems. The user–item rating matrix is huge (millions × thousands) and mostly empty. SVD collapses it into latent factors — hidden taste dimensions — that explain ratings with far fewer numbers.
PCA. Center your data. Compute its SVD. The right singular vectors are the principal components. PCA and SVD are the same algorithm under the hood.
7.7.9 Student Q&A
7.7.10 Exam Guidance & Lecture Recap
Exam Guidance Summary
Key Industry Applications
Image Compression (SVD-based)
The SVD factorizes an image (treated as a matrix of pixel intensities) into . By discarding smaller singular values — which capture only fine-grained detail — and retaining only the top singular values, the image can be reconstructed with a drastically reduced storage footprint. This principle underpins JPEG compression pipelines. It is also used in WhatsApp's image resizing to achieve near-lossless quality at a fraction of the original file size.
Low-Rank Adaptation (LoRA) for LLMs
When fine-tuning large language models like GPT or Gemini, updating the full weight matrix is prohibitively expensive. LoRA decomposes the weight update into a low-rank product where and are much smaller matrices. This is directly inspired by the SVD's ability to approximate a matrix with a low-rank factorization. It reduces trainable parameters by several orders of magnitude without sacrificing downstream task performance.
Recommender Systems (Netflix, Amazon, Spotify)
User–item interaction matrices are enormous and sparse: rows are millions of users, columns are millions of items, and most entries are empty. SVD factorizes this matrix into latent user-feature and item-feature vectors, discovering hidden patterns. For example, it groups users who like similar genres without explicitly knowing the genre labels. This latent factor approach powered the Netflix Prize-winning algorithm. It remains the backbone of modern recommendation engines.
Principal Component Analysis (PCA)
PCA reduces the dimensionality of high-dimensional datasets by projecting data onto the directions of maximum variance. These directions are the eigenvectors of the data covariance matrix, computed via eigen decomposition or equivalently via SVD of the centered data matrix. The resulting principal components form a new coordinate system where the first few axes capture most of the information. This enables visualization, noise reduction, and more efficient model training across all of machine learning.
MFML Lecture 07 notes · Matrix Decompositions, Vector Spaces, and Determinants
Sections Breakdown
Compute determinants by cofactor expansion along any row or column using minors and the checkerboard sign pattern.
Define row space and column space, and show they always share the same dimension — the rank.
Define the null space (kernel) and prove rank plus nullity equals the number of columns.
Explain that matrix multiplication is right-to-left and that decomposition reverse-engineers a transformation.
Factor a symmetric positive definite matrix as A = LL^T and use the determinant shortcut.
Factor a square matrix as A = PDP^{-1}; eigenvectors are pure-stretch directions, eigenvalues are stretch amounts.
Factor any rectangular matrix as A = U Sigma V^T and connect it to eigen decomposition.
Exam Revision Notes
Below is the distilled, exam-ready core of this lecture. Every entry is built from the full textbook notes above. Use this section for rapid review — but if something doesn't make sense, go back to the full explanation in the main content.
Determinants via Minors and Cofactors
Must-know: The determinant of a square matrix is computed by cofactor expansion along any row or column. The checkerboard sign pattern is the main exam error source — always write it out before expanding.
⚠️ Top pitfall: Forgetting the checkerboard sign when attaching the cofactor — a sign flip silently breaks the whole calculation.
Self-check: Expand a given 3×3 matrix along two different rows. Do both give the same determinant? If not, where is the sign error?
Connects to: Row space and column space, Eigen decomposition, Cholesky determinant shortcut.
Row Space and Column Space
Must-know: The row space (span of rows, lives in ) and the column space (span of columns, lives in ) always have the same dimension — the rank. This is a theorem, not a definition.
⚠️ Top pitfall: Swapping where each space lives — the row space is in (because each row has entries), not . Count entries per vector, not the number of vectors.
Self-check: A 2×2 matrix has dependent rows. What is its rank, and what does that imply about its column space?
Connects to: Null space and rank nullity, Determinants, Multicollinearity in regression.
Null Space and the Rank Nullity Theorem
Must-know: The null space is the set of vectors maps to zero. The rank-nullity theorem partitions the input dimension: rank (preserved directions) plus nullity (collapsed directions) equals , the number of columns.
⚠️ Top pitfall: Using (rows) instead of (columns) in the theorem. The sum always equals the input dimension , never the output dimension.
Self-check: A 4×4 matrix has rank 1. What is the dimension of its null space?
Connects to: Row space and column space, Eigen decomposition, PCA.
Matrix Composition and Decomposition
Must-know: Matrix multiplication reads right-to-left: in , acts first, then . Decomposition reverse-engineers a complex transformation into elementary pieces (stretch, shear, rotate).
⚠️ Top pitfall: Reading as "first , then ". Order changes everything for transformations — this is the single most common intuition error.
Self-check: For two 2×2 matrices, is generally equal to ? Why does order matter geometrically?
Connects to: Cholesky decomposition, Eigen decomposition, Singular Value Decomposition.
Cholesky Decomposition
Must-know: A symmetric positive definite matrix factors uniquely as with lower triangular. The determinant becomes the square of the product of 's diagonal entries — dropping cofactor expansion from to .
⚠️ Top pitfall: Applying Cholesky to a non-symmetric or non-positive-definite matrix — you hit a negative radicand and the real square root fails. Always verify SPD first.
Self-check: Given a 2×2 Cholesky factor , how do you recover without expanding the full matrix?
Connects to: Determinants, Eigen decomposition, Positive definite matrices.
Eigen Decomposition (Diagonalization)
Must-know: A diagonalizable square matrix factors as . Eigenvectors are the pure-stretch directions; eigenvalues are the stretch amounts. For symmetric matrices, (spectral decomposition).
⚠️ Top pitfall: Forgetting to normalize eigenvectors, or mixing up eigenvalue–eigenvector pairing order. must sit in column 1 of , paired with .
Self-check: For a symmetric matrix, what replaces in the decomposition, and why?
Connects to: Singular Value Decomposition, Determinants, PCA, Rank nullity.
Singular Value Decomposition (SVD)
Must-know: Any matrix factors as — two rotations and one stretch. Singular values are square roots of the eigenvalues of (or ). SVD is the universal tool; eigen decomposition is its engine.
⚠️ Top pitfall: Forgetting the transpose on (writing instead of ), or confusing singular values with eigenvalues when is not symmetric positive semidefinite.
Self-check: Why does SVD work on a rectangular matrix when eigen decomposition does not?
Connects to: Eigen decomposition, PCA, Image compression, Low-rank approximation (LoRA).
Was this lecture useful?
BitsNotes AI Assistant
Subject Notes AssistantConfigure AI Chat
Choose how to access the chatbotSigned in as
Powered by BitsNotes — 20 messages per day. No API key needed. Want unlimited access? Use "Bring Your Own Key" mode.
Sign in to use AI Chat
Get 20 free AI messages per day to ask questions about your lecture notes. Sign in with Google or GitHub — it takes 5 seconds.
Sign In to BitsNotesSwitch to "Bring Your Own Key" tab above for unlimited access with any OpenAI-compatible provider.