Math for CS and ML · 15 min

Eigenvectors: the directions a matrix only stretches

Sweep a vector around the circle to find where A·v lines up with v, and see why rotations have none.

01Why it matters

The directions a matrix leaves alone

Apply a matrix and almost every arrow gets knocked off its line: it turns as well as stretches. But most matrices have a few special directions where the arrow stays on its own line and is only stretched, shrunk or flipped.

Those directions explain what the matrix does when you apply it over and over, which is why they show up everywhere: Google's PageRank, the long-run state of a Markov chain, the principal components of a dataset, and whether a recurrent network's signal explodes or fades.

02Key parts

The pieces you will see

eigenvector
A non-zero vector vv with Av=λvAv = \lambda v: the matrix sends it somewhere on its own line.
eigenvalue λ
The stretch factor along that line. λ>1\lambda > 1 stretches, 0<λ<10 < \lambda < 1 shrinks, λ<0\lambda < 0 flips, λ=0\lambda = 0 crushes the line to the origin.
eigen line
All multiples of an eigenvector. The matrix maps the line onto itself.

03See it work

Sweep a vector around the circle

v sweeps around the circle; A·v traces the dashed ellipse. Where A·v lands on v's own dashed line, v is an eigenvector.

For this symmetric matrix the arrow lines up twice, at 45° (where AA triples it) and at 135° (where it leaves it alone). At the end, the whole grid is transformed: the two eigen lines stay exactly where they were.

04Predict

Your turn: will it line up?

Before each step, predict whether the next direction is an eigenvector.

Make 5 predictions: step forward and answer each question before the next step plays.

0 of 5 made

05Try it

Break it on purpose

Try the examples below, then drag î and ĵ at the end of a run to see the eigen lines move.

  • Shear: only one eigen line, the x-axis. Every other arrow leans to the right.
  • Rotation: no arrow ever lines up, so there are no real eigenvectors (the eigenvalues are complex numbers).
  • Squash flat: one eigenvalue is 0. A whole line is crushed onto the origin, which is why det⁡A=0\det A = 0.

06Check yourself

Check yourself

  1. Question 1 of 5

    A = [[3, 0], [0, 1]]. Which of these is an eigenvector?

    Your answer comes back in Review in a few days, so it sticks.

  2. Question 2 of 5

    Av = −2v. What does A do to v?

  3. Question 3 of 5

    Why does a 90° rotation have no real eigenvectors?

  4. Question 4 of 5

    A matrix has eigenvalues 3 and 1/2. What is its determinant?

  5. Question 5 of 5

    Which of these 2×2 matrices has two different eigen lines?

07Explain it back

Say it in your own words

What makes a vector an eigenvector, and why do eigenvectors explain what happens when you apply a matrix over and over?

08Recap

What to remember

  • An eigenvector stays on its own line: Av=λvAv = \lambda v. The eigenvalue λ\lambda is the stretch along it.
  • Find them geometrically by sweeping a direction and watching where AvAv lines up with vv.
  • Rotations have none (real), shears have one, symmetric matrices have two at right angles.
  • Eigenvalues multiply to det⁡A\det A and add up to the trace. Next: eigenvectors of a covariance matrix are the principal components of data (PCA).
Back to path