# what is the difference between only if and iff

I have read this question. I am now stuck with the difference between if and only if and only if. Please help me out.

Thanks

-
The moon is made of lemon meringue only if $1+1=2$. –  Ilmari Karonen Sep 28 '11 at 20:08

Let's assume A and B are two statements. Then to say "A only if B" means that A can only ever be true when B is true. That is, B is necessary for A to be true. To say "A if and only if B" means that A is true if B is true, and B is true if A is true. That is, A is necessary and sufficient for B. Succinctly,

$A \text{ only if } B$ is the logic statement $A \Rightarrow B$.

$A \text{ iff } B$ is the statement $(A \Rightarrow B) \land (B \Rightarrow A)$

-
@RossMillikan & Josh: Thanks for the answers. So I can conclude it as 'only if' is same as implies and 'iff' is same as equivalence? –  Aditya Anjoli Sep 28 '11 at 20:05
@Akito: that is correct –  Ross Millikan Sep 28 '11 at 20:07

I will find a million dollars inside this locker only if I know the combination.

But that doesn't mean I will find a million dollars there if I know the combination. After all, there might be only a half million in there.

-

If A then B is true unless A is true and B is false and written $A \implies B$.

A only if B is true unless A is true and B is false, equivalent to if A then B.

A if B is true unless A is false and B is true, the converse of the above, and is written $B \implies A$

A iff B, also written A if and only if B, is true if A and B have the same truth value. It represents (A if B) and (A only if B) and is written $A \iff B$

-

A number is positive if and only if it is greater than zero.

A number is real if it is an integer. A real number, however need not be an integer.

-