Optimize ordered data under constraints

Lesson progressPractice problems 0/3
Difficulty
Advanced
Estimated time
29 minutes
Techniques
Constrained-dataOrdered-slotsExtremal-constructionComplementary-sumsFeasibility

What you’ll learn

  1. Turn a mean into a total, and a median and range into fixed spots in an ordered list.
  2. Keep rules like positive, integer and distinct in view while you fill the other spots.
  3. Make one group as large as possible by making the rest as small as possible.
  4. Prove a maximum or minimum can’t be beaten, then build a list that reaches it.
  5. Check a finished list for count, order, total, median, range, every rule and what the question asks for.

Why this matters on the SAT

Build the list that reaches the limit

Usually you’re given a list and asked for its mean or median. Some SAT questions flip that around. They fix the mean and the median, say, and ask for the smallest possible range. Now there’s no list to work from. You have to build one that pushes the range as low as it can go.

Solution to the example

Start with what can’t change. Nine values with a mean of 1414 must add up to

9(14)=126.9(14)=126.

Put the values in order. The fifth one is the median, 1010. Could the range be 88 or less? The smallest value is at most 1010, so the largest would be at most 1818. Then the first five values are at most 1010 each, and the last four are at most 1818 each. Even the biggest total you could reach is

5(10)+4(18)=122,5(10)+4(18)=122,

which is short of 126126. So the range has to be at least 99.

And 99 works. Keep the first five values at 1010 and make the last four 10+9=1910+9=19. That’s 50+76=12650+76=126, right on target:

10, 10, 10, 10, 10, 19, 19, 19, 19.10,\ 10,\ 10,\ 10,\ 10,\ 19,\ 19,\ 19,\ 19.

Its median is 1010, and its range is 19−10=919-10=9. The answer is B.

Notice the two parts. The first shows that nothing smaller than 99 can work. The second shows that 99 really can. You need both: a bound on its own might name a value no list can reach, and a list on its own doesn’t show you can’t do better. Bound it, then build it.

SAT example

A data set consists of 99 integers. The mean of the data set is 1414, and the median is 1010.

What is the minimum possible range of the data set?

  1. A

    88

  2. B

    99

  3. C

    1010

  4. D

    1414

Translate the conditions into slots

Start by writing the unknown values in order, from least to greatest:

x1≤x2≤⋯≤xn.x_1\le x_2\le \cdots \le x_n.

Each position is a slot. Now every condition in the question becomes a rule about certain slots. In the opening example, the mean made the total 126126, the median locked slot 55 at 1010, and the range tied the smallest and largest values together. Here’s the same idea for any list of nn values:

What each condition tells you about the slots

ConditionWhat it means for the slots
A mean of MM for nn valuesThe total is nMnM.
A median of mm, with an odd number of valuesThe middle slot is mm. Slots to its left are at most mm, and slots to its right are at least mm.
A range of RRxn−x1=Rx_n-x_1=R, so the largest minus the smallest is fixed. Move one end and the other has to move with it.
Positive integersEvery slot is one of 1,2,3,…1,2,3,\ldots.
Distinct integersNo two slots are equal, so each is bigger than the one before: x1<x2<⋯<xnx_1<x_2<\cdots<x_n.
Values from LL through UUEvery slot sits between the two bounds: L≤xi≤UL\le x_i\le U.

Say 1111 positive integers have median 66. The middle of 1111 values is slot 66, so the slots start out like this:

The median locks slot six

Slots11-556677-1111
What the order allowsAt most 66Exactly 66At least 66
Smallest positive values, if repeats are allowed1,1,1,1,11,1,1,1,1666,6,6,6,66,6,6,6,6

This doesn’t answer anything yet. It shows what’s locked, so you can see which slots are still free to push.

Common mistake:

If the values must be distinct, you can’t use a number twice, so every ≤\le between slots becomes <<. When you need the smallest or largest values allowed, use consecutive integers. For example, three distinct positive integers can’t all be 11. The smallest they can be is 11, 22 and 33.

Decide which way to push

Once the slots are set, ask what the question wants large or small, and which slots feed it.

  • To make a sum as large as possible, push the slots in it up, or make everything else as small as you can.
  • To make a sum as small as possible, push the slots in it down, or make everything else as large as you can.
  • To make the range small, pull the smallest and largest values toward each other while keeping the total. In the opening example, a range of 88 left the total 44 short of 126126, so the range had to be at least 99.
  • To make the median as large as possible, try a value, add up the least the list could total with it, and compare that with the fixed total. If 77 positive integers add up to 7070, a median of 2020 fails, because slots 44 through 77 would each be at least 2020, already 8080. A fixed range can push the smallest values up too, so keep them as low as the range allows.

