Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

1 Question 1 Description

First, we must explain the question


informally and generally: Maximize the product of some number of terms which adds up
to a given constant. In other words, for a given constant, find how many terms which add up
to that constant maximizes their product; then find that maximum product.
Qn Pn
Now, we do so formally and precisely: Maximize i=1 xi s.t i=1 xi = c for {x1 , . . . , xn , c}∈
Z.

Note that in the latter formulation we added the stipulation that each of the terms adding
to the integer constant and whose product we are maximizing are also integers.

2 Applying The Method of Lagrange Multipliers


2.1 Reviewing It
In order to maximize f (x1 , . . . , xn ) subject to the constraint g(x1 , . . . , xn ) = c, consider all
solutions (if any) to the following equations:

∇f (x1 , . . . , xn ) = λ∇g(x1 , . . . , xn ) (1)


0 = ∇g(x1 , . . . , xn ) (2)

for some non-zero scalar multiple λ.

2.2 Applying It
Qn
Pn we are maximizing f (x1 , . . . , xn ) = i=1 xi subject to the constraint g(x1 , . . . , xn ) =
Here
i=1 xi −c, so applying the method, the first equation in the system gives us
Q   
i̸=1 xi 1
.
.. .
∇f (x1 , . . . , xn ) =   = λ  ..  = λ∇g(x1 , . . . , xn ) =⇒
  
Q
j̸=n xi 1
Y Y
λ= xi = · · · = xi =⇒ x1 = · · · = xn .
i̸=1 i̸=n

This is our solution! Specifically, for any xi ∈ {x1 , . . . , xn ,}


c
x1 + · · · + xn = nxi = c =⇒ xi = (3)
n
 c n Yn 
=⇒ = max xi (4)
n i=1

. Equation two produces no alternative solutions since ∇g(x1 , . . . , xn ) = 1 ̸= 0.

3 Finding a general solution (for {x1, . . . , xn, c} ⊂ R)


So, we have found that in order to maximize the product of terms which add up to a constant,
each of those terms must be equal to each other. However, we must now find what n (the
exponent and the number of terms) maximizes the product. In other words, we can set the
following equation to find what n maximizes or minimizes the product:
d  c  n d cn
= =0
dn n dn nn
(5)

Now, using the quotient rule, and knowing the derivative of nn with respect to n (proven in the
appendix), we have

d (ln c)(cn )(nn ) − (cn )(nn )(ln n + 1) (cn )(nn )(ln c − ln n − 1)


= = =
dn n2n n2n
(cn )(ln c − ln n − 1)
= 0 =⇒ ln c − ln n − 1 = 0 =⇒ ln n = ln c − 1 =⇒
nn
c
=⇒ eln n = e(ln c)−1 =⇒ n = (6)
e
Pn
Substituting n into equation four, we conclude: for i=1 xi = c
n
Y  c
max xi = e e (7)
i=1

4 Finding solutions for {x1, . . . , xn, c} ⊂ Z


Given
Qthat we havePfound, by combining equations three and six, that the general solution to
n n
max i=1 xi s.t. i=1 xi = c is xi = e, an irrational number, we must now find a numerical
method to find the solution for {x1 , . . . , xn , c, n} ⊂ Z.

4.1 The Numerical Method


If xi = e, and we want to find a solution for xi ∈ Z, n ∈ N, then the closest approximation is
e ≈ 3 = xi and ec ≈ 3c = n.

To satisfy the latter constraint, we assume 3|c, but this is not always the case. Hence we
consider the following case: 3c ∈
/ N; in such a case we can round 3c down to the nearest natural
number using the floor function. Remember, the terms have to sum up to c, so we must fill the
gap created by rounding 3c down, but how so?

4.2 Case 1: c = 25
25 25 24
Initially
Pn we get 3 3 , but since 25 3
/ N, we must rewrite the product as 3⌊ 3 ⌋ = 3 3 = 38 . Since
,∈
i=1 xi = 25, so far we have 25 = 3(8) + xn = 24 + xn =⇒ xn = 1. For xn = 1, we have the
product equal to (38 )(1), so the 1 has no effect. Upon P closer inspection, though, one finds that
the product (37 )(22 ) which still satisfies the constraint ni=1 xi = 25 is greater than the original
answer of 38 . This can be attributed to the fact that the approximation e ≈ 3 results in room
for error, that is, answers which are very close to the true solution. More generally, we write:
Q  c
• For 3c ∈ N, {x1 , . . . , xn , } ∈ W, given that ni=1 xi = c, max n
P
i=1 i = (3 ).
x 3

