I have 2 input $X$ and $Y$ which are both positive integers. I have to maximize this function

Let $A=\min(Y/4,X/2)$ , $B=\min(W/2,Y/2)$, $C=\max(A,B)$, and $D=\max(X-W,Y)$.

Then $$ f(X,Y)=\max_{0\leq W\leq X} C\cdot C\cdot D $$

How can this problem be solved? Is it possible to determine whether this function will have a single global maximum or not?

  • $\begingroup$ W can vary from 0 to X . $\endgroup$ Apr 9 '13 at 21:14
  • $\begingroup$ @julien:W varies from 0 to X . $\endgroup$ Apr 9 '13 at 21:15
  • $\begingroup$ @julien:Real values. $\endgroup$ Apr 9 '13 at 21:26
  • $\begingroup$ So is my edit correct? $\endgroup$
    – Julien
    Apr 9 '13 at 21:28

The easy part is this: If $Y\ge 2X$, then $A=X/2$, $B=W/2$, $C=B=W/2$, $D=X-W$, hence $$f(X,Y)=\max_{0\le W\le X} \frac{W^2(X-W)}4=\left.\frac{W^2(X-W)}4\right|_{W=\frac23X}=\frac{X^3}{27}.$$ But if $X\le Y<2X$, you should try to find $$ f(X,Y)=\max\left\{\max_{0\le W\le Y/2}C^2D, \max_{Y/2< W\le X}C^2D\right\}$$ and the case $Y<X$ need still a bit more consideration.

  • $\begingroup$ is the function f(X,Y)monotonically increasing /decreasing for X<=Y<2X $\endgroup$ Apr 10 '13 at 13:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.