Find formula for the most distant value from a mean

215 Views Asked by At

I have a set of values and i need to find the most distant value from the mean of those values: Let's say the values are those:

    [3,2,5,4,1]
    Mean = 3

The most distant value would be 5 but how can i express this in a formula?
1

There are 1 best solutions below

0
On BEST ANSWER

If the values are denoted $v_i$ and the mean $\overline v$,

$$v_{\text{argmax}_i|v_i-\overline v|}$$