If and only if - "Material equivalence" redirects here , in
logic and fields that rely on it such as mathematics , is a
logical connective between statements which means that the truth
of either one of the statements requires the truth of the other.
Thus, either both statements are true, or both are false. To put
it another way, the first statement will always be true when the
second statement is, and will only be true under those
conditions. In writing, common alternative phrases to "if and
only if" include iff, Q is necessary and sufficient for P, P is
equivalent to Q, P precisely if Q, P precisely (or exactly) when
Q, P exactly in case Q, and P just in case Q. Many authors
regard "iff" as unsuitable in formal writing; others use it
freely. The statement "(P iff Q)" is equivalent to the statement
"not (P xor Q)" or "P == Q" in computer science. In logic
formulas, logical symbols are used instead of these phrases; see
the discussion of notation. The truth table of p iff q (also
written as p ↔ q ) is as follo