INPUT OUTPUT
A B A B
0 0 1
0 1 0
1 0 0
1 1 1

In logic and mathematics, if and only if (sometimes abbreviated as iff) is a logical operator denoting a logical biconditional (often symbolized by [1] or). It is often used to conjoin two statements which are logically equivalent.[2]

In general, given two statement A and B, the statement "A if and only if B" is true precisely when both A and B are true or both A and B are false.[3][4] In which case, A can be thought of as the logical substitute of B (and vice versa).[5]

An "if and only if" statement is also called a necessary and sufficient condition.[6][2] For example:

Note that the truth table shown is also equivalent to the XNOR gate.

[change | change source]

References

[change | change source]
  1. "Comprehensive List of Logic Symbols". Math Vault. 2020-04-06. Retrieved 2020-09-04.
  2. 2.0 2.1 "The Definitive Glossary of Higher Mathematical Jargon: If and Only If". Math Vault. 2019-08-01. Retrieved 2020-08-22.
  3. Weisstein, Eric W. "Equivalent". mathworld.wolfram.com. Retrieved 2020-09-04.
  4. Peil, Timothy. "Conditionals and Biconditionals". web.mnstate.edu. Archived from the original on 2020-10-24. Retrieved 2020-09-04.
  5. ""If and Only If"". www.math.hawaii.edu. Retrieved 2020-08-22.
  6. Weisstein, Eric W. "Iff". mathworld.wolfram.com. Retrieved 2020-08-22.