# 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
Also try to understand in terms of plain translation. AiffB means A is true 'if' B is true & A is true 'only if' B is true.The 'only if' means that A is true in no other cases.'A if B' can be written as B => A.And 'A only if B' can be written as notB => notA. It is the property of => sign that c=>d is same as notd=>notc. Thus , you can replace notB=>notA by A=>B. Thus A iff B can be written as A=>B and B=>A . Of course what I am saying is same as what others have already said . I just wanted to emphasise how we can intuitively try to understand the logic from the meaning of 'if' and 'only if'. –  ameyask86 Feb 11 '14 at 11:18

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? –  Shen Xu 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.

-

$A \text{ iff } B$ is the statement

"if B then A" and "only if B then A"

$(B \Rightarrow A) \land (notB \Rightarrow notA)$

$(B \Rightarrow A) \land (A \Rightarrow B)$

$A=B$

-