Here’s the catch. Whatever you push, the other slots have to make up the difference. A value that looks like the extreme isn’t the answer until the rest of the list can still reach the total, stay in order and follow every rule.

Use a complementary sum

Say 1010 values must add up to 5050, and you want the 44 greatest as large as possible. If the other 66 add up to 2020, the 44 greatest get 3030. Shrink those 66 to a total of 1414, and the 44 greatest get 3636. Every bit you take from the rest goes to the group you want.

In general, call the group you want large BB and everything else CC, the complement of BB. If all nn values have a fixed total TT, then

sum⁡(B)=T−sum⁡(C).\operatorname{sum}(B)=T-\operatorname{sum}(C).

So to make BB large, make CC small:

maximize B by minimizing its complement C.\boxed{\text{maximize }B\text{ by minimizing its complement }C.}

This is most useful when BB is the greatest values. Then CC holds the smaller values, and the median often sets how small some of them can be.

Check your understanding:

A set of 1313 positive integers has mean 77 and median 55. The 44 greatest values form group B. What is the greatest possible mean of B?

Common mistake:

It’s tempting to start by making the largest values huge. But that can break the total, or leave no values that work on the median’s side of the list. If you get stuck, back up: turn the mean into a total, mark the locked slots, then decide which leftover sum to make small or large.

Example: Maximize the mean of the greatest values

Watch how much of the work happens before you touch the four greatest values.

Worked example

Data set A consists of 1111 positive integers with a mean of 99 and a median of 66. Data set B consists of the 44 greatest integers in data set A.

Which choice is the maximum possible value of the mean of data set B?

  1. A

    1919

  2. B

    2020

  3. C

    412\frac{41}{2}

  4. D

    2222

Step 1

Turn the conditions into slots

Eleven values with a mean of 99 add up to

11(9)=99.11(9)=99.

Write them in order:

x1≤x2≤⋯≤x11.x_1\le x_2\le\cdots\le x_{11}.

With 1111 values, slot 66 is the middle, so it holds the median:

x6=6.x_6=6.

Step 2

Split off the four greatest

The four greatest values sit in slots 88 through 1111. Their complement is slots 11 through 77:

x1+⋯+x7⏟complement+x8+⋯+x11⏟target=99.\underbrace{x_1+\cdots+x_7}_{\text{complement}} + \underbrace{x_8+\cdots+x_{11}}_{\text{target}} =99.

The total is fixed, so the smaller you make slots 11 through 77, the more is left for the four greatest.

Step 3

Make the first seven values as small as allowed

The values only have to be positive, so slots 11 through 55 can each be 11. Slot 66 is locked at 66, and slot 77 can’t be less than the median, so it’s at least 66:

x1+⋯+x7≥1+1+1+1+1+6+6=17.x_1+\cdots+x_7 \ge 1+1+1+1+1+6+6=17.

That leaves at most

99−17=8299-17=82

for the four greatest, so their mean is at most

824=412.\frac{82}{4}=\frac{41}{2}.

Step 4

Build a list that reaches the bound

So far you know the mean can’t go above 412\frac{41}{2}. Now show that a list gets there. Keep slots 11 through 1010 as small as allowed, five 11s and five 66s, and give everything left to slot 1111: 99−35=6499-35=64.

1, 1, 1, 1, 1, 6, 6, 6, 6, 6, 64.1,\ 1,\ 1,\ 1,\ 1,\ 6,\ 6,\ 6,\ 6,\ 6,\ 64.

It has 1111 positive integers, its total is

5+30+64=99,5+30+64=99,

and its median is 66. Its four greatest values are 6,6,6,646,6,6,64, with mean

6+6+6+644=824=412.\frac{6+6+6+64}{4}=\frac{82}{4}=\frac{41}{2}.

The list reaches the bound, so the answer is C.

Check your understanding:

If the 1111 positive integers in the example also had to be distinct, what would be the smallest possible sum of the first seven values?

Common mistake:

After step 3, it’s tempting to pick 412\frac{41}{2} and move on. But the inequality only shows the mean can’t go higher. It doesn’t show that any list gets there. Finish by writing a complete list in order and checking every condition.

