OUTCRY
4 of 4 runs leftEnter arcade

← Guide BookPlay it

Gradient Lab · Eigenvector Spotter

Eigenvector Spotter Guide - Spot Eigenvectors Fast

Given a 2x2 matrix and four candidate directions, click the one that A merely stretches instead of rotating - the eigenvector.

Eigenvector Spotter in play on Outcry
Eigenvector Spotter, in play.

What is an eigenvector?

An eigenvector of a square matrix A is a nonzero vector v that keeps its direction under the linear map A defines: Av = λv for some scalar λ, called the eigenvalue. Most vectors get rotated as well as scaled when you multiply by A; an eigenvector is special because the map only stretches, shrinks, or flips it along the same line through the origin. The eigenvalue records how much: |λ| > 1 stretches, |λ| < 1 shrinks, and a negative λ flips the direction while keeping the line fixed.

The eigenvalues of an n x n matrix are the roots of its characteristic polynomial det(A - λI) = 0, and each eigenvalue comes with at least one eigenvector spanning its eigenspace. When A has n linearly independent eigenvectors, they form a basis in which A acts by simple coordinate-wise scaling - a change of perspective called diagonalization: A = PDP⁻¹, where the columns of P are the eigenvectors and D is diagonal with the eigenvalues on it. In that basis, applying A is nothing more than multiplying each coordinate by its own eigenvalue.

Diagonalization is what makes eigenvectors useful in practice. Once you have A = PDP⁻¹, computing powers becomes trivial - Aⁿ = PDⁿP⁻¹, and Dⁿ is just each eigenvalue raised to the n-th power - which is exactly what governs the long-run behavior of a linear dynamical system, a Markov chain, or a discretized differential equation. Eigenvalues with magnitude above 1 blow a system up over time, eigenvalues below 1 decay it toward zero, and an eigenvalue of exactly 1 marks a direction that persists unchanged, which is how Markov chains find their stationary distribution.

For symmetric matrices - the case that matters most in practice - the spectral theorem guarantees real eigenvalues and eigenvectors that are orthogonal as well as independent, so diagonalization comes for free with an orthonormal change of basis. This is the machinery behind principal component analysis: the eigenvectors of a covariance matrix are the directions of uncorrelated variation in the data, ranked by the size of their eigenvalues, and it is behind risk models that decompose a portfolio's variance into independent factors. Quant work leans on eigenvectors constantly - PCA on yield curves or covariance matrices, stability analysis of a system of linear ODEs, and the spectral radius of a matrix as a stand-in for how fast an iterative method converges or a system compounds risk.

How it works

Each round the game builds a random 2x2 matrix A = P·D·P⁻¹ from a random invertible integer matrix P and a diagonal D with two distinct nonzero integer eigenvalues. By construction the columns of P are exactly the eigenvectors of A. You are shown A (entries displayed rounded to 2 decimals, computed at full precision) and four labeled arrows on a small plot: one true eigenvector and three decoy directions, each checked at generation time to not be an eigenvector and to not be parallel to either true eigenvector.

Click the direction that stays on its own line when A is applied - the one A only stretches or flips. After you pick, the reveal shows A·v for your choice and states whether the result is a scalar multiple of the input. The correctness test in the code is the cross product: v is an eigenvector when (Av)ₓ·vᵧ - (Av)ᵧ·vₓ is zero (within 1e-6), meaning Av and v are parallel.

There is one correct option per round - the puzzle deliberately excludes the other eigenvector from the candidates. Press next for a fresh matrix; rounds continue indefinitely.

How scoring works

Score goes up by 1 for each correct first click; the round counter goes up by 1 either way. There are no points for speed, no streak bonus, and no penalty beyond the missed point. The HUD shows ROUND and SCORE for the session.

What an eigenvector is

An eigenvector of A is a nonzero direction v with Av = λv: the matrix moves every point on that line to another point on the same line, scaling by the eigenvalue λ. A negative λ flips the direction but keeps the line, which the game counts as staying on its own line - flips are allowed, rotation is not.

The test the game itself runs is the one you should run mentally: compute Av and check whether it is proportional to v. Two vectors (p, q) and (r, s) are parallel exactly when the cross product p·s - q·r is zero. That is one multiplication pattern, no division, and no need to find λ first - which matters because the matrix entries are messy decimals while the candidates are small integers.

Geometrically, everything not on an eigenline gets rotated at least a little. The plot gives you a first filter: apply A roughly in your head to each arrow and ask which output would land on the same line through the origin.

Fast arithmetic on messy matrices

The candidates have small integer coordinates like (2, -1), so Av is two dot products of a 2-vector against rows of A. With A = [[a, b], [c, d]] and v = (x, y), Av = (ax + by, cx + dy). Then the parallel check is (ax+by)·y - (cx+dy)·x = 0. You are comparing a handful of two-digit products - entirely feasible in your head or on paper within a few seconds per candidate.

Work by elimination. A candidate fails the moment the cross product is clearly nonzero - and with rounded display entries, 'clearly nonzero' means far from zero. Because entries are shown rounded, the true eigenvector's cross product may come out near zero in your hand check instead of exactly zero; the decoys are constructed to be non-parallel by a wide margin, so they miss by a lot. Pick the candidate closest to zero.

