# Arg max

{{ safesubst:#invoke:Unsubst||$N=Refimprove |date=__DATE__ |$B= {{#invoke:Message box|ambox}} }}

In mathematics, arg max stands for the argument of the maximum, that is to say, the set of points of the given argument for which the given function attains its maximum value.[note 1]

## Definition

The arg max is defined by

$\operatorname {*} {arg\,max}_{x}f(x):=\{x\mid \forall y:f(y)\leq f(x)\}.$ In other words, it is the set of points x for which f(x) attains its largest value. This set may be empty, have one element, or have multiple elements. For example, if f(x) is 1−|x|, then it attains its maximum value of 1 at x = 0 and only there, so

$\operatorname {*} {arg\,max}_{x}(1-|x|)=\{0\}$ .

The arg max operator is the natural complement of the max operator which, given the same function, returns the maximum value instead of the point or points that reach that value; in other words

$\max _{x}f(x)$ is the element in $\{f(x)\mid \forall y:f(y)\leq f(x)\}.$ This set can contain no elements (in which case the maximum is undefined) or one element, but cannot contain multiple elements.

Equivalently, if M is the maximum of f, then the arg max is the level set of the maximum:

$\operatorname {*} {arg\,max}_{x}\,f(x)=\{x\mid f(x)=M\}=:f^{-1}(M)$ If the maximum is reached at a single point then this point is often referred to as the arg max, meaning we define the arg max as a point, not a set of points. So, for example,

$\operatorname {*} {arg\,max}_{x\in \mathbb {R} }(x(10-x))=5$ (rather than the singleton set {5}), since the maximum value of x(10 − x) is 25, which occurs for x = 5.[note 2] However, in case the maximum is reached at many points, arg max is a set of points.

Then, we have for example

$\operatorname {*} {arg\,max}_{x\in [0,4\pi ]}\cos(x)=\{0,2\pi ,4\pi \}$ since the maximum value of cos(x) is 1, which occurs on this interval for x = 0, 2π or 4π. On the whole real line, the arg max is $\{0,2\pi ,-2\pi ,4\pi ,\dots \}.$ Note also that functions do not in general attain a maximum value, and hence will in general not have an arg max: $\operatorname {*} {arg\,max}_{x\in \mathbb {R} }x$ is the empty set, as x is unbounded on the real line. However, by the extreme value theorem (or the classical compactness argument), a continuous function on a compact interval has a maximum, and thus an arg max.

## Arg min

arg min stands for argument of the minimum, and is defined analogously. For instance,

$\operatorname {*} {arg\,min}_{x}\,f(x)$ are points x for which f(x) attains its smallest value. The complementary operator is, of course, min.