Same method, new target: the median

Shrinking the complement works when you want the greatest values large. To make the median large, you need a different finish, but you still start from the slots.

Suppose a data set has 99 positive integers, mean 1111, and range 1414. You want the greatest possible median.

The total is

9(11)=99.9(11)=99.

Could the median be 1818 or more? Look at what that forces. The largest value is at least the median, so it would be at least 1818. With a range of 1414, the smallest value would then be at least

18−14=4.18-14=4.

So the first four values would each be at least 44, and the last five, from the median up, would each be at least 1818. The smallest total you could get is

4(4)+5(18)=106,4(4)+5(18)=106,

which is more than 9999. So the median can’t be 1818 or more.

Now build a list with median 1717. Put the median and the four values above it at 1717, which uses 5(17)=855(17)=85. That leaves 99−85=1499-85=14 for the first four. The range makes the smallest value 17−14=317-14=3, and 3+3+3+5=143+3+3+5=14:

3, 3, 3, 5, 17, 17, 17, 17, 17.3,\ 3,\ 3,\ 5,\ 17,\ 17,\ 17,\ 17,\ 17.

Its total is 9999, its range is 17−3=1417-3=14, and its median is 1717. So the greatest possible median is

17.\boxed{17}.

The target changed, but the moves didn’t: turn the conditions into slots, rule out anything better, then build and check the list that reaches the limit.

Check your understanding:

The list above has median 1717. Why doesn’t that list alone prove that 1717 is the greatest possible median?

Verify the final list

Before you pick an answer, check your list against the question, not against what you meant to write.

Check the finished list

CheckAsk yourself
CountAre there exactly nn values?
OrderAre the values written from least to greatest?
Number rulesIs every value an integer? If the question asks, is each one positive, within the bounds and different from the rest?
MeanDoes the total equal nn times the given mean?
MedianIs the right value sitting in the middle slot?
RangeDoes the largest value minus the smallest equal the given range, or the one you’re claiming?
The questionDoes the group or statistic the question asks about actually reach your answer?

Do these by hand. Desmos can add up a finished list, but it can’t tell you which slots to squeeze, which inequality proves nothing does better, or whether distinct values change the best arrangement.

Practice problems

These three match what you’ve seen: the smallest range, the largest mean of the greatest values, and the largest median. The second adds distinct values and a cap.

Find the smallest range

Practice problem

A data set consists of 1111 integers. Its mean is 1313, and its median is 99.

What is the minimum possible range of the data set?

Answer choices
Calculator loads as you approach
Start from the slots and the total. The calculator can add up your finished list.

Distinct values with a cap

Practice problem

Data set A consists of 1414 distinct integers, each from 11 through 2525, inclusive. The mean of data set A is 1515. Data set B consists of the 66 greatest integers in data set A.

What is the maximum possible value of

mean⁡(B)−mean⁡(A)?\operatorname{mean}(B)-\operatorname{mean}(A)?
Answer choices
Calculator loads as you approach
Pick the six greatest allowed values first. The calculator can total the other eight or check your finished list.

Find the greatest median

Practice problem

A data set consists of 77 positive integers. Its mean is 1010, and its range is 1212.

What is the greatest possible median of the data set?

Calculator loads as you approach
Start with the range: a big median pushes the smallest value up too. The calculator can check your final total.

Finish the lesson

3 practice examples left

Finish the remaining questions correctly to complete this lesson.

Quick recap

  • Turn a fixed mean into a fixed total before you place any values.
  • Write the values in order as slots, lock the median slot, and tie the end slots together with the range.
  • Keep the integer, positive, distinct and bound rules in view from the start.
  • To make the greatest values add up to as much as possible, make the rest add up to as little as possible.
  • To shrink the range or raise the median, test a better value and show the total can’t fit.
  • Bound it, then build it: the bound shows you can’t do better, and a complete list shows the value can happen.
  • Check the count, order, rules, total, median, range and what the question asks for.
  • Work by hand, and use a calculator only to check the arithmetic once the list is decided.

Next lesson

Interpret scatterplots

Move from constructing one-variable data to interpreting direction, strength, form, clusters, and outliers in paired data.

Start next lesson

Practice

Practice this lesson

31 SAT questions use what this lesson teaches. Practice a few in a study session at the difficulty you choose.

Start practice