# Question in regards to class (statistic)

20
Let's suppose i have a class of interval 7, say [20, 27[

With the numbers 20 21 22 23 24 25, there are 2 ways to derive the median yes?

I may use [a+b[ /2 to get the median which in the case above will give me 23.5, or i may simply look at the numbers above and clearly see the median is 22.5.

So my question is: Are these 2 methods to derive the median valid?

I would assume so (since in terms of definition both are valid) but i want to be sure.

Thank you :)

2. ### jbriggs444

1,936
What does [20,27[ have to do with { 20, 21, 22, 23, 24, 25 } ?

For an interval (with a uniform density function) the median is the midpoint of the interval, yes.

For finite set of discrete elements (with no weights on the elements) in sorted order, the median is the middle element. If the number of elements is even, it is usually taken as the mean of the two elements closest to the middle. For {20, 21, 22, 23, 24, 25} the two elements closest to the middle are 22 and 23 and their mean is 22.5. So again, that would be a "yes".