28
2.2 Conditional Statements 2.2 Conditional Statements 1 / 10

2.2 Conditional Statements - United States Naval Academy

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

2.2 Conditional Statements

2.2 Conditional Statements 1 / 10

Conditional Statements

Definition1 When making a logical inference, one reasons from a hypothesis to

a conclusion.

2 A conditional statement is the sentence “if p then q”, denotedsymbolically p → q.

3 p is called the hypothesis.

4 q is called the conclusion.

5 p → q is false when

p is true and q is false, and true otherwise.

2.2 Conditional Statements 2 / 10

Conditional Statements

Definition1 When making a logical inference, one reasons from a hypothesis to

a conclusion.

2 A conditional statement is the sentence “if p then q”, denotedsymbolically p → q.

3 p is called the hypothesis.

4 q is called the conclusion.

5 p → q is false when p is true and q is false, and true otherwise.

2.2 Conditional Statements 2 / 10

Conditional Statements

Definition1 When making a logical inference, one reasons from a hypothesis to

a conclusion.

2 A conditional statement is the sentence “if p then q”, denotedsymbolically p → q.

3 p is called the hypothesis.

4 q is called the conclusion.

5 p → q is false when p is true and q is false, and true otherwise.

2.2 Conditional Statements 2 / 10

Truth Table for p → q

Fact

The truth table for p → q is

p q p → q

T T

TT F FF T TF F T

2.2 Conditional Statements 3 / 10

Truth Table for p → q

Fact

The truth table for p → q is

p q p → q

T T TT F

FF T TF F T

2.2 Conditional Statements 3 / 10

Truth Table for p → q

Fact

The truth table for p → q is

p q p → q

T T TT F FF T

TF F T

2.2 Conditional Statements 3 / 10

Truth Table for p → q

Fact

The truth table for p → q is

p q p → q

T T TT F FF T TF F

T

2.2 Conditional Statements 3 / 10

Truth Table for p → q

Fact

The truth table for p → q is

p q p → q

T T TT F FF T TF F T

2.2 Conditional Statements 3 / 10

Example

Example

A conditional statement that is true by virtue of the fact that itshypothesis is false is called vacuously true. For example:

If 0 = 1 then 0 = 2.

2.2 Conditional Statements 4 / 10

If-Then as Or

Example

1 Show that p → q ≡∼ p ∨ q.

2 Rewrite the following statement in an if-then form: “Either you donot get 90% or you get an A”.

3 Show that ∼ (p → q) ≡ p∧ ∼ q.

2.2 Conditional Statements 5 / 10

If-Then as Or

Example

1 Show that p → q ≡∼ p ∨ q.

2 Rewrite the following statement in an if-then form: “Either you donot get 90% or you get an A”.

3 Show that ∼ (p → q) ≡ p∧ ∼ q.

2.2 Conditional Statements 5 / 10

If-Then as Or

Example

1 Show that p → q ≡∼ p ∨ q.

2 Rewrite the following statement in an if-then form: “Either you donot get 90% or you get an A”.

3 Show that ∼ (p → q) ≡ p∧ ∼ q.

2.2 Conditional Statements 5 / 10

The Contrapositive of a Conditional Statement

Definition

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.

2.2 Conditional Statements 6 / 10

The Contrapositive of a Conditional Statement

Definition

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.

2.2 Conditional Statements 6 / 10

The Contrapositive of a Conditional Statement

Definition

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.

2.2 Conditional Statements 6 / 10

Conditional statement ≡ its contrapositive

Fact

A conditional statement is logically equivalent to its contrapositive.

2.2 Conditional Statements 7 / 10

The Converse and Inverse of a Conditional Statement

Definitions

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.”

Example

Write down the converse and inverse of the statement: “If it snows todaythen the Naval Academy will close early.”

2.2 Conditional Statements 8 / 10

The Converse and Inverse of a Conditional Statement

Definitions

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.”

Example

Write down the converse and inverse of the statement: “If it snows todaythen the Naval Academy will close early.”

2.2 Conditional Statements 8 / 10

The Converse and Inverse of a Conditional Statement

Definitions

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.”

Example

Write down the converse and inverse of the statement: “If it snows todaythen the Naval Academy will close early.”

2.2 Conditional Statements 8 / 10

The Converse and Inverse of a Conditional Statement

Definitions

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.”

Example

Write down the converse and inverse of the statement: “If it snows todaythen the Naval Academy will close early.”

2.2 Conditional Statements 8 / 10

Only If and the Biconditional

Definition

If p and q are statements, p only if q means “if not q then not p,” or,equivalently,

“if p then q.”

Example

Rewrite the following statement in if-then form in two ways, one which isthe contrapositive of the other:A hacker gains access to the USNA server only if there is

an open port on the server.

2.2 Conditional Statements 9 / 10

Only If and the Biconditional

Definition

If p and q are statements, p only if q means “if not q then not p,” or,equivalently, “if p then q.”

Example

Rewrite the following statement in if-then form in two ways, one which isthe contrapositive of the other:A hacker gains access to the USNA server only if there is

an open port on the server.

2.2 Conditional Statements 9 / 10

Only If and the Biconditional

Definition

If p and q are statements, p only if q means “if not q then not p,” or,equivalently, “if p then q.”

Example

Rewrite the following statement in if-then form in two ways, one which isthe contrapositive of the other:A hacker gains access to the USNA server only if there is

an open port on the server.

2.2 Conditional Statements 9 / 10

The Biconditional

Definition

The biconditional of p and q is “p if, and only if, q” and is denotedp ↔ q.

It is true if

both p and q have the same truth values and is false if pand q have opposite truth values.

Note: The expression “if and only if” is sometimes abbreviated iff.

Examples

1 “USNA is closed if, and only if, it snows”.

2 Show that p ↔ q ≡ (p → q) ∧ (q → p).

2.2 Conditional Statements 10 / 10

The Biconditional

Definition

The biconditional of p and q is “p if, and only if, q” and is denotedp ↔ q.

It is true if both p and q have the same truth values and is false if

pand q have opposite truth values.

Note: The expression “if and only if” is sometimes abbreviated iff.

Examples

1 “USNA is closed if, and only if, it snows”.

2 Show that p ↔ q ≡ (p → q) ∧ (q → p).

2.2 Conditional Statements 10 / 10

The Biconditional

Definition

The biconditional of p and q is “p if, and only if, q” and is denotedp ↔ q.

It is true if both p and q have the same truth values and is false if pand q have opposite truth values.

Note: The expression “if and only if” is sometimes abbreviated iff.

Examples

1 “USNA is closed if, and only if, it snows”.

2 Show that p ↔ q ≡ (p → q) ∧ (q → p).

2.2 Conditional Statements 10 / 10

The Biconditional

Definition

The biconditional of p and q is “p if, and only if, q” and is denotedp ↔ q.

It is true if both p and q have the same truth values and is false if pand q have opposite truth values.

Note: The expression “if and only if” is sometimes abbreviated iff.

Examples

1 “USNA is closed if, and only if, it snows”.

2 Show that p ↔ q ≡ (p → q) ∧ (q → p).

2.2 Conditional Statements 10 / 10