Courses / Computer Science I
Discrete Mathematics

Relations

Computer Science I 289 words Free to read

Connecting Elements

A binary relation RR on a set is a collection of ordered pairs — it says which elements are "related." "Is less than," "is equal to," "divides," and "is a sibling of" are all relations. Formally, RR is a subset of the set of all pairs (a,b)(a, b), and we write aRba\, R\, b when the pair is in RR. Relations underlie ordering, equivalence, databases, and graphs.

Three properties classify relations:

Two combinations are especially important. An equivalence relation is reflexive, symmetric, and transitive — it behaves like "sameness" and partitions the set into disjoint equivalence classes (all elements equivalent to each other). "Has the same remainder mod 5" is an equivalence relation; its classes are the five remainder groups. A partial order is reflexive, antisymmetric (if aRba\,R\,b and bRab\,R\,a then a=ba = b), and transitive — it captures "ordering" like \le or "divides" or subset inclusion, where some elements may be incomparable.

The power of these properties is that they let us reason about a relation abstractly: knowing a relation is an equivalence relation immediately tells us it partitions the set, no matter what the relation actually is.

Common pitfall: confusing symmetric with transitive, or assuming a relation with one property has the others. Symmetry is about reversing a single pair (aRbbRaa\,R\,b \Rightarrow b\,R\,a); transitivity chains two pairs into a third (aRb,bRcaRca\,R\,b, b\,R\,c \Rightarrow a\,R\,c). A relation can easily have one without the other — "is one mile from" is symmetric but not transitive.

Practise this lesson

The explanation above is free to read. The graded practice for this lesson lives in the Tryals app.

10practice questions
2interactive scenes
Start Computer Science I free

Discrete Mathematics