Function
A function is a process that converts units of one mathematical notion into units of another.
The notation Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle f : A \rightarrow B} is shorthand for the following statement: Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle A} and Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle B} are some mathematical notions, Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle f} is a function converting an Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle A} into a Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle B} .
Examples

Functions
The following table encodes a function:
| x | (0,0) | (1,0) | (0,1) | (1,1) |
| f(x) | 0 | 1 | 1 | 0 |
That table describes the input and output of an XOR gate. A XOR gate (another example of something that performs a function) can be seen in figure (1). The following lines of C++ code perform a function:

string reverseString(const string &s) {
string returnStr = "";
for (int i = s.size() - 1; i >= 0; --i) {
returnStr.append(s[i]);
}
return returnStr;
}
A sequence is a function.
A table describing several trigonometric functions is shown in figure (2).
A graph can describe a function: it provides instructions for producing outputs from inputs.
The method that an elementary schooler learns for carrying out long division is a function.
Non-functions
A coffee machine is not a function. It carries out a process; it takes some inputs (energy, water, coffee grounds, paper filter) and converts them into coffee. But the inputs and outputs are not mathematical notions.
The traditional concept
In standard mathematics, a function always converts elements of a set Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle X} into elements of a set Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle Y} . The sets could be infinite, so the function doesn't have to describe a real process. In fact, though standard mathematicians usually think about functions as if they were processes, standard mathematics technically doesn't define functions as processes at all. Rather, it defines a function from Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle X} to Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle Y} as a subset of Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle X \times Y} satisfying certain conditions.
A function doesn't have to describe a real process, beca