Conditional Statements: Let p and q be statements. A sentence of the form "If p, then q" is denoted symbolically by "p ® q"; p is called the hypothesis, premise, or antecedent and q is called the conclusion or consequence. The symbol ® (if-then) is a binary connective, like Ù and Ú , that can be used to join statements to create new statements. Referred to as if-then or as a conditional. Most computer programs with any degree of difficulty utilize this connector to make alternative decisions. The truth table for ® (if-then) is intuitive.

Suppose you go to interview for a job and are promised:

If you show up for work Monday morning, then you will get the job.

Under what circumstances are you justified in saying the promise was broken and the statement false? Answer: you do show up for work Monday morning and you do not get the job. Certainly, if you do not show up and do or do not get the job you can not say the promise was broken.

Definition:
If p and q are statement variables, the conditional of q by p is "If p, then q" or "p implies q"1 and is denoted p® q. It is false when p is true and q is false; otherwise it is true. The conditional, ®, has lower precedence than the conjunction and disjunction operators.

 p q p ® q T T T T F F F T T F F T

The above truth table indicates that the truth value of the conditional will be the same as when Ø p is true, or when q is true. This combination is the same as Ø p Ú q.

The foregoing analysis with the conditional allows us a means of determining a statement for any given truth table. This method is known as disjunctive normal form.

Example:
Determine a statement using disjunctive normal form satisfying the below truth table:

 p q ? 1. T T F 2. T F F 3. F T T 4. F F T

Note from line 3 that Ø p Ù q produces a value of T. Line 4, Ø p Ù Øq, also produces a true value. Thus we get a value of T either from line 3 or from line 4 (or both). The required statement is formed from the disjunction of the two rows.

(Ø p Ù q) Ú (Ø p Ù Øq).

Example:
Find a statement, using disjunctive normal form, having the truth values as indicated below:

 p q ? 1. T T F 2. T F T 3. F T T 4. F F F

(p Ù Ø q) Ú (Ø p Ù q).

Representation of If-then as Or

p ® q Û Ø p Ú q.

Use truth tables to establish the logical equivalence of "if p, then q" and "not p or q."

By definition p ® q is false if, and only if, its hypothesis, p, is true and its conclusion, q, is false. It follows that the negation of "if p, then q" is logically equivalent to "p and not q."

Ø ( p ® q) Û p Ù Ø q.

This result can be obtained using logical equivalence

 Ø ( p ® q) Û Ø (Ø p Ú q) Û Ø (Ø p) Ù Ø q DeMorgan's law Û p Ù Ø q double negative law

The contrapositive of a conditional statement of the form "If p, then q" is

If Ø q, then Ø p.

Symbolically,

The contrapositive of p® q is Ø q® Ø p.

A conditional statement is logically equivalent to its contrapositive.

The contrapositive form is frequently used in mathematics and computer science to make solutions simpler or to offer another approach to a tough problem. This logical equivalence is the basis for one of the most important laws of deduction, modus tollens, and for the contrapositive method of proof.

Example 1

Write "If the Seahawks win the CAA tournament, then they will have won tomorrows game." in contrapositive form.

Soln: If the Seahawks do not win tomorrows game, then they will not win the CAA tournament.

The Converse and Inverse of a Conditional Statement top
Definition:
Suppose a conditional statement of the form "If p, then q" is given,

1. The converse is "If q, then p."
2. The inverse is "If Ø p, then Ø q."

Symbolically,

the converse of p® q is q® p,

and

The inverse of p® q is Ø p® Ø q.

Careful:

1. A conditional statement and its converse are not logically equivalent.
2. A conditional statement and its inverse are not logically equivalent.
3. The converse and the inverse of a conditional statement are logically equivalent to each other.

Example 2

 Conditional Converse If it is cold, then I will wear my coat If you fall in the pond, then you will get wet. I'll kiss you if the moon is made of green cheese. If I wear my coat, then it is cold. If you are wet, then you fell in the pond. If I kiss you, then the moon is made of green cheese. It should be obvious in the examples above that the converse does not have the same meaning as the conditional.

Example 3

Consider the following conditional statement:
"I will use Basic if the programming assignment is easy."
If we let q be the proposition: "I will use Basic" and p be the proposition: "The programming assignment is easy," then our statement is of the form p® q.
The converse, q® p is
"If I use Basic, then the programming assignment is easy."
The inverse Ø p® Ø q, is
"If the programming assignment is hard (not easy), then I will not use Basic."
The contrapositive, Ø q® Ø p, is
"If I do not use Basic, then the programming assignment is hard."
Note how the position of the if is critical to determing the hypostheses and how the contrapositive is logically equivalent to the original conditional statement.
"If I do not use Basic, then the programming assignment is hard."  =  "If the programming assignment is easy, then I will use Basic."
"The programming assignment is hard, if I do not use Basic."         =  "I will use Basic if the programming assignment is easy."

Example 4 -Try It

Write the converse, inverse, and contrapositive of each of the following symbolic statements. Verify the conditional and its contrapositive are equivalent by evaluating their truth tables.
(a) Ø p® q
(b) (Ø p Ú q) ® Ø r

Definition: top
If p and q are statements,

p only if q means "if not q, then not p,"

or, equivalently (by its contrapositive)

"if p, then q."

There are many synonyms for the if-then statement in English and a number of these are used equivalently in mathematical reasoning. p ® q can be expressed as:

1. If p, then q.
2. q if p.
3. q by p.
4. p only if q.
5. q follows from p.
6. q provided p.
7. q whenever p.
8. q is a necessary condition for p (q follows necessarily from p).
9. p is a sufficient condition for q.

Biconditional (Û )

If it is known that both p ® q and its converse, q ® p, are true, we know that q follows from p and p follows from q. This gives rise to our next binary connective, the biconditional, denoted p if, and only if q, (p Û q). Some authors use the term equivalence for this connector. It is true if both p and q have the same truth values and is false if p and q have opposite truth values.

Necessary and Sufficient Conditions top
Definition:

If r and s are statements:
r is a sufficient condition for s means "if r, then s."
r is a necessary condition for s means "if not r, then not s."

Consider the statement "If John is eligible to vote, then he is at least 18 years old." Let r be "John is eligible to vote" and let s be "John is at least 18 years old." The truth of the condition "John is eligible to vote" is sufficient to ensure the truth of the condition "John is at least 18 years old." That is, if r then s.
In addition, the condition "John is at least 18 years old" is necessary for the condition "John is eligible to vote" to be true. If John were younger than 18, then he would not be eligible to vote. Which can be seen as if not r, then not s.

1. The philosopher Willard VanOrman Quine advises against using the phrase "p implies q" to mean "p q" because the word implies suggests that q can be logically deduced from p and this is often not the case. The phrase is used by many people, probably because it is convenient.

2.  Discrete Structures: an introduction to mathematics for computer science, Fletcher R. Norris, Prentice-Hall, pp 28-29.