How do you work median out

To calculate the median of a set of numbers, follow these steps:

1. Arrange the numbers in the set in ascending order.
2. If the set has an odd number of values, the median is the middle number.
3. If the set has an even number of values, the median is the average of the two middle numbers.

For example, consider the set {4, 7, 1, 9, 2, 5, 8}:

1. Arrange the numbers in ascending order: {1, 2, 4, 5, 7, 8, 9}
2. Since the set has an odd number of values (7), the median is the middle number, which is 5.