# Math puzzle

**URL:** https://boards.straightdope.com/t/math-puzzle/465115
**Category:** Factual Questions
**Created:** [September 25, 2008, 3:26am UTC](https://boards.straightdope.com/t/math-puzzle/465115 "2008-09-25T03:26:02Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![dauerbach](https://avatars.discourse-cdn.com/v4/letter/d/c2a13f/32.png) [@dauerbach](https://boards.straightdope.com/u/dauerbach)
#### Post date: [September 25, 2008, 3:26am UTC](https://boards.straightdope.com/t/math-puzzle/465115/1 "2008-09-25T03:26:02Z")

</div>

Here is the question:

A+B+C+D=100

Using positve intergers what is the greatest and least product of ABCD. Each number can be used more than once.

Assuming that 0 is not an option, I come up with 25_25_25\*25 for greatest.

I come up with 49_49_1\*1 as least.

Are those the best answers?

---

<div class="post-metadata">

### Author: ![Harmonious\_Discord](https://avatars.discourse-cdn.com/v4/letter/h/74df32/32.png) [@Harmonious\_Discord](https://boards.straightdope.com/u/Harmonious_Discord)
#### Post date: [September 25, 2008, 3:32am UTC](https://boards.straightdope.com/t/math-puzzle/465115/2 "2008-09-25T03:32:47Z")

</div>

1_1_1_97 is less than 49_49_1_1

You have the greatest correct.

---

<div class="post-metadata">

### Author: ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)
#### Post date: [September 25, 2008, 3:36am UTC](https://boards.straightdope.com/t/math-puzzle/465115/3 "2008-09-25T03:36:35Z")

</div>

For any non-zero integer e, 25 \* 25 \* (25 - e) \* (25 + e) will be less that 25 \* 25 \* 25 \* 25. That’s not a proof, but it strongly suggests that 25[sup]4[/sup] is the maximum product.

---

<div class="post-metadata">

### Author: ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)
#### Post date: [September 25, 2008, 3:59am UTC](https://boards.straightdope.com/t/math-puzzle/465115/4 "2008-09-25T03:59:57Z")

</div>

97,1,1,1 and 25,25,25,25 are indeed the extreme answers.

To understand this, it might be easier to first consider the three-dimensional equivalent. You’ve got a box, with dimensions A by B by C, where A, B, and C add up to some number. I can decrease any side by 1, and increase some other side by 1, and the sum will remain the same. In face, I can get any set of sides I want, by doing this repeatedly. Let’s say that we start with a box where, without loss of generality, A is the longest side, and C is the shortest side. If I decrease side A by 1, I’ll then decrease the volume of the box by an amount (B\*C). If I then increase C by 1 (bringing me back up to the same sum), I’ll increase the volume of the box by an amount (A-1)\*B. As long as A-1 \> C, this is a net increase in the volume of the box, and if (A-1) = C, then it’s no change at all. So if I keep on decreasing the longest side and increasing the shortest side until they differ by at most 1, then at every step, the volume will increase, until it can’t increase any more when all the sides are equal or as near as possible to equal. Likewise, if I keep making the shortest side shorter and the longest side longer, the volume will decrease, until they’re as different as possible.

With four numbers, it works the same way, except that the box is now four-dimensional.

---

<div class="post-metadata">

### Author: ![Santo\_Rugger](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@Santo\_Rugger](https://boards.straightdope.com/u/Santo_Rugger)
#### Post date: [September 25, 2008, 5:27am UTC](https://boards.straightdope.com/t/math-puzzle/465115/5 "2008-09-25T05:27:29Z")

</div>

> [@dauerbach](#):
>
> Are those the best answers?

If you’re interested, I can put together an optimization macro in Excel and send you the file. You’d be able to fiddle with the numbers to see what other combinations give.

It’s actually quite easy; set up four cells that can be changed, list the two constraints (sum and product) and then maximize (or minimize) the product.

Just let me know if you want it.

---

<div class="post-metadata">

### Author: ![nivlac](https://avatars.discourse-cdn.com/v4/letter/n/3bc359/32.png) [@nivlac](https://boards.straightdope.com/u/nivlac)
#### Post date: [September 25, 2008, 5:35am UTC](https://boards.straightdope.com/t/math-puzzle/465115/6 "2008-09-25T05:35:40Z")

</div>

This is actually a fairly simple optimization problem with one constraint. Just use a [Lagrangian multiplier](http://en.wikipedia.org/wiki/Lagrange_multiplier) and you’ll quickly conclude that an extremum occurs at A=B=C=D=25, which has to be a maximum. The minimum will occur at a boundary point which can be found by simple enumeration.

---

<div class="post-metadata">

### Author: ![Santo\_Rugger](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@Santo\_Rugger](https://boards.straightdope.com/u/Santo_Rugger)
#### Post date: [September 25, 2008, 5:49am UTC](https://boards.straightdope.com/t/math-puzzle/465115/7 "2008-09-25T05:49:58Z")

</div>

> [@nivlac](#):
>
> Just use a [Lagrangian multiplier](http://en.wikipedia.org/wiki/Lagrange_multiplier)…

_bookmarks link_  
Thanks.
