12

Let me explain my deal. We can split any positive number into addends, and then we can take those addends and use them now as factors. The product will be maximum if all addends were equal.

E.g., the number 10 can be split apart as 9 + 1, or 8 + 2... Many ways. However, if we split it as 5 + 5, the product (5 * 5 = 25) will be the greatest of all possible products.

I am very grateful to the person who finally explained it to me in case of just two addends.

Suppose we have a number a (it's a parameter, or a "known unknown"). We can split it into two addends in multiple ways. Let's denote the first addend as x. Then, the second addend would be a – x. After that, we take our two addends and use them as factors. So the resulting function will be as follows:

y = x * (a – x) = ax – x².

We now take the first derivative:

y' = (ax – x²)' = a – 2x.

Now, a – 2x must equal zero.

a – 2x = 0;

a = 2x;

x = a/2 — we got the first addend. The second addend will equal a – a/2 = a/2. Thus, they are equal to each other.

[In fact, afterwards we should take the second derivative as well, in order to make sure that we found the point of maximum rather than minimum.

y'' = (ax – x²)'' = (a – 2x)' = –2.

The second derivative is a negative constant. Hence, x = a/2 is indeed the point of maximum.]

However, the problem is that I got the proof for two addends. But what if they are more? (Three, four, and so on.)

I am afraid we may obtain a function of two or more variables. Deriving such functions was never pleasurable for me. I am certainly not good at it...

So is there maybe a simpler way to prove it?

Alexander
  • 325
  • 4
    Your question is essentially "prove that there is equality in the AM-GM inequality iff all terms are equal". You may find that this phrasing helps you find more discussion of this on this site and the internet! See eg this, this, this, this. – Izaak van Dongen Oct 16 '23 at 21:07
  • 1
    You specify that $a$ must be positive, but you forgot to speficy that the addends must be positive too! Without this, it fails: for any $x$ we have $a=a+2x-x-x$, but the product of these four addends is $2ax^3$, which we can make as large as we like. – TonyK Oct 18 '23 at 20:13

3 Answers3

24

The idea of changing two terms in order to keep the sum the same while increasing the product is an instance of a general technique called smoothing. This idea was attempted in lulu's post, but the specific smoothing used there (replace by two copies of the average) fails to prove the desired AM-GM inequality without requiring significant real analysis (which is technically more demanding than the desired theorem), because repeating this process generally does not lead to the case where all the terms are equal. You need to somehow reach that case from where you start, in order to conclude that the all-equal case is indeed the maximum.

It turns out that there is a way to do smoothing that actually succeeds in reaching the all-equal case. This way is presented quite clearly in the linked wikipedia page (under the section "Proof by successive replacement of elements"). The idea is to not replace by two copies of the average of the two terms, but to replace by the average of all the terms and whatever is left. In case the wikipedia link gets broken, here is the key insight:

Let $m$ be the average of all the terms. If there are two terms $x,y$ such that $x < m < y$, then replace them by $m,x+y-m$, which preserves the sum but changes the product by $m·(x+y-m)-x·y = (m-x)·(y-m) > 0$ and increases the number of copies of $m$. So you can only do this at most $n$ times where $n$ is the number of terms. When you cannot do this anymore, there are no such $x,y$, so either all are at least $m$ or all are at most $m$. In both cases, they must be all equal to $m$ (since $m$ is their average).

I note that this argument is presented in some form by bof and Saikat on the 3rd Math SE thread linked by Izaak van Dongen, but not very clearly. So I prefer mine or wikipedia's instead. Also, the technique of smoothing is really useful but not mentioned at all there or on wikipedia. Here are some examples of its power:

  1. Maximizing an expression using brackets
  2. Cyclic Polygon Maximum Area & Isoperimetric Polygon Maximum Area [this one does use real analysis]
user21820
  • 57,693
  • 9
  • 98
  • 256
  • 1
    The original statement is wrong unless one adds the condition that all summand be positive (or at least non-negative and a positive). To see where the proof fails otherwise, note that where it says that the product changes by $(m-x)(y-m)$, it really changes by that value times the product of all of the summands except x,y, so it is important that that product is positive. – Carsten S Oct 17 '23 at 17:19
  • 1
    @CarstenS: Yes thank you for pointing it out. I totally missed the ambiguity in the phrase "split any positive number into addends"... And your comment specifying exactly where in the proof that condition is required is also great for students! So thanks again! =) – user21820 Oct 18 '23 at 03:39
  • This is unnecessarily complicated: simply considering two unequal terms is enough to establish the equality of all terms, by contradiction. See my answer. – TonyK Oct 18 '23 at 20:22
  • @TonyK: You are absolutely wrong. I have adequately explained the reason why, and lulu also understands it. If you do not have a compactness argument, you are simply wrong, full-stop. – user21820 Oct 19 '23 at 04:44
  • Look at the question again: "How can we prove that in order to the product to be maximum, the addends must be equal?" My post shows that if the product is maximum, the addends must be equal. Right? – TonyK Oct 19 '23 at 12:57
  • @TonyK: Look again. The question which you quoted is ungrammatical. This shows that the asker is not able to phrase the question in the correct manner. Obscuring the mathematics just because the asker did not ask exactly the correct question is bad pedagogy. – user21820 Oct 19 '23 at 13:29
  • @user21820: Now you are simply being offensive to the OP. They made a slight slip $-$ "in order to" instead of "in order for" $-$ perhaps because English is not their native language. Do you really think that changes anything? – TonyK Oct 19 '23 at 13:40
  • @‍TonyK: I'm not being offensive; imprecision is always a huge problem in mathematical pedagogy. The asker clearly wants to know how to prove the AM-GM inequality, not the version he/she stated. Nearly everyone here (the asker, me, lulu, Carsten S, and at least 2 other people who upvoted my comment on lulu's post) knows that. Nothing you say will change that intended question. Without my comments and answer, hundreds if not thousands of beginner students will be misled by yours. So please, stop disturbing me.. – user21820 Oct 19 '23 at 15:22
  • 1
    @user21820: If you want to convince someone that their answer is incorrect or imprecise, then do you really think that telling them they are "absolutely wrong" in boldface is the right way to do this? Regardless of your intention, your comments do come across as angry and unfriendly. Nobody appreciates being spoken to in this way. – Joe Oct 20 '23 at 13:49
  • @‍Joe: I am tired of all these excuses for pedagogical nonsense. Please stop. – user21820 Oct 20 '23 at 13:59
  • @user21820: I’m not making excuses for anything. On the contrary, I am suggesting that if you word your comments more softly, then people are less likely to dig their heels in when you criticise their answer. This would actually reduce the amount of “pedagogical nonsense” that you speak of. – Joe Oct 20 '23 at 23:51
  • @‍Joe: This is not the first time for such blatant mathematical misguidance that is just left around by all other thousands of viewers. Look, if you cannot handle harsh truths, then just don't go around disturbing others. Spend your time and energy in actually putting out your "soft words", and solidifying your own mathematical understanding. – user21820 Oct 21 '23 at 04:59
