freeCodeCamp/guide/english/logic/conditional-and-bicondition.../index.md

1022 B

title
Conditional and Biconditional Statements

Conditional and Biconditional Statements

Conditional statement: "if". If one thing is true, then something else is true or can happen. Example: if it rains right now, then the ground will be wet. However, the converse ("if the ground is wet, then it is raining") is not necessarily true. Let the conditional statement be "if P, then Q". We can use the direct method for proving the conditional statement. First, assume that P is true, and then show that P ensures that Q is true.

Biconditional statement: "if and only if". If one thing is true, then something else is true; and if that something else is true, then that the one thing is true. Another way to think about it is that two things are either both true, or both false (not one true and the other false). Example: A square has an area of 16 cubic meters if and only if its sides are both 4 meters long. When proving biconditional statements, we must prove both directions.