Probability that $f(x)=ax^2+bx+c$ has some root if $a,b,c$ are nonzero integers such that $-2k\le a,b,c\le 2k$?

81 Views Asked by At

I'm not looking necessarily for the exact probability, but an estimate. Lets call the exact probability P, leaving implicit the k dependacy.

So, I tried first for $k=50$, i.e., $a,b,c \in [-100,100]$ and my reasoning is as follows. $f(x)$ cuts the $X$ axis iff $b^2-4ac>0$ iff $b^2>4ac$.

That can happen if $ac<0$ for example, which happens precisely when $a>0$ and $c<0$ or $a<0$ and $c>0$. There are $100*200*100*2$ cases in which all this can happen.If then I divide by $200^3$, which is the total number of possible cases, I get $0.5$. So $P\ge 0.5$.

If I take the general case of $2k$, we have analougously that $P \ge \dfrac{k*2k*k*2}{(2k)^3}=0.5$

On the other hand, if we analise when $b^2\le 4ac$, this is equivalent to $(\dfrac{b}{2})^2\le ac$ which happens, for example, when $a,c\ge \dfrac{b}{2}$

So, back to the $k=50$ case

if $b=100$, then $b/2=50$, and $a,c$ can be $50,51,...,100$[$51^2$ choices]

if $b=99$, then $b/2=49.5$ and $a,c$ can be again $50,51,..,100$[$51^2$ choices].

if $b=98$, then $b/2=49$, and $a,c$ can be $49,50,...,100$[$52^2$ choices].

To sum up, there are $2(51^2+51^2+52^2+..+100^2)$ ways in which this can happen. Note that I'm not considering when b might be negative, which duplicates the number. So there are $2*2*\displaystyle \sum_{51}^{100}i^2$. Also, I'm not considering when a,c are both negative. For example, for b=100, a,c=-50,-51,...,-100 are useful, too. So there are in fact $2*2*2*\displaystyle \sum_{51}^{100}i^2=2363400$, which divided by $200^3$ is $0.295425$(lets leave it in $0.3$).So I get that $0.5\le P\le 0.7 $ Finally for the general case of $2k$, I get that the probability that $\dfrac{b}{2}\le ac$ is $\ge$ than $\dfrac{7}{24}+\dfrac{9}{48k}+\dfrac{1}{48k^2}$(used the same method). When k goes to infinity, we have just $\dfrac{7}{24}$ which is $0.29$...,i.e, approx $0.3$

So, in general, P is between 0.5 and 0.7, whatever k is.

Do you have better bounds?

1

There are 1 best solutions below

2
On

I made some experiments in Sagemath. Here is the code, that you can also try.

def q(k):     
   j = 0
   L = [choice(range(-k,k)) for i in range(3)]
   a,b,c=L[0],L[1],L[2]
   if b^2>4*a*c:
       j = j + 1
   return j

def prob(k,n):
    j = 0
    for i in range(n):
        j = j + q(k)
    return RR(j/n)

prob(100,1500000)
0.627494000000000

prob(200,15000000)
0.627154600000000

It seems that the probability is indepedent from $k$ and very close to $0.627.$ I don't have a formal proof.