What is the median of the following list of numbers
- A)
- B)
- C)
- D)
- E)
Answer
C
Key insight
With 4040 numbers the median is halfway between the 2020th and 2021st. The squares 1, 4, ..., 1936 (44 of them) squeeze in below, pushing the middle down by 44.
Solution
There are numbers, an even count, so the median is the average of the th and st smallest. The job is to find those two numbers.
- Without the squares. The list alone would have as its th number.
- The squares that get in the way. Some squares are small and slip in among the numbers below . Which ones? and . So the squares are all at most : that is small squares. Every other square is at least .
- Count up to a number between and . The numbers in the list that are at most are the ordinary numbers (that is of them) plus the small squares. That is numbers.
- We want this count to be : gives . So exactly numbers are at most , and the biggest of them is . That makes the th number.
- The next number is . It is not a square, so it appears only once, and it is the st.
- The median is .
The answer is .
Why this works
To find the number in a given position of a sorted list, count how many entries are at or below a guess, and adjust the guess until the count is right. Here the small squares crowd in at the bottom, so everything moves places down compared with the plain list to .
The trap
Counting 45 squares instead of 44, forgetting that 45 squared is 2025, which is bigger than 2020. That shifts the answer to 1975.5.
Concise solution
With entries, the median is the average of the th and st smallest.
For an integer , the entries that are at most are the integers together with the perfect squares up to , namely of them. Since , for this count is .
We want , so . Thus exactly entries are , and the th smallest entry is itself. The next entry is (not a square, so it appears once), which is the st.
Median .
The answer is .
Review in the AoPS books
- Prealgebra, Chapter 13: Data and Statistics
- Introduction to Number Theory, Chapter 1: Integers: The Basics
- Introduction to Algebra, Chapter 20: Special Functions (§20.3)
Techniques
Bound the quantity above/below or estimate to pin it down · Set up the equation/formula and compute; no special trick needed