Function
A function is a process that converts units of one mathematical notion into units of another.
The notation is shorthand for the following statement: and are some mathematical notions, is a function converting an into a .
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 into elements of a set . 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 to as a subset of satisfying certain conditions.[Notes 1]
A function doesn't have to describe a real process, bec
Notes
Cite error: <ref>
tags exist for a group named "Notes", but no corresponding <references group="Notes"/>
tag was found