36

The following is a homework question for which I am asking guidance.

Let $A$, $B$, $C$ be independent random variables uniformly distributed between $(0,1)$. What is the probability that the polynomial $Ax^2 + Bx + C$ has real roots?

That means I need $P(B^2 -4AC \geq 0$). I've tried calling $X=B^2 -4AC$ and finding $1-F_X(0)$, where $F$ is the cumulative distribution function.

I have two problems with this approach. First, I'm having trouble determining the product of two uniform random variables. We haven't been taught anything like this in class, and couldn't find anything like it on Sheldon Ross' Introduction to Probability Models.

Second, this strategy just seems wrong, because it involves so many steps and subjects we haven't seen in class. Even if I calculate the product of $A$ and $C$, I'll still have to square $B$, multiply $AC$ by four and then subtract those results. It's too much for a homework question. I'm hoping there might be an easier way.

6 Answers6

29

Hints: First consider $B^2 \geq 4AC$. Now, if $U$ is uniform$(0,1)$, then $-\log(U)$ is exponential$(1)$; further, the sum of two independent exponential$(1)$ random variables has pdf $x e^{-x}$, $x > 0$. Thus, using the law of total probability, the answer can be found by solving an elementary one dimensional integral. I've confirmed the result by simulations.

EDIT: Specifically, $$ {\rm P}(B^2 - 4AC \ge 0) = \int_{\log 4}^\infty {[1 - e^{ - (x - \log 4)/2} ]xe^{ - x} \,{\rm d}x} = \frac{{5 + 3\log 4}}{{36}} \approx 0.2544134. $$ The answer was confirmed using Monte Carlo simulations: $N=10^8$ runs gave average of $0.25444043$.

EDIT: Note that it is quite easy to determine, moreover, the distribution of the product of $n$ independent uniform$(0,1)$ random variables. Indeed, let $U_1,\ldots,U_n$ be independent uniform$(0,1)$ variables. Write $$ U_1 \cdots U_n = \exp \Big[ - \sum\nolimits_{i = 1}^n { - \log U_i } \Big]. $$ Since the $-\log U_i$ are independent exponential$(1)$ variables, $U_1 \cdots U_n$ is merely distributed as $e^{-X}$, where $X$ has gamma pdf $x^{n-1}e^{-x}/(n-1)!$, $x > 0$.

EDIT: Elaborating in response to the OP's request (see the first comment below).

Actually, the hint was supposed to send you in a slightly different direction, that is to consider the probability $$ {\rm P}\bigg( - \log B \le \frac{{( - \log A) + ( - \log C) - \log 4}}{2}\bigg), $$ or $$ {\rm P}\bigg(X \le \frac{{Y - \log 4}}{2}\bigg), $$ where $X$ is exponential$(1)$ and $Y$, independent of $X$, has gamma pdf $f_Y (x) = xe^{-x}$, $x > 0$. Then, by the law of total probability (and using that $X$ and $Y$ are independent), the above probability is given by $$ \int_0^\infty {{\rm P}\bigg(X \le \frac{{Y - \log 4}}{2}\bigg|Y = x\bigg)f_Y (x)\,{\rm d}x} = \int_0^\infty {{\rm P}\bigg(X \le \frac{{x - \log 4}}{2}\bigg)xe^{ - x} \,{\rm d}x}, $$ and so substituting the exponential$(1)$ cdf yields the desired integral.

Shai Covo
  • 24,077
28

Hint: You are looking for the volume of the $(a,b,c) \in [0,1]^3$ such that $b^2 \geq 4ac$.

Zarrax
  • 44,950
11

I liked Shai Covo's approach of taking the product distribution to a sum. This will help to extend it to larger number of variables as well.

In this particular case, we can also use the following method (if one is averse to exponents :-)).

Given $A,B$ and $C$ are i.i.d and Uniform(0,1), \begin{eqnarray*} f_{A}(a) &=& \begin{cases} 1, & a \in [0,1] \\ 0, & otherwise \end{cases} \\ f_{B}(b) &=& \begin{cases} 1, & b \in [0,1] \\ 0, & otherwise \end{cases} \\ f_{C}(c) &=& \begin{cases} 1, & c \in [0,1] \\ 0, & otherwise \end{cases} \end{eqnarray*}