Q 
⌊ 3c ⌋−1
• For c−1
Pn n
3
∈ N, {x1 , . . . , xn , } ∈ W, given that x
i=1 i = c, max i=1 i = (3
x )(22 ).
The reason that we actually further restricted {x1 , . . . , xn , c} not just to integers but to
natural numbers, is because for {x1 , . . . , xn , c} ∈ Z|{x1 , . . . , xn } ∈ (−∞, 0], c ∈ (−∞, 2]
there are actually no solutions (that is, no maximum product)! We will explore why this
is true in the final section, 4.4 Trivial Cases.

4.3 Case 2: c = 26
Finally, we must consider the case when c−2 3
∈ N, such as for n = 26. Using the same reasoning
8
as
Pn for the previous case, we get 3 , but we are missing one term to satisfy the constraint
i=1 xi = 26, specifically 26 = 3(8) + xn = 24 + xn =⇒ xn = 2. Hence our true solution is
8
(3 )(2). From this we get the last general case:
Q 
⌊ 3c ⌋
• For c−2
Pn n
3
∈ N, {x 1 , . . . , x n , } ∈ W, given that x
i=1 i = c, max i=1 i = (3
x )(2).

4.4 Trivial Cases


Q 
n
First we have to prove why ∄ max i=1 xi for {x1 , . . . , xn } ∈ Z|{x1 , . . . , xn } ∈ (−∞, 0),c ∈
(−∞, 2] that is, for {x1 , . . . , xn , c} ∈
/ W.
Q 
n Pn
If, for example, max i=1 i = 38 for
x i=1 xi = 24, then we cannot let any term a = xj < 0
for then 38 (a)t (−a)t is also a solution ∀t ∵ ni=1 xi = 3(8) + at − at = 3(8) = 24. In fact,
P
while limx→∞ (38 + at − at) = 24, limx→∞ |38 (a)t (−a)t | = ∞. Hence in order to eliminate this
possibility, we must restrict all xi s.t. xi > 0.

Finally, we must consider when c ∈ Z|c ∈ (−∞, 2], failing to satisfy the outlined conditions:
c c−1 c−2
3
, 3 , 3 ∈ N.

For c ∈ Z|c ∈ (−∞, 0), there are no solutions for xi > 0. However, if we forget about this
restriction, then the following cases emerge:

• If ∈
Q
c
Z (meaning
6  if c is an even multiple of 3),
n −c
max i=1 xi = (−3)
3 .

• If ∈
Q
c
Z, 6c ∈
3
/Z (meaning if c is an odd multiple of 3),
n ⌊ −c ⌋−1
max i=1 xi = (−3)
3 (−2)(−1).

• If c+1
∈ Z, 2c ∈
3  Z (meaning if c is an even integer one less than a multiple of 3),
Qn −c
⌊ 3 ⌋−1
max i=1 xi = (−3) (−2)2 .

• If c+1
∈ Z, 
3
c
2

/ Z (meaning if c is an odd integer one less than a multiple of 3),
⌊ −c
Qn ⌋−1
max i=1 xi = (−3)
3 (−2)(−1)2 .

• If c+2 c
∈ Z, 2
3
∈ Z (meaning if c
3
is an even integer two less than a multiple of 3),
⌊ −c
Qn ⌋ 2
max i=1 xi = (−3)
3 (−1) .

• If c+2
∈ Z, 
3
c
2

/ Z (meaning if c
3
is an odd integer two less than a multiple of 3),
⌊ −c
Qn ⌋
max i=1 xi = (−3)
3 (−2).
Pn Q 
n
For x i = 0, max i=1 i = 0, where xi = 0. If we hadn’t restricted xi > 0 then
x
i=1
Qn 
n n
∄ max i=1 xi = (a )(−a )∀a ∈ Z.
Q  Q 
For ni=1 xi = 1, max n n
P
i=1 x i = 1, where x i = 1. If we hadn’t restricted x i > 0 max i=1 x i =
1 = (1)n (−1)n−1 ∀n ∈ Z. In order to set the exponent of (−1) to 0, we let n = 1, which gives
us our only term and maximum product, 1, as aforementioned.
Pn Q 
n
For x
i=1 i = 2, max i=1 i = 2. We know 2 is the only term (and maximum) since
x
2 > 12 > (12 )(0)n ∀n ∈ Z. Again, here we restrict xi > 0.

And we are done!

5 Appendix: The derivative of xx


Let y = xx
1 dy dy
y = xx =⇒ ln y = ln xx =⇒ ln y = x ln x =⇒ = ln x + 1 =⇒ = y ln x + y =⇒
y dx dx
Substituting y = xx , we arrive at
dy
= (ln x)xx + xx = xx (ln x + 1) (8)
dx

You might also like