A relation is any association between elements of one set, called the set of inputs, and another set, called the set of outputs and can be written as ordered pairs. There is a difference between the range and co-domain. Range of a relation and means the set of all possible outputs - values that the relation does not actually use.

For example, if domain is a set of Fruits = {apples, grapes, bananas} and the co-domain is a set of Colors = {red, green, yellow} then the colors of these fruits form a relation. We might say that apples are related to red, while grapes are related to green only and bananas to yellow only.

Another way of looking at this is to say that a relation is a subset of ordered pairs drawn from the set of all possible ordered pairs of elements of two other sets, which we normally refer to as the Cartesian product of those sets.

Using the example above, we can write the relation in set notation: {(apples, red),

(grapes, green), (bananas, yellow)}.

In general, a relation is any subset of the Cartesian product of its domain and co-domain. If A and B are two sets, then a relation R from A to B is a sub set of A × B. So R is a relation, if R $\subseteq $ { (x , y) I x $\in$ X and y $\in$ Y} for domain A and co-domain B.

**Example 1:** Consider the sets A = { a, b, c} and B = { 1, 2, 3},

then the Cartesian product of A and B is A x B = { (a,1), (b,2), (c,3)}.

If we take B x A = {(1,a),(2,b), (3,c)}.

It is clear that A x B $\neq$ B x A , i.e. formation of Cartesian product is not commutative.

**Example 2:** Consider a set A = { a,b,c,e,f,i}.

Now consider the relation on

B = { (x,y) $\in$ A x A I where x is vowel and y is not a vowel}

Then elements of B are:

{(a,b), (a,c), (a,f), (e,b), (e,c), (e,f), (i,b), (i,c), (i,f)}

We can also write these elements as

aRb, aRc, aRf, eRb, eRc, eRf, iRb, iRc, iRf.

→ Read More