1.1.13Linear Algebra Essentials

Eigenvalues and eigenvectors

1,598 words7 min readdifficulty · medium6 backlinks

WHAT are we even asking?

  • WHY nonzero? v=0v=0 trivially satisfies A0=λ0A\cdot 0 = \lambda \cdot 0 for any λ\lambda, so it tells us nothing. We forbid it.
  • WHY does λ\lambda matter in ML? PCA, covariance structure, PageRank, stability of gradient descent, spectral clustering — all are "find the special directions" problems.

HOW do we find them? (Derivation from scratch)

We want Av=λvAv = \lambda v with v0v \neq 0. Rearrange:

Avλv=0    AvλIv=0    (AλI)v=0Av - \lambda v = 0 \;\Rightarrow\; Av - \lambda I v = 0 \;\Rightarrow\; (A - \lambda I)\,v = 0

Now the key logical step. (AλI)v=0(A-\lambda I)v = 0 is a homogeneous system.

  • If (AλI)(A-\lambda I) were invertible, the only solution would be v=(AλI)10=0v = (A-\lambda I)^{-1}0 = 0. But we banned v=0v=0.
  • So for a nonzero vv to exist, (AλI)(A-\lambda I) must be singular (non-invertible).
  • A matrix is singular     \iff its determinant is zero.

Then for each λ\lambda, plug back into (AλI)v=0(A-\lambda I)v = 0 and solve for the null-space vectors vv.


Worked Example 1 — a clean 2×22\times 2

A=(2112)A = \begin{pmatrix} 2 & 1 \\ 1 & 2 \end{pmatrix}

Step 1: build AλIA-\lambda I. Why? We derived that eigenvalues make this matrix singular. AλI=(2λ112λ)A - \lambda I = \begin{pmatrix} 2-\lambda & 1 \\ 1 & 2-\lambda \end{pmatrix}

Step 2: determinant = 0. Why? Singular     det=0\iff \det = 0. (2λ)2(1)(1)=0(2-\lambda)^2 - (1)(1) = 0 λ24λ+3=0    (λ1)(λ3)=0\lambda^2 - 4\lambda + 3 = 0 \;\Rightarrow\; (\lambda-1)(\lambda-3)=0 So λ1=1, λ2=3\lambda_1 = 1,\ \lambda_2 = 3.

Step 3: eigenvector for λ=3\lambda=3. Why? Substitute into (AλI)v=0(A-\lambda I)v=0 to find the direction. (1111)(xy)=0x+y=0y=x\begin{pmatrix} -1 & 1 \\ 1 & -1 \end{pmatrix}\begin{pmatrix}x\\y\end{pmatrix}=0 \Rightarrow -x+y=0 \Rightarrow y=x Eigenvector v1=(11)v_1 = \begin{pmatrix}1\\1\end{pmatrix} (any scale).

Step 4: eigenvector for λ=1\lambda=1. (1111)v=0x+y=0y=x\begin{pmatrix} 1 & 1 \\ 1 & 1 \end{pmatrix}v=0 \Rightarrow x+y=0 \Rightarrow y=-x Eigenvector v2=(11)v_2 = \begin{pmatrix}1\\-1\end{pmatrix}.

Check: A(11)=(33)=3(11).A\begin{pmatrix}1\\1\end{pmatrix} = \begin{pmatrix}3\\3\end{pmatrix} = 3\begin{pmatrix}1\\1\end{pmatrix}.


Worked Example 2 — a triangular shortcut

B=(4205)B = \begin{pmatrix} 4 & 2 \\ 0 & 5 \end{pmatrix}

Step 1: det(BλI)=(4λ)(5λ)(2)(0)=(4λ)(5λ)\det(B-\lambda I) = (4-\lambda)(5-\lambda) - (2)(0) = (4-\lambda)(5-\lambda). Why zero term? The lower-left is 00, so the cross product vanishes.

Step 2: Roots are λ=4,5\lambda = 4, 5 — exactly the diagonal entries.


Two invariants that catch mistakes fast

WHY (sketch): The characteristic polynomial det(AλI)=(1)n(λλ1)(λλn)\det(A-\lambda I) = (-1)^n(\lambda-\lambda_1)\cdots(\lambda-\lambda_n). Matching the λn1\lambda^{n-1} coefficient gives the sum = trace; the constant term (λ=0\lambda=0) gives det(A)=λi\det(A)=\prod \lambda_i.

Example 1 check: trace =2+2=4=1+3=2+2=4=1+3 ✓, det=41=3=1×3\det = 4-1=3=1\times 3 ✓.


