සංගතිකSangathika

SAM · සංගතික · Linear algebra · page 17

Eigenvectors and eigenvalues

An eigenvector is a direction that a matrix only stretches.

A matrix moves every arrow in the plane. Almost every arrow gets knocked off its own line. A few special directions stay on their line and are only stretched, shrunk or flipped. Those directions are the eigenvectors, and the number each one is stretched by is its eigenvalue.

Before you start: page 1, vectors, especially scaling an arrow. This page also uses three ideas that pages 6, 9 and 13 will teach in full: a matrix as a machine, the determinant, and the null space. Until those lessons are written, the refresher below covers what you need.

Plate 17.1 · The blend

Twenty-four arrows on the unit circle, moved by A = 2112, the matrix this leaf calls S. The green arrows never leave their line. Every other arrow turns.
  1. 01
  2. 02
  3. 03
  4. 04
  5. 05
  6. 06
  7. 07
  8. 08
  9. 09
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20

Warm-up · from page 1, vectors

Two questions before you start

WARM-UP 1 OF 2

The arrow (1, 1) is multiplied by −2. Where does the result point?

WARM-UP 2 OF 2

Which of these can knock an arrow off its own line?

Refresher: how a matrix moves a vector

Multiplying A by v = (x, y) takes x copies of the first column of A and adds y copies of the second column.

211210=21 the first column
211211=33 both columns added

Look at the second line. The input (1, 1) and the output (3, 3) point the same way. The output is the input, three times longer. Hold on to that; it is the whole idea of this page.

Layer 1 · Principle

The question a matrix answers

Treat a matrix A as a machine. Feed it an arrow v and it hands back a new arrow Av. For a typical input the output points somewhere new: it has been turned as well as resized.

So ask one question. Are there directions that the machine does not turn? For those directions the output lands on the same line as the input. The machine can stretch it, shrink it, or flip it through the origin, but it stays on that line.

Those directions are the eigenvectors. Eigen is German for "own": an eigenvector is a direction the matrix keeps as its own. Older books call them characteristic vectors. Find them yourself before reading any algebra.

Plate 17.2 · Hunt the directions

Drag anywhere on the grid, or use the slider, to point v in a new direction. The grey-blue arrow is Av, with A = 2112, the matrix this leaf calls S. Your job: find every direction where the grey-blue arrow lands on the dashed line through v. There are two.

  • input v
  • output Av
  • line through v
  • eigen-direction
v
Av
Off the line by
Directions found
0 of 2

The same search, done for every direction at once. The curve shows how many degrees Av sits off the line of v as v sweeps from 0° to 180°. It only needs half a turn, because the directions at θ and θ + 180° lie on the same line. Wherever the curve crosses zero, you have an eigen-direction.

Layer 2 · Statement

Writing it down

"The output lands on the same line as the input" means the output is the input times some number. Call that number λ (lambda). Then the whole idea is one equation:

Av=λv

Read it left to right: applying the matrix to v gives the same result as multiplying v by a plain number. A nonzero v that satisfies it is an eigenvector, and its λ is the matching eigenvalue. In Plate 17.2 you found λ = 3 along (1, 1) and λ = 1 along (1, −1).

The eigenvalue tells you what happens along that direction:

EigenvalueWhat happens to the arrow
λ > 1stretched, same way round
λ = 1left exactly as it was
0 < λ < 1shrunk, same way round
λ = 0crushed to the origin
λ < 0flipped through the origin, then scaled by |λ|; still on the same line

An eigenvector is really a direction. If v works, so does 5v or −0.2v, with the same λ, because A(5v) = 5Av = 5λv = λ(5v). That is why we draw eigenvectors as whole lines.

The zero vector does not count. A0 = λ0 holds for every matrix and every λ, so it tells you nothing. The definition asks for v ≠ 0.

Layer 3 · Application

What survives repetition

Eigenvectors matter most when a matrix is applied over and over. A good model of that is a population moving between two places, year after year.

Two towns hold 30 000 people between them, and the total never changes. Each year 10% of Town A's people move to Town B, and 20% of Town B's people move to Town A. If x and y are this year's shares, next year's shares are

x′y′=0.90.20.10.8xy

Each column says where one town's people go: the first column is Town A (90% stay, 10% leave), the second is Town B (20% leave, 80% stay). Now check two directions by plain multiplication, using only Layer 2:

M(2, 1) = (1.8 + 0.2, 0.2 + 0.8) = (2, 1). An eigenvector with λ = 1: a two-to-one split reproduces itself exactly.

M(1, −1) = (0.9 − 0.2, 0.1 − 0.8) = (0.7, −0.7) = 0.7(1, −1). An eigenvector with λ = 0.7: moving people from one town to the other is a "gap" that keeps 70% of its size each year.

Plate 17.3 · Run the years

  • starting split
  • split after each year
  • λ = 1 direction (2, 1)

YearTown AGap from 66.7%Gap ÷ last year's

Whatever start you choose, Town A's share heads for 66.7%, and the last column settles on 0.700. That number is the second eigenvalue, showing up in the data.

Why every start ends at two-thirds

Write the starting split as a mix of the two eigenvectors. For a start of (s, 1 − s) the mix is always

(s, 1 − s)=⅓ (2, 1)+c (1, −1),  with c = s − ⅔

Each year multiplies each part by its own eigenvalue, so after k years the split is ⅓(2, 1) + c · 0.7k (1, −1). The first part is multiplied by 1 forever and never changes. The second part shrinks by 30% every year and fades away. For your current start, .

This is the general lesson. Apply a matrix many times and the direction with the largest |λ| takes over, because its eigenvalue raised to a high power swamps all the others. Google's original PageRank used exactly this to rank web pages as a long-run share of visits, and numerical software uses it to find the largest eigenvalue of matrices far too big to solve by hand: start anywhere and keep multiplying.

Layer 4 · Specifics

Finding them by hand

Hunting with a slider works for one matrix. To find eigenvectors for any 2 × 2 matrix A = abcd, turn the equation into something you can solve.

  1. Gather everything on one side. Av = λv is the same as Av − λv = 0. To factor out v both terms need a matrix in front, so write λv as λIv, where I is the identity matrix:

    (A − λI)v = 0
  2. Ask when a nonzero v can solve it. A − λI is just another matrix. If it sends a nonzero v to 0, it crushes that whole line to a point, which flattens the plane onto a line. A flattened plane has zero area, and the determinant is exactly the factor by which a matrix scales area. So the condition is

    det(A − λI) = 0
  3. Expand the determinant. Subtracting λ from the diagonal and using det = (top-left)(bottom-right) − (top-right)(bottom-left):

    (a − λ)(d − λ) − bc = λ² − (a + d)λ + (ad − bc) = 0

    This is the characteristic equation. Its middle coefficient is the trace a + d and its last term is det A, so it reads λ² − (trace)λ + det = 0. Solve it like any quadratic. A useful check: the two eigenvalues add up to the trace and multiply to the determinant.

  4. Go back for each direction. For each λ, solve (A − λI)v = 0. The two rows of that system say the same thing, so one row is enough to fix the direction.

Worked example · the matrix from Plate 17.2

A = 2112: trace 4, determinant 2·2 − 1·1 = 3.

Characteristic equation: λ² − 4λ + 3 = 0, which factors as (λ − 3)(λ − 1) = 0. So λ = 3 or λ = 1. Check: 3 + 1 = 4 is the trace and 3 × 1 = 3 is the determinant.

For λ = 3: A − 3I = −111−1. The first row says −x + y = 0, so y = x and v = (1, 1). Check: A(1, 1) = (3, 3) = 3(1, 1).

For λ = 1: A − I = 1111. The first row says x + y = 0, so v = (1, −1). Check: A(1, −1) = (1, −1).

The discriminant (trace)² − 4·det decides how many directions to expect. Positive: two real eigenvalues and two directions. Zero: one repeated eigenvalue, which can give one direction or every direction. Negative: no real eigenvalues, so no direction survives. The lab below has an example of each.

The four steps, as code. This leaf's library, sam.js, gains one function on this page, eigen, built on det and apply:

const S = [2, 1, 1, 2];        // rows (2, 1) and (1, 2)
eigen(S).pairs                 // λ = 3 along (0.71, 0.71), λ = 1 along (0.71, −0.71)
apply(S, vec(1, 1))            // [3, 3]: the same line, three times longer
eigen([1, 1, 0, 1]).kind       // 'one': the shear H keeps a single direction

Layer 5 · Exploration

Every kind of 2 × 2 matrix

Pick a preset or type your own entries. S, H and P are the matrices this leaf returns to again and again. The tinted grid is the plane after the matrix has moved it, and the shaded shape is where the unit square lands. Green lines are eigen-directions; the solid green arrow is where the unit eigenvector ends up. Drag the blend slider and watch the plane bend around the green lines while they stay put.

Plate 17.4 · Matrix lab

A=
Trace
Determinant
Equation
Discriminant
Eigenvalues
Directions

Layer 6 · Check

Check your understanding

QUESTION 1 OF 6

R turns every vector 90° anticlockwise. How many real eigen-directions does R have?

QUESTION 2 OF 6

You find that Av = −2v. Is v an eigenvector?

QUESTION 3 OF 6

(1, 1) is an eigenvector of A with λ = 3. What about (5, 5)?

QUESTION 4 OF 6

The shear H, with rows (1, 1) and (0, 1), slides each point sideways by its height. How many separate eigen-directions does it have?

