# Symbol for “the greater of the two values”

I'm looking for an operator that returns the greater of two values.

Here's an example. If $a=5$, $b=6$ and $???$ is the operator, I'd like to have $x$ equal $b$ when I do $x=a???b$, since $b$ is the larger of the two values.

• This is usually denoted by $\max$. For instance $\max(5,6)=6$. – Git Gud Jan 4 '16 at 23:00
• @GitGud The OP was asking for an operator rather than a function. I am not sure if such an operator exists? – Mufasa Jan 4 '16 at 23:02
• @Mufasa I don't see why $a\star b$ is any more or less preferable than $\star(a,b)$ in this situation. Especially since the extension of the notation beyond the binary case for this is so useful and widely used. – JMoravitz Jan 4 '16 at 23:06
• @JMoravitz - fair enough :) – Mufasa Jan 4 '16 at 23:06
• @Mufasa One can look at $\max$ as a binary operation,pretty much by definition of binary operation. If one is required to build $\max$ from $+,-,\cdot$ and $\div$, then one can note that $$\forall x,y\in \mathbb R\left(\max(x,y)=\dfrac{x + y + |x-y|}{2}\right).$$ – Git Gud Jan 4 '16 at 23:06

You can always write $x=\max\{a,b\}$; this is common. A less common notation is $x=a\lor b$; although it is used, it is uncommon enough that I would definitely define it before using it. Note too that the more common notation easily generalizes to the maximum of any finite set of numbers: if $A=\{a_k:k=1,\ldots,n\}$, for instance, you can write $x=\max A$, $x=\max\{a_1,\ldots,a_n\}$, or $x=\max\{a_k:k=1,\ldots,n\}$.
The matching usages for the smaller of two numbers are $\min\{a,b\}$ and $a\land b$.
For $S=\{a_1,\cdots,a_n\}$, define $*$ inductively by operator $*:\mathbb{R}^n\to\mathbb{R}$ as $*(a_1,a_2)=\dfrac{|a_2-a_1|+a_2+a_1}{2}$ if $n=2$ and $*:\mathbb{R}^{n+1}\to\mathbb{R}$ as $*(a_1,...,a_n,a_{n+1})=*(*(a_1,\cdots,a_n),a_{n+1})$. Thus $*(a_1,\cdots,a_n)=\max S$ for any set $S=\{a_1,\cdots,a_n\}$.