Add a fifth number to the set {3,7,9,10} so that the mean is equal to the median of the set.

Show whether or not it is possible to create a set of numbers where the same problem yields more solutions than the above.

Let n be the number of terms in the original set. Let T be the total number of terms in the original set. Let x be the new term.

/****************************************************/

If n is even, then the original set has two central terms (when in increasing sequence). Let them be L and H (low and High).

There are only 3 cases to consider:

The new median is L if x <= L. Then (n+1)L = x + T, so x = (n+1)L - T. This is only a solution if (n+1)L - T <= L.

Simplifying, this is only a solution if L <= T/n.

The new median is H if x >= H. Then (n+1)H = x + T, so x = (n+1)H - T. This is only a solution if (n+1)H - T >= H.

Simplifying, this is only a solution if T/n <= H.

The new median is x if L <= x <= H. Then (n+1)x = x + T, so x = T/n. This is only a solution if L <= T/n <= H.

Clearly, if n is even, there are most three solutions, and at least one.

For example {3,7,9,10}. T/n = 7.25, which is between 7 and 9, so there are three solutions.

For example {3,7,9,25}. T/n = 11, which is greater than 9, so there is only one solution.

There are only two solutions if T/n = L or H.

There is only one solution if L = H, since there is only one possible median.

/*************************************************/

If n is odd, then the original set has three central terms (when in increasing sequence). Let them be L, M, and H (Low, Middle and High).

There are only 3 cases to consider:

The new median is (L+M)/2 if x <= L. Then (n+1)(L+M)/2 = x + T,

so x = (n+1)(L+M)/2 - T. This is only a solution if (n+1)(L+M)/2 - T <= L.

Simplifying a little, this is only a solution if L <= (2T - (n+1)M)/(n-1)

The new median is (H+M)/2 if x >= H. Then (n+1)(H+M)/2 = x + T,

so x = (n+1)(H+M)/2 - T. This is only a solution if (n+1)(H+M)/2 - T >= H.

Simplifying, this is only a solution if (2T - (n+1)M)/(n-1) <= H.

The new median is (M+x)/2 if L <= x <= H. Then (n+1)(M+x)/2 = x + T,

so x = (2T - (n+1)M)/(n-1). This is only a solution if (2T - (n+1)M)/(n-1) is between L and H.

Simplifying, this is only a solution if L <= (2T - (n+1)M)/(n-1) <= H.

Clearly, if n is odd, there are most three solutions, and at least one.

To find out which, the critical calculation is (2T - (n+1)M)/(n-1).

/*************************************************/

Geometrically, in both cases,

if f(x) = the median as a function of x then it is a line with slope = 1/(n+1)

if g(x) = the median as a function of x, then it is a flat line segment, connected to a line of slope 1, connected to another flat line segment.

Clearly, they intersect in at least one and at most three places.

g(x) is completely flat if L = H.

*Edited on ***February 21, 2014, 8:44 am**