QUESTION 5 OF 6

A has eigenvalues 0.5 and 2. You apply A twenty times to a typical vector. Which way does the result point?

QUESTION 6 OF 6

det(A) = 0. What does that guarantee about the eigenvalues of A?

Challenges · Seed, Branch and Canopy

Three challenges

Each challenge declares its level. Commit an answer before the solution opens. Hints open one at a time.

Seed

Shift the matrix

Needs: this page (the equation Av = λv).

S has eigenvalues 3 and 1, along (1, 1) and (1, −1). Without solving any new equation, what are the two eigenvalues of S + 2I, where I is the identity matrix?

Hint 1

Use the definition, not the characteristic equation: what does S + 2I do to the arrow (1, 1)?

Hint 2

(S + 2I)v = Sv + 2v. If Sv = λv, what is Sv + 2v?

Hint 3

Each eigenvalue moves by the same amount, and the directions do not change at all.

Hints used: 0 of 3

Branch

Apply it twice

Needs: this page, and scaling from page 1.

Without multiplying any matrices, find both eigenvalues of S², which means applying S twice. Then say what S¹⁰ does to the arrow (1, −1).

Hint 1

Apply S to (1, 1), then apply S again to the result.

Hint 2

S(Sv) = S(λv) = λ(Sv). Keep going one more step.

Hint 3

Along (1, −1), λ = 1. What is 1 raised to any power?

Hints used: 0 of 3

Canopy

Any two towns

Needs: this page, Plate 17.3; it meets the Probability leaf, where the two towns return as a Markov chain.

Change the rules of Plate 17.3. Each year a share p of Town A's people move to Town B, and a share q of Town B's people move to Town A, with p and q between 0 and 1. In terms of p and q, find the long-run share of people in Town A, and the number the gap shrinks by each year. Check your answer against p = 0.1 and q = 0.2.

Hint 1

Write the matrix first. The first column is where Town A's people go: (1 − p, p). The second is where Town B's people go: (q, 1 − q).

Hint 2

A long-run split does not change from year to year, so it is an eigenvector with λ = 1. Solve (1 − p)x + qy = x.

Hint 3

The two eigenvalues add up to the trace, 2 − p − q. One of them is 1.

Hints used: 0 of 3

Recap

The page in four sentences

A matrix turns most directions, and the directions it does not turn are its eigenvectors, each with an eigenvalue λ that says how much it is stretched, shrunk or flipped. The equation Av = λv says exactly this, for nonzero v. You find the eigenvalues from det(A − λI) = 0 and then the directions from (A − λI)v = 0. When a matrix is applied again and again, the direction with the largest |λ| wins.

Next · page 18, change of basis and diagonalisation

Plate 17.3 left a number unexplained: the gap between the towns shrinks by exactly 0.7 every year. The next lesson reads a matrix in the language of its own eigenvectors, where that number explains itself.

Why does the gap shrink by exactly 0.7 every year, and what does that make easy about applying the matrix many times?

Page 18 is still being written.

For the teacher: how this page is sequenced

The page finds eigenvectors by eye before it names them, and keeps the same matrix, S, from the opening figure to the worked example, so that each layer re-reads one familiar object.

  1. Need before name. Plate 17.1 shows almost every arrow turning and two lines that do not. The question "which directions survive?" exists before the word eigenvector does.
  2. Act before read. Plate 17.2 asks the learner to hunt the two directions by dragging, with a curve that turns the hunt into a picture of every direction at once.
  3. Misconceptions cleared. An eigenvector is a direction, not one arrow; the zero vector does not count; a negative λ flips but stays on the line; a repeated eigenvalue does not promise two directions (the shear H, quiz question 4).
  4. Application before procedure. Plate 17.3 shows an eigenvalue in data, the 0.700 ratio, before Layer 4 shows how to compute one. Page 18 explains the ratio.
  5. Exploration last. Plate 17.4 covers every case of a 2 × 2 matrix, including the house matrices S, H and P.
  6. Interim links. Until pages 9, 13 and 16 are written, the warm-up draws on page 1 and Layer 4 gives its own short argument for the determinant. When those pages exist, the warm-up moves to pages 13 and 16, and Layer 4 points back to the determinant and the null space.
  7. Challenges. Seed 17.1 is hard because it must be done from Av = λv alone, without the characteristic equation the page has just taught. Branch 17.2 is hard because it extends the definition to repeated application: the learner must see that the directions survive and only the numbers change. Canopy 17.3 is a meeting point with the Probability leaf: the learner builds the matrix from words, recognises the steady state as the λ = 1 eigenvector, and uses the trace to find the other eigenvalue without solving.
  8. Plate 17.1, purpose. A matrix turns most directions; the green lines are the ones it only stretches. The rest of the page is the study of those lines.