Eigenvalues, Eigenvectors, and Determinants
Eigenvalues, Eigenvectors, and Determinants
This lecture covers three cornerstone ideas in linear algebra. They are the Cauchy-Schwarz inequality, the determinant, and eigenvalues with eigenvectors.
The Cauchy-Schwarz inequality is a bound on inner products. The determinant is a scalar that captures how much a matrix scales area and volume. Eigenvalues and eigenvectors are the special directions along which a matrix acts like pure scaling.
Together, these concepts form the mathematical foundation for principal component analysis (PCA) and dimensionality reduction. These techniques appear in every modern machine learning pipeline.
6.1 Cauchy-Schwarz Inequality
6.1.1 Definition and Explanation
Symbol Registry
| Symbol | Meaning | Type | Shape |
|---|---|---|---|
| Vectors in an inner product space | Vector | ||
| Inner product of x and y | Scalar | Scalar | |
| Euclidean norm (length) of x | Scalar | Scalar |
6.1.2 Geometric Origin via the Dot Product
You can see where Cauchy-Schwarz comes from by looking at the dot product. The dot product between two vectors can be expressed using the cosine of the angle between them.
Now divide both sides by the product of the lengths.
The maximum value of cosine is 1 and the minimum is -1. So the ratio on the left is always bounded between -1 and 1. That is the geometric origin of Cauchy-Schwarz. Take the inner product of two vectors. Divide it by the product of their lengths. The result can never exceed 1 in absolute value. You have an upper bound and a lower bound.
The key requirement: the inner product must be a valid inner product. It must be bilinear (or sesquilinear for complex), symmetric (or conjugate-symmetric), and positive-definite. When these axioms hold, Cauchy-Schwarz follows. Equality holds if and only if and are linearly dependent — one is a scalar multiple of the other.
6.1.3 Practical Relevance
This inequality is rarely used directly in machine learning practice. In eleven years of working in ML, you may never call on it explicitly. It is a foundational tool — something used inside proofs and derivations, not something you compute day to day. It tells you the lower bound and upper bound for normalized inner products. The ratio is always clamped between -1 and 1.
Visual Intuition: Picture two arrows on a 2D plane, both starting at the origin. The first arrow has length 3, the second has length 4. Their inner product is 12 only if they point in exactly the same direction (). It is 0 if they are perpendicular. It is if they point in exactly opposite directions (). The Cauchy-Schwarz inequality says: the inner product lives in , period. The takeaway: the inner product divided by the length product gives , a number between and .
- Confusing inner product with dot product. The dot product is one specific inner product on . But Cauchy-Schwarz holds for any valid inner product , not just the dot product. The notation is the general inner product.
- Forgetting the absolute value. The inequality is about , not about itself. Without the absolute value, the lower bound is , not 0.
- Assuming equality is common. Equality requires that and be scalar multiples of each other. Most pairs of random vectors do not achieve equality.
Real-World & Domain Connection: In statistics, the correlation coefficient between two random variables is exactly the Cauchy-Schwarz inequality applied to centered random variables: and .
In signal processing, the matched filter is the optimal linear filter for detecting a known signal in noise. It achieves its maximum signal-to-noise ratio when the filter is proportional to the signal. This is a direct consequence of Cauchy-Schwarz. In quantum mechanics, the Heisenberg uncertainty principle — — is derived from Cauchy-Schwarz applied to wave functions.
6.2 Determinants — Geometric Interpretation
6.2.1 The Transformation View
When a matrix multiplies a vector to produce a new vector , the matrix does more than move that one vector. It transforms the entire space.
Think of the input space as a rubber sheet of paper with a grid drawn on it. The matrix applies some force to this sheet — stretching it, squishing it, or shearing it. Every vector in the space moves. Every grid cell deforms. The determinant measures how much the area of any grid cell scales under that transformation.
Symbol Registry
| Symbol | Meaning | Type | Shape |
|---|---|---|---|
| Transformation matrix | Matrix | ||
| Determinant: area/volume scaling factor | Scalar | Scalar | |
| Input vector | Vector | ||
| Transformed output vector | Vector |
6.2.2 Area in Two Dimensions
In a 2D grid, you have two basis vectors — say the standard basis and . The area enclosed between them starts as 1. Every parallelogram cell in the grid has that same area. The determinant is that uniform area scaling factor.
Now apply a horizontal shear. The Y basis vector moves sideways. The grid slants. The area of each cell may or may not change — shear actually preserves area. But apply a stretch instead: pull the sheet horizontally. The grid cells widen. If the original area was 1 unit and the new area is 8 units, the determinant is 8. The determinant is the multiplicative factor by which area scales, not the difference.
Under a pure rotation, area is preserved. Rotate a square piece of paper by 45 degrees, and the paper's area is exactly the same. The grid lines stay parallel and equidistant. The determinant before rotation equals the determinant after rotation. Rotation does not stretch or squish.
Step 1 — Identify the columns: The columns are and . These are the images of the standard basis vectors under .
Step 2 — Compute the determinant:
Step 3 — Interpret geometrically: The matrix stretches the plane. The unit square (area 1) maps to a parallelogram of area 6. Every grid cell scales by a factor of 6. Since , orientation is preserved — the transformed parallelogram has the same handedness as the original square.
Sense-check: The matrix is upper triangular (all entries below the diagonal are zero). For triangular matrices, the determinant equals the product of the diagonal entries: . The result is consistent.
- The matrix must be square (). Non-square matrices have no determinant — the concept of scaling a space onto itself requires equal input and output dimensions.
- The absolute value gives the magnitude of scaling. The sign carries separate information about orientation (preserved or reversed). The two pieces of information are independent.
- When , the geometric object degenerates — a parallelogram collapses to a line, a parallelepiped flattens to a plane. The "volume" is zero, but the object still exists as a set of lower dimension. The formula still yields the correct zero measure.
- The interpretation holds for any square matrix with real entries. Over , the determinant is complex-valued, and the geometric picture requires a different notion of volume.
- Viewing columns as images of basis vectors is equivalent to viewing rows that way, because — transposing does not change the determinant.
Visual Intuition: Picture the 2D coordinate plane with horizontal -axis and vertical -axis. The original unit square sits at , , , — a perfect square of area 1. Apply the matrix from the worked example. Each vertex transforms: stays at the origin, maps to , maps to , and maps to . The four transformed points form a parallelogram. Its base runs from to — length 2 along the -axis. Its left edge rises vertically from to — a vertical climb of 3. The horizontal base times the vertical height gives , matching . The takeaway: the four matrix entries dictate the shape of the transformed grid, but the determinant alone — one number — tells you the area of any transformed shape.
6.2.3 Volume in Three Dimensions and Beyond
In three dimensions, the determinant becomes the scaling factor of volume — the volume of a parallelepiped defined by three basis vectors. A parallelepiped is the 3D analog of a parallelogram: a box-like shape whose opposite faces are parallel parallelograms. Multiply a matrix by a 3D vector. The transformation changes a unit cube of volume 1 into a parallelepiped. The determinant tells you by how much the volume scales.
For , the three columns give three vectors . The volume of the parallelepiped they span equals . Algebraically, the determinant recovers the scalar triple product — — which is exactly the signed volume of the parallelepiped.
In dimensions, the determinant generalizes to hyper-volume — the -dimensional analog of area and volume. The concept stays the same: the determinant is always a single scalar. Whether you think in 2D (area), 3D (volume), or D (hyper-volume), the determinant is one number that captures how much the transformation scales the measure of space.
6.2.4 Determinant of Zero — Dimensional Collapse
When both basis vectors become collinear — lying on the same line — the entire 2D space collapses to a single line. There is no area on a line. The determinant is 0. In 3D, if all three basis vectors lie in the same plane, the volume collapses and the determinant is 0.
A zero determinant signals that the transformation has destroyed a dimension. The matrix is singular — it is non-invertible. You cannot undo the transformation because information was lost when the space collapsed. Multiple different input vectors map to the same output vector, so you cannot recover the original input from the output alone.
- A zero determinant does not mean the output is always the zero vector. A singular matrix can produce non-zero outputs — it simply maps the entire space onto a lower-dimensional subspace (a line, a plane). Example: has because row 2 is twice row 1. Yet . The space collapses, not every output.
- Do not confuse with . The notation means the absolute value of the determinant (always non-negative). Writing absolute values inside the matrix first — — produces an entirely different quantity with no standard geometric meaning.
- Large entries do not imply a large determinant. A matrix with all entries in can have a large determinant if the columns are long and nearly orthogonal. A matrix with entries in the thousands can have a determinant near zero if the columns are nearly collinear. The determinant depends on geometry, not magnitude of entries.
- The professor flags this repeatedly: Students often compute , correctly conclude the matrix is invertible, but fail to apply the contrapositive — implies singular and non-invertible. Both directions matter equally on exams.
6.2.5 Student Questions and Answers
A: The determinant is the multiplicative scaling factor — the ratio of new area to old area. It is not a difference. If the original unit square has area 1 and the transformed parallelogram has area 32, then . Mathematically, for any measurable region in the domain, the image has area equal to . The determinant is the constant of proportionality.
Contrast this with subtraction: the area grew by 31, but the determinant is the factor 32. If the original area were not 1, the "change" would vary by region, but the multiplicative factor stays the same everywhere — that is why the determinant is the meaningful quantity.
Q: When we rotate a rubber sheet, the grid lines stay parallel and equidistant. Does the determinant change?
A: No. Every pure rotation matrix has determinant exactly . The standard rotation matrix for angle is
and its determinant is for every angle . A rotation preserves area (no stretching), preserves shape (no squishing), and preserves orientation (no flipping). Rotate a square piece of paper by 45 degrees: same area, same shape — just pointed in a different direction. The determinant is unchanged.
Next: we move from the geometric meaning of determinants to another perspective on matrices. We look at the special directions (eigenvectors) along which the transformation acts like pure scaling. The scaling factors (eigenvalues) define those directions.
Real-World & Domain Connection: In computer graphics, GPU pipelines use the determinant for back-face culling. When rendering a 3D triangle mesh, the sign of the determinant of the matrix formed by the triangle's vertex positions tells the renderer something useful. It tells the renderer whether the triangle faces toward or away from the viewer. Triangles facing away are culled — skipped — saving substantial rendering time.
In continuum mechanics, the deformation gradient tensor's determinant gives the local volume change ratio. It governs how materials compress or expand under stress. In multivariable calculus, the Jacobian determinant converts between coordinate systems during integration — . The determinant captures exactly how area elements stretch. In probability theory, the same principle rescales probability density functions when you transform random variables. The determinant sits at the center of any discipline that involves changing coordinates or deforming space.
6.3 Eigenvalues and Eigenvectors — Geometric Intuition
6.3.1 Hook — What Survives the Transformation?
Apply a matrix to a handful of vectors. Most of them move — their direction shifts, their length changes. But pause and ask: do any vectors keep their direction? Are there special directions that survive the transformation intact, merely stretching or shrinking along the same line they started on?
Those directions exist. They are the eigenvectors. The matrix acts on them the way a zoom lens acts on a photograph: everything along that axis scales, nothing rotates away. Finding these invariant directions is the central geometric problem of this section.
6.3.2 Intuition and Analogy — Three Physical Metaphors
Spinning Globe. Place your finger on a globe and spin it. Every point on the surface traces a circle — except the two points at the North and South Poles. Those points stay fixed. The axis connecting them does not move. In the language of eigenvectors: the rotation axis is an eigenvector. Its eigenvalue is 1. Points on that axis do not get scaled at all.
Stretching Dough. Roll out a sheet of dough with a rolling pin. The dough stretches in one direction and compresses in the perpendicular direction. Vectors aligned with the stretch direction get longer — they are eigenvectors with . Vectors aligned with the compression direction get shorter — they are eigenvectors with . Both directions are eigenvector axes. The dough does not rotate vectors; it only scales them along those two principal directions.
Shearing a Deck of Cards. Push the top half of a deck sideways. The cards slide, but the bottom card stays put. Every card slides parallel to the bottom card. Horizontal vectors — vectors parallel to the cards — do not change direction. They slide but stay horizontal. Those horizontal vectors are eigenvectors. Their eigenvalue is . They neither stretch nor shrink; they translate within their own axis.
A matrix transformation can also be thought of as applying a force to the input space. A force has a direction and a magnitude. The direction of the force is the eigenvector. The magnitude of the force is the eigenvalue. Vectors that align with the force direction only get stretched or squished along that same line — they stay on their axis. Any vector not aligned with the force direction gets displaced to a new direction entirely.
6.3.3 The Core Equation — Formal Definition
A nonzero vector is an eigenvector of a square matrix if multiplying by returns a scalar multiple of :
The scalar is the eigenvalue associated with . This equation says: the matrix acts on the same way scalar multiplication by would. The output is parallel to the input.
The zero vector is excluded from the definition. If , the equation holds for every , which makes the eigenvalue meaningless.
Symbol Registry
| Symbol | Meaning | Type | Shape |
|---|---|---|---|
| Square transformation matrix | Matrix | ||
| (or ) | Eigenvector — must be nonzero | Vector | |
| (Lambda) | Eigenvalue: scaling factor along that direction | Scalar | Scalar |
Eigenspace. For a given eigenvalue , the set of all eigenvectors associated with , together with the zero vector, forms a subspace called the eigenspace. Every vector in that eigenspace satisfies .
6.3.4 Worked Example
Factor the output: .
The output is . So is the eigenvalue. The vector got scaled by a factor of . Its direction stayed the same. The negative sign means it flipped to the opposite side of the same axis. It is still on that axis. The eigen relationship holds: .
Non-Example. Consider with the same matrix .
For to be an eigenvector, we need for a single . Checking component-wise: would give , but would give . The components demand inconsistent scaling factors. No single satisfies the equation. So is not an eigenvector.
6.3.5 Assumptions and Scope
Square matrices only. The definition requires to be square. If is , then must be and the output is also — matching the shape of .
Up to eigenvalues. An matrix has up to eigenvalues, counting multiplicity. Some matrices have fewer than distinct eigenvalues. The characteristic polynomial has degree , so it yields roots in the complex plane, though some may repeat.
Real and complex eigenvalues. A real matrix can produce complex eigenvalues. They always appear in conjugate pairs. Rotation matrices in 2D, for instance, have eigenvalues — purely real only when or .
Symmetric matrices. If is symmetric (), all eigenvalues are real. This property makes symmetric matrices central in applications like principal component analysis and spectral clustering.
Triangular matrices. If is upper or lower triangular, the eigenvalues sit on the main diagonal. No computation needed — read them off directly.
Negative eigenvalues. A negative means the eigenvector flips direction — a reflection across the origin — and scales by . The vector stays on the same axis; it just points the opposite way.
6.3.6 Visual Intuition — Axes, Scaling, and Rotation
Eigenvectors are entire axes. An eigenvector is a direction, not a single arrow. If is an eigenvector, then , , and — every scalar multiple along that line — are also eigenvectors. The eigenvector is the axis itself.
Stretching and shrinking are both eigen behavior. A vector that elongates () is an eigenvector. A vector that shrinks () is an eigenvector. The test is always: does the vector remain on the same axis after the transformation? The amount of scaling — stretch or squish — does not matter for eigenvector status.
Flipping. When , the vector flips 180 degrees to the opposite side of the axis. It stays collinear with the original direction. A flip is still an eigenvector: the axis is the same, only the sign of the coordinate along that axis changes.
Rotation matrices. A pure 2D rotation matrix sweeps every vector along a circular arc. No vector stays on its original axis. So a 2D rotation matrix has no real eigenvectors. Its eigenvalues are complex: . In 3D, however, every rotation happens around some axis. Points lying on that rotation axis do not move. So in 3D, the axis of rotation is an eigenvector with .
6.3.7 Comparison — Determinant vs Eigenvalue
Both the determinant and the eigenvalue describe scaling, but at different scopes.
| Aspect | Determinant | Eigenvalue |
|---|---|---|
| What it measures | Scaling of area or volume across the entire space | Scaling along one specific direction |
| Count | One number for the whole matrix | One number per eigenvector direction (up to ) |
| Relationship | Each is a factor of | |
| Zero value means | Space collapses — at least one dimension squashes to zero; at least one eigenvalue is zero | Vectors along that direction get annihilated; the matrix is singular along that axis |
| Sign | Positive means orientation preserved; negative means orientation reversed | Positive means same direction; negative means flipped direction |
| Geometric picture | The volume of the unit cube after transformation | The stretch factor along one principal axis |
The determinant is the product. The eigenvalues are the factors. Knowing the determinant tells you the net volume change. Knowing the eigenvalues tells you how that volume change distributes across each principal direction.
6.3.8 Common Pitfalls — Student Questions
A: The determinant measures the scaling of area or volume across the entire space — it is one number for the whole transformation. The eigenvalue measures the scaling along a specific direction. They are related: . But they answer different questions. "How much did the total volume change?" — that is the determinant. "Along which directions does the transformation act like pure scaling, and by how much?" — those are the eigenvalues. See Section 6.3.7 for a side-by-side table.
(Asked by several students — 3 variants of this question appeared.)
A: When , the space collapses — area or volume vanishes. Since the determinant equals the product of all eigenvalues, a zero determinant means at least one eigenvalue must be zero. But not all eigenvalues need to be zero.
Eigenvectors still exist when the space collapses. The transformation still has a direction along which it acts. Vectors lying along the nullspace direction — the direction that gets squashed to the origin — are eigenvectors with . Vectors along other principal directions remain eigenvectors with their respective eigenvalues. The only case where no real eigenvectors exist is a pure rotation in 2D, where every vector changes direction and no axis remains invariant.
(Asked by two students — covering multiple eigenvectors and the stretching vs. shrinking distinction.)
A: An matrix has up to distinct eigenvector directions — the principal axes along which the transformation acts independently. In a 2D transformation, you typically get two eigenvector directions. Each direction is an entire axis, not a single vector. Any scalar multiple of an eigenvector is also an eigenvector.
The test for eigenvector status is simple: does the vector remain on the same axis before and after the transformation? If yes, it is an eigenvector — whether it got longer (), shorter (), flipped (), or stayed the same length (). The amount and sign of scaling do not affect eigenvector status. Only a change in direction disqualifies a vector.
(Asked by two students — covering matrix dependence and rotation.)
A: Eigenvectors depend entirely on the matrix. Change the matrix, and the eigenvectors change. For a given matrix , the eigenvectors are fixed — they are the principal axes of that specific transformation. Any vector could be an eigenvector for some matrix, but for a given , only vectors lying along its principal axes qualify.
In a 2D rotation, every vector changes direction. There is no axis along which vectors merely stretch or shrink. So no real eigenvectors exist — the eigenvalues are complex conjugates. In a 3D rotation, the axis of rotation is an eigenvector with . Points on that axis do not move. Higher-dimensional rotations always have at least one real eigenvector when the dimension is odd.
6.3.9 Recap and Bridge
6.3.10 Real-World Connections
Principal Component Analysis (PCA). Given a cloud of data points, PCA finds the directions of maximum variance. Those directions are the eigenvectors of the covariance matrix. The eigenvalues tell how much variance each direction captures. This underpins dimensionality reduction, facial recognition, and data compression.
Google PageRank. The web is a giant graph. PageRank models a random surfer clicking links. The steady-state probability of being on each page is the eigenvector of the web's link matrix corresponding to . That dominant eigenvector ranks the pages.
Vibration Analysis. When a bridge or a building shakes, its natural vibration modes are eigenvectors of the stiffness matrix. The eigenvalues give the squares of the natural frequencies. Engineers check that these frequencies do not match driving forces — avoiding resonance disasters.
Quantum Mechanics. Observable quantities — position, momentum, energy — are represented by matrices. The possible measurement outcomes are the eigenvalues. The state of the system after measurement collapses to the corresponding eigenvector.
Markov Chains. The long-run steady-state distribution of a Markov chain is the eigenvector of the transition matrix with eigenvalue .
6.4 Applications in Machine Learning — Dimensionality Reduction
6.4.1 Hook: The Curse of 100 Columns
You sit at your desk at a music streaming company. The dataset has 100 columns per user — age, location, device type, time spent listening, time spent skipping, favorite genre, daily active minutes. The label is binary: "subscribed" (yes) or "not subscribed" (no).
Your first impulse is to throw all 100 columns into a model and let it figure things out. But 100 columns hides a problem. Some columns are redundant. Time spent listening and time spent active? Nearly identical. Some columns are noise. Device firmware version number? Purely random. Some columns have mathematical relationships you cannot see by scanning the raw data.
If you fit a model on 100 columns, your model must learn coefficients for all 100 — even the useless ones. This wastes compute, inflates variance in predictions, and makes the model hard to inspect.
If you could squeeze those 100 columns into just 3 numbers, the model would train faster. Those 3 numbers would capture all the meaningful variation. The model would also generalize better. You could plot the data on a single graph.
Eigenvectors deliver exactly that: they compress high-dimensional data into a tiny handful of truly informative coordinates.
6.4.2 Intuition + Analogy: Finding the Grain of the Wood
But those axes do not align with the plank. A better approach: find the direction the plank naturally points in. Describe every point on the plank by how far along that grain direction it lies. One coordinate — not three — captures the plank's extent. The cross-section, perpendicular to the grain, is tiny and boring.
High-dimensional data behaves the same way. Points do not fill the space evenly. They cluster along a few dominant directions — the "grain" of the data. Eigenvectors locate that grain. The data spreads most along the first eigenvector, less along the second, and negligibly along the rest.
Analogy Key: Standard axes (age, experience, location) are the room's , , . The plank is your data cloud. Eigenvectors are the plank's natural axes. Eigenvalues measure how far the plank extends along each natural axis. The analogy breaks when data curves (non-linear structure) — PCA only finds straight axes, not curved ones.
6.4.3 Why Eigenvectors Matter in ML
Eigenvalues and eigenvectors are the most important concept in linear algebra for machine learning. Along with singular value decomposition — covered in the next lecture — they form the foundation of dimensionality reduction.
The central idea: high-dimensional data often has only a few directions of meaningful variation. You might have 100 features, but the target variable likely depends on only a handful of them. Eigenvectors help you find those important directions.
6.4.4 The Variance Intuition
Suppose you work at a music streaming company and want to predict whether a user will buy a subscription. You have hundreds of features: age, gender, location, listening habits, device type, and so on. The historical data tags some users as subscribers (yes) and others as non-subscribers (no).
Your hypothesis is that subscription depends on some of those features. But if a feature has zero variance, it cannot explain any variation in the output. Say every user on the platform is exactly 30 years old. That feature contributes nothing. Only features that vary can explain variation in the output.
So you want to find which directions in your data have the most variance. You want the axes along which the data spreads out the most. Those axes are combinations of your original features — not just "age" or "experience" alone, but linear combinations like .
6.4.5 Worked Intuition: Age vs Experience
The direction of elongation is not purely age. It is not purely experience. It is a new diagonal axis — a linear combination of both. If you project all data points onto that diagonal axis, you capture most of the spread. The perpendicular direction captures very little spread.
Now instead of storing two numbers per person (age, experience), you store one number: their coordinate on that principal axis. You went from 2D to 1D with minimal information loss.
Worked calculation. Suppose after mean-centering, your two features have covariance matrix:
Let the eigenvalues be and , with eigenvectors and .
The first eigenvector points at 45° — an equal mix of age and experience. This axis captures of the total variance. The second eigenvector, orthogonal, captures the remaining 20%.
Projecting a user with onto the first principal component:
Each user is now represented by a single scalar . You compressed 2D to 1D while retaining 80% of the information.
6.4.6 Eigenvectors as Principal Axes of Variance
Symbol Registry
| Symbol | Meaning | Type | Shape |
|---|---|---|---|
| Data matrix (observations × features), mean-centered | Matrix | ||
| Covariance matrix | Matrix | ||
| i-th eigenvalue: variance captured along that direction | Scalar | Scalar | |
| i-th eigenvector: principal direction, | Vector | ||
| Projected coordinate on a principal axis | Scalar | Scalar | |
| Data in the reduced -dimensional subspace | Matrix |
The covariance matrix is symmetric, so the Spectral Theorem guarantees real eigenvalues and an orthonormal eigenbasis. The eigendecomposition:
This factors the transformation into three operations: rotate into the eigenbasis (), scale each axis independently by (), rotate back ().
6.4.7 Formalize: PCA Step by Step
Given observations and features, stored as matrix :
- Mean-center the data. Subtract the column mean from every entry. The centered matrix is .
- Compute the covariance matrix. . This matrix encodes pairwise feature relations.
- Eigendecompose. Solve . Sort eigenpairs by descending.
- Select top . Choose the first eigenvectors forming .
- Project. Compute the reduced representation: .
The reconstruction error equals the sum of dropped eigenvalues:
The fraction of variance retained is:
A common heuristic: pick the smallest such that , retaining 95% of variance. Plotting against produces the scree plot. The "elbow" — where eigenvalues flatten — suggests a natural cutoff.
6.4.8 Dimensionality Reduction by Truncation
Suppose you compute all 100 eigenvalues from your 100-feature dataset. The first eigenvalue might be 20, the second 10, the third 2, and the remaining 97 might all be tiny — below 0.01.
The first eigenvector alone captures a huge amount of the total variance. The first two together capture even more. The first three might capture 99% of the total variance. You can discard the other 97 dimensions and lose only 1% of the information. Your data compresses from 100 columns to 3 columns.
This is dimensionality reduction. You find the eigenvectors of your data matrix. The eigenvalues tell you how much variance each direction captures. You keep only the top few directions and project your data onto them. You store fewer numbers. You build simpler models. And you lose almost nothing.
| Assumption | Why It Matters |
|---|---|
| Linearity. Data lives on or near a linear subspace. | PCA projects onto flat hyperplanes. A spiral or swiss roll cannot be flattened usefully. Consider kernel PCA or autoencoders for non-linear data. |
| Mean-centered data. | Without centering, the first component points at the data centroid, not the direction of maximum variance. Always center. |
| Feature scaling. | Features on different scales (age vs. salary) distort the covariance matrix. Standardize to zero mean and unit variance before PCA. |
| Large variances imply signal. | PCA assumes high-variance = signal. This fails if noise has high variance (sensor drift, artifacts). Inspect loadings. |
Visual Intuition: Picture a 3D ellipsoid floating in space. The ellipsoid's longest axis is the first principal component, with length . The second axis, perpendicular to the first, has length . The shortest axis completes the ellipsoid. PCA finds this ellipsoid, reorients coordinates to align with it, then chops off the shortest axes. For the age–experience scatterplot: an elongated ellipse tilted at 45° — the major axis is the first principal component, the minor axis the second.
- Forgetting to standardize. A feature in [0,1000] dominates one in [0,1] purely by numeric scale, not relevance. Standardize all features to unit variance.
- Misinterpreting loadings. A near-zero loading does not mean the feature is unimportant — it may contribute via a correlated proxy loaded on another component.
- Dropping low-variance = dropping signal. In anomaly detection, anomalies live in the low-variance subspace. Always ask: is my signal in the head or tail of the eigenvalue spectrum?
- Over-relying on the elbow rule. The scree plot may not show a clear elbow. Use the 95%-variance rule or cross-validation when eigenvalues decay smoothly.
Student Questions and Answers
A: Generally no for dimensionality reduction. If a direction captures only 2% of the variance, discarding it loses very little information. But one exception: anomaly detection. Anomalies often break the dominant correlation pattern, so their signal lives in the low-variance subspace. If you discard those components, you discard the anomaly signal. The rule: if you seek the dominant pattern, keep top eigenvalues. If you seek the exception, inspect the tail.
A: Eigenvalues of a covariance matrix are always non-negative because covariance matrices are positive semi-definite. The Gram matrix gives for all , so all eigenvalues satisfy . A negative eigenvalue would mean "negative variance" — impossible since variance is a sum of squares. In other contexts — non-symmetric matrices, Hessians at saddle points — negative eigenvalues signal a reflection or a saddle point. For PCA, all eigenvalues are zero or positive.
A: You are projecting the data onto new axes — the eigenvector directions. It is not about shrinking data values. It is about choosing which axes to keep and which to discard. Your original point becomes after projecting onto the top two eigenvectors and dropping the third. The numbers changed — they are coordinates in a new basis — but they are not "scaled down" uniformly. The third coordinate vanished because its eigenvector captured negligible variance. Think of it as taking a 3D object and capturing its most informative 2D shadow.
A: Eigen decomposition appears everywhere. In spectral clustering, eigenvectors of the graph Laplacian embed data points so clusters separate nicely. In NLP, latent semantic analysis (LSA) uses SVD — the generalized eigen decomposition — on term-document matrices to capture latent topic structure. In optimization, the condition number of the Hessian — the ratio of largest to smallest eigenvalue — determines how quickly gradient descent converges. In computer vision, eigenfaces compress images by keeping only the top pixel combinations. In PageRank, the dominant eigenvector of the web's link matrix ranks every webpage. The next lecture covers SVD, which generalizes eigen decomposition to rectangular matrices.
Keeping only the top eigenvectors compresses -dimensional data into dimensions with minimal information loss. PCA is a linear method — it works on flat subspaces. This limitation motivates the next lecture. Singular value decomposition handles rectangular matrices, low-rank approximations, and generalizes eigen decomposition to non-square matrices.
Real-World & Domain Connection: In image compression, eigenfaces represent faces with ~50 numbers instead of tens of thousands of pixels — the top eigenvectors correspond to lighting direction, head orientation, and expression. In genomics, PCA on 20,000+ genes measured on a few hundred patients reduces dimensions before clustering disease subtypes — the top components often match known biological pathways. In finance, PCA on asset return covariance matrices separates systematic risk (market factor, first component) from diversifiable risk (tail components). In signal processing, reconstructing from top components yields a denoised signal — used in EEG artifact removal and audio separation.
6.5 Computing Eigenvalues and Eigenvectors
6.5.1 The Characteristic Equation
| Symbol | Meaning | Type | Shape |
|---|---|---|---|
| Characteristic matrix | Matrix | ||
| Characteristic polynomial in | Scalar | Scalar | |
| Identity matrix | Matrix | ||
| Zero vector | Vector |
6.5.2 Why the Identity Matrix?
A scalar cannot be directly subtracted from a matrix. Think of it in simple terms. You have a matrix . You want to subtract . You need to subtract from each diagonal entry — not from every entry. The identity matrix places only on the diagonal and leaves the off-diagonal entries untouched.
If you used a matrix of all ones instead, you would subtract from every entry, which would destroy the transformation's structure. The identity matrix preserves the matrix while only adjusting the diagonal. It is the same idea as multiplying a scalar by 1 in ordinary algebra. The identity matrix is the "1" of matrix multiplication. It does not change anything it multiplies.
6.5.4 Full Worked Example
6.5.5 Why Set the Determinant to Zero?
The reasoning is geometric. From , there are two possibilities: either (trivial, not useful) or is singular. A singular matrix collapses space onto a lower dimension.
When you are on the eigenvector axis, the concept of area vanishes — there is only a line. A line has no area. So the determinant must be zero. Setting says: find the values that collapse the space onto a line. That line is the eigenvector direction.
The characteristic polynomial is always degree for an matrix. For you get a quadratic — find its roots. For you get a cubic — factor or use the rational root theorem. Some roots may be repeated (repeated eigenvalues) or complex. Complex eigenvalues come in conjugate pairs and correspond to rotations in the transformation.
- Forgetting the identity matrix. Writing instead of . A scalar cannot be subtracted from a matrix — the dimensions do not match.
- Sign errors in determinant expansion. Especially with the minus signs from . Write out each term of the product explicitly before combining.
- Forgetting that eigenvectors are not unique. Any non-zero scalar multiple of an eigenvector is also an eigenvector. Graders will accept any correct scalar multiple unless a specific form is requested.
- Dividing both sides wrongly when solving for eigenvectors. The system is dependent by design. Do not try to invert the matrix — it is singular. Express one variable in terms of the other, pick a convenient value, and read off the eigenvector.
6.5.7 The Complete Procedure (Summary)
| Step | Action | What you get |
|---|---|---|
| 1 | Form | The characteristic matrix |
| 2 | Compute and set to zero | The characteristic polynomial |
| 3 | Solve the polynomial for | The eigenvalues |
| 4 | For each , substitute into | A dependent linear system |
| 5 | Solve the linear system to express | The eigenvector direction |
Verification step. Always multiply by your eigenvector. The result must equal times the eigenvector. This quick check catches sign mistakes and mis-factored quadratics.
Real-World & Domain Connection: The characteristic equation method is not just a classroom exercise. In structural engineering, eigenvalue problems determine the natural frequencies of buildings and bridges — the values tell engineers which frequencies to avoid to prevent resonance. In Google's PageRank algorithm, the dominant eigenvector of the web's link matrix (found by solving a giant characteristic equation numerically) ranks every webpage. In quantum mechanics, the Schrödinger equation is an eigenvalue problem where gives the possible energy levels of a system. In machine learning, PCA solves the eigenvalue problem of the covariance matrix to find the principal components — the directions that capture the most variance in your data.
6.6 Computing Determinants via Minors and Cofactors
6.6.1 Why Minors and Cofactors
For matrices larger than , the determinant is computed recursively using minors and cofactors. The formula only works for . For and larger, you break the matrix down into smaller pieces.
6.6.2 Minor of an Element
6.6.3 Cofactor
| Symbol | Meaning | Type | Shape |
|---|---|---|---|
| Minor: determinant after deleting row i, column j | Scalar | Scalar | |
| Cofactor: signed minor, | Scalar | Scalar | |
| Entry of A at row i, column j | Scalar | Scalar |
6.6.4 Determinant by Cofactor Expansion
6.6.5 Worked Example — 3×3 Determinant
- Sign errors on . The checkerboard sign is the single most frequent mistake. Many students compute the minor perfectly and then forget the sign. Pause after each cofactor and verify: is even or odd?
- Wrong submatrix. Deleting an incorrect row or column produces a different determinant. Double-check your deletion — the submatrix must exclude all entries that share a row or column with the current entry.
- Mixing rows mid-expansion. Once you pick a row, use only that row. The formula sums for a fixed . Do not pull entries from different rows.
- Forgetting the product rule: and . Swapping two rows flips the sign. Scaling a row by scales by .
Visual Intuition: Picture a matrix as a cube of numbers. The cofactor expansion along row 1 is like slicing the cube into three faces, computing each face's area, and summing them with alternating signs. The checkerboard pattern tells you which faces flip orientation. The final sum — one number — is the signed volume of the parallelepiped spanned by the three column vectors of the matrix.
Real-World & Domain Connection: Cofactor expansion is the algorithmic backbone of determinant computation in every linear algebra library. In computer graphics, the determinant appears in the cross product formula. That formula computes surface normals for lighting and collision detection.
In statistics, the determinant of a covariance matrix appears in the multivariate Gaussian density function. It is computed via cofactor expansion or LU decomposition. A near-zero determinant warns of multicollinearity — features that are nearly linearly dependent. In robotics, the Jacobian determinant determines whether a robot arm can move freely. It also shows when the arm has hit a singularity where one direction of motion is lost.
6.7 Exam Guidance Summary
- The characteristic equation method — — is the standard approach for computing eigenvalues and eigenvectors of and matrices. Know it cold. You solve a quadratic () or cubic () for eigenvalues, then solve linear systems for eigenvectors.
- Determinant computation via minors and cofactors is tested on matrices. Know the checkerboard sign pattern. For larger matrices, computational tools are used in practice — understand the recursive process conceptually.
- Eigenvalues and eigenvectors are the most important concept in linear algebra for machine learning. They are foundational for PCA and dimensionality reduction. The next lecture on singular value decomposition generalizes this idea to non-square matrices — expect exam crossover between these two topics.
6.7.1 Common Exam Mistakes to Avoid
- Forgetting to multiply by the identity matrix. Writing directly is dimensionally wrong — you are trying to subtract a scalar from a matrix. Always write .
- Sign errors in the cofactor . Use the checkerboard pattern: positive at , negative at , positive at , alternating. A wrong sign cascades — the whole determinant is wrong.
- Forgetting to verify your answer. Always plug your eigenvalues and eigenvectors back into . If it does not check, you made an arithmetic error somewhere. This quick check catches sign mistakes and mis-factored quadratics.
- Not recognizing triangular matrices. If the matrix is upper or lower triangular, the eigenvalues are simply the diagonal entries. Do not waste time computing the characteristic polynomial when you can read eigenvalues directly off the diagonal.
6.7.2 Key Facts for Exams
- matrix is singular columns are linearly dependent matrix is not invertible space collapses to lower dimension
- , ,
- For a rotation matrix, the determinant is always 1 — rotation preserves area
- Eigenvalues of a covariance matrix are always non-negative (positive semi-definite)
- The determinant equals the product of all eigenvalues:
- An matrix has up to eigenvectors; eigenvectors are entire directions (axes), not single vectors
- A negative eigenvalue means the vector flips direction along the same axis
- 2D rotation matrices have no real eigenvectors; their eigenvalues are complex conjugates
6.8 Key Industry Applications
6.8.1 Dimensionality Reduction (PCA)
Eigen decomposition of the data covariance matrix finds the directions of maximum variance. The eigenvectors (principal components) are new orthogonal axes ordered by importance. The eigenvalues tell you how much variance each axis captures. You project high-dimensional data onto the top few principal components and discard the rest. This compresses data with minimal information loss — going from hundreds of features to a handful while retaining 95%+ of the variance. PCA is used everywhere in ML pipelines: as a preprocessing step before clustering or classification, as a visualization tool (projecting to 2D/3D for plotting), and as a noise filter (discarding low-variance components).
6.8.2 Subscription Prediction
Streaming platforms like Spotify use user features to predict subscription likelihood. These features include age, gender, location, listening habits, device type, and session length. With hundreds of features, many are correlated. For example, time spent listening correlates with time spent active.
PCA reduces hundreds of features to a handful of principal components before modeling. This makes the prediction model faster to train. It is also less prone to overfitting and easier to interpret. You can inspect which original features dominate each principal component.
6.8.3 Image Compression
Eigenvectors help identify the most important pixel combinations in an image. The eigenfaces technique represents faces with ~50 numbers instead of tens of thousands of pixels — keeping only the top eigenvector projections. The dropped components correspond to fine texture detail that carries little visual information. The same principle applies to general image compression: SVD (generalized eigen decomposition) decomposes an image matrix into rank-1 layers, and keeping only the top few layers gives an excellent low-rank approximation.
6.8.4 Feature Engineering
Correlated features (like age and experience) get replaced by uncorrelated axes from eigenvectors — the principal components. These new axes capture the same information more compactly. The new features are linear combinations of the originals. The eigenvalues tell you how important each new feature is.
This decorrelation helps linear models, which assume independent features. It also speeds up gradient-based optimization, which slows down when features are correlated.
6.8.5 More Applications
- Finance: PCA on asset return matrices separates systematic market risk (first component) from diversifiable risk.
- Genomics: PCA on gene expression data (20,000+ genes) finds biological pathway signals before disease clustering.
- PageRank: Google's original ranking algorithm computes the dominant eigenvector of the web's link matrix.
- Vibration analysis: Natural frequencies of structures are eigenvalues of the stiffness matrix — engineers avoid resonance frequencies to prevent collapse.
- Recommender systems: SVD (next lecture) factors user-item rating matrices into low-rank embeddings for collaborative filtering.
MFML Lecture 06 notes · Eigenvalues, Eigenvectors, and Determinants
Sections Breakdown
A bound on the inner product of two vectors, with geometric origin via the dot product and cosine.
The determinant as the area/volume scaling factor of a linear transformation, including zero-determinant collapse.
Special directions along which a matrix acts like pure scaling, with physical metaphors and real-world connections.
How eigenvectors of the covariance matrix power PCA and compress high-dimensional data.
The characteristic equation det(A - lambda I) = 0 and the full worked procedure.
Recursive cofactor expansion for 3x3 and larger determinants, with a worked example.
Common exam mistakes and key facts for eigenvalues, eigenvectors, and determinants.
PCA, subscription prediction, image compression, feature engineering, and additional applications.
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.
Cauchy-Schwarz Inequality
Must-know: The absolute inner product of two vectors can never exceed the product of their lengths. It bounds the normalized inner product between and — exactly the cosine of the angle between them. It is a proof tool, rarely computed directly in ML.
⚠️ Top pitfall: Forgetting the absolute value, or confusing the general inner product with the dot product . Cauchy-Schwarz holds for any valid inner product, not just the dot product.
Self-check: If two vectors have lengths 3 and 4, what is the largest possible value of their inner product?
Connects to: Determinant (both are bounds on geometric quantities), Eigenvalues (inner products appear in covariance matrices for PCA).
Determinant — Geometric Scaling Factor
Must-know: The determinant is the single scalar that measures how much a linear transformation scales area (2D), volume (3D), or hyper-volume (D). A zero determinant means the space collapses — the matrix is singular and non-invertible.
⚠️ Top pitfall: Thinking means every output is the zero vector. It does not — the matrix maps the space onto a lower-dimensional subspace. Also, columns linearly dependent not invertible has a non-trivial solution.
Self-check: A pure rotation matrix has determinant . Why does its determinant not change even though the shape is "turned"?
Connects to: Eigenvalues (the determinant equals the product of all eigenvalues), Minors and Cofactors (how to compute it for larger matrices).
Eigenvalues and Eigenvectors
Must-know: An eigenvector is a direction that survives a transformation unchanged except for scaling. The eigenvalue is that scale factor. The defining equation is , with . Eigenvectors are entire axes, not single arrows.
⚠️ Top pitfall: Assuming a vector must stretch to be an eigenvector. Shrinking (), staying the same (), or flipping () all count. Only a change in direction disqualifies a vector. A 2D rotation has no real eigenvectors.
Self-check: If , must all eigenvalues be zero? Explain why at least one is.
Connects to: Characteristic Equation (how to find them), PCA (eigenvectors of the covariance matrix), Determinant (product of eigenvalues).
Principal Component Analysis (PCA)
Must-know: PCA finds the directions of maximum variance in data by eigendecomposing the covariance matrix. The eigenvectors are new axes ordered by importance; the eigenvalues say how much variance each captures. Keep the top to compress dimensions into .
⚠️ Top pitfall: Forgetting to standardize features before PCA. A feature on a large numeric scale dominates one on a small scale purely by magnitude, distorting the covariance matrix. Also, eigenvalues of a covariance matrix are always non-negative.
Self-check: You keep the top 3 of 100 principal components and retain 99% of variance. Roughly what fraction of information did you discard?
Connects to: Eigenvalues and Eigenvectors (the engine of PCA), Singular Value Decomposition (next lecture generalizes this to rectangular matrices).
Characteristic Equation
Must-know: To find eigenvalues, solve . This decouples the problem: first solve the characteristic polynomial for , then plug each into to get the eigenvector direction.
⚠️ Top pitfall: Writing instead of . You cannot subtract a scalar from a matrix — the identity matrix places only on the diagonal. Also, for triangular matrices, read eigenvalues straight off the diagonal and skip the polynomial.
Self-check: After finding an eigenvalue and eigenvector , how do you verify your answer in one line?
Connects to: Eigenvalues and Eigenvectors (the geometric meaning), Determinant (the determinant is set to zero), Minors and Cofactors (used inside the characteristic polynomial for 33).
Minors and Cofactors
Must-know: For matrices larger than , compute the determinant recursively. The minor is the determinant after deleting row , column . The cofactor adds the checkerboard sign . Expand along any row or column.
⚠️ Top pitfall: Sign errors on the checkerboard . The most common mistake is computing the minor perfectly then forgetting the sign. Always choose a row or column with the most zeros to minimize work.
Self-check: In a matrix, what is the sign of the cofactor ?
Connects to: Determinant (this is how you compute it), Characteristic Equation (cofactor expansion builds the characteristic polynomial).
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.