What is the general formula for calculating the median? How can I rewrite the equation
$\mu = \frac{1}{N}\sum _{i=1}^Nx_i$, 
if I don't want to find the mean, but the median of all $x_i$, $i=1,\dots,N$?
 A: After some extra research it seems there is no solution for my desire. The best bet probably is to define a function, say $m(x)$, which is defined as
$m\left(x\right)
=\begin{cases}
  x_\frac{n+1}{2}                                    & n\text{ odd}\\
  \frac {1}{2}\left(x_{\frac{n}{2}} + x_{\frac{n}{2} + 1}\right) & n \text{ even}
\end{cases}
$
A: For a given sample $X_1,\ldots,X_n -$ by which I mean a collection of independent, identically distributed random variables $-$ the median of the sample is either the $\dfrac{n+1}{2}^{th}$ or $\dfrac{n}{2}^{th}$ order-statistic, depending on whether $n$ is odd or even respectively. The sample mean does not give a sufficient amount of information to uniquely determine what these order-statistics are.  
A: Let's start with just $3$ numbers.  Unfortunately, $\mathrm{median}(a,b,c)$ is not a polynomial of $a,b,c$.  (polynomial in the operations $+, \times, x^y$.)
It is a polynomial in the "lattice" operations $x \vee y$ and $x \wedge y$, however:
$$
\mathrm{median}(a,b,c) = (a \vee b) \wedge (b \vee c) \wedge (c \vee a)
= (a \wedge b) \vee (b \wedge c) \vee (c \wedge a) .
$$