A useful shortcut: compute the ratio of Av's components and compare it to y/x for the candidate. If (ax+by)/(cx+dy) matches x/y's structure - same ratio between components - it is your eigenvector. Sign flips across both components are fine (negative eigenvalue); a sign flip in only one component is rotation.

Why eigenvectors matter beyond the click

The construction A = P·D·P⁻¹ the game uses is diagonalization run backwards, and it is the reason eigenvectors matter in practice: in the eigenbasis, applying A is just componentwise scaling. Powers of A, matrix exponentials, and long-run behavior of linear dynamical systems all become trivial once you know the eigen-directions - Aⁿ = P·Dⁿ·P⁻¹.

In quant work this shows up as principal components of a covariance matrix (directions of maximal variance), the stationary behavior of Markov chains (the eigenvector for eigenvalue 1), and stability of discretized systems (eigenvalues inside or outside the unit circle). Getting fluent at 'does this matrix preserve this direction' is the atomic skill under all of them.

Note the game's edge case: if both eigenvalues were equal, A would be a multiple of the identity and every vector would be an eigenvector - so the generator forces distinct eigenvalues. That degenerate case is itself a classic interview probe: for A = cI, the eigenspace is the whole plane.

A worked example

  1. Setup: the matrix shown and the four candidate directions.

    A=(1230),(1,1), (2,−3), (1,−2), (3,1)A = \begin{pmatrix}1 & 2\\ 3 & 0\end{pmatrix}, \quad (1,1),\ (2,-3),\ (1,-2),\ (3,1)
  2. Candidate (1, 1). Apply A:

    A(11)=(1⋅1+2⋅13⋅1+0⋅1)=(33)A\begin{pmatrix}1\\1\end{pmatrix} = \begin{pmatrix}1\cdot1+2\cdot1\\ 3\cdot1+0\cdot1\end{pmatrix} = \begin{pmatrix}3\\3\end{pmatrix}
  3. Parallelism test for (1, 1): cross product is zero, so this is an eigenvector with λ = 3.

    3⋅1−3⋅1=0⇒(1,1) is an eigenvector, λ=33\cdot1 - 3\cdot1 = 0 \quad\Rightarrow\quad (1,1)\ \text{is an eigenvector},\ \lambda = 3
  4. Check the decoy (2, -3). It also comes out parallel - it is the matrix's other eigenvector (λ = -2), which the real game excludes from the candidate list.

    A(2−3)=(−46),(−4)(−3)−6(2)=12−12=0A\begin{pmatrix}2\\-3\end{pmatrix} = \begin{pmatrix}-4\\6\end{pmatrix}, \quad (-4)(-3)-6(2) = 12-12 = 0
  5. Candidate (1, -2): cross product is nonzero, so this is rotated, not an eigenvector.

    A(1−2)=(−33),(−3)(−2)−3(1)=6−3=3≠0A\begin{pmatrix}1\\-2\end{pmatrix} = \begin{pmatrix}-3\\3\end{pmatrix}, \quad (-3)(-2)-3(1) = 6-3 = 3 \ne 0
  6. Candidate (3, 1): cross product is nonzero, so this is rotated too - click the candidate whose cross product is zero.

    A(31)=(59),5(1)−9(3)=−22≠0A\begin{pmatrix}3\\1\end{pmatrix} = \begin{pmatrix}5\\9\end{pmatrix}, \quad 5(1)-9(3) = -22 \ne 0

Common mistakes

• Rejecting a direction because Av points the opposite way. A flip means a negative eigenvalue - the vector is still on its own line and still an eigenvector.

• Solving the characteristic polynomial for λ first. You never need the eigenvalues here; the parallelism cross product is faster and is exactly the test the game grades with.

• Comparing only one component ratio. (ax+by)/x matching some scale is not enough - both components must scale by the same factor, which is what the cross product checks in one line.

• Expecting your hand computation on the rounded display entries to give exactly zero. The underlying matrix is full precision; pick the candidate whose cross product is closest to zero, since decoys miss by a wide margin.

• Forgetting that eigenvectors are directions, not points: any nonzero scalar multiple of an eigenvector is the same answer, so normalize mentally to the smallest integers and compare lines. Arrow length is irrelevant.

Why interviews test this

Quant-research and quant-dev linear algebra screens almost always touch eigenvectors: define them, find them for a small matrix, explain diagonalization, or connect them to PCA on a covariance matrix. The 2x2 case is the standard whiteboard size, and interviewers watch whether you reach for the definition Av = λv and a parallelism check before grinding the characteristic polynomial.

Follow-ups this game prepares you for: what happens when eigenvalues repeat (the identity-multiple degenerate case), why symmetric matrices have orthogonal eigenvectors, and why the top eigenvector of a covariance matrix is the direction of maximal variance.

Play Eigenvector Spotter on Outcry

Eigenvector Spotter is free to play on Outcry, in the Gradient Lab section, and every run is timed and scored. Read the guide once, then play Eigenvector Spotter and check your score against the strategy above. The guide book has a written guide for every other game, and the practice hub and mock assessments put the same skills under a real screen's clock.