18

Consider $N=2x$. We have $N=x+x$ of course, or $N=(x+\lambda)+(x-\lambda)$ for any $\lambda$. But if you multiply those two terms you'd get $x^2-\lambda^2$ which is maximized when $\lambda=0$

That handles the case of more summands as well. If your list of $k$ summands had two unequal terms, then you could replace them by their average and thereby increase the product.

Note: as remarked in the comments, for more than two summands, this argument is incomplete. it certainly shows that the "all equal" case is a local maximum and that no point where the values are unequal could be a maximum, but a priori it could be the case that there is no global maximum. That can be fixed with some real analysis, but at the moment I don't see an elementary way to do that (which doesn't mean that there isn't one).

lulu
  • 70,402
  • 1
    This is a wrong answer. It shows that you can increase the product if not all are equal but never shows that the maximum is attained when ALL are equal. – user21820 Oct 17 '23 at 12:01
  • @user21820 it is fairly obvious that there is a maximum (the set consisting of $n$ real,non-negative, numbers that sums to a fixed value is compact). I say "fairly" only because that argument does require a little analysis, while the rest of the argument avoids it. – lulu Oct 17 '23 at 12:03
  • 6
    How can you say "fairly obvious" when the asker here definitely know absolutely nothing about compactness? I know that argument too, but it's pedagogically terrible to present your post in this manner when you know the asker cannot possibly fill in the gap. – user21820 Oct 17 '23 at 12:07
  • 1
    Thanks for fixing your answer! Do you want me to post an answer giving the 100% elementary way (without using real analysis)? – user21820 Oct 17 '23 at 12:32
  • 2
    @user21820 oh, of course you should post that. Absolutely. – lulu Oct 17 '23 at 12:52
  • 1
    I've just done that! – user21820 Oct 17 '23 at 13:04
  • 2
    @user21820 Saw it. Thanks! (+1) – lulu Oct 17 '23 at 13:09
  • You could probably use the derivative to show that for any pair of summands $x < y$, $x + \epsilon$ and $y - \epsilon$ have a larger product than $xy$ (as long as $\epsilon < (y - x)/2$). Then you could construct a sequence of pairwise replacements on any set of summands that ends up with all summands being the same, showing that "all summands the same" is indeed a global maximum. This is complex, but elementary. – MartianInvader Oct 17 '23 at 23:00
0

Let's take the case of two summands as given (as suggested in the original post, and as confirmed in lulu's answer). Then the general case follows easily:

Suppose we are given $a>0$, and we have a finite set of positive addends: $$a=x_1+x_2+\cdots+a_n$$ with the product $a_1a_2\ldots x_n=P$, say.

Suppose that these addends are not all equal. Then there exist two addends $x_i,x_j$ with $x_i\ne x_j$. But now see what happens if we replace $x_i$ and $x_j$ with two copies of $\frac12(x_i+x_j)$: this leaves the sum unchanged, but it increases the product, just as in the case of two addends. So $P$ is not a maximum.

