1
$\begingroup$

Given a list of integers $a_1,a_2,...,a_n$ where $n \geq 1$ is odd (may not be in ascending order), is it possible to express their median in terms of some well-known operations such as maximum or minimum?

For example, if we have three numbers, say $3,6,5$, then their median is always the one which is neither the maximum nor minimum. In the example, their median is $5$.

$\endgroup$
5
  • $\begingroup$ For the median pick one of the $a_1,a_2,...$ to find the minimum of the sums $|a_1-a_1|+|a_2-a_1|+|a_3-a_1|...$ and $|a_1-a_2|+|a_2-a_2|+|a_3-a_2|...$ and so on $\endgroup$ Commented Feb 5, 2020 at 9:17
  • $\begingroup$ @PeterSheldrick May I have a proof of the formula or reference that you provide above? $\endgroup$ Commented Feb 5, 2020 at 9:25
  • $\begingroup$ @Idnoknow see this answer $\endgroup$ Commented Feb 5, 2020 at 9:42
  • $\begingroup$ If $a_{(1)}\le a_{(2)}\le \cdots\le a_{(n)}$ are the ordered observations, then median of $(a_1,a_2,\ldots,a_n)$ for odd $n$ is $a_{\left(\frac{n+1}{2}\right)}$. $\endgroup$ Commented Feb 5, 2020 at 17:41
  • $\begingroup$ How about the answer by @GEdgar in this old post? $\endgroup$ Commented Feb 6, 2020 at 7:25

3 Answers 3

1
$\begingroup$

Yes! Write $n=2k+1$. Then the median is the maximum of the minima of all $k+1$ element subsets of the data.

For example, when $n=3$, then there are $\binom{3}2=3$ two element subsets of the data: $\{a_1,a_2\},\{a_1,a_3\},\{a_2,a_3\}$. The median is the max of all these minima: $$ \text{median}(a_1,a_2,a_3)=\max\big(\min(a_1,a_2),\min(a_1,a_3),\min(a_2,a_3)\big) $$ When $n=5$, there are $\binom53=10$ three element subsets of the data, so $$ \text{median}=\max\Big(\min(a_1,a_2,a_3),\min(a_1,a_2,a_4),\min(a_1,a_2,a_5),\min(a_2,a_3,a_4),\dots,\min(a_3,a_4,a_5)\Big) $$ As you can see, this formula quickly gets unwieldy. The number of terms is $\binom{n}{(n+1)/2}$, which grows exponentially.

$\endgroup$
0
$\begingroup$

The median is the arg min of the sum of absolute deviations of $X_i$ from $\theta.$

Similarly, the mean is analogous for squared deviation.

$\endgroup$
-1
$\begingroup$

$F(k)=\sum_{r=1}^n |k-a_r| $, (where k is a variabe , $a_r>a_{r+1}$)


If n is odd ,n=2m+1

$k>a_1\Rightarrow$ all mods open as $k-a_r$ and so derivative is >0(as you increase 'k' the value of function increase).

$a_1>k>a_2$ then one mod only open as $a_r-k$(r=1) , and others as $k-a_r$, hence still derivative >0

$a_m>k>a_{m+1} $ ,here m+1 mods open as $k-a_r$ and m mods open as $a_r-k$ ,so derivative is greater than 0

So obviusly derivative becomes negative if $k<a_{m+1}$ and derivative is greater than 0 if $k>a_{m+1}$ , hence minimum of the function is at $a_{m+1}$.


If n is even ,n=2m

You will find that derivative is >0 if , $k>a_{m}$

Derivative <0 if $k<a_{m+1}$

Derivative =0 if $ a_m>k>a_{m+1}$ , so the function is minimum for all such $k$(including $a_m$ and $a_{m+1}$).

So for even number of terms we define mode as $\frac{a_m+a_{m+1}}{2}.$

$\endgroup$

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.