Equivalence relation examples [0094]
- March 4, 2026
Example Equality [0090]
- March 4, 2026
Of course, equality itself is an equivalence relation. We can check that it is indeed reflexive, symmetric, and transitive.
Example Words by length [0091]
- March 4, 2026
Consider the relation L on the set of all English words, where two words are related if and only if they have the same number of letters. This is an equivalence relation:
Reflexive? Check, each word has the same number of letters as itself.
Symmetric? Check, if a has the same number of letters as b, then b has the same number of letters as a.
Transitive? Check, if a has the same number of letters as b, and b has the same number of letters as c, then a has the same number of letters as c.
Example Last digit in base 10 [0092]
- March 4, 2026
What about the example from last time where two numbers were related when they had the same last digit in base 10? This is an equivalence relation too. Reflexivity, symmetry, and transitivity follow straightforwardly from the definition. Later in the semester, we will explore a more general version of this relation.
Example If and only if [0093]
- March 4, 2026
If and only if, aka biconditional (\leftrightarrow ), is an equivalence relation on propositions.
Example Case-insensitive equality [009M]
- March 7, 2026
We can define a relation on strings where two strings are related if they have the same characters in the same order, except that letters may differ in whether they are upper- or lowercase. For example, Straw! would be related to sTRaW! but not to strawberry, nor to warts.
Example Lists up to reordering [009N]
- March 7, 2026
As another example, consider the relation on lists of elements, where two lists are related if they have exactly the same elements, but possibly in a different order. For example, [1,2,3,1] is related to [3,1,1,2], but not to [3,2,1].
Many equivalence relations that arise naturally in mathematics and computer science are like this: we start out with a bunch of things that are all different, but there is some aspect of them we don't care about. We want to consider things "the same" if the only difference bewteen them has to do with the part we don't care about.
Example Divisibility [0095]
- March 4, 2026
What about the divisibility relation R_6? It is reflexive and transitive; however, it is not symmetric, so it is not an equivalence relation.
Example Close integers [0096]
- March 4, 2026
Consider the relation on integers given by \{(a,b) \mid |a - b| \leq 1 \}. In other words, a and b are related when they are “very close”, that is, the distance between them is at most 1. This is reflexive and symmetric, but not transitive, so it is not an equivalence relation.