A function is an association between two variables. For example, a person’s height is a function of
their age.
Functions can also be abstracted to a box, called the process, with which are associated an input and
one or many outputs.
What is a function?
In terms of sets, a function is a type of binary relation that associates each element of a set with a
unique element of another set.
For two sets, A and B, if one element in A is not mapped to an element in set B, then the relation is
not a function. The same is true, if one element in A is mapped to multiple elements in B.
A function from a set A to a set B, is a relation from A to B if:
For every a ∈ A, there exists a unique b ∈ B such that <a, b> ∈ f.
A function from set A to B can also be written as f: A → B
In this way, A is known as the Domain and B is known as the Codomain.
An element in the codomain may be known as a function of an element(s) in the domain or as
images. Preimages are the elements in the domain to which are mapped to the relevant image.
For example:
A B
A 1
B 2
C 3
This diagram represents a function between sets A and B. A is the Domain and B is the Codomain. ‘1’
is the image of A and also ‘1’ = f(A) = f(B) as stated above. In the same way. B is the Preimage of ‘1’,
as is A.
The Range of a function is the set of all its outputs, or images. The range is always a subset of the
codomain. In the example above, Range = {1, 2}.