![]() |
VOOZH | about |
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:
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.
An arrow diagram visually shows a relation by drawing arrows from elements of set A to elements of set B that are related.
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.
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).
A binary relation can also be represented as a directed graph, where:
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.
| x is greater than y | 1 | 2 | 3 |
|---|---|---|---|
| 1 | ❌ | ✔ | ✔ |
| 2 | ❌ | ❌ | ✔ |
| 3 | ❌ | ❌ | ❌ |
Read More,