Hence if we want $P$ to be a maximum, we must choose all the addends to be equal.

TonyK
  • 64,559
  • 1
    This answer is wrong. You have shown that if they are not all equal then you can increase the product. But you have not shown that if they are all equal then the product is the (global) maximum. – user21820 Oct 19 '23 at 04:50
  • @user21820: They are the same thing, once you note that the product is bounded above (by $P^n$, for instance), and that therefore a least upper bound exists. – TonyK Oct 19 '23 at 11:06
  • That's still wrong. Firstly, you don't mean $P^n$ but rather $a^n$ where $a$ is the total sum. Secondly, existence of a least upper bound of a subset of ℝ does not imply that it is in that subset! And proving (rigorously) that it is in fact the case for this question is much more difficult than the elementary solution that I and wikipedia have presented! – user21820 Oct 19 '23 at 12:02
  • 1
    Yes, you are right about $P^n$. But I wish you would stop shouting! – TonyK Oct 19 '23 at 12:11
  • I'm not shouting. Please delete your post that adds nothing to this thread (because it was already attempted in vain by lulu who corrected his/her post after I pointed out the same exact error that you made). – user21820 Oct 19 '23 at 12:12
  • 1
    @user21820: Why are you so angry? – TonyK Oct 19 '23 at 12:37
  • I'm not angry. Why do you want to clutter this thread? – user21820 Oct 19 '23 at 12:40
  • @user21820: I have edited the last two sentences to make it quite clear why my asnwer is correct. – TonyK Oct 19 '23 at 13:00
  • Your answer is at best downright misleading. I give up. – user21820 Oct 19 '23 at 13:26
  • 1
    @TonyK I think you implicitly use the continuity of product here to reach the conclusion, which is an understandable oversight.

    Let $P: [0,\infty)^n \to \Bbb R$ be the product function, and $r_{ij}: [0,\infty)^n \to [0,\infty)^n$ be the replacement of the $i^{th}$ and $j^{th}$ entries with their average.

    What you've shown is that any $n$-tuple of positive reals $x \in [0,\infty)^n$, $P(r_{ij}(x)) = P(x)$ for $x \in D := { x \in [0,\infty)^n : x_1 = \cdots = x_n }$ and $P(r_{ij}(x)) > P(x)$. for $x\notin D$. (to be continued)

    – BigbearZzz Oct 19 '23 at 17:54
  • 1
    (continued) Does the property you proved imply that the restriction of $P$ to ${ x \in [0,\infty)^n : x_1+\cdots + x_n = c }$ attains its maximum at $x = (c/n,\dots,c/n)$? Not necessarily for a discontinuous $P$.

    Let $Q: [0,\infty)^n \to \Bbb R$ be defined to be equal to $P$ except on the set $D$, where we define $Q$ to be $0$ there. $Q$ satisfies $Q(r_{ij}(x)) = Q(x)$ for $x \in D$ and $Q(r_{ij}(x)) > Q(x)$. for $x\notin D$. too, but it attains its minimum on $D$, not the maximum.

    This means that the continuity of $P$ is essential, but your elementary argument did not address it.

    – BigbearZzz Oct 19 '23 at 17:55
  • 1
    Depending on how the question is interpreted, what's missing from this answer is not only continuity but also the subtler notion of compactness. Taken literally, it's kinda OK: it proves that if any set of x's is maximal then they must all be equal, and that's what the title of the question says. But what it doesn't prove is that any set of x's is maximal at all. – Gareth McCaughan Oct 21 '23 at 12:52
  • Consider the following argument: "How do we maximize f(x) = x^2 for real x? Well, f is a smooth function, so if x is even a local maximum then f'(x) = 0 and hence x = 0. So the maximum value of f is attained at x=0". Obviously this doesn't work, and the reason why is that actually "maximize x^2 for real x" is a thing you can't do. – Gareth McCaughan Oct 21 '23 at 12:53
  • A priori, this question could have been like that. user21820's answer shows that it isn't by giving a concrete procedure that, in finitely many steps, arrives at something maximal. Alternatively, if you don't mind introducing more advanced concepts, you can say: we're looking at nonnegative n-tuples x summing to A; the set of all such is a closed bounded subset of R^n, hence is compact, hence any continuous function thereon is bounded above and attains its least upper bound; now consider a point where it does so, etc. – Gareth McCaughan Oct 21 '23 at 12:56
  • But that requires either that you introduce the notion of compactness, making the proof less elementary, or that you do by hand the things that the stuff about compactness lets you shortcut, making the proof longer and less elegant. – Gareth McCaughan Oct 21 '23 at 12:57
  • 1
    Again, strictly speaking this answer does answer the literal question asked. But the point about existence of a maximum is an important one that it bypasses and I think an answer that deals with that is a better answer. – Gareth McCaughan Oct 21 '23 at 13:00
  • @GarethMcCaughan: And there I think you have said it all. Thank you! – TonyK Oct 21 '23 at 15:20