A relation R from the set A to set B is a subset of A * B. If A is any set then any subset of A * A is a relation on A. If R is relation from the set A to set B and (a, b) $\in$ R, then we say a is related to b under the relation R. This is denoted by a R b. If (a, b) not equal R then we write a R b under the relationship R.

Example: Consider the sets A = {1, 2, 3, 4} and B = {3, 5, 7}
Set R = |(a, b)| a $\in$ A, b $\in$ B a < b}, is a relation from the set A into set B.

Solution: If A has m elements and B has n elements, then we know that A * B has mn elements. Thus there are 2$^{mn}$ subsets of A * B. Hence there are 2$^{mn}$ different realtions from the set A into B.

Let R $\subset$ A * B be a relation from the set A into set B . Then the set
{ a | (a, b) $\in$ R}
is called the domain of the relation R and the set {a| (a, b) $\in$ R} is called the range of the relation R.

A relation R on a set A is called reflexive, if (x, x) $\in$ R for all x $\in$ A. That is R is reflexive on the set A  if x R x for all x $\in$ A.
That is R is reflexive on the set A if x R x for all x $\in$ A.

A relation R on a set A is not reflexive if there exists at least one element x $\in$ A such that (x, x) $\notin$ R.
The identity relation  on A is reflexive.

The relation similar defined on the set of all triangles on a plane, is reflexive, where as the relation less than defined on the set of all real numbers is not reflexive for a < a for any a $\in$ R.
Example: Let R and R' be two relations defined on A. Show that
If R and R' are reflexive, then R $\cup$ R' and R $\cap$ R' are both reflexive.

Solution:
Since R and R' are relations on A, R $\subset$ A * A and R' $\subset$ A * A
Thus R $\cup$ R' and R $\cap$ R' are subsets of A * A and hence they are relations on A.

By data R and R' are reflexive.
$\forall$ a $\in$ A, (a, a) $\in$ R and (a, a) $\in$ R'
$\rightarrow$ (a, a) $\in$ R $\cup$ R' and (a, a) $\in$ R $\cap$ R'  for all a $\in$ A.

Hence R $\cup$ R' and R $\cap$ R' are reflexive.
A relation R on a set A is said to be transitive relation if:

(x, y) $\in$ R and (y, z) $\in$ R

$\rightarrow$ (x, z) $\in$ R

That is if x R y  and y R z

$\rightarrow$ x R z

The relation R on a set A is not a transitive relation if

x R y and y R z but x $\not$ R z

The relation R defined on the set L of all lines on a plane by I$_{1}$ R $l_{2}$ if and only if I$_{1}$ is perpendicular to I$_{2}$.

Where I$_{1}$ and I$_{2}$ are any two lines on the plane, is not transitive. However the relation parallel defined on the same set L is transitive.

Example: Let R and R' be two relations defined on A. Show that

If R and R' are transitive, then R $\cap$ R' is transitive but R $\cup$ R' need not be transitive.

Solution : Since R and R' are relations on A, R $\subset$ A * A and R' $\subset$ A * A

Thus R $\cup$ R' and R $\cap$ R' are subsets of A * A and hence they are relations on A.

Let (a, b) $\in$ R $\cap$ R' and (b, c) $\in$ R $\cap$ R'

[(a, b) $\in$ R and (a, b) $\in$ R'] and [(b,c) $\in$ R and (b,c) $\in$ R']

[(a, b) $\in$ R and (b, c) $\in$ R] and [(a, b) $\in$ R' and (b, c) $\in$ R']

(a, c) $\in$ R and (a, c) $\in$ R'  (Since R and R' are transitive)

(a, c) $\in$ R $\cap$ R'

R $\cap$ R' is transitive.

Given below is an example to show that if R and R' are transitive R $\cup$ R' need not be transitive.

Consider A = {3, 4, 5}, R and R' be the relations on A, given by R = {(3, 4)} and R' = {(4, 5)}. These are clearly transitive.

f(x) = x$^{2}$ + 3x + 1, g(x) = 2x - 3

Now R $\cup$ R' = { (3, 4), (4, 5)} is not transitive for (3, 4) $\in$ R $\cup$ R' and (4, 5) $\in$ R $\cup$ R' but (3, 5) $\notin$ R $\cup$ R'.
A relation R defined on the set A is called symmetric relation if:

(x, y) $\in$ R $\rightarrow$ (y, x) $\in$ R

A relation R on a set A is said to be not symmetric if there exists a, b $\in$ A with a $\neq$ b such that (a, b) $\in$ R but (b, a) $\neq$ R

Since (x, y) $\in$ R  $\rightarrow$ (y, x) $\in$ R$^{-1}$ the relation R will be symmetric if R = R$^{-1}$

Example: Consider R and R' be two relations defined on A. Show that If R and R' are symmetric then R $\cup$ R' and R $\cap$ R' are both symmetric.

Solution:  Let (a, b)  $\in$ R $\cup$ R'

$\rightarrow$ (a, b) $\in$ R or (a, b) $\in$ R'

$\rightarrow$ (b, a) $\in$ R or (b, a) $\in$ R'

Since R and R' are symmetric

$\rightarrow$ (b, a) $\in$ R $\cup$ R'

Therefore R $\cup$ R' is symmetric.

Again let (a, b)  $\in$ R $\cap$ R'

$\rightarrow$ (a, b) $\in$ R and (a, b) $\in$ R'

$\rightarrow$ (b, a) $\in$ R and (b, a) $\in$ R'

Since R and R' are symmetric

$\rightarrow$ (b, a) $\in$ R $\cap$ R'

Therefore R $\cap$ R' is symmetric.
Equivalence relation is one which is reflexive, symmetric and transitive.
A relation R defined on a set A is called an equivalence relation, if it is reflexive, symmetric and transitive.

Example 1: Let R be the relation defined on the set Z of integers by R = {(x, y) | (x - y) is divisible by 5}. Show that R is an equivalence relation.

Solution: By data it is given that x R y if and only if 5 | (x - y)

Now for every x $\in$ Z, 5 | (x - y). Thus x R x, for all x $in$  Z,

Therefore R is said to be reflexive.

Now, x R y

$\rightarrow$ 5| (x - y)

$\rightarrow$ 5| - (x - y)          (Since $\frac{a}{b}$ $\rightarrow$ $\frac{a}{- b}$)

$\rightarrow$ 5 | (y - x)

Therefore y R x

Thus x R y = y R x

Therefore as we see from above R is said to be symmetric.

Again let, x R y and y R z

$\rightarrow$ 5| (x - y)  and 5 | (y - z)

$\rightarrow$ 5| (x - y) + (y - z)

(Since $\frac{a}{b}$ and $\frac{a}{c}$  $\rightarrow$ $\frac{a}{b}$ + c)

$\rightarrow$ 5| (x - z)

$\rightarrow$  x R z

Thus x R y and y R z

$\rightarrow$ x R z

Therefore R is transitive and hence R is said to be in an equivalence relation.