What does the exclamation mark do?

Probably you're thinking about the symbol for the factorial function: $$n! = 1\times 2 \times 3\times \cdots \times (n-1) \times n$$


An exclamation mark can also be shorthand for "unique". For example, the statement $$\forall y\in f(A), \exists!x\in A \text{ s.t. } y=f(x)$$ would be read as "for all $y$ in the range of $f$, there exits a unique $x$ in the domain such that $y=f(x)$". In other words, $f$ is one-to-one.


...or possibly double factorial $n!! = n \times (n-2) \times (n-4) \times \cdots $, or maybe subfactorial, $!n$, also known as derangement number.

Added ... and superfactorial for desert.