A relation from A to B is a rule that assigns elements of A to elements of B. A relation from a set A to itself is referred to as a relation on A. An example of a relation would be a function but not all relations are functions. Indeed there are two elementary examples to show this. The first is the relation that assigns to each element of A every element of B. The second is the empty relation that assigns no element of A to any in B.
A relation expresses just what we think of in every day life. For example we might have two sets of students and say that a student in the first set is related to a student in the second set if they have taken a class together. Certainly we might envisage a situation where a student in the first set is related to several students in the second set as well as a student in the first set who is not related to anyone in the second set.
Another way to view a relation is as a subset of the Cartesian product
. For our two elementary examples above, the relations would
be
and
, respectively. You have probably seen
relations on the real numbers, R. For example, a real number x
is related to a real number y if
. The picture of this
in the plane is the unit circle.
To picture a relation between finite sets we can draw a table. The columns
are indexed by the elements of A and the rows by the elements of
B. If
is related to
then we put a 1 in the (a,b)
position of the table, otherwise we put a 0. Here is an example for
and
.
This shows that 3 is related to both x and y but 2 is not related to either.
As we can think of a relation from A to B as a subset of
then if A has n elements and B has m
elements then there are
possible relations.
Relations can also be specified by a formula (as in the unit circle above)
or in a descriptive way (as for the student example). However, it is possible
that two apparently different relations yield the same subset of
.
Another way to represent a relation between finite sets is to use a digraph. We represent each element of the sets A and B as dots or vertices. If a is related to b we draw an arrow from the vertex representing a to the vertex representing b. Note that if the same symbol is used in both sets, we think of each as distinct objects and draw a vertex for each. The picture below gives a digraph of the example that we tabulated above.

It is convenient to represent a relation by a letter or a symbol such as
R or
etc. If R is the letter for the relation and
is
related to
then we would write aRb. If the two are elements are
not related then we could express that by drawing a / through the symbol
representing the relation. So if
is the symbol that we use for the
relation and a and b are not related, we would write
.