The product $U=AC$ follows, \begin{eqnarray*} \mathbb{P}\left(U \le u \right) &=& \mathbb{P}\left( AC \le u \right) \\ &=& \int_{c=0}^{1}{\mathbb{P}\left( A \le \frac{u}{c} \right) f_{C}(c) dc} \\ &=& \int_{c=0}^{u}{\mathbb{P}\left( A \le \frac{u}{c} \right) f_{C}(c) dc} + \int_{c=u}^{1}{\mathbb{P}\left( A \le \frac{u}{c} \right) f_{C}(c) dc} \\ &=& \int_{c=0}^{u}{ dc} + \int_{c=u}^{1}{ \frac{u}{c} dc} \\ &=& u +(1 \log 1- u \log u) \\ &=& u(1-\log u ) \end{eqnarray*}

Note: We can get the product distribution as well, upon differentiation: viz., $f_{U}(u)=-\log(u), 0\le u\le 1$.

Now the requisite condition for real roots is, \begin{eqnarray*} \mathbb{P}\left(B^{2}-4 A C \ge 0 \right) &=& \mathbb{P}\left( A C \le \frac{B^{2}}{4} \right) \\ &=& \int_{0}^{1}{\mathbb{P}\left( A C \le \frac{b^{2}}{4} \right) f_{B}(b) db} \\ &=&\int_{0}^{1}{ \frac{b^{2}}{4} \left(1-\log \frac{b^{2}}{4} \right) db} \\ &=& \left[ \frac{b^{3}}{36} \left(5 + \log 64 - 3 \log b^{2} \right) \right]_{0}^{1} \\ &=& \frac{1}{36} \left(5+ \log 64\right) \\ &\approx& 0.2544134189822131. \end{eqnarray*}

Nivedita Rethnakar
  • 1,370
  • 7
  • 11
  • A small correction: instead of $u +(1 \log 1- u \log u)$, it should be $u +(u \log 1- u \log u)$. Thank you for the easy to understand answer! – Hungry Blue Dev Aug 12 '20 at 11:11
6

Here's another approach which utilizes the total law of probability directly. $$P(B^2\geq 4AC)=\int_{0}^{1}P(B^2\geq4AC|C=c)f_{C}(c)dc$$ Using independence the above simplifies to $$P(B^2\geq 4AC)=\int_{0}^{1}P(B^2\geq4Ac)dc$$ When $c\in\Big(0,\frac{1}{4}\Big)$ we have $$P(B^2 \geq 4Ac)=\int_0^1 \int_{\sqrt{4ac}}^1dbda=1-\frac{4\sqrt{c}}{3}$$ When $c\in \Big[\frac{1}{4},1\Big)$ we have $$P(B^2 \geq 4Ac)=\int_0^1 \int_0^{b^2/4c}dadb=\frac{1}{12c}$$ Putting everything together $$P(B^2\geq 4AC)=\int_0^{1/4}\Bigg(1-\frac{4\sqrt{c}}{3}\Bigg)dc+\int_{1/4}^1\frac{dc}{12c}=\frac{5+3\ln(4)}{36}$$

Matthew H.
  • 9,191
3

Hints:

It is not impossible to find the cumulative distribution of $D=AC$, and so easily of $E=4D=4AC$ and $F=\sqrt{E}=\sqrt{4AC}$ [you know $4AC \ge 0$].

Then all you have to do is find the probability that $F<|B|$ which is not difficult if you know or can work out that $\int x^2 \log(x) \, dx = x^3(3 \log(x)-1)/9$.

As a check, you should be getting a result slightly more than 0.25.

Incidentally as a comment on the question, the requirement that $A$ and $C$ have the same sign makes a big difference to the result, as $B^2-4AC$ is always positive if $A$ and $C$ have opposite signs.

Henry
  • 157,058
3

We want the volume of the region in the unit cube satisfying the property $AC < Z \equiv B^2 / 4$. Separate into two regions: $A < Z$ and $A > Z$. For the former, all $C$ up to $1$ satisfy the property, while for the latter, all $C$ up to $Z / A$ satisfy the property. We then have

$$ \int_0^1 dB \int_0^Z dA \int_0^1 dC + \int_0^1 dB \int_Z^1 dA \int_0^{Z/A} dC = \frac{1}{12} + \frac{1 + 3 \ln 2}{18} \approx 0.2544 $$

xdavidliu
  • 637