Equivalence

From MediaWiki
Jump to navigation Jump to search

Equivalence

Equivalence is the logical operation corresponding to "IF AND ONLY IF". It states that two propositions are logically identical in truth value.

Symbols

  • p ↔ q (standard notation)
  • p ⇔ q (alternative)
  • p IFF q (short for "if and only if")

Definition

The equivalence p ↔ q is true if p and q have the same truth value. It is false if their truth values differ.

Truth Table

p q p ↔ q
T T T
T F F
F T F
F F T

Examples

  • If p = "2 is even" and q = "4 is divisible by 2",
 then p ↔ q is true, since both are true.
  • In Python: p == q (when p and q are booleans)
  • In Java: p == q (when p and q are booleans)