I've read a few instances in reading mathematics and computer science that use the equivalence symbol ≡
, (basically an '=' with three lines) and it always makes sense to me to read this as if it were equality. What is the difference between these two concepts?
Equality is both an equivalence relation and a partial order. Equality is also the only relation on a set that is reflexive, symmetric and antisymmetric. In algebraic expressions, equal variables may be substituted for one another, a facility that is not available for equivalence related variables.
Definition. An equivalence relation on a set S, is a relation on S which is reflexive, symmetric and transitive. Examples: Let S = ℤ and define R = {(x,y) | x and y have the same parity} i.e., x and y are either both even or both odd. The parity relation is an equivalence relation.
Definition of equivalence 1a : the state or property of being equivalent. b : the relation holding between two statements if they are either both true or both false so that to affirm one and to deny the other would result in a contradiction. 2 : a presentation of terms as equivalent.
identical means that it only looks the same. equivalent means that they are equal.
Wikipedia: Equivalence relation:
In mathematics, an equivalence relation is a binary relation between two elements of a set which groups them together as being "equivalent" in some way. Let a, b, and c be arbitrary elements of some set X. Then "a ~ b" or "a ≡ b" denotes that a is equivalent to b.
An equivalence relation "~" is reflexive, symmetric, and transitive.
In other words, = is just an instance of equivalence relation.
Edit: This seemingly simple criteria of being reflexive, symmetric, and transitive are not always trivial. See Bloch's Effective Java 2nd ed p. 35 for example,
public final class CaseInsensitiveString { ... // broken @Override public boolean equals(Object o) { if (o instance of CaseInsensitiveString) return s.equalsIgnoreCase( ((CaseInsensitiveString) o).s); if (o instanceof String) // One-way interoperability! return s.equalsIgnoreCase((String) o); return false; } ... }
The above equals implementation breaks the symmetry because CaseInsensitiveString
knows about String
class, but the String
class doesn't know about CaseInsensitiveString
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With