Sub topic 1
Reading and sorting a data set
Every statistic in this tutorial starts from the same step: you read a collection of numbers correctly and put it in a form you can work with. Most GRE mistakes on mean, median, mode, and range come from a misread list, a missed repeat, or a list that was never sorted. This chapter covers how data sets are written on the test, how to count and order them, and which habits prevent errors later.
Prerequisites
This chapter assumes you can already do the following:
- Do arithmetic with fractions, decimals, and negative numbers, and compare them on a number line.
- Solve a basic linear equation such as
3x + 4 = 19. - Square a number and take a square root.
- Read a simple list or table of numbers.
The Python snippets are optional. They check the hand work, and you can skip them without losing the idea.
What a data set is
A data set is a collection of numbers, called values or data points, that describe something. Examples are the scores of eight students or the daily rainfall for a week. Three facts about data sets matter on the GRE:
- Repeats count. The list
4, 4, 4, 5has four values, not two. Each repeat is a separate observation. - Order carries no meaning unless stated.
7, 4, 9and9, 7, 4are the same data set. Sorting changes how you read it, not what it contains. - Size is written n. The count of values is called n. You will use n in the mean, in the median's position, and later in the standard deviation.
Here is a small data set used throughout this tutorial, first as it might be given and then sorted:
- Given:
7, 4, 9, 4, 5, 2, 5, 4 - Sorted:
2, 4, 4, 4, 5, 5, 7, 9
Both have n = 8. The sum is 40, so the mean is 5. You do not need those results yet. What matters is that sorting made the repeats visible: 4 appears three times and 5 appears twice.
How the GRE presents data
The same data can appear in several forms. You should recognize each one and be able to convert it to a sorted list.
A plain list
This is the simplest form. It may be unsorted, may contain repeats, and may include negative numbers or decimals. Do not assume it is in order.
A frequency table
A frequency table lists each distinct value with the number of times it occurs. The table for our data set looks like this:
| Value | Frequency |
|---|---|
| 2 | 1 |
| 4 | 3 |
| 5 | 2 |
| 7 | 1 |
| 9 | 1 |
The frequencies add up to n. Here 1 + 3 + 2 + 1 + 1 = 8. That total is a useful check, and it is also the value you need when you compute a mean or locate a median.
Two quantities come directly from a frequency table:
- The count is the sum of the frequencies.
- The sum of the data is the sum of each value times its frequency. Here 2·1 + 4·3 + 5·2 + 7·1 + 9·1 = 40.
The most common error with frequency tables is treating the table as a list of five values. It describes eight values, so the mean is not (2 + 4 + 5 + 7 + 9) / 5. That would give 5.4, but the correct mean is 5.
Information in words
A word problem may hide the data set. "Five employees earn $40, $40, $45, $50, and $65 per hour" gives n = 5 with a repeat. "Ten households, three of which own no cars" tells you three of the ten values are 0. Write the values out as a list before doing anything else, and include the zeros. A value of 0 is still a value, and leaving it out changes n.
Sorting a data set
To sort a data set, put the values in increasing order, from least to greatest. Do it for any problem involving a median, a mode, a range, or quartiles. It costs a few seconds and prevents most errors.
A reliable procedure:
- Count the values as you copy them, and note n.
- Find the smallest value, write it down, and cross it out of the original.
- Repeat until nothing remains.
- Check that the sorted list also has n values.
Step 4 catches the usual slip of dropping a repeated value.
Sorting tricky numbers
Order by value, not by how the numbers look.
- Negative numbers: the more negative a number is, the smaller it is.
-10 < -2 < 0. Students often put-2before-10because 2 is less than 10. - Mixed forms: convert fractions and decimals to one form before comparing.
3/5,0.4, and1/2become0.6,0.4, and0.5, so the sorted order is0.4, 1/2, 3/5. - Decimals: compare place by place.
0.25is greater than0.2but less than0.3. Length does not matter, so0.125is smaller than0.2.
Python can sort and count for you. This snippet checks the example data set:
from collections import Counter
raw = [7, 4, 9, 4, 5, 2, 5, 4]
ordered = sorted(raw)
counts = Counter(raw)
print(len(raw)) # 8
print(ordered) # [2, 4, 4, 4, 5, 5, 7, 9]
print(sorted(counts.items())) # [(2, 1), (4, 3), (5, 2), (7, 1), (9, 1)]
print(sum(v * f for v, f in counts.items())) # 40The pairs in the third line are exactly the rows of the frequency table above. The last line applies the "value times frequency" rule and recovers the sum 40.
Expanding a frequency table into a list
If a problem gives a frequency table and asks for a median or a mode, expanding it into a sorted list makes the answer easy to see. Write each value as many times as its frequency.
freq = {30: 2, 10: 3, 20: 1}
expanded = sorted(v for v, f in freq.items() for _ in range(f))
print(expanded) # [10, 10, 10, 20, 30, 30]
print(len(expanded)) # 6The table was not given in order, but the expanded list is. The count is 3 + 1 + 2 = 6.
On the exam you rarely need to expand a long table. You can instead keep a running total of frequencies. If n = 6, the middle falls between the 3rd and 4th values. The running totals are 3 for the value 10 and 4 for the value 20, so those two values (10 and 20) are the middle pair.
Positions in a sorted list
Once a list is sorted, you can refer to a value by its position, counting from 1 at the smallest value. Positions are how you find the middle value later.
- If n is odd, there is one middle position, the one numbered (n + 1) / 2. For n = 7, that is position 4.
- If n is even, there are two middle positions, the ones numbered n / 2 and n / 2 + 1. For n = 8, that is positions 4 and 5.
In 2, 4, 4, 4, 5, 5, 7, 9, positions 4 and 5 hold 4 and 5. The next chapters turn this into a rule for the median. For now, the point is that you can only identify those positions in a sorted list.
The diagram shows the reading routine to follow before any calculation.
Common errors
- Not sorting before reading the middle. The middle of an unsorted list is not the median. In
7, 4, 9, 4, 5, 2, 5, 4, the values in the middle positions are 4 and 5 by coincidence, but with other data this fails. - Collapsing repeats. Counting
4, 4, 4as a single value gives the wrong n, the wrong sum, and the wrong mean. - Treating a frequency table as a list. The frequencies are counts, not data values.
- Dropping zeros. A zero belongs to the data set and counts toward n.
- Misordering negatives.
-3is smaller than-1, so it comes first. - Assuming the list is sorted. The GRE often presents values in a deliberately scrambled order.
Exercises
Exercise
Sort the data set 12, -3, 7, 7, 0, -3, 5. State n, and state which position holds the single middle value.
Show answer
Sorted: -3, -3, 0, 5, 7, 7, 12. There are n = 7 values. Because n is odd, the middle is position (7 + 1) / 2 = 4, which holds the value 5.
Exercise
A frequency table shows the value 1 with frequency 4, the value 3 with frequency 2, and the value 6 with frequency 4. How many values are in the data set, and what is their sum?
Show answer
n = 4 + 2 + 4 = 10. The sum is 1·4 + 3·2 + 6·4 = 4 + 6 + 24 = 34.
Exercise
Sort from least to greatest: -1/2, -0.6, 0.25, -0.05.
Show answer
Convert to decimals: -0.5, -0.6, 0.25, -0.05. The sorted order is -0.6, -1/2, -0.05, 0.25.
Exercise
Ten households were surveyed about cars owned. Three own 0 cars, five own 1 car, and two own 2 cars. Write the sorted data set, and give n and the sum.
Show answer
Sorted: 0, 0, 0, 1, 1, 1, 1, 1, 2, 2. n = 10, and the sum is 0·3 + 1·5 + 2·2 = 9.