Maximum value of the fraction

272 Views Asked by At

I have a expression say $E$ and a set $N$ consists of ordered pairs of values. $E=(X-a)/(Y-b)$ .Here $a,b$ is ordered pair taken from $N$. Given the values of $X, Y$ and $N $ and i want to find the maximum value of E.

Ex. $X=5$ , $Y=6$ , $N=\{(2,2),(2,3),(3,5)\}$

$E=max((5-2)/(6-2),(5-2)/(6-3),(5-3)/(6-5))$

$E=max(3/4,3/3,2/1)$

$E=2$ . I know that keeping every pair and checking will give answer but i want to know that can we infer anything about maximum value of E from ordered pairs directly (without substitution $a,b$)

1

There are 1 best solutions below

2
On

Assuming positive values for $E$ we can simplify the problem by deleting obvious non solution pairs.

Note that $E=(X-a)/(Y-b)$ is maximized when we pick the smallest $a$ and the largest $b$ in our set.

If there is such a pair in our set $N$, then our answer is that pair.

If such a pair does not exist we can eliminate the pairs which are not candidates for max and try the ones which are candidates.

For example in you problem the pair $(2,2)$ is out because while it has the smallest $a$, there is a pair $(2,3)$ with the same $a$ and larger $b$