Equivalence Classes Formed by a Key

An equivalence relation groups each element with all elements related to it. Equal values of a key define one such relation.

Source
Anbloq
Language
English
Created
Updated
Chapters
4
Reading time
1 min
In this article4 chapters
  1. Group by a remainder
  2. Connect membership and grouping
  3. Recover the partition induced by a key
  4. Keep representative choice outside the relation

Group by a remainder

Among 0 through 5, grouping by remainder modulo three gives \(\{0,3\},\{1,4\},\{2,5\}\). Every integer in that domain has one remainder. See quotient and remainder for the operation.

Connect membership and grouping

Same remainder is reflexive, symmetric, and transitive because equality has those properties. Each resulting group appears in a set partition, and referring to one group suffices when calculations depend only on the remainder.[1]

Recover the partition induced by a key

Associate each integer with its remainder modulo three. Over \(\{0,1,2,3,4,5,6\}\), the class of four is \(\{1,4\}\). Key equality is reflexive, symmetric and transitive because those properties hold for equality itself. See partitions as buckets.

Key 0: {0,3,6}
Key 1: {1,4}
Key 2: {2,5}
Each element appears in exactly one class

Keep representative choice outside the relation

Choosing the smallest element gives class one the representative one. Another rule may choose four without changing equivalence. If representatives become stored external identifiers, changes in class membership can change that choice. Define whether consumers depend on stable IDs.

References

  1. Eric Lehman, F. Thomson Leighton and Albert R. Meyer, Mathematics for Computer Science ↩