A relation is just a set of pairs
No condition at all. {(1,1), (2,5)} is a relation on {1,2,5}, and so is the empty set.
Any subset of A × B is a relation. Three ways to present one — as pairs, as a matrix, as a directed graph — and the operations of inverse and composition.
Core ideas
The definition is deliberately weak: any set of pairs qualifies. The interesting relations are the ones with extra properties, from “Properties of Relations” on.
No condition at all. {(1,1), (2,5)} is a relation on {1,2,5}, and so is the empty set.
The pair list, the boolean matrix and the directed graph carry identical information. Each makes different properties obvious.
S ∘ R follows R then S. Reversing the order generally gives a different relation, and often an empty one.
The material
The definition, three ways to draw it, and two operations.
A relation from A to B is a subset R ⊆ A × B. A relation on A is a subset of A × A. We write a R b for (a, b) ∈ R.
The definition permits everything. ∅ is a relation (nothing is related), and A × A is a relation (everything is related to everything). Between those extremes there are 2^(n²) relations on an n-element set — 512 on a three-element set, and over thirty-three million on a five-element one.
The matrix is what the lab shows, because the four properties of “Properties of Relations” are all visible in it: the diagonal, the transpose, and the presence of both (a,b) and (b,a) for distinct a, b.
R⁻¹ = {(b, a) : (a, b) ∈ R} — every pair reversed. As a matrix this is the transpose.
For R ⊆ A × B and S ⊆ B × C, S ∘ R = {(a, c) : ∃b ∈ B with (a,b) ∈ R and (b,c) ∈ S}. Read right to left: apply R first, then S.
The right-to-left order is chosen to match function composition, where (g ∘ f)(x) = g(f(x)). It is a convention and some texts reverse it; what matters is being consistent and saying which you mean.
On {1,2,3}, let R = {(1,2), (2,3)} and S = {(2,1), (3,3)}. Then S ∘ R = {(1,1), (2,3)}: from 1, R reaches 2 and S takes 2 to 1; from 2, R reaches 3 and S takes 3 to 3. Meanwhile R ∘ S = {(2,2)} — a different relation.
If M_R and M_S are the boolean matrices of R and S, then the matrix of S ∘ R is the boolean product M_R M_S, where multiplication is ∧ and addition is ∨.
That is the same computation as counting walks of length 2 in “Graph Representations” in Graphs and Trees, with ∨ in place of +. Composition of relations and paths in a directed graph are the same idea.
Interactive
Decided by checking, not by name
Method
Choose the presentation that makes your question easy.
Nothing is clearer than the list for four or five pairs, and the list is what the definition actually is.
Reflexive is a full diagonal; symmetric is equal to its transpose. Both are one glance in matrix form and tedious in list form.
Transitivity and the transitive closure are statements about paths, and arrows make paths visible.
S ∘ R means R first. Pick each a, follow R to every b, then S to every c, and collect the pairs (a, c).
On {1,2,3,4}, let R = {(1,2), (2,3), (3,4)} — the successor relation.
The last line is “Properties of Relations”'s transitive closure computed by hand: the union of all powers of R is exactly the pairs joined by a path of any length. Warshall's algorithm in the lab does this without enumerating the powers.
Take R = {(1,1),(1,2),(2,3),(3,1)} on {1,2,3}, write its matrix, sketch its digraph, and compute R ∘ R in whichever presentation is easiest. Then check the answer in a second presentation.
Something to change about this lesson? Write it down, tick it off when it is handled, and export the list when you want to act on it. Kept in this browser only: nothing is sent anywhere, and nobody is notified.
No recommendations yet for this lesson.