How to maximize f(x,y)=(x+y-2)/(xy) where x,y in {1,2,…,n}? It seems that maximum will occur when (x,y)=(1,n) or (n,1).

Sasha Hess

Sasha Hess

Answered question

2022-09-12

How to maximize f ( x , y ) = x + y 2 x y ?
How to maximize f ( x , y ) = x + y 2 x y where x , y { 1 , 2 , , n }?
It seems that maximum will occur when ( x , y ) = ( 1 , n ) or ( n , 1 ) .

Answer & Explanation

darkflamexivcr

darkflamexivcr

Beginner2022-09-13Added 14 answers

Note that f ( 1 , 1 ) = 0 and f ( 1 , 2 ) = f ( 2 , 1 ) = 1 2
Otherwise,
f ( x , y ) = x + y 2 x y = 1 y + 1 x 2 x y = 1 y ( 1 1 x ) + 1 x ( 1 1 y ) 1 2 ( 1 1 x ) + 1 2 ( 1 1 y ) 1 1 n
Note that
f ( 1 , n ) = 1 1 n
Thus the maximum is 1 1 n which is achieved at ( 1 , n ).
Konciljev56

Konciljev56

Beginner2022-09-14Added 2 answers

Let M be a maximal value.
Thus,
M x y x y + 2 0 ,
which is a linear inequality of x and of y, which says that it's enough to check this inequality for the extreme values of x and y:
( x . y ) { ( 1 , 1 ) , ( n , n ) , ( 1 , n ) , ( n , 1 ) } ,
which gives
M { 0 , 2 ( n 1 ) n 2 , n 1 n } ,
which gives that n 1 n is a maximal value.

Do you have a similar question?

Recalculate according to your conditions!

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?