In case the domain is finite, the values of the function can be given as a table. E.g., let \(\mathcal{T}\) be the set of truth values {T, F}. Then \(\neg: \mathcal{T}\to\mathcal{T}\) is a function defined by the table
+-----+--------+
| P | NOT(P) |
+=====+========+
| T | F |
+-----+--------+
| F | T |
+-----+--------+
The function can also be given by a formula. E.g. Let \(f : \mathbb{R}\to\mathbb{R}\) be a function given by the formula \(f(x)=x^2\) for all \(x\in\mathbb{R}\). This is the familiar square function we studied in calculus.