In general, A × B ≠ B × A.

Relation A relation R from a set A to a set B is a subset of the cartesian product A × B obtained by describing a relationship between the first element x and the second element y of the ordered pairs in A × B.

The image of an element x under a relation R is given by y, where (x, y) ∈ R,

The domain of R is the set of all first elements of the ordered pairs in a relation R.

The range of the relation R is the set of all second elements of the ordered pairs in a relation R.

Function A function f from a set A to a set B is a specific type of relation for which every element x of set A has one and only one image y in set B. We write f: A→B, where f(x) = y.

A is the domain and B is the codomain of f.

The range of the function is the set of images.