As we saw here, the minimum of two quantities can be written using elementary functions and the absolute value function.

$\min(a,b)=\frac{a+b}{2} - \frac{|a-b|}{2}$

There's even a nice intuitive explanation to go along with this: If we go to the point half way between two numbers, then going down by half their difference will take us to the smaller one. So my question is: "Is there a similar formula for three numbers?"

Obviously $\min(a,\min(b,c))$ will work, but this gives us the expression: $$\frac{a+\left(\frac{b+c}{2} - \frac{|b-c|}{2}\right)}{2} - \frac{\left|a-\left(\frac{b+c}{2} - \frac{|b-c|}{2}\right)\right|}{2},$$ which isn't intuitively the minimum of three numbers, and isn't even symmetrical in the variables, even though its output is. Is there some nicer way of expressing this function?

  • 2
    $\begingroup$ You could use the unit step function or Iversonian brackets, but I suppose the resulting expression cannot be considered in any way nice... $\endgroup$ Dec 7, 2010 at 4:42
  • $\begingroup$ Could you list the original reference for the expressions? $\endgroup$
    – user13769
    Jul 26, 2011 at 1:01
  • 16
    $\begingroup$ $\min\{a,b,c\}$ is nice. $\endgroup$
    – Raphael
    Jul 26, 2011 at 5:14
  • 2
    $\begingroup$ Please note that it is much nicer (IMHO) to do it the other way around, i.e., to express absolute value in terms of min/max: $\;|a| = a \max -a\;$, and $\;a \min b = - (-a \max -b)\;$. min/max have nice properties like associativity, $\;+\;$ distributes over them, etc. See my answer math.stackexchange.com/a/555286/11994 for an example. $\endgroup$ Dec 10, 2013 at 5:35

5 Answers 5


This probably isn't what you were thinking of, but if $a_1, ... a_n$ are non-negative, then

$$\min(a_1, ... a_n) = \lim_{k \to -\infty} \sqrt[k]{a_1^k + ... + a_n^k}$$


$$\max(a_1, ... a_n) = \lim_{k \to \infty} \sqrt[k]{a_1^k + ... + a_n^k}.$$

There are several applications of these identities (at least the second one), e.g. to functional analysis. They are also related to the way in which tropical arithmetic arises as a "limit" of ordinary arithmetic.

  • $\begingroup$ So if I just pick some even $k$ large enough then I could approximate the max function right ? $\endgroup$ Jan 29 at 15:29

First, define $$ \Delta=|a-b|+|b-c|+|c-a|\newcommand{\Mu}{\mathrm{M}}\tag{1} $$ It is somewhat intuitive that $$ \frac{\Delta}{2}=\max(a,b,c)-\min(a,b,c)\tag{2} $$ For example, if $a\ge b\ge c$ then $|a-b|+|b-c|+|c-a|=2a-2c$.

Next, define $$ \Sigma=a\left(1-\frac{|b-c|}{\Delta}\right)+b\left(1-\frac{|c-a|}{\Delta}\right)+c\left(1-\frac{|a-b|}{\Delta}\right)\tag{3} $$ Again, if $a\ge b\ge c$, then $$ \begin{align} \Sigma &=a\left(\frac{2a-b-c}{2(a-c)}\right)+b\left(\frac{a-c}{2(a-c)}\right)+c\left(\frac{a+b-2c}{2(a-c)}\right)\\ &=a+c \end{align} $$ Thus, considering the symmetry of $(3)$, it is evident that $$ \Sigma=\max(a,b,c)+\min(a,b,c)\tag{4} $$ Combining $(2)$ and $(4)$ yields $$ \max(a,b,c)=\frac{\Sigma}{2}+\frac{\Delta}{4}\tag{5} $$ and $$ \min(a,b,c)=\frac{\Sigma}{2}-\frac{\Delta}{4}\tag{6} $$ At least $(5)$ and $(6)$ are symmetric in $a$, $b$, and $c$ since $(1)$ and $(3)$ are. That is, $$ \begin{align} \max(a,b,c) &=\frac{a}{2}\left(\frac{|c-a|+|a-b|}{|a-b|+|b-c|+|c-a|}\right)\\ &+\frac{b}{2}\left(\frac{|a-b|+|b-c|}{|a-b|+|b-c|+|c-a|}\right)\\ &+\frac{c}{2}\left(\frac{|b-c|+|c-a|}{|a-b|+|b-c|+|c-a|}\right)\\ &+\frac{|a-b|+|b-c|+|c-a|}{4}\tag{7} \end{align} $$ and $$ \begin{align} \min(a,b,c) &=\frac{a}{2}\left(\frac{|c-a|+|a-b|}{|a-b|+|b-c|+|c-a|}\right)\\ &+\frac{b}{2}\left(\frac{|a-b|+|b-c|}{|a-b|+|b-c|+|c-a|}\right)\\ &+\frac{c}{2}\left(\frac{|b-c|+|c-a|}{|a-b|+|b-c|+|c-a|}\right)\\ &-\frac{|a-b|+|b-c|+|c-a|}{4}\tag{8} \end{align} $$

  • 7
    $\begingroup$ Is it possible to generalize this idea to rewrite $\min(a_1, ... a_n)$ ? Although it would be surely awful as equation I'm interested ;-) $\endgroup$ Jan 29, 2014 at 19:11
  • 1
    $\begingroup$ If $a$, $b$ and $c$ are vectors for the vertices of a triangle then $\Sigma/2$ is its Spieker Center and $\Delta/4$ is its semiperimeter. Is there any significance to the circle about $\Sigma/2$ with radius $\Delta/4$? $\endgroup$ Jun 30, 2014 at 16:36
  • $\begingroup$ GeoGebra suggests that this circle doesn't (as one might hope) always go through two vertices of the triangle. When the vertices are not collinear it goes through none of the points, instead going around the triangle on the outside of all the vertices. $\endgroup$ Jun 30, 2014 at 17:02
  • 2
    $\begingroup$ a) The value $\Delta/4$ is actually half the semiperimeter. b) That circle is very close to being the Excircles Radical Circle $\endgroup$ Nov 17, 2017 at 14:00

