# Maximum of a set of values from given mean and median

The arithmetic mean and median of $5$ distinct natural numbers are both $7$,what may be the maximum of the $5$ numbers?

Here we see that the median is the $3rd$ value.Also the sum of the numbers is $35$.

Can we get any idea about the maximum value from this?

• You write "we see that the median lies between 3rd and 4th value." Are you sure? Also, you state that the numbers must live in $\{1, 2, \ldots\}$ (or maybe you define the natural numbers as including zero -- up to you). Do you see how that helps? Commented May 28, 2016 at 22:13
• Please read the help center in relation to homework (though the comments apply to more than just homework) and also the self-study guidelines. You need to show some effort yourself and explain what you've tried, or to ask a very specific question that would arise from a proper attempt (not just "how do I do this exercise") Commented May 29, 2016 at 0:33
• @Adrian, I apologize,I was wrong to state the median between 3rd and 4th value.It will be the 3rd value.I have edited my question.I have recently read article about that zero can not be included in a set of natural numbers.If zero is included then it is easy to find the maximum. Commented May 29, 2016 at 3:24
• @Glen_b , All that I understood from the problem is that the median can not be stated specifically.Probably, It is unbounded.But I was not sure as I was not able to prove it in any way.I apologize, from the next time I will definitely try to put some more efforts before asking a question. Commented May 29, 2016 at 3:28
• The maximum isn't unbounded either (it's finite a natural number exactly as suggested by the question; in fact it's obvious it must be less than 35). Commented May 29, 2016 at 4:28

This is quite straightforward.

Start with any five different natural numbers* with the required properties (median and mean both 7) and then see how you can change them without changing the mean or the median.

* As Adrian notes and as discussed at the link above, whether the natural numbers includes 0 depends on who you're talking to; you will need to check which definition you're expected to use (or to do it for both cases -- once you've done it for one definition, the other is simple)

Manipulating the set of numbers while keeping the mean and median unchanged is easiest if you have the five starting numbers in sorted order.

It's trivial to keep both mean and the median the same as you change some of the numbers; in each case any change you make must leave something unchanged (you note a connection between the mean and the sum - keep that connection mind to figure out what has to stay unchanged as you change numbers).

Once you see what that thing is in each case (one for the median and for the mean), it's a simple matter to change everything else as far as it is possible to do which will increase the largest number, and finally to confirm that no further changes can be made without breaking at least one of the conditions.

You may like to get things rolling by thinking about how small the smallest number can be (why as small as can be? ... think about that, too)

Since it's been up more than a day I can perhaps add a little more information. If the OP posts some additional thoughts I may go further.

Clearly the two invariants to play with are that $\sum_i x_i = 35$ (which makes the mean correct) and that $x_{(3)}=7$ (the median is then correct). So whatever you do must satisfy those points.

Imagine we start with the numbers $(4,5,7,9,10)$ for $(x_{(1)}, ...,x_{(5)})$.

This satisfies both conditions.

Now we would like to make $x_{(5)}$ larger but must keep the sum at $35$. Which other numbers can be moved? Which direction should they go? How far can they go?

• If we start with the numbers $(4,5,7,9,10)$ ,to make the $5th$ value as large as possible we can write $(1,2,7,8,17)$ , here the median and mean are both 7 and I think 17 is the maximum value of the set that we can get. Commented May 30, 2016 at 13:02