# Math Help - Probability with random-coefficient quadratic equation

1. ## Probability with random-coefficient quadratic equation

Let A, B, and C be independent random variables, and consider the random-coefficient quadratic equation $Ax^2 + Bx + C = 0$

What is the probability that the equation has real roots $x$ when A, B, and C take on the value 1 with probability $p \in [0,1],$ and -1 with probability $1 - p$?

What is the probability that the equation has real roots $x$ when A, B, and C a have a $\cup(0,1)$ distribution?

2. Originally Posted by MrJack1990
Let A, B, and C be independent random variables, and consider the random-coefficient quadratic equation $Ax^2 + Bx + C = 0$

[snip]

What is the probability that the equation has real roots $x$ when A, B, and C a have a $\cup(0,1)$ distribution?
You require $\Delta = B^2 - 4AC > 0$. So you need to calculate $\Pr(\Delta > 0)$.

3. Originally Posted by MrJack1990
Let A, B, and C be independent random variables, and consider the random-coefficient quadratic equation $Ax^2 + Bx + C = 0$

What is the probability that the equation has real roots $x$ when A, B, and C take on the value 1 with probability $p \in [0,1],$ and -1 with probability $1 - p$?

What is the probability that the equation has real roots $x$ when A, B, and C a have a $\cup(0,1)$ distribution?
For the first part, the discriminant is positive in the cases where (A,B,C) are
(-1,-1,1),
(-1,1,1),
(1,-1,-1), or
(1,1,-1).
These four cases have probabilities
$(1-p)^2 p$,
$(1-p) p^2$,
$p (1-p)^2$, and
$p^2 (1-p)$.

So the total probability of real roots is the sum of these probabilities,

$2 [ p^2 (1-p) + p (1-p)^2] = 2 p (1-p)$.

4. It may be useful to point out that the value of $B$ contributes nothing to the solution.
The solution depends upon $A~\&~C$ having different signs.
That probability is indeed $2p(1-p)$.

5. As Mr Fantastic said, for part b of this question I need to find the probability of the determinant when it is greater than zero. Alternatively I could say that I require $Pr(B^2 > 4AC)$. But I am getting confused with how to do this if A,B, and C all have a uniform distribution.
I know the pdf and the distribution function for a uniform distribution, but is this a case of conditional probability? If so, how do I apply it here. Continuous disrtibutions confuse me

6. If instead A,B,C ~ uniform(0,1) and are still independent, one way to do it is to compute the distribution of the random variable B^2 - 4AC. The chance of real roots is then the probability that this quantity is positive. I recall that someone on Math Help Forum mentioned recently the distribution of the product of standard uniforms (which you need for the 4AC part), but then you have to find the distribution of the square, and finally the difference too. The distribution would seem to be prety messy. I'm not sure whether folks on this list would deign to use Monte Carlo simulation or numerical methods to do such a calculation, but I found this probability to be about 0.254 using RAMAS Risk Calc. You can also do it with Monte Carlo simulation in R (The R Project for Statistical Computing) with a
simple script like

many = 2000000
A = runif(many)
B = runif(many)
C = runif(many)
arg = B^2 - 4*A*C
length(arg[0<arg])/many

Is resorting to such approaches bad form?

7. Originally Posted by Scoodai
If instead A,B,C ~ uniform(0,1) and are still independent, one way to do it is to compute the distribution of the random variable B^2 - 4AC. The chance of real roots is then the probability that this quantity is positive. I recall that someone on Math Help Forum mentioned recently the distribution of the product of standard uniforms (which you need for the 4AC part), but then you have to find the distribution of the square, and finally the difference too. The distribution would seem to be prety messy. I'm not sure whether folks on this list would deign to use Monte Carlo simulation or numerical methods to do such a calculation, but I found this probability to be about 0.254 using RAMAS Risk Calc. You can also do it with Monte Carlo simulation in R (The R Project for Statistical Computing) with a
simple script like

many = 2000000
A = runif(many)
B = runif(many)
C = runif(many)
arg = B^2 - 4*A*C
length(arg[0<arg])/many

Is resorting to such approaches bad form?
Not at all.

However, you can find the result analytically. The probability that the roots are real is the same as the probability the $B^2 - 4AC \geq 0$, and

$\Pr(B^2 - 4AC \geq 0) = \int \int \int f_{A,B,C}(A,B,C) \, dA \, dB \,dC$
$= \int \int \int f(A) f(B) f(C) \, dA \, dB \,dC$ ..... by independence
$= \int \int \int \, dA \, dB \,dC$ ..... since f is the Uniform p.d.f.

where the region of integration in all the triple integrals is the region where $0 \leq A \leq 1$, $0 \leq B \leq 1$, $0 \leq C \leq 1$, and $B^2 - 4AC \geq 0$.

If you can work out the integral (i.e., find the volume of the region), then you are done.

8. ## Embarrassed to ask but...

Originally Posted by awkward
.

where the region of integration in all the triple integrals is the region where $0 \leq A \leq 1$, $0 \leq B \leq 1$, $0 \leq C \leq 1$, and $B^2 - 4AC \geq 0$.
I am confused with the $B^2 - 4AC \geq 0$ part that you wrote.

I must be doing the wrong thing. If there A, B, and C are all the same, and given the pdf of a uniform distribution is

$f(x) = \frac{1}{b-a}$ for $a< x where 1 = 0 and a = 0, won't I just get a probability of one when integrating?? Where do I apply $B^2 - 4AC \geq 0$?

9. Originally Posted by MrJack1990
[snip]Where do I apply $B^2 - 4AC \geq 0$?
It's part of the set of conditions that are used to determine the integral limits. Read the last part of awkward's post again.