# Mathematical representation of the largest element in a set

I've looked but cannot find the mathematical way to represent the following:

r = Max(x1, x2, x3)


I want to mathematically show that r = max value of the set (x1, x2, x3). To make sure I'm being clear, I want to write the math formula of the code equivalent.

As I responded on stackoverflow...

You can take the infinity/uniform norm of the corresponding tuple, which is defined as

$$\lim_{n \rightarrow \infty} (|x_1|^n + |x_2|^n + |x_3|^n + ...)^{\frac{1}{n}}$$

Or you can just have a maximum/infimum function... what exactly is your problem with using that?

Alternatively, you can define $f\mbox{ = max}$ recursively as

$$f(\{a_1,a_2,a_3,\cdots\}) = \begin{cases} a_1 & \mbox{if the sequence is singleton} \\ f(\{a_2,a_3,a_4,\cdots\}) & \mbox{if } a_1 \leq a_2 \\ f(\{a_1,a_3,a_4,\cdots\}) & \mbox{otherwise} \end{cases}$$

This can be made a lot nicer if you allow $f$ to be a two variable function with an accumulator.

• Yeah, the max function is perfectly legitimate. One can also use: $\max(a,b)=\frac{1}{2}(a+b+|a-b|)$. Dec 19, 2010 at 13:32
• I have no issue with the function. I just want to know how to write it correctly as a math formula. Average, sum, etc. is easy. But how do we say max? Do we write the word "max"? Dec 19, 2010 at 13:34
• Just writing 'max' is fine. Also of note is the supremum, which is the least upper bound of the sequence (this can be different from maximum if the sequence is infinite... consider the sequence {1-1/n}, which has no maximum but a least upper bound of 1). Dec 19, 2010 at 13:39

I wouldn't write $\max(a,b)$ or $\max(a,b,c)$. For me, max assigns to a set its maximal element (if it exists), so I use $\max\{a,b\}$ and $\max\{a,b,c\}$. In general, if $A$ is a set of real numbers, I write $\max A := \sup A$ (the supremum of $A$) if $\sup A$ is an element of $A$.