The Spectrum of a Random Matrix

Fill a matrix with noise and its eigenvalues arrange themselves into a semicircle

A Matrix Full of Nothing in Particular

Take a large square grid and fill every cell with a random number. Copy the upper half onto the lower half so the matrix is symmetric — that is the only structure you are allowed to impose, and it is there for one reason: symmetric matrices have real eigenvalues, so the answers will lie on a line where you can look at them. Now ask for those eigenvalues.

There is no reason to expect anything. You put in noise; the eigenvalues are a horrible tangled function of every entry at once; the sensible prediction is a mess. What comes out instead is a semicircle. The eigenvalues fill the interval [−2, 2] with density √(4 − x²)/2π and they do it every time, to a precision that improves as the matrix grows.

Eugene Wigner found this in the 1950s while trying to predict the energy levels of uranium, and it is the first surprise of a subject made entirely of surprises. The second one is that the noise you started with barely matters, and the third is that even this smooth curve is hiding something: look closely at how the eigenvalues sit inside it and they are pushing each other apart.

The Matrix, and Its Eigenvalues

Start small enough to read. Here is an actual 8×8 symmetric matrix with every entry visible, and underneath it the eight numbers that come out of diagonalising it. Nothing is being averaged and nothing is hidden: those eigenvalues belong to that matrix. Their sum is its trace, which you can check by eye against the diagonal.

-0.2
0.4
-0.3
0.3
0.3
-0.6
0.1
0.2
0.4
0.3
0.0
-0.2
-0.1
-0.3
0.2
-0.2
-0.3
0.0
-0.1
-0.1
-0.1
0.1
0.2
-0.4
0.3
-0.2
-0.1
1.0
0.2
0.0
-0.4
0.2
0.3
-0.1
-0.1
0.2
-0.1
0.4
0.7
0.1
-0.6
-0.3
0.1
0.0
0.4
0.5
0.2
0.9
0.1
0.2
0.2
-0.4
0.7
0.2
0.1
0.2
0.2
-0.2
-0.4
0.2
0.1
0.9
0.2
-0.2

hover or tap a cell — the mirror lights up too

Sixty-four numbers, thirty-six of them independent — the other twenty-eight are copies, because the matrix has to be symmetric for its eigenvalues to be real. Nothing was chosen. Every entry is a fresh Gaussian draw, scaled by 1/√8.

-1.304
λ smallest
1.577
λ largest
1.026
largest entry
1.360
trace = Σλ
1
matrices rolled
density at 0, against 1/π = 0.3183
100%
of all eigenvalues inside [−2, 2]

Dense 8×8 symmetric matrix, entries drawn one at a time, eigenvalues by cyclic Jacobi rotations — no shortcut and no ensemble formula. Eight eigenvalues are far too few to look like anything, and the ones from a single matrix will happily wander past ±2. Pooled over thousands of 8×8 draws the density at the origin measures 0.308 against the semicircle’s 1/π ≈ 0.3183, and 97.1% of eigenvalues land inside [−2, 2]. The shape is already there at eight; it is just buried under the noise of eight samples.

Try it: Re-roll a dozen times and watch two different things happen at once. Any single spectrum jumps around wildly — eight numbers cannot look like a curve — but the pile they land in stops moving after about twenty rolls. The shape is a property of the process, not of any one matrix.

Turn N Up

Eight eigenvalues are noise. Eight hundred are a curve. Nothing changes along the way except the size of the matrix — same distribution for the entries, same 1/√N scaling, same histogram, no fitting of any kind. The gold line is √(4 − x²)/2π drawn from the formula, and by N = 400 the bars are sitting on it.

0.996
L1 gap to the semicircle
0.000
density at 0 vs 1/π = 0.3183
0.0%
inside [−2, 2]
noise
what you are looking at

Every bar is a real spectrum: the Dumitriu–Edelman tridiagonal β-ensemble at β = 1, which has exactly the eigenvalue law of a dense symmetric Gaussian matrix and diagonalises in O(N²), so N = 800 costs about twelve milliseconds instead of several seconds. The gold curve is √(4 − x²)/2π and nothing is fitted to it — no scaling, no offset. For a single matrix the L1 gap between histogram and curve averages 1.33 at N = 10, 0.20 at N = 100 and 0.036 at N = 800: a factor of 37 over the range of the slider. The measured density at the origin converges on 1/π ≈ 0.3183, which is the peak height the formula demands.

Try it: Drag the slider slowly from 10 to 800 and watch the L1 readout fall from above 1 to under 0.04. Then hold N at 60 and pool 25 matrices instead: the curve appears just as cleanly. Size and repetition buy you the same thing, which is the first hint that the semicircle is a law of averages rather than a property of large matrices specifically.

It Barely Matters What You Put In

The obvious guess is that the semicircle is a fact about Gaussians — bell curves in, something bell-shaped out. It is not. Replace every entry with a coin flip, so the matrix contains nothing but +1 and −1 and there is not a continuous quantity anywhere in it, and the eigenvalues form the same semicircle. Use a flat distribution instead and the same thing happens. All that is required is that the entries be independent, have mean zero, and have a variance at all.

