Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a mathematical function such that;

f(3, 5)   = 3
f(10, 2)  = 2
f(14, 15) = 14
f(9, 9)   = 9

It would be even more cool if there's a function that takes three (3) parameters, but that one could be solved by using recursive functionality;

f( f(3, 5), 4) = 3
share|cite|improve this question
You mean you don't consider min(x,y) a mathematical function? Please define "mathematical function". – Alex B. Dec 6 '10 at 13:43
@Alex Bartel, Well, yes I do - but could it be expressed with arithmetic operators? – Björn Dec 6 '10 at 13:49
up vote 13 down vote accepted


Oscar gave a nice interpretation of the above formula in his follow-up question, but I'll give a dumb derivation here for completeness.

Making use of Iversonian brackets, we have

$$\min(x,y)=x[y \geq x]+y[y < x]$$

and since $[\neg p]=1-[p]$,

$$\min(x,y)=x[y \geq x]+y(1-[y \geq x])=y-(y-x)[y-x \geq 0]$$

Now, there is the identity

$$\frac{u+|u|}{2}=u[u \geq 0]$$

and so we have


which simplifies to the desired expression.

The extension to more than two arguments is no longer as compact, though, since one now has to contend with products of Iversonian brackets ($[p \land q]=[p]\cdot[q]$).

share|cite|improve this answer
Is there some nice way of expressing the minimum of three variables using the absolute value function? (Where nice means that the expression is symmetric in the three variables; f(x,f(y,z)) doesn't count because it isn't pretty enough.) – Oscar Cunningham Dec 6 '10 at 14:07
Maybe that ought to be a separate question, @Oscar... (I don't know the answer either.) – J. M. Dec 6 '10 at 14:12
I don't really see in what sense the absolute value is more of an "arithmetic operator" than min. – Qiaochu Yuan Dec 6 '10 at 22:53
Thanks @J.M., you saved my head from being exploded. – Adnan Aug 20 '12 at 12:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.