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]

INPUTOUTPUT
ABA B
001
010
100
111

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:

  • "Madison will eat the fruit if and only if it is an apple" is equivalent to saying that "Madison will eat the fruit if the fruit is an apple, and will not eat the fruit if it is not an apple". That the given fruit is an apple is both a necessary and a sufficient condition for Madison to eat the fruit.

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

References

Wikiwand in your browser!

Seamless Wikipedia browsing. On steroids.

Every time you click a link to Wikipedia, Wiktionary or Wikiquote in your browser's search results, it will show the modern Wikiwand interface.

Wikiwand extension is a five stars, simple, with minimum permission required to keep your browsing private, safe and transparent.