Answer: 21
Explanation
Given data set = {21, 28, 30, 31, 17, 16, 12}
Sorted data set = {12, 16, 17, 21, 28, 30, 31}
There are n = 7 items in this set. This is the sample size. Because the sample size is an odd number, we can find the middle index by computing n/2 = 7/2 = 3.5 which rounds up to 4.
The 4th slot is where the middle is located. We have 3 values below the median and 3 values above (giving 3+1+3 = 7 values total).
The number 21 is in the 4th slot, so it is the median.
------------
Another way to find the median is to cross off the first and last values in the sorted set.
We go from {12, 16, 17, 21, 28, 30, 31} to {16, 17, 21, 28, 30}
Repeat that process to get to {17, 21, 28} and it should be very clear at this point that 21 is at the very middle. I've marked them in bold to help show this better.