Probability of Real Roots in a Quadratic Equation with Uniform(α,β) Coefficients

Background

This paper is a direct follow-up to our earlier work on the symmetric case, where we found that the probability of obtaining real roots of a quadratic equation is approximately 62.7% when coefficients are drawn from $U(-\theta, \theta)$.

The question that follows naturally is what happens when we remove the symmetry constraint?

What if the coefficients come from $U(\alpha, \beta)$ for any real numbers $\alpha$ and $\beta$?

The generalisation was more challenging than expected. We could apply simplifications for the symmetric case. For this instance, we had to employ a more powerful approach of obtaining the value - vector calculus. Our co-author Mukesh Chaudhary provided the insight necessary to proceed.

The Problem in Plain English

Consider the quadratic equation $Ax^2 + Bx + C = 0$. It has real roots when $B^2 \geq 4AC$. We want to find the probability of this happening when $A$, $B$, and $C$ are independently drawn from a uniform distribution $U(\alpha, \beta)$.

The geometric intuition follows: when we have three independent real values, we’re essentially working in a 3D space where each point $(A, B, C)$ represents one set of coefficients. Out of this entire cube, only certain sub-regions satisfy the discriminant condition $B^2 \geq 4AC$.

The probability we’re after is the volume of this “solution region” divided by the total volume.

The shape of this solution region is rather intricate. In the symmetric case, we could work around the complexity. But in the general case, we needed to compute these volumes properly using vector calculus.

The Key Finding

Unlike the symmetric case, which gives a single probability (62.7%), the general case produces different probabilities depending on the relationship between $\alpha$ and $\beta$. We derived the following algorithm that handles all cases:

Algorithm to calculate the probability of obtaining a real root when the coefficients are sampled from the continuous distribution $U(\alpha, \beta)$, where $\alpha, \beta \in \mathbb{R}$ :

  1. Calculate the scaling factor $\theta = \dfrac{\text{signum}(\alpha) \cdot \text{signum}(\beta)}{\max(|\alpha|, |\beta|)}$
  2. Find the ratio $f = \min(|\alpha|, |\beta|) \cdot \theta$, and its absolute value $r = |f|$
  3. Calculate total volume of the cube as $V = (1 - f)^3$
  4. Pre-compute $V_0 = \dfrac{5}{36} + \dfrac{\log 2}{6} \approx 0.2544$ It is also recommended to compute: $r^2$, $r^3$, $r^{\frac{3}{2}}$, $\dfrac{\log r}{6}$
  5. If $f = 0$, return $V_0 \approx 0.2544$
  6. If $f \in \left[\dfrac{1}{2}, 1\right]$, return $0$
  7. If $f \in \left[\dfrac{1}{4}, \dfrac{1}{2}\right)$, return $\left(-V_0 - \dfrac{\log r}{6} + r^2 - \dfrac{8}{9}r^3\right) \div V$
  8. If $f \in \left(0, \dfrac{1}{4}\right)$, return $\left(V_0 - 2r + \dfrac{16}{9}r^{\frac{3}{2}} + r^2 - \dfrac{8}{9}r^3\right) \div V$
  9. If $f \in \left[-\dfrac{1}{2}, 0\right)$, return $\left(V_0 + 2r + 3r^2 + r^3\left(2V_0 - \dfrac{\log r}{6} - \dfrac{8}{9}\right)\right) \div V$
  10. If $f \in \left[-1, -\dfrac{1}{2}\right)$, return $\left(2(V_0 + r + r^2) + \dfrac{\log r}{6} + r^3\left(2V_0 - \dfrac{\log r}{6}\right)\right) \div V$

The constant $V_0 = \dfrac{5}{36} + \dfrac{\log 2}{6}$ appears throughout the formula and represents the base probability in certain limiting cases.

Abstract

The roots of a quadratic equation $Ax^2 + Bx + C = 0$ are real if the discriminant $B^2 - 4AC$ is non-negative. In this paper, the coefficients are taken as independently and identically distributed $U(\alpha, \beta)$, where $\alpha, \beta \in \mathbb{R}$. The exact probability of obtaining real roots is derived through simplification by considering the ratio of the endpoints. Vector calculus is used to derive the final formula, which is experimentally verified using Monte Carlo simulation.

Publication Details

Authors

Keywords

Quadratic equation, continuous uniform distribution, probability, Monte Carlo simulation, vector calculus

This paper extends our earlier result for the symmetric case, where coefficients were drawn from $U(-\theta, \theta)$. That work established the foundational approach and the 62.7% probability for the symmetric distribution.

Access the Publication

The full paper is available through the DOI link above. It contains the complete mathematical derivations, proofs, and Monte Carlo simulation results that verify the formula. We also show a render of the acceptable volume within the unit cube that represents the region where roots are real.

Comments