Define a function as a set of ordered pairs.
A function from is defined by a set of ordered pairs such that any two ordered pairs should not have the same first component and the different second component.
This means that each element of a set, say X is assigned exactly to one element of another set, say Y.
The set X containing the first components of a function is called the domain of the function.
The set Y containing the second components of a function is called the range of the function.
For example, f = {(a, 1), (b, 2), (c, 3)} is a function.
Domain of f = {a, b, c}
Range of f = {1, 2, 3}