Here is a hint why there is no simple such formula:

In the case of two variables $a_i$ they are the zeros of the polynomial $$p(x):=(x-a_1)(x-a_2)=x^2 -(a_1+a_2)x + a_1 a_2\ .$$ Therefore by the formula for quadratic equations we have $$\min(a_1, a_2)\ =\ {a_1+a_2-\sqrt{(a_1+a_2)^2 -4a_1 a_2}\over 2} ={a_1+a_2\over2}-{|a_1-a_2|\over 2}\ .$$

Using the same idea with three variables $a_i$ we would have to look at the third degree polynomial $$q(x):=(x-a_1)(x-a_2)(x-a_3)$$ which has three real roots. Therefore we are in the "casus irreducibilis" of Cardano's formula, which can only be solved via complex numbers. Even if you would write everything out, you couldn't decide "by inspection" which root is the smallest.

  • 2
    $\begingroup$ That's good stuff. $\endgroup$ May 29, 2013 at 17:30

If you want a symmetric expression, you can take $\frac13 (\min(a,\min(b,c))+\min(b,\min(a,c))+\min(c,\min(a,b)))$. But if you rewrite it using that absolute-value trick, I still don't think it gives something that's "intuitively the minimum", I'm afraid...


Based on Christian Blatter's answer and the trigonometric solution of the cubic equation, we can derive the following unusual solution.

Let $a$, $b$ and $c$ be real numbers. Then they are the roots of the equation


which can also be written as


The trigonometric formula gives the solutions of a cubic equation in terms of its coefficients. If we substitute in the above coefficients and simplify we get an expression for the three roots, but now their size order is clear. Let $M$ be the average of $a$, $b$ and $c$, and let $P$ and $Q$ be the quadratic and geometric means of the quantities $a+b-2c$, $a-2b+c$ and $-2a+b+c$. That is:

$$M=\frac{a+b+c}3,$$ $$P=\sqrt{\frac{(a+b-2c)^2+(a-2b+c)^2+(-2a+b+c)^2}3},$$ $$Q=\sqrt[3]{(a+b-2c)(a-2b+c)(-2a+b+c)}.$$

Then we have

$$\max(a,b,c)=\frac{\sqrt 2}3P\cos\left(\frac 13\arccos\left(\sqrt 2\left(\frac QP\right)^3\right)\right)+M,$$

$$\mathrm{median}(a,b,c)=\frac{\sqrt 2}3P\cos\left(\frac 13\arccos\left(\sqrt 2\left(\frac QP\right)^3\right)+\frac{2\pi}3\right)+M,$$

$$\min(a,b,c)=\frac{\sqrt 2}3P\cos\left(\frac 13\arccos\left(\sqrt 2\left(\frac QP\right)^3\right)+\frac{4\pi}3\right)+M.$$

  • $\begingroup$ This also answers an Olympiad style inequality: "If $x+y+z=0$, $P=\sqrt{(x^2+y^2+z^2)/3}$ and $Q=\sqrt[3]{xyz}$ show that $\left|\frac QP\right|\leq\sqrt[6]2$." $\endgroup$ Feb 17, 2017 at 17:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .