## How to calculate a median?

The median is a measure of central tendency of a distribution and represents the midpoint of an ordered dataset. Unlike the average, which considers every value in the dataset, the median is influenced by the position of the data and not their actual values. This makes the median a more robust measure than the average, as it is less sensitive to outliers.

### Steps to calculate the median

To calculate the median, we follow the steps:

**Order the dataset**: Arrange all values in the dataset from low to high. If your series of numbers is {8, 3, 5, 4, 9, 1}, you order the values as {1, 3, 4, 5, 8, 9}.
**Find the middle of the dataset**: Check if the number of data (n) is even or odd.
- For an odd number of data: The median is the value in the middle of the ordered sequence. In our series of six numbers {1, 3, 4, 5, 8, 9}, there is no single number exactly in the middle, as we have an even number of numbers.
- For an even number of data: The median is the average of the two middle numbers. In our dataset, 4 and 5 are the middle numbers. We calculate their average as (4 + 5)/2 = 4.5. So, the median is 4.5.

### Example

Suppose we have the following series of numbers: 4, 8, 6, 5, 3, 2, 8, 9, 2, 5.

- We first arrange the numbers in ascending order: 2, 2, 3, 4, 5, 5, 6, 8, 8, 9.
- We see that the number of numbers in the series is 10, which is an even number.
- Since we have an even number of numbers, we take the two middle numbers (5 and 5 in this case) and calculate the average. In this case, the median is also 5.

The median gives us a valuable measure of central tendency that gives a more complete view of our data, especially when combined with other measures such as the average and mode. Moreover, as the median is less sensitive to extreme values, it can in many cases provide a more accurate picture of the 'typical' value in a dataset.