Almost none of the roots are real
Worth reading first: The roots of the slope stay inside · A loop that cannot miss the middle.
A polynomial of degree has exactly roots in the complex numbers, counted with multiplicity, and what the coefficients already know is how much the coefficients say about them before any is found: their sum, their product, and every symmetric combination. A loop that cannot miss the middle proved it by watching the image of a large circle wind round the origin times. How many of those roots are real is a different question, and for a particular polynomial it can be anything from down to nought or one, depending on the parity of . The polynomial has all its roots real; has at most one.
So ask it of a typical polynomial. Choose each coefficient independently from the standard normal distribution — the bell curve of mean nought and spread one — and count the real roots. A quadratic has two real roots when and none otherwise, and with normal coefficients the average count is about . A polynomial of degree thirty might be expected to have many more. It usually has two or four.
The average number of real roots of a random polynomial of degree grows like . Mark Kac proved it in 1943, and it means that almost all the roots of a random polynomial leave the real line: of a thousand roots, about five are real. This essay computes the average exactly, checks it against samples, and then finds the reason for the logarithm in where on the line the real roots sit.
Thirty roots and two of them real
The two polynomials in the figure were drawn at random and their roots found numerically. Every root reported was checked by substituting it back, and every root called real was checked again by the polynomial changing sign across it. The degree-30 polynomial has two real roots, at and . The degree-100 polynomial also has two, at and . All the other roots come in pairs , mirror images across the real line, as the roots of any polynomial with real coefficients must.
Two features stand out beyond the count. The complex roots are not scattered across the plane: they sit close to the unit circle, closer for the higher degree. And the real roots that do occur tend to be near or — the circle’s two points on the real line. The first feature is the subject of a separate essay. The second turns out to explain the count.
A polynomial with real coefficients crosses the real axis at each real root. A polynomial of high degree with random coefficients oscillates, but the oscillation of a sum of many random terms is mostly cancellation, and a sign change of the whole requires the terms to line up in a particular way. The question is how often that happens across the line, and the answer is a density.
Two small cases by hand
The smallest cases can be settled without any formula for the density, and they already show the count falling behind the degree. A quadratic with independent normal coefficients has real roots exactly when its discriminant is positive. The product of two independent normals is as often negative as positive, and when it is negative the discriminant is certainly positive; when it is positive, has to beat it. A simulation of two million quadratics finds real roots in 64.9% of them, so the average number of real roots is about — the first point of the curve below, where the exact integral gives .
A cubic always has at least one real root, and has three exactly when its discriminant is positive. Among 400,000 random cubics the discriminant was positive in about a quarter, and the average count was . So the quadratic realises of its possible real roots on average, and the cubic only half: already at degree three, most of the room the degree allows is going unused.
The pattern continues, and the sections below show why it continues in exactly the way it does. At degree the share of roots that are real is the average count divided by : about one in eight at degree twenty, one in twenty-eight at degree a hundred, one in two hundred at degree a thousand.
The count computed exactly, and a logarithm
Kac’s method is to count sign changes in expectation. At each point of the real line, the value is itself a normal random variable, since it is a fixed combination of independent normal coefficients; so is its derivative . The chance that crosses nought in a tiny interval depends only on the joint distribution of and , which is a pair of correlated normals, and working it out gives an expected number of crossings per unit length. This is now called the Kac–Rice formula, after Kac and Stephen Rice, who found the same principle for random signals in 1944.
For coefficients all of variance one the formula reads
the factor four accounting for the four stretches , , and , which carry the same expected number of roots by symmetry. The solid curve in the figure is this integral evaluated numerically for every degree from 2 to 1,024. The dots are averages over 120 random polynomials at each marked degree, and every one lies within two standard errors of the curve.
The integral grows like plus a constant, to four places, which is the dashed line. The approach is quick: the two differ by of a root at degree eight, by at degree 32 and by less than a hundredth from degree 128 on, and at degree a thousand the exact value is . Doubling the degree adds of a real root, whatever the degree already is.
The constant was computed by J. Ernest Wilkins in 1988, together with further terms of the expansion. Kac’s own proof gave the leading term. What neither the formula nor its expansion says, by itself, is why the logarithm appears — why the real roots are so scarce and yet not bounded. For that the density has to be looked at along the line.
Crowded towards plus and minus one
The density of real roots is far from even. It is low near the origin, rises steeply towards , peaks there at roots per unit length for degree 40, and falls away beyond. The histogram of 1,168 real roots from 400 random polynomials follows it closely.
The reason for the peaks is a competition between terms. For well below 1, the powers decay quickly, the first few terms dominate, and behaves like a polynomial of small degree, which has few roots. For well above 1 the last few terms dominate and the same is true in reverse. Only near are all terms of comparable size, and only there can the sum oscillate rapidly. At itself the polynomial is simply the sum of its coefficients, a normal variable with variance ; a little way from 1 the terms are weighted by slowly changing powers, and the sum becomes a slightly different combination of the same coefficients — correlated with the value at 1, but not identical. How quickly that correlation decays as moves away from 1 sets how often the sum can change sign, and it decays over a distance comparable to itself.
The two halves of the line mirror each other. The polynomial has the coefficients of in reverse order, which for independent identically distributed coefficients is another polynomial with the same distribution. Its roots are the reciprocals of the roots of , so a root of at inside is as likely as one at outside it. The same reversal pairs the power sums of the roots with those of their reciprocals, the quantities every power sum, from the coefficients alone computed without finding a single root. That is why 576 of the 1,168 sampled roots lie between and : in expectation exactly half do.
Even on a logarithmic ruler
The peaks become intelligible in the right coordinate. Measure a root’s position not by but by how close it is to , on a logarithmic scale: , which is nought at the origin, 1 at , 2 at , and at a distance from . In this coordinate the real roots spread almost evenly.
Near but not too near, the Kac–Rice density is approximately , and changing variable to turns that into a constant. Counting the two signs and the two sides of gives four copies, so the real roots arrive at a steady rate of about per unit of — the dashed line in the figure, which the exact curve approaches after starting higher at the origin. The histogram from 150 random polynomials of degree 200 follows the curve.
The even spread stops at . Closer to than a distance , the terms of the polynomial no longer look like a sum of independent pieces — hardly changes over the whole range of — and the polynomial there behaves like a single smooth random function with no room to oscillate. So the real roots occupy a stretch of length about in the logarithmic coordinate, at a rate of per unit, and the total is about .
The logarithm is the length of the region in which a polynomial of degree can oscillate, measured on the scale that makes its oscillation uniform. Each doubling of the degree lets the roots come a factor of two closer to , which adds to the length of the region and to the count.
The logarithm belongs to equal variances
The count depends on the law chosen for the coefficients, and the logarithm is a feature of giving every coefficient the same spread. Alan Edelman and Eric Kostlan showed in 1995 that the Kac–Rice density has a geometric meaning, and with it computed the answer for other laws. If coefficient has variance equal to the binomial coefficient , the expected number of real roots is exactly , for every — the figure’s middle curve passes through 2, 4, 8 at degrees 4, 16, 64 to four decimal places. That law is the natural one from a geometric point of view: it is the only one whose distribution is unchanged by rotating the real projective line, so no point of the line is special.
With variances , the coefficients of the exponential series, the count grows like . At degree 128 the ratio to is still and falls towards only slowly. The real roots of such a polynomial spread roughly evenly over an interval of length about centred at the origin, rather than crowding near .
Equal variances concentrate the action near the unit circle, because that is where equal coefficients make all the terms the same size. Change the weights, and the region where the terms balance moves and changes shape, and the count changes with it. The logarithm is not a universal fact about random polynomials; it is what happens when every power of is given the same importance.
Signs as good as bell curves
Kac’s argument uses the normal distribution in an essential way: a fixed combination of normal variables is normal, which is what makes the joint law of and computable. It is natural to ask whether the answer depends on that. Take the simplest possible random coefficients instead — each or with equal chance.
At low degree the counts differ. A random polynomial of degree four with coefficients has about real roots on average, against for normal coefficients. But the gap closes as the degree grows, and at degree 128 the two samples average and . Paul Erdős and Cyril Offord proved in 1956 that polynomials with coefficients follow the same law: the number of real roots is with probability tending to one.
The universality has a reason visible in the logarithmic picture. What sets the rate of per unit is how behaves on a stretch where many terms contribute comparably, and there the sum of many independent coefficients looks normal whatever the coefficients are, by the principle the bell curve from coin flips made visible. Near the origin only the first few coefficients matter and their actual distribution shows through, which is why small degrees differ. Terence Tao and Van Vu extended the universality in 2015 to a wide class of coefficient laws: the average is to within an error bounded independently of , whatever the law, so long as it has mean nought and a little more than a finite variance.
What the count does not settle
The average is one number about a distribution, and as the average settles and the wobble does not showed for sums of coin tosses, the spread around it carries information the average cannot. The spread is known here too: Nina Maslova showed in 1974 that the variance grows like , and that the count, suitably scaled, is asymptotically normal. So a random polynomial of degree a thousand has about real roots, and a degree- polynomial almost never has more than a few times .
The count also says nothing about which roots are real in a given polynomial. For that the tool is exact and not statistical: the remainders of the Euclidean algorithm applied to and , which the remainders that count the roots turned into Sturm’s theorem, count the real roots of any particular polynomial in any interval. The random theory predicts what that count will usually be; Sturm’s sequence finds it for the one polynomial at hand.
And there is a relation to the derivative’s roots. The roots of the slope stay inside showed that the critical points lie inside the convex hull of the roots. For a random polynomial the roots hug the unit circle, so the hull is nearly the whole disc and the theorem says little; the real critical points obey their own law of the same logarithmic kind, since is again a polynomial with independent normal coefficients, of unequal variances .
Still open: the chance of no real root at all
A polynomial of odd degree must have at least one real root, since it tends to opposite infinities at the two ends of the line. A polynomial of even degree can have none. How likely is that for a random polynomial of even degree ?
The answer decays like a power of the degree, , for some exponent . Amir Dembo, Bjorn Poonen, Qi-Man Shao and Ofer Zeitouni proved in 2002 that such a law holds, with between and , and their simulations put it at about . The exact value of is not known, and it is not even known whether it is a simple number. The same exponent governs the chance that a certain smooth random process stays positive for a long time — a persistence probability — and the corresponding exponents for many such processes are known only numerically.
The difficulty is that the event is global and rare. The Kac–Rice formula counts crossings on average and is blind to their correlations, while the absence of every crossing on the whole line is a statement about all of them at once. A random polynomial with no real root has to stay on one side of the axis across the whole region of length where it would ordinarily oscillate, and computing the probability of that demands exactly the correlation structure the average ignores.
What the pictures cannot settle
Every count here was obtained by finding every root numerically and checking it, and every real root was confirmed by a change of sign. The exact curves come from evaluating the Kac–Rice integral numerically to high accuracy, and the samples agree with them within their sampling error. None of that is a proof of the asymptotic law; it is the law observed where it can be computed, and the proofs are Kac’s, Erdős and Offord’s, and Edelman and Kostlan’s.
The pictures show averages over some hundreds of polynomials. Individual polynomials vary: among the samples at degree 128 some had one real root and some had eight. The theorem describes what the typical polynomial does, and it leaves room for every atypical one — including the polynomials with all their roots real, which are exactly the ones that the textbooks, choosing their examples by hand, tend to show.
What links here
Computed from the collection, not written here: the essays that point at this one.
Reads more easily once this is understood
Essays that name this one as worth reading first.
Shares its objects with
Essays that name at least two of the same things, and that neither author linked.
- An average that never settles — both name expectation, normal distribution
- Counting what has no formula — both name density, logarithm
- Fair bits from an unfair coin — both name expectation, randomness
- How far from the average a thing can be — both name expectation, normal distribution
- How fast the bell arrives — both name expectation, normal distribution
- Matching as they arrive — both name expectation, randomness
Named objects
A dashed tag is an object no other essay names yet.
Complex numbersDensityExpectationLogarithmNormal distributionPolynomialRandomnessRoots