# Simple calculation of Mode of a number list

I’ve seen it asked a number of times. Here’s a simple calculation of the mode of a list.

I get that you’re taking the average of two elements of sorted list N_{S}, but what elements are you averaging? What do the floor and ceil functions get you?

Mode should result in the most common value, but if I change 3 values to 11 (making 11 most common), the output of mode is not 11.

\operatorname{floor}\left(\frac{\operatorname{length}\left(N\right)+1}{2}\right)


Brain fart. Median, not mode, which makes this totally unnecessary becaues there’s a function for it.

If you’re looking for mode, here’s a quick example: Mode (v2)

1 Like