A function from a set (the domain) to a set (the codomain) is a rule that assigns to each element exactly one . The set of all actual outputs is the range.
Functions are the backbone of all of mathematics — calculus studies their derivatives and integrals, linear algebra studies linear functions (matrices), and computer science studies them as algorithms.
A function can be defined by:
- A formula (),
- A graph (set of points),
- A table of input-output pairs,
- Or a verbal rule.
The vertical line test distinguishes functions from arbitrary relations: any vertical line crosses the graph of a function at most once.