Define a function as a set of ordered pairs.
A function is a set of ordered pairs with the property that no two ordered pairs have the same first component and different second components.
Sometimes we say that a function is a rule (correspondence) that assigns to each element of one set, X, only one element of another set, Y.
The elements of set X are often called inputs and the elements of set Y are called outputs.
The domain of a function is the set of all first components, x, in the ordered pairs.
The range of a function is the set of all second components, y, in the ordered pairs.
A function can be defined by a set of ordered pairs.
Example: {(1,a), (2, b), (3, c), (4,a)} is a function, since there are no two pairs with the same first component.
The domain is then the set {1,2,3,4} and the range is the set {a, b, c}.