Library · Geometric Probability · Chapter 8

A random quadratic with three uniform coefficients

Revised Report an error

Problem 8.1

Let a,b,ca, b, c be independent uniform random variables in [0,1][0, 1]. What is the probability that the quadratic ax2+bx+c=0a x^2 + b x + c = 0 has real roots?

Solution. The quadratic has real roots iff its discriminant is non-negative: b2≥4ac,i.e.,ac≤b2/4.b^2 \geq 4 a c, \qquad \text{i.e.}, \qquad a c \leq b^2 / 4.

Step 1: P(ac≤t)\mathbb{P}(a c \leq t) for fixed t∈(0,1)t \in (0, 1). With a,ca, c iid uniform in [0,1][0, 1], P(ac≤t)=∫01∫011[ac≤t] dc da.\mathbb{P}(a c \leq t) = \int_0^1 \int_0^1 \mathbf{1}[a c \leq t] \, dc \, da. For a≤ta \leq t the inner integral gives 11 (since ac≤a≤ta c \leq a \leq t always). For a>ta > t it gives t/at/a. Hence P(ac≤t)=t+∫t1ta da=t(1−ln⁡t).\mathbb{P}(a c \leq t) = t + \int_t^1 \tfrac{t}{a}\, da = t(1 - \ln t).

Step 2: Integrate over bb. Set t=b2/4t = b^2/4, which lies in [0,1/4][0, 1/4] for b∈[0,1]b \in [0, 1]: P(real roots)=∫01b24(1−ln⁡b24)db.\mathbb{P}(\text{real roots}) = \int_0^1 \tfrac{b^2}{4} \left( 1 - \ln \tfrac{b^2}{4} \right) db. Expand ln⁡(b2/4)=2ln⁡b−ln⁡4=2ln⁡b−2ln⁡2\ln(b^2 / 4) = 2 \ln b - \ln 4 = 2 \ln b - 2 \ln 2, so 1−ln⁡(b2/4)=1+2ln⁡2−2ln⁡b1 - \ln(b^2/4) = 1 + 2 \ln 2 - 2 \ln b. Hence P(real roots)=14∫01b2(1+2ln⁡2−2ln⁡b) db.\mathbb{P}(\text{real roots}) = \frac{1}{4} \int_0^1 b^2 (1 + 2 \ln 2 - 2 \ln b) \, db. Using ∫01b2 db=13\int_0^1 b^2 \, db = \tfrac13 and ∫01b2ln⁡b db=−19\int_0^1 b^2 \ln b \, db = -\tfrac19: P(real roots)=14[(1+2ln⁡2)⋅13−2⋅(−19)]=14⋅3+6ln⁡2+29=5+6ln⁡236.\begin{align*} \mathbb{P}(\text{real roots}) &= \tfrac{1}{4}\left[ (1 + 2 \ln 2) \cdot \tfrac13 - 2 \cdot (-\tfrac19) \right] \\ &= \tfrac{1}{4} \cdot \tfrac{3 + 6\ln 2 + 2}{9} = \frac{5 + 6 \ln 2}{36}. \end{align*} Therefore P(real roots)=5+6ln⁡236≈0.2544.■\boxed{\mathbb{P}(\text{real roots}) = \frac{5 + 6 \ln 2}{36} \approx 0.2544.} \qedhere

Compare with Chapter 4, where the parametrisation x2+2px+qx^2 + 2 p x + q with p,q∈[−1,1]p, q \in [-1, 1] gave the cleaner probability 23\tfrac23. The present version has three random coefficients rather than two, and adds the rescaling aa on the leading coefficient; the resulting answer involves ln⁡2\ln 2 — an irrational constant with no simple expression in π\pi. This is the first sign of how adding an extra random parameter can break a closed-form expression into a transcendental one.

import numpy as np
a, b, c = np.random.rand(3, 10**7)
p = (b*b >= 4*a*c).mean()
print(f"sim: {p:.5f}   exact: {(5 + 6*np.log(2))/36:.5f}")
# sim: 0.25443   exact: 0.25441
Report an error on this page

Reports are stored by Netlify. See the privacy note.