Posts Tagged ‘probability’

How many quadratic equations with real roots are there? (Part I)

May 3, 2009

The answer: infinity.

Okay, that wasn’t a useful question, so let’s ask a better one.  Of all possible quadratic equations with real coefficients, what fraction of them, f_{real}, have real roots?

As all children know, the quadratic equation is a x^2 +bx +c and its roots are the values of x for which the equation equals zero.  Everyone, adults included, also knows that the roots can be found with the quadratic formula:

x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}

For real coefficients, the roots are real only when the quantity inside the square-root is positive.  This quantity is called the discriminant, and so we’ll give it the symbol D and talk about it for the rest of the post.


The question about real roots is a question about the discriminant: of all possible choices of a, \, b,\, and c, how often will the discriminant be positive?

To get a feel for what the answer might be and to show an example of how to introduce probability into interesting places where it ought to have no business, as a first step, we might ask, what’s the average value of the discriminant?

More specifically, let’s assume a,\,b and c are each drawn from a uniform distribution, and, since infinite domains are a pain, let’s assume the allowed choices of each coefficient are bounded by \pm r.  We’ll take the limit as r\rightarrow \infty later.  This is a model for a process like: “I throw a dart at a number line three times, and each point of impact gives me a coefficient.”  We could choose other distributions, but this one is in some sense the most “symmetrical” and thus best.

Under the uniform selection assumption, the average value of the discriminant is easy to find:

\bar{D}=\frac{1}{8r^3}\displaystyle \int_{-r}^r dc\int_{-r}^r db\int_{-r}^r da \left(b^2-4ac\right)= \frac{r^2}{3}

Well, that’s interesting.  On the one hand, if we take r to infinity, we get \bar{D}\rightarrow \infty, which is bad—screwy stuff happens when we try to think about things with infinite mean.  That the mean is infinite probably isn’t suprising.  Unless it’s exactly zero, then either b^2 or 4ac is bigger on average, and since both can go to infinity, the only plausible answers for \bar{D} are 0,\pm\infty

On the other hand, for any finite r, \bar{D} is positive, and so we might expect that quadratics with real roots are more common than quadratics with imaginary roots, and so maybe f_{real}>\frac{1}{2}.

Further ignoring 200 years of mathematics, let’s look at the standard deviation, \sigma_D, of the discriminant, since, if it’s small relative to the mean, maybe we can trust the mean anyway.  The idea is that sometimes things that give mathematicians strokes are still informative.  As they say in regard to somewhat related issues:

There are in this world optimists who feel that any symbol that starts off with an integral sign must necessarily denote something that will have every property that they should like an integral to possess. This of course is quite annoying to us rigorous mathematicians; what is even more annoying is that by doing so they often come up with the right answer.

McShane, E. J.
Bulletin of the American Mathematical Society, v. 69, p. 611, 1963.

Calculated in the usual way, we find:

\sigma_D= \frac{2}{15}\sqrt{105}r^2

Well, that’s infinite too in the limit, but how big of an infinite is it?  If we look at the standard deviation over the mean, we see:

\frac{\sigma_D}{\bar{D}}=\frac{2}{5}\sqrt{105}\approx 4.1

and so, infinite or not, the standard deviation is bigger than the mean, which tells us that I probably shouldn’t bet on f_{real}>\frac{1}{2} no matter how much I adore a nice, sloppy argument.

Some of you may be screaming by now: this can’t be the best way to do this! And you’d be right.  The condition that the discriminant is positive defines a surface in (a,b,c)-space that separates coefficient sets that lead to real roots from those that don’t.  It seems plausible that the volume of real-root space relative to the volume of the whole space will tell us what fraction of quadratics have real roots.  We’ll pick this up in the next post, wherein we’ll also learn more about that quote by McShane.