[Math] Calculating new median if one of the observations from original calculation is removed

arithmeticmedian

find new average if removing one element from current average

Hey guys, found an old question that I would like to build on if possible, would appreciate your help.

To piggyback on this old question I found…Is it possible to find calculate a median by removing one number from the current median?

Let's say all you have is the median of a set of numbers (e.g., $= 40$) and the number of observation (e.g., $= 100$), and want to find the new median if one of the observations was removed (e.g., $= 50$)?

Going back and recalculating the median without the focal observation is not an option.

Thanks, J

Best Answer

Sure. You have $n$ observations $x_i$ which are sorted. Say $n$ was even, then the median after deleting $x_j$ is the $n/2$th observation among those which are left. This is just the $n/2$th of the original observations if that is less than $j$, otherwise it is the $(n+2)/2$th of the original observations. You can proceed similarly if $n$ was odd.

The tricky aspect here is: if you keep on doing this, when do you actually update the data structure rather than continuing to modify your accessor function?

One difference from the case of the mean is that it actually doesn't really matter what the old median was or even what the removed value was, all that matters is where the removed value was in the sorted sequence.

That said, if all you have is the old median and the deleted observation, then no, you cannot know the new median in general. All you can be sure is that the median could only increase (resp. decrease) if the deleted observation was smaller (resp. larger) than the old median.

Related Question