Forecast-then-Verify


Common Mistakes (Steel-manned)


Flashcards

What defining equation must an eigenvector satisfy?
Av=λvAv = \lambda v with v0v \neq 0.
Why must (AλI)(A-\lambda I) be singular?
So that (AλI)v=0(A-\lambda I)v=0 has a nonzero solution vv; an invertible matrix would force v=0v=0.
What equation gives the eigenvalues?
The characteristic equation det(AλI)=0\det(A-\lambda I)=0.
Sum of eigenvalues equals?
The trace of AA.
Product of eigenvalues equals?
The determinant of AA.
Eigenvalues of a triangular matrix are?
Its diagonal entries.
Are eigenvectors unique?
No — any nonzero scalar multiple works; they define a direction/subspace.
Eigenvalues of a 90° rotation matrix?
±i\pm i (complex — no real eigenvector).
What special property do symmetric matrices' eigenvectors have?
They are real and mutually orthogonal.
In PCA, what do the top eigenvectors of the covariance matrix represent?
Directions of maximum variance (principal components).

Recall Feynman: explain to a 12-year-old

Imagine pushing a big blob of jelly. Push it any random way and it wobbles and rotates. But there are a few special push-directions where the jelly just squishes straight in or straight out — no twisting. Those magic push-directions are eigenvectors, and "how much it squishes/stretches" is the eigenvalue. If the eigenvalue is 2, that direction doubles; if it's 0.50.5, it shrinks to half; if negative, it flips to the other side.


Connections

  • Determinants — the tool that detects singularity (det=0\det=0).
  • Matrix as Linear Transformation — eigenvectors = directions not rotated.
  • DiagonalizationA=PΛP1A = P\Lambda P^{-1} using eigenvectors as columns of PP.
  • Principal Component Analysis (PCA) — eigenvectors of the covariance matrix.
  • Symmetric Matrices and Spectral Theorem — real orthogonal eigenvectors.
  • Trace and Determinant — invariants equal to sum/product of eigenvalues.
  • Null Space — eigenvectors live in the null space of (AλI)(A-\lambda I).

Concept Map

special vectors

only scaled by

must be nonzero

rearrange with I

nonzero v needs singular

singular iff

degree-n polynomial

roots give

plug back solve null space

used in

used in

Matrix A rotates and stretches

Eigenvector v

Eigenvalue lambda

Av = lambda v

A - lambda I times v = 0

A - lambda I is singular

det A - lambda I = 0

Characteristic polynomial

PCA and covariance

PageRank and spectral clustering

Hinglish (regional understanding)

Intuition Hinglish mein samjho

Dekho, matrix AA ek transformation hai — jab tum kisi vector pe apply karte ho, wo usually usko ghumata (rotate) bhi hai aur khींchta (stretch) bhi. Lekin kuch khaas vectors aise hote hain jinko AA sirf lambaai me badalta hai, direction bilkul nahi ghumata. Yehi special directions eigenvectors hain, aur jitna scale hota hai wo number eigenvalue (λ\lambda) hai. Formula simple: Av=λvAv = \lambda v, aur vv zero nahi hona chahiye.

Nikalne ka tarika first principles se aata hai: Av=λvAv=\lambda v ko rearrange karo to (AλI)v=0(A-\lambda I)v=0. Agar (AλI)(A-\lambda I) invertible hota, to sirf v=0v=0 milta — jo hume nahi chahiye. Isliye wo matrix singular honi chahiye, matlab det(AλI)=0\det(A-\lambda I)=0. Yahi characteristic equation hai; iske roots eigenvalues dete hain. Phir har λ\lambda ko wapas daal ke null-space se eigenvector nikaalte ho.

Quick checks yaad rakho: sab eigenvalues ka sum = trace aur product = determinant. Triangular matrix me to eigenvalues seedhe diagonal pe likhe hote hain — free me mil jaate hain! Ek trap: v=0v=0 ko answer mat samajhna, aur ek scalar multiple bhi valid eigenvector hota hai, so direction important hai, exact vector nahi.

ML me yeh kyu important? PCA me covariance matrix ke top eigenvectors wo directions batate hain jahan data me sabse zyada variance hai — yani sabse zyada "information". Google ka PageRank, spectral clustering, stability of optimization — sab jagah eigen-cheezein aati hain. Toh yeh concept solid karlo, poori linear algebra ka dil hai.

Test yourself — Linear Algebra Essentials

Connections