Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between equality and equivalence?

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?

like image 881
Tristan Havelick Avatar asked Nov 23 '08 00:11

Tristan Havelick


People also ask

Is equality an equivalence relation?

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.

What is equivalence and example?

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.

What equivalence means?

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.

What is difference between equivalent and identical?

identical means that it only looks the same. equivalent means that they are equal.


1 Answers

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.

like image 53
Eugene Yokota Avatar answered Sep 23 '22 00:09

Eugene Yokota