Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I was wondering if it's possible to prove the following statement.

Lets say we have a value K. I want to find the value where

A+B = K (both A,B,K are integers)

where A*B is the highest possible value.

I've found out that it's:

a = K/2; b = K/2; when K is even

a = (K-1)/2; b = ((K-1)/2)+1; when K is odd.

But is there a way to prove this.

share|improve this question
    
I think $n=K$ is an integer and also you seem to want $A,B$ to be integers. If these guesses are right, you should edit the question to make these clear. –  Dinesh Feb 6 '11 at 8:55
    
Thanks dinesh, I've changed it. –  Timo Willemsen Feb 6 '11 at 8:57

2 Answers 2

up vote 3 down vote accepted

In the even case, assuming $A\leq B$, the numbers will be of the form $A=\frac{K}{2}-m$ and $B=\frac{K}{2}+m$ in order to get $A+B=K$, with $m=0,1,\ldots,\frac{K}{2}$. Then multiplying gives $AB=\left(\frac{K}{2}\right)^2 - m^2 \leq \left(\frac{K}{2}\right)^2$.

In the odd case, you'll have $A=\frac{K}{2}-m-\frac{1}{2}$ and $B=\frac{K}{2}+m+\frac{1}{2}$, with $m=0,1,\ldots,\frac{K-1}{2}$. Multiplying gives

$\begin{align*} AB &= \left(\frac{K}{2}\right)^2 - \left(m+\frac{1}{2}\right)^2 = \frac{K^2}{4} - m^2 - m - \frac{1}{4} \\ & = \frac{K-1}{2}\left(\frac{K-1}{2}+1\right) - m^2 - m \leq \frac{K-1}{2}\left(\frac{K-1}{2}+1\right). \end{align*}$

Alternatively, you can think of optimizing a quadratic function by finding the vertex. If you write $AB$ as a quadratic function of $A$ or $B$ alone using the constraint $A+B=K$ (as indicated in PEV's answer), then the closest integer to the vertex will solve your problem because the parabola opens down.

share|improve this answer

We know that $B = K-A$. So you want to maximize $AB = A(K-A)$. So we have:

$$AB = A(K-A)$$

$$ = AK-A^2$$

Find the critical points and use some derivative tests.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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