That last condition is not decoration. Cauchy-distributed entries look harmless — most draws are small — but the tails are heavy enough that the variance is infinite, and there is nothing left to normalise by. The spectrum does not settle into a wider semicircle or a different curve; it comes apart. At N = 120 only about 16% of the eigenvalues are anywhere near [−2, 2] and the largest is typically in the hundreds — and both numbers get worse as N grows rather than better, which is the signature of a limit that does not exist rather than one you have not reached yet.

The textbook case: every entry a standard normal.
0.0%
inside [−2, 2]
0.00
median largest |λ| per matrix
0.000
density at 0 vs 1/π = 0.3183
0.996
L1 gap to the semicircle

Dense N×N symmetric matrices, entries drawn one at a time from the chosen law and scaled by 1/√N, diagonalised by cyclic Jacobi — the slow way, because the entries are the whole subject here, and the tridiagonal sampler used elsewhere in this lesson has no entries to swap. Measured at N = 120: Gaussian, ±1 and uniform entries all put over 99.8% of their eigenvalues inside [−2, 2], with a median largest eigenvalue of 1.96 in every case. Cauchy entries put about 16% inside, and the median largest eigenvalue is ≈ 480 — and both numbers get worse as N rises, which is what “spreads without limit” means in practice. The three laws that agree are three genuinely different inputs; the one that disagrees is the one with no variance to normalise by.

Try it: Cycle through Gaussian, ±1 and uniform with 40 matrices pooled and watch the four readouts refuse to change. Then switch to Cauchy and press Fit axis to data: the semicircle collapses to a spike at the origin because the axis has had to stretch to the hundreds. Raise N and the spike gets narrower — the failure compounds.

Why a Semicircle and Not Something Else

Here is a picture that gets the answer right, though it is a picture rather than a proof. For the Gaussian ensembles the joint probability density of the eigenvalues can be written down exactly, and it reads as the Boltzmann weight of a physical system: N unit charges confined to a line, each pulled toward the origin by a quadratic well and each pushed away from every other by a logarithmic repulsion. The eigenvalues are the charges. The semicircle is where they come to rest.

The gap between that and a proof is worth naming. The exact statement is about the density of a random configuration; replacing it with the single most likely configuration, and then with a smooth continuous density, are both approximations that happen to be excellent. And nothing in this argument mentions coin flips or uniform entries at all — that the same answer holds for those is universality, a genuinely harder theorem. What the gas picture does give you is a reason the answer is a semicircle rather than a bell curve, an intuition for why the support has hard edges, and a prediction precise enough to check.

0
descent steps
0.000
span, against 4 for [−2, 2]
0.0e+0
worst gap from the exact minimiser
settled
gradient descent on the gas energy

Gradient descent on E(x) = (N/4)·Σxₖ² − Σj<k log|xⱼ − xₖ|, the exponent of the Gaussian ensembles’ joint eigenvalue density. The gold tick marks are the exact minimiser, √(2/N) times the roots of the Hermite polynomial HN — obtained from a tridiagonal eigenvalue problem that shares no arithmetic with the descent, so the two agreeing to fifteen decimal places is a real check rather than a restatement. The span settles a little short of 4 because N is finite: at N = 60 the outermost charge rests at ±1.855, at N = 400 at ±1.958.

Try it: Switch off the repulsion and every charge slides into the origin; switch off the well and they run off the screen. Neither force is optional and neither is doing the job alone. Then turn both back on and overlay a real matrix of the same size: the eigenvalues sit around the resting positions, jittering, never far off.

What the Curve Does Not Tell You

The semicircle is a statement about where eigenvalues are, in bulk. It says nothing about how any two of them get along, and that turns out to be where the subject actually lives. The same law governs the largest eigenvalue only up to the edge, where a different distribution entirely takes over; and the fine structure inside the bulk — the spacing between neighbours — is a law so rigid that it turns up in the zeros of the Riemann zeta function for reasons nobody can explain. See also Linear Algebra for what an eigenvalue is doing in the first place, and Probability for the central limit theorem this law quietly stands beside.

Key Takeaways

  • Noise in, a curve out — the eigenvalues of a large random symmetric matrix, scaled by 1/√N, fill [−2, 2] with density √(4 − x²)/2π, peaking at exactly 1/π ≈ 0.3183
  • Size sharpens it, not creates it — the shape is already present at N = 8 once you pool enough matrices, but a single spectrum only looks like the curve once N is in the hundreds: the L1 gap falls from about 1.33 at N = 10 to 0.036 at N = 800
  • The entries hardly matter — Gaussian, ±1 coin flips and uniform draws give the same semicircle to within measurement error, which is universality in its simplest form
  • Finite variance is the real condition — Cauchy entries have none, and their spectrum spreads without limit: the fraction inside [−2, 2] falls from 26% at N = 40 to 17% at N = 120 while the median largest eigenvalue climbs into the hundreds
  • Charges on a wire explain the shape — a logarithmic repulsion in a quadratic well settles into exactly √(2/N) times the roots of the Hermite polynomial HN, whose density is the semicircle; it is a heuristic for the general case but an exact calculation for the Gaussian one