# Likelihood of circle vs. ellipse vs. parabola vs. hyperbola from $ax^2+bxy+cy^2+dx+ey+f=0$ with coefficients uniformly random in $[-1,1]$

Q. What is the probability that a random quadratic equation describes a circle, an ellipse, a parabola, or a hyperbola? Let's use this definition of a random quadratic:

$$a\, x^2 + b\, x y + c\, y^2 + d\, x + e\, y + f = 0 \;$$

where $$a,b,c,d,e,f$$ are each uniformly random within $$[-1,1]$$.

For a circle the probability should be $$0$$, but I am unclear on the likelihood of ellipse vs. parabola vs. hyperbola.

Each conic can be represented as a point in a $$5$$-dimensional projective space. So I'm asking for the corresponding portions/volumes within this space.

My trigger for this question is a quote from Colin Adams: "So if we want to understand the geometry of surfaces, it's all about the hyperbolic case." So I was wondering if hyperbolas dominate even in the plane. (Colin Adams, "What is ... a Hyperbolic 3-Manifold?" AMS 65, no. 5, pp.544-546.PDF download).

Added: Simulations suggest that hyperbolas occur roughly 73% of the time, ellipses 14%, and the remainder have only imaginary solutions.

• You should definitely look up eccentricity, which is the number that determines what kind of conic one gets from given values of $a, b, ..., f$. There's a formula for it on Wikipedia. Mar 26, 2021 at 21:50
• d,e,f shouldn't matter. They effect location mostly, although you could get a non-existent solution, such as a=c=1, f < 0, and others =0. Mar 26, 2021 at 21:57
• The ellipse/parabola/hyperbola nature of the conic is given by the sign of the discriminant, $b^2-4ac$. So, you only have to consider $a$, $b$, $c$.
– Blue
Mar 26, 2021 at 22:09
• Thinking out loud ... $ax^2+2bxy+cy^2+2dx+2ey+f=0$ is often taken as the "preferred form" of the equation, to avoid fractions in various related formulas. Usually, this is merely a notational convenience, but in your context, choosing between $b$ as coefficient vs "half-coefficient" to vary between $-1$ and $1$, would seem to have material implications on the outcome of your investigation. From a "polynomial space" standpoint, coefficient $b$ is a perfectly reasonable parameter; but I wonder if half-coefficient $b$ might represent the "conic space" better in some sense.
– Blue
Mar 26, 2021 at 22:31
• More thinking out loud ... If you're trying to get a handle on hyperbola domination of "conic space", then polynomials with artificially-clamped coefficients (and real-vs-complex concerns) may not be the most-appropriate (ahem) focus. The classical scenario of a plane cutting a cone has only two parameters to consider: the "steepness" of the plane and cone surface. (See this answer.) But the overall probability of a "steeper" plane is $1/2$, making hyperbolas and ellipses equally likely. (continued)
– Blue
Mar 26, 2021 at 23:28

Leaving aside the presence of imaginary ellipses, what you ask is the probability that, given three numbers $$a$$, $$b$$, $$c$$ chosen at random in $$[-1,1]$$, then $$b^2>4ac$$ (hyperbolic case).

But $$b^2=4ac$$ is the equation of a cone in $$abc$$ space, hence that probability is the same as the fraction of the volume of cube $$[-1,1]^3$$ which is outside that cone. To compute this volume, let's focus on the first octant and unit cube $$[0,1]^3$$. The intersection between the cone and a plane $$b=\text{constant}$$ is a hyperbola in $$ac$$-plane with equation $$ac=b^2/4$$. The intersection of the same plane with the unit cube is a square and the area in that square outside the hyperbola is: $$A(b)={b^2\over4}+\int_{b^2/4}^1{b^2/4\over a}da= {b^2\over4}\left(1-\ln{b^2\over4}\right).$$ The required volume can then be computed by integrating that over $$b$$: $$V=\int_0^1 A(b)\,db={5\over36}+{1\over6}\ln2.$$ The cone intersects the original $$[-1,1]^3$$ cube in other three octants, with the same external volume, while the unit cubes in the remaining four octants are completely outside the cone. Hence the requested probability is: $$p={1\over8}(4V+4)={41\over72}+{1\over12}\ln2\approx 0.627207.$$ This result is confirmed by a quick simulation with Mathematica:

tot = 0; niter = 1000000;

Do[
a = RandomReal[{-1, 1}];
b = RandomReal[{-1, 1}];
c = RandomReal[{-1, 1}];
If[b^2 - 4 a c > 0, tot++],
{niter}];

tot/niter // N

Out[20]= 0.627543

• Thank you! I don't think this takes into account all six coefficients. But it is a nice calculation, and agrees with the intuition that hyperbolas dominate. Mar 28, 2021 at 11:38
• The other coefficient can only give rise to imaginary ellipses, but the probability of getting a hyperbola shouldn't change. Mar 28, 2021 at 11:42