Median

The median of a set of numbers is the middle value when the numbers are arranged in order. If there are an even number of values, the median is the average of the two middle values.

Calculating median

  1. Arrange the numbers in order from smallest to largest.
  2. If there are an odd number of values, the median is the value in the middle.
  3. If there are an even number of values, the median is the average of the two middle values (the number between the two middle values).

Examples

Find the median of \{3, 1, 4, 1, 5\}

Find the median of \{1, 4, 9, 16\}

Find the median of \{3, 1, 4, 1, 5, 9\}

Find the median of \{1, 2, 3, 4, 5, 6, 7, 8\}