Intersection of two quadratic equation

46 Views Asked by At

If the curves $$y=ax^2+bx+c$$ and $$y=px^2+qx+r$$ do not intersect each other and $a,b,c,p,q,r \in \{1,2,\dots,10\}$, then find the maximum value of $$(aq-bp)^2+(c-r)^2$$

2

There are 2 best solutions below

0
On

The answer is $9882$.

Proof: First, $|aq-bp|\le 99$ because $1\le aq,bp\le 100$. Also, $|c-r|\le 9$. Therefore, $(aq-bp)^2+(c-r)^2\le 99^2+9^2=9882$.

To prove $9882$ is achieved, set $a=10, b=1, c=10, p=1, q=10, r=1$. The curves $y=10x^2+x+10$ and $y=x^2+10x+1$ do not intersect, because the equation:

$$10x^2+x+10=x^2+10x+1$$

i.e.

$$9x^2-9x+9=0$$

has no real solutions (discriminant less than zero).

0
On

Brute force (Python):

max_a = 0
max_b = 0
max_c = 0
max_p = 0
max_q = 0
max_r = 0
max = -1

for a in range(1,11):
  for b in range(1,11):
    for c in range(1,11):
      for p in range(1,11):
        for q in range(1,11):
          for r in range(1,11):
            if (b-q)*(b-q) < 4*(a-p)*(c-r):
              cur = (a*q-b*p)*(a*q-b*p)+(c-r)*(c-r)
              if cur > max:
                max = cur
                max_a = a
                max_b = b
                max_c = c
                max_p = p
                max_q = q
                max_r = r

print('Max=', max, 'a=', max_a, 'b=', max_b, 'c=', max_c, 'p=', max_p, 'q=', max_q, 'r=', max_r)

This prints:

Max= 9882 a= 1 b= 10 c= 1 p= 10 q= 1 r= 10

So, the maximum is $9882$.