Serving the Quantitative Finance Community

 
User avatar
submarine
Topic Author
Posts: 0
Joined: December 20th, 2005, 3:20 pm

probability of a quadratic function has two real roots?

December 21st, 2005, 9:12 pm

What’s the probability that a quadratic function has two real roots? how can we get this?
 
User avatar
TraderJoe
Posts: 1
Joined: February 1st, 2005, 11:21 pm

probability of a quadratic function has two real roots?

December 21st, 2005, 10:21 pm

1/4? Assuming there is symmetry in quadratic equations, the solution sample space = {(R, R), (R,I), (I,R), (I,I)}, where R = Real and I = Imaginary.Wild guess.
Last edited by TraderJoe on December 20th, 2005, 11:00 pm, edited 1 time in total.
 
User avatar
needaclue
Posts: 0
Joined: September 22nd, 2005, 8:00 pm

probability of a quadratic function has two real roots?

December 22nd, 2005, 1:41 am

QuoteOriginally posted by: submarineWhat’s the probability that a quadratic function has two real roots? how can we get this?If one is talking about quadratic equations with real coefficients, then if there is one complex root, the other is also complex (its conjugate). Therefore (R,I) and (I,R) are not possible.This problem doesn't have a symmetry or a unique solution. It is a matter of sampling i.e. how one chooses the quadratic coefficients from the space of real numbers.For example, one solution could be as follows:Any quadratic equation requires two numbers to be specified: x^2 + u.x + v = 0 where u, v have to be sampled from some space using some probability measure. Suppose I choose u, v uniformly (and independently) from the interval -L : L where L is very large. Then, the discriminant D = u^2 - 4v is most likely going to be positive because u^2 would in general be larger than 4v. This would mean a low probability of imaginary roots. On integrating I get that when L is > 4, the probability of having imaginary roots = . Obviously if L -> infinity, the probabiltiy of imaginary roots goes to 0.
 
User avatar
thomssi
Posts: 2
Joined: August 25th, 2005, 2:45 am

probability of a quadratic function has two real roots?

December 22nd, 2005, 3:18 am

QuoteOriginally posted by: needaclueQuoteOriginally posted by: submarineWhat’s the probability that a quadratic function has two real roots? how can we get this?If one is talking about quadratic equations with real coefficients, then if there is one complex root, the other is also complex (its conjugate). Therefore (R,I) and (I,R) are not possible.This problem doesn't have a symmetry or a unique solution. It is a matter of sampling i.e. how one chooses the quadratic coefficients from the space of real numbers.For example, one solution could be as follows:Any quadratic equation requires two numbers to be specified: x^2 + u.x + v = 0 where u, v have to be sampled from some space using some probability measure. Suppose I choose u, v uniformly (and independently) from the interval -L : L where L is very large. Then, the discriminant D = u^2 - 4v is most likely going to be positive because u^2 would in general be larger than 4v. This would mean a low probability of imaginary roots. On integrating I get that when L is > 4, the probability of having imaginary roots = . Obviously if L -> infinity, the probabiltiy of imaginary roots goes to 0.Assuming we have integer number co-efficients I think the above simplifies a bit in terms of defining the quadratic.If we define as a.x^2 + b.x + c = 0 which is the equivalent to the above but with u=b/a and v= c/a.On this basis for real roots b^2 >4ac.The probability of ac being -ve is 50% in which case the above is always true. If ac is +ve then I think the probability is 25% (this is intuitive at the moment). Overall therefore probability is 50% + 50% x 25% = 62.5%.I have assumed a flat probability distribution. Using excel to test this I got marginally higher - around 62.7%.
Last edited by thomssi on December 21st, 2005, 11:00 pm, edited 1 time in total.
 
User avatar
alexandreC
Posts: 0
Joined: June 9th, 2004, 11:35 pm

probability of a quadratic function has two real roots?

December 22nd, 2005, 9:50 am

One would have to define a probability density in the infinit set of real numbers in order to answer this question.Or else, to limit the 3 dimensional space defined by the 3 quotients of the quadratic equation,and consider a uniform distribution in that space.But there are different ways of diffining the boundaries, with no obvious canonical way(for ex, we can consider a sphere, or a cube, etc, and they would lead to different probabilities.)After that, you want to send the boundaries to infinity, in some "regular" way, and the probabilities should then agree.In any case (and because a 2-d surface has zero 3-d volume)the probability of ending up with a quadratic solution with one root only would be zero.Is this desirable for the probem you are trying to solve?A
Last edited by alexandreC on December 21st, 2005, 11:00 pm, edited 1 time in total.
 
User avatar
Athletico
Posts: 14
Joined: January 7th, 2002, 4:17 pm

probability of a quadratic function has two real roots?

December 22nd, 2005, 3:05 pm

assume a quadratic equation of the form a x^2 + b x + c = 0assume a, b and c are uniformly distributed over a large cube w/sides [-R, +R] and we'll take the limit as R -> Inf.clearly if the sign of a and c are opposite then there will be 2 real solutions with probability 1. no matter how we take limits, it's safe to say this will happen half the time, so we only need to compute 1 integral, when a and c have the same sign.i'll skip the details of the integral and just report the answer, the total probability of two real roots isEDIT: correction, the integral for the same sign case is: 1/2 + 1/2*(5/36 + Log(2)/6) ≈ 0.62720671
Last edited by Athletico on December 21st, 2005, 11:00 pm, edited 1 time in total.
 
User avatar
needaclue
Posts: 0
Joined: September 22nd, 2005, 8:00 pm

probability of a quadratic function has two real roots?

December 22nd, 2005, 8:13 pm

there is no reason to define a quadratic equation as ax^2+bx+c = 0 even though standard high school textbooks do that. one of the three constants is wholly redundant and can be replaced by 1.If one is happy with such redundancy, then why not go ahead and introduce a "d" as:ax^2 + bx + c + d = 0 orax^2 + bx + c + d^100 = 0 !nothing stops one from having literally hundreds of constants in the equation.therefore i think it makes sense to just divide by "a" and just use x^2 + u.x + v = 0Two constants is the minimal requirement to define the equation and is still absolutely general i.e. it includes all possible equations. But even here one can play around. I didn't need to divide by "a" - I could have divided by "b" to get:u.x^2 + x + v = 0Now the discriminant is D = 1 - 4uv and if we sample u, v uniformly from a large space, it will almost always be < 0 if both have the same sign, giving a 50% probability of complex roots in the limit where the sample space is over R.
Last edited by needaclue on December 21st, 2005, 11:00 pm, edited 1 time in total.
 
User avatar
Paul
Posts: 7057
Joined: July 20th, 2001, 3:28 pm

probability of a quadratic function has two real roots?

December 22nd, 2005, 8:52 pm

Very nice! a and c uniformly distributed, between 0 and 1, say, then x=a/c has probability density functionandP
 
User avatar
Athletico
Posts: 14
Joined: January 7th, 2002, 4:17 pm

probability of a quadratic function has two real roots?

December 22nd, 2005, 9:01 pm

>> there is no reason to define a quadratic equation as ax^2+bx+c = 0 even though standard high school textbooks do that. >> one of the three constants is wholly redundant and can be replaced by 1.this is true, but if you replace the leading coefficient with 1 and assume the other two are uniformly distributed, you're solving a different problem.with a leading 1 on the x^2 term, x^2 + b x + c = 0, the probability of 2 real roots goes to 1 in the limit, with b and c drawn from a uniformly distributed square centered at the origin.if you generalize the problem to allow all three constants, a b and c, to be drawn independently from a uniform distribution centered at the origin, you get another answer, the 62.7% i calculated. and as you said, dividing through by b (leaving u=a/b and v=c/b constants) gives a 50% answer.because of the way the problem was originally phrased (no special form for "quadratic function" as specified) i prefer the more general ax^2 + bx + c interpretation.IMO this problem is interesting in the way the Buffon Needle problem is interesting: different answers depending on seemingly harmless differences in interpretation.
 
User avatar
Paul
Posts: 7057
Joined: July 20th, 2001, 3:28 pm

probability of a quadratic function has two real roots?

December 22nd, 2005, 9:08 pm

I very much agree with Athletico about the 'harmless' assumption/simplification!submarine, what inspired this question? P
 
User avatar
needaclue
Posts: 0
Joined: September 22nd, 2005, 8:00 pm

probability of a quadratic function has two real roots?

December 22nd, 2005, 10:00 pm

QuoteOriginally posted by: Athleticobecause of the way the problem was originally phrased (no special form for "quadratic function" as specified) i prefer the more general ax^2 + bx + c interpretation.without making a big deal about it, i just don't see why ax^2+bx+c is more general. it is merely redundant because only two constants are needed to describe all possible quadratic equations.
 
User avatar
needaclue
Posts: 0
Joined: September 22nd, 2005, 8:00 pm

probability of a quadratic function has two real roots?

December 22nd, 2005, 10:15 pm

There is yet another way of looking at this problem, which seemed kind of neat to me. We can look directly at the factorized form of the equation:(x - r1)(x - r2) = 0 where r1, r2 are the roots.Now for every possible pair of real roots (r1,r2) there is exactly one pair of complex roots (r1+i.r2,r1-i.r2).So if we work in a measure where roots are directly chosen uniformly from in order to define the equation, then there is an exactly 50% probability each of having real or complex roots.
Last edited by needaclue on December 21st, 2005, 11:00 pm, edited 1 time in total.
 
User avatar
vplanas
Posts: 0
Joined: October 6th, 2004, 4:53 am

probability of a quadratic function has two real roots?

December 27th, 2005, 2:10 pm

For every different parametrization of the smaple space, (a x^2 + bx + c=0, or (x^2+bX+c=0), or thelast form that needaclue suggested, the fact that keeping the "same" probability distribution for the parameter that appear in the representation is giving us different probability spaces, an hence different result about the probability of a subset (in this case, the subset of equations with real roots). This is because the mapings between all this representation, even if they are bijections, they are not linear mappings.As Athletico pointed out, this is the same apparent "paradox" as the Buffon nedle problem.Now we cam make an aesthetical-based choice, for instance, that the probability is invariant if we take coefficients uniformely distributed from -\alpha to +\alpha, for any value of \alpha. (sort of scale invariance), and that representation is ax^2+bx+c=0. (a guess)
 
User avatar
Athletico
Posts: 14
Joined: January 7th, 2002, 4:17 pm

probability of a quadratic function has two real roots?

December 27th, 2005, 5:29 pm

Now we cam make an aesthetical-based choice, for instance, that the probability is invariant if we take coefficients uniformely distributed from -\alpha to +\alpha, for any value of \alpha. (sort of scale invariance), and that representation is ax^2+bx+c=0. (a guess) You're right - this is true.The derivation in my previous post took the limit as alpha -> Inf, but this isn't necessary. Alpha cancels out; you do get scale invariance with the ax^2 + bx + c = 0 representation. Quick demo in matlab:>> alpha = 100;>> a = -alpha + 2*alpha*rand(1000000, 1);>> b = -alpha + 2*alpha*rand(1000000, 1);>> c = -alpha + 2*alpha*rand(1000000, 1);>> mean(b.*b - 4.*a.*c >= 0)you'll get an ans of about 62.7% no matter what alpha you use.... it is merely redundant because only two constants are needed to describe all possible quadratic equations.I disagree -- x^2 + bx + c = 0 is a projection of all possible quadratic equations; it can't describe them all (what if the x^2 term is absent?) By this logic how many constants would be needed to describe all linear equations?
 
User avatar
vplanas
Posts: 0
Joined: October 6th, 2004, 4:53 am

probability of a quadratic function has two real roots?

December 27th, 2005, 7:20 pm

Quote... it is merely redundant because only two constants are needed to describe all possible quadratic equations.I disagree -- x^2 + bx + c = 0 is a projection of all possible quadratic equations; it can't describe them all (what if the x^2 term is absent?) By this logic how many constants would be needed to describe all linear equations?True, but the set of equations with a=0 (proper quadratic term absent) is a subset with Lebesgue measure zero in the probability distribution we are discussing.You need three constants to describe all the quadratic equations, you only need two constants to characterize roots of quadratic equations. (plus a singleton to characterize all the imaginary roots.