# Probability of a quadratic equation to have a solution

• Jan 20th 2011, 03:05 AM
dely84
Probability of a quadratic equation to have a solution
Hi,

Let ksi, eta and dzeta to be iid rv ~ Uniform(0,1). What is the probability that the equation: ksi*x^2 + eta*x + dzeta = 0, to have a real solution i.e. D>=0. I got that I need to specify the limits of the tripple integral I have to solve for finding this probability... The point is that I don't know how to solve: (eta^2)/4>=ksi*dzeta. The outer integral would be from 0 to 1, but what about the inner two?

Some help will be much appreciated. Thanks.
• Jan 20th 2011, 11:08 PM
matheagle
This is just a nasty calc problem.
You want to integrate the density of 1, over the region

$y^2>4xz$ but only in the unit cube.

The best way to start is to find the boundary, when $y^2=4xz$

and then try to make sense of your region, or the complementary region.
• Jan 21st 2011, 12:09 AM
CaptainBlack
Quote:

Originally Posted by dely84
Hi,

Let ksi, eta and dzeta to be iid rv ~ Uniform(0,1). What is the probability that the equation: ksi*x^2 + eta*x + dzeta = 0, to have a real solution i.e. D>=0. I got that I need to specify the limits of the tripple integral I have to solve for finding this probability... The point is that I don't know how to solve: (eta^2)/4>=ksi*dzeta. The outer integral would be from 0 to 1, but what about the inner two?

Some help will be much appreciated. Thanks.

This is quite a nice problem for demonstrating hit-and-miss Monte-Carlo. We generate a large sample of points in the unit cube count number of cases where discriminant is positive and divide by the sample size.

Code:

>NN=10000000;      ..sample size > >xx=random(3,NN);  ..sample of size NN of coefficients > >pp=sum(xx(1,: )^2>4*xx(2,: )*xx(3,: ))/NN ..count the positive disc and divide by sample size     0.254644 > > >SE=sqrt((NN*pp*(1-pp)))/NN  ..approx standard error of the estimate     0.000137768 >
So the required probability is ~=0.255 or 25.5%

CB
• Jan 21st 2011, 04:15 PM
dely84
Quote:

Originally Posted by matheagle
This is just a nasty calc problem.
You want to integrate the density of 1, over the region

$y^2>4xz$ but only in the unit cube.

The best way to start is to find the boundary, when $y^2=4xz$

and then try to make sense of your region, or the complementary region.

Hi,
Yeah, that is exactly the issue. I am not sure how to do that. Could you please elaborate on how to define the boundaries of the integration over the triple integral. I could solve it just if new how to setup the last boundary.
• Jan 22nd 2011, 09:16 AM
Guy
There's actually another route you can go with this. You can make use of the following fact:

If X ~ uniform[0, 1] then -log(X) ~ exponential(1).

After an annoying amount of calculus and some standard results from distribution theory, the answer I get is:

$\displaystyle
\frac{3\log 4 + 5}{36} \approx 0.2544
$
• Jan 22nd 2011, 01:31 PM
dely84
Quote:

Originally Posted by Guy
There's actually another route you can go with this. You can make use of the following fact:

If X ~ uniform[0, 1] then -log(X) ~ exponential(1).

After an annoying amount of calculus and some standard results from distribution theory, the answer I get is:

$\displaystyle
\frac{3\log 4 + 5}{36} \approx 0.2544
$

Hi, Thanks for the answer. Could you please show the steps for this transformation. I need to see how to form the integral. If you could post it and I will sove it for me.
• Jan 22nd 2011, 02:21 PM
Guy
Quote:

Originally Posted by dely84
Hi, Thanks for the answer. Could you please show the steps for this transformation. I need to see how to form the integral. If you could post it and I will sove it for me.

Well, if x, y, z ~ iid uniform[0, 1] then

$\displaystyle
P(y^2 \ge 4xy) = P(-2\log y \le - \log x - \log y - \log 4).
$

Now, -2log(y) ~ exponential(2) [I'm going to use the scale parametrizations of the exponential and gamma], and because x and z are independent, -log(x) - log(z) is the sum of two independent exponential(1) random variables, and so is distributed gamma(2, 1). So, if A ~ exponential(2) and B ~ gamma(2, 1) with A independent of B you want to calculate

$
P(A \le B - \log(4)) = P(A \le B - \log(4) \cap B \ge \log(4)).
$

It should be obvious now how to proceed. If you don't know from class the result about -log(x) giving an exponential, it is really very easy to show using the so-called distribution function method:

$
P(-\log (X) \le x) = P(X \ge e^{-x}) = 1 - e^{-x}
$

which is the cdf of an exponential random variable.