Median of a set of Integer The median of a set containing odd number of integer is the middle element after sorting. What about the case of even number of terms. Some places mention of average of the two middle value, but I heard that precise definition allows any number from the left middle number to the right middle number. For example, {1 2 3 4}, any number between and including 2 and 3 is valid.

I think you have to take the average of the two middle numbers.
median({1,2,3,4}) = (2+3) / 2 = 2.5
That's what they said me in school.
