Function

« Back to Glossary Index

Basic definition of a Function

A function is a mathematical relation between two sets of numbers: for each element in the first set (called the domain) there is assigned exactly one element in the second set (called the codomain or range).

In other words:

A function is like a machine: it takes an input, applies an operation, and produces a single output.

Notation

f: X right Y

where f is the function, X is the domain and Y is the codomain.

If we give the function a value x, it returns a value:

y = f(x)

where y is the output corresponding to x.

Simple example

f(x) = 2x + 3
  • If we input x = 1, we get f(1) = 5.
  • If we input x = 4, we get f(4) = 11.

Graphical example

When plotting a function on the plane, each value of x has a unique output point y.

To verify this, we use the vertical line test: if a vertical line intersects the graph at more than one point, it is not a function.

Graphical example of the vertical line test: function vs non-function
Minimalist icon representing a mathematical function with notation f: X → Y in corporate fuchsia (#FC3869) on a white background, deGalaLab style.

In summary:

A function is a relation that assigns each input value to exactly one output value.

« Back to Glossary Index