A relation R from set A to set B is a subset of the Cartesian product A × B. That is:
R ⊆ A × B
Here, A is called the domain, and B is called the co-domain.
Each pair (a, b) ∈ R means that the element a ∈ A is related to the element b ∈ B by the relation R.
Some of the common representations of relations and functions are:
- Set of Ordered Pairs
- Arrow Diagram
- Matrix Representation
- Adjacency List
- Directed Graph
- Table Representation
Set of Ordered Pairs
A binary relation R between two sets A and B is defined as a subset of the Cartesian product A × B. It can be written as a set of ordered pairs i.e., (a, b) where a ϵ A and b ϵ B.
Example:
- Sets: A = {1, 2, 3}, B = {4, 5}
- Relation: R: A → B such that a → b + 3
- R = {(1, 4), (2, 5)}
Arrow Diagram
An arrow diagram visually shows a relation by drawing arrows from elements of set A to elements of set B that are related.
Example:
- Sets: A = {-3, -2, -1, 0, 1, 2, 3}, B = {0, 1, 2, 3}
- Relation: R: A → B such that a and -a maps to the absolute value of a.
- R = {(-3, 3), (3, 3), (-2, 2), (2, 2), (-1, 1), (1, 1), (0, 0)}
- Arrow Diagram:

Matrix Representation
A binary relation can be represented using a matrix, especially when A and B are finite. The rows correspond to elements of A, and the columns correspond to elements of B. If (a, b) ∈ R, then the matrix entry is 1; otherwise, it is 0.
Example:
- Sets: A = {1, 2, 3}, B = {4, 5}
- Relation: R = {(1, 4), (2, 5)}
- Matrix:
M = \begin{bmatrix} 1 & 0 \\ 0 & 1 \\ 0 & 0 \end{bmatrix} - Row 1 corresponds to 1 ∈ A, and column 1 corresponds to 4 ∈ B.
- M11 = 1, indicating (1, 4) ∈ R.
Adjacency List Representation
An adjacency list is a compact and efficient way to represent a graph, particularly when the graph is sparse (i.e., has fewer edges relative to the number of vertices).
- Example:
- A = {0, 1, 2, 3}
- Relation R: A → A such that
- R = {(0, 1), (0, 2), (1, 2), (2, 3)}
- Adjacency List:
- 0: {1, 2}
- 1: {2}
- 2: {3}
- 3: {}
- Adjacency List:
Directed Graph
A binary relation can also be represented as a directed graph, where:
- Elements of A and B are vertices.
- If (a, b) ∈ R, there is a directed edge from A to B.
Example:
- Sets: A = {1, 2, 3, 4}
- Relation: R: A → A such that
- R = {(1, 1), (2, 2), (3, 3), (4, 4), (2, 1), (3, 1), (4, 1), (3, 2), (4, 2), (4, 3)}
- Graph:

Table Representation
A binary relation can be presented as a table where rows correspond to elements of A, and columns correspond to elements of B. A checkmark (✔) or 1 indicates that the pair is in the relation and for those which are not in the relation we can use crossmark (❌) or 0.
Example:
- Sets: A = {1, 2, 3}, B = {1, 2, 3}
- Relation: is greater than
- R = {(2, 1), (3, 1), (3, 2)}
- Table:
| x is greater than y | 1 | 2 | 3 |
|---|---|---|---|
| 1 | ❌ | ✔ | ✔ |
| 2 | ❌ | ❌ | ✔ |
| 3 | ❌ | ❌ | ❌ |
Read More,