33
Conditional Statements Lecture 3 Section 2.2 Robb T. Koether Hampden-Sydney College Fri, Jan 17, 2014 Robb T. Koether (Hampden-Sydney College) Conditional Statements Fri, Jan 17, 2014 1 / 26

Conditional Statements - Lecture 3 Section 2people.hsc.edu/faculty-staff/robbk/Math262/Lectures/Spring 2014/Le… · Aconditional statementis a statement of the form p !q: p is thehypothesis

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Conditional Statements - Lecture 3 Section 2people.hsc.edu/faculty-staff/robbk/Math262/Lectures/Spring 2014/Le… · Aconditional statementis a statement of the form p !q: p is thehypothesis

Conditional StatementsLecture 3

Section 2.2

Robb T. Koether

Hampden-Sydney College

Fri, Jan 17, 2014

Robb T. Koether (Hampden-Sydney College) Conditional Statements Fri, Jan 17, 2014 1 / 26

Page 2: Conditional Statements - Lecture 3 Section 2people.hsc.edu/faculty-staff/robbk/Math262/Lectures/Spring 2014/Le… · Aconditional statementis a statement of the form p !q: p is thehypothesis

1 Conditional Statements

2 The Contrapositive

3 Other OperatorsThe BiconditionalThe Exclusive-OrThe NAND OperatorThe NOR Operator

4 Assignment

Robb T. Koether (Hampden-Sydney College) Conditional Statements Fri, Jan 17, 2014 2 / 26

Page 3: Conditional Statements - Lecture 3 Section 2people.hsc.edu/faculty-staff/robbk/Math262/Lectures/Spring 2014/Le… · Aconditional statementis a statement of the form p !q: p is thehypothesis

Outline

1 Conditional Statements

2 The Contrapositive

3 Other OperatorsThe BiconditionalThe Exclusive-OrThe NAND OperatorThe NOR Operator

4 Assignment

Robb T. Koether (Hampden-Sydney College) Conditional Statements Fri, Jan 17, 2014 3 / 26

Page 4: Conditional Statements - Lecture 3 Section 2people.hsc.edu/faculty-staff/robbk/Math262/Lectures/Spring 2014/Le… · Aconditional statementis a statement of the form p !q: p is thehypothesis

Conditional Statements

A conditional statement is a statement of the form

p → q.

p is the hypothesis.q is the conclusion.

Read p → q as “p implies q” or “if p, then q.”The idea is that the truth of p implies the truth of q (but nothingmore).

Robb T. Koether (Hampden-Sydney College) Conditional Statements Fri, Jan 17, 2014 4 / 26

Page 5: Conditional Statements - Lecture 3 Section 2people.hsc.edu/faculty-staff/robbk/Math262/Lectures/Spring 2014/Le… · Aconditional statementis a statement of the form p !q: p is thehypothesis

Example: Conditional Statements

Which of the following scenarios are consistent with the statement“If I win the lottery, then I will buy a Mercedes Benz.”

Scenario 1: I win the lottery and I buy a Mercedes Benz.Scenario 2: I win the lottery and I do not buy a Mercedes Benz.Scenario 3: I do not win the lottery and I do not buy a Mercedes

Benz.Scenario 4: I do not win the lottery and I buy a Mercedes Benz.

Robb T. Koether (Hampden-Sydney College) Conditional Statements Fri, Jan 17, 2014 5 / 26

Page 6: Conditional Statements - Lecture 3 Section 2people.hsc.edu/faculty-staff/robbk/Math262/Lectures/Spring 2014/Le… · Aconditional statementis a statement of the form p !q: p is thehypothesis

Example: Conditional Statements

Which of the following scenarios are consistent with the statement“If I win the lottery, then I will buy a Mercedes Benz.”Scenario 1: I win the lottery and I buy a Mercedes Benz.

Scenario 2: I win the lottery and I do not buy a Mercedes Benz.Scenario 3: I do not win the lottery and I do not buy a Mercedes

Benz.Scenario 4: I do not win the lottery and I buy a Mercedes Benz.

Robb T. Koether (Hampden-Sydney College) Conditional Statements Fri, Jan 17, 2014 5 / 26

Page 7: Conditional Statements - Lecture 3 Section 2people.hsc.edu/faculty-staff/robbk/Math262/Lectures/Spring 2014/Le… · Aconditional statementis a statement of the form p !q: p is thehypothesis

Example: Conditional Statements

Which of the following scenarios are consistent with the statement“If I win the lottery, then I will buy a Mercedes Benz.”Scenario 1: I win the lottery and I buy a Mercedes Benz.Scenario 2: I win the lottery and I do not buy a Mercedes Benz.

Scenario 3: I do not win the lottery and I do not buy a MercedesBenz.

Scenario 4: I do not win the lottery and I buy a Mercedes Benz.

Robb T. Koether (Hampden-Sydney College) Conditional Statements Fri, Jan 17, 2014 5 / 26

Page 8: Conditional Statements - Lecture 3 Section 2people.hsc.edu/faculty-staff/robbk/Math262/Lectures/Spring 2014/Le… · Aconditional statementis a statement of the form p !q: p is thehypothesis

Example: Conditional Statements

Which of the following scenarios are consistent with the statement“If I win the lottery, then I will buy a Mercedes Benz.”Scenario 1: I win the lottery and I buy a Mercedes Benz.Scenario 2: I win the lottery and I do not buy a Mercedes Benz.Scenario 3: I do not win the lottery and I do not buy a Mercedes

Benz.

Scenario 4: I do not win the lottery and I buy a Mercedes Benz.

Robb T. Koether (Hampden-Sydney College) Conditional Statements Fri, Jan 17, 2014 5 / 26

Page 9: Conditional Statements - Lecture 3 Section 2people.hsc.edu/faculty-staff/robbk/Math262/Lectures/Spring 2014/Le… · Aconditional statementis a statement of the form p !q: p is thehypothesis

Example: Conditional Statements

Which of the following scenarios are consistent with the statement“If I win the lottery, then I will buy a Mercedes Benz.”Scenario 1: I win the lottery and I buy a Mercedes Benz.Scenario 2: I win the lottery and I do not buy a Mercedes Benz.Scenario 3: I do not win the lottery and I do not buy a Mercedes

Benz.Scenario 4: I do not win the lottery and I buy a Mercedes Benz.

Robb T. Koether (Hampden-Sydney College) Conditional Statements Fri, Jan 17, 2014 5 / 26

Page 10: Conditional Statements - Lecture 3 Section 2people.hsc.edu/faculty-staff/robbk/Math262/Lectures/Spring 2014/Le… · Aconditional statementis a statement of the form p !q: p is thehypothesis

Truth Table for the Conditional

p q p → qT T TT F FF T TF F T

p → q is true if p is false or q is true.p → q is false if p is true and q is false.Thus, p → q is logically equivalent to ∼ p ∨ q.

Robb T. Koether (Hampden-Sydney College) Conditional Statements Fri, Jan 17, 2014 6 / 26

Page 11: Conditional Statements - Lecture 3 Section 2people.hsc.edu/faculty-staff/robbk/Math262/Lectures/Spring 2014/Le… · Aconditional statementis a statement of the form p !q: p is thehypothesis

Outline

1 Conditional Statements

2 The Contrapositive

3 Other OperatorsThe BiconditionalThe Exclusive-OrThe NAND OperatorThe NOR Operator

4 Assignment

Robb T. Koether (Hampden-Sydney College) Conditional Statements Fri, Jan 17, 2014 7 / 26

Page 12: Conditional Statements - Lecture 3 Section 2people.hsc.edu/faculty-staff/robbk/Math262/Lectures/Spring 2014/Le… · Aconditional statementis a statement of the form p !q: p is thehypothesis

The Contrapositive

The contrapositive of p → q is ∼ q →∼ p.The statements p → q and ∼ q →∼ p are logically equivalent.(Prove it!)

Robb T. Koether (Hampden-Sydney College) Conditional Statements Fri, Jan 17, 2014 8 / 26

Page 13: Conditional Statements - Lecture 3 Section 2people.hsc.edu/faculty-staff/robbk/Math262/Lectures/Spring 2014/Le… · Aconditional statementis a statement of the form p !q: p is thehypothesis

The Converse and the Inverse

p → q q → p

∼p → ∼q ∼q → ∼p

Four conditionals.

Robb T. Koether (Hampden-Sydney College) Conditional Statements Fri, Jan 17, 2014 9 / 26

Page 14: Conditional Statements - Lecture 3 Section 2people.hsc.edu/faculty-staff/robbk/Math262/Lectures/Spring 2014/Le… · Aconditional statementis a statement of the form p !q: p is thehypothesis

The Converse and the Inverse

p → q q → p

∼p → ∼q ∼q → ∼p

Converses

Converses

The converse of p → q is q → p

Robb T. Koether (Hampden-Sydney College) Conditional Statements Fri, Jan 17, 2014 9 / 26

Page 15: Conditional Statements - Lecture 3 Section 2people.hsc.edu/faculty-staff/robbk/Math262/Lectures/Spring 2014/Le… · Aconditional statementis a statement of the form p !q: p is thehypothesis

The Converse and the Inverse

p → q q → p

∼p → ∼q ∼q → ∼p

Inverses Inverses

The inverse of p → q is ∼ p →∼ q

Robb T. Koether (Hampden-Sydney College) Conditional Statements Fri, Jan 17, 2014 9 / 26

Page 16: Conditional Statements - Lecture 3 Section 2people.hsc.edu/faculty-staff/robbk/Math262/Lectures/Spring 2014/Le… · Aconditional statementis a statement of the form p !q: p is thehypothesis

The Converse and the Inverse

p → q q → p

∼p → ∼q ∼q → ∼p

Contrapositives

The contrapositive of p → q is ∼ q →∼ p

Robb T. Koether (Hampden-Sydney College) Conditional Statements Fri, Jan 17, 2014 9 / 26

Page 17: Conditional Statements - Lecture 3 Section 2people.hsc.edu/faculty-staff/robbk/Math262/Lectures/Spring 2014/Le… · Aconditional statementis a statement of the form p !q: p is thehypothesis

Outline

1 Conditional Statements

2 The Contrapositive

3 Other OperatorsThe BiconditionalThe Exclusive-OrThe NAND OperatorThe NOR Operator

4 Assignment

Robb T. Koether (Hampden-Sydney College) Conditional Statements Fri, Jan 17, 2014 10 / 26

Page 18: Conditional Statements - Lecture 3 Section 2people.hsc.edu/faculty-staff/robbk/Math262/Lectures/Spring 2014/Le… · Aconditional statementis a statement of the form p !q: p is thehypothesis

Outline

1 Conditional Statements

2 The Contrapositive

3 Other OperatorsThe BiconditionalThe Exclusive-OrThe NAND OperatorThe NOR Operator

4 Assignment

Robb T. Koether (Hampden-Sydney College) Conditional Statements Fri, Jan 17, 2014 11 / 26

Page 19: Conditional Statements - Lecture 3 Section 2people.hsc.edu/faculty-staff/robbk/Math262/Lectures/Spring 2014/Le… · Aconditional statementis a statement of the form p !q: p is thehypothesis

The Biconditional

The biconditional of p and q is denoted p ↔ q.Read p ↔ q as “p if and only if q.”p ↔ q is logically equivalent to

(p → q) ∧ (q → p).

It is also logically equivalent to

(∼ p ∨ q) ∧ (∼ q ∨ p)

and(p ∧ q) ∨ (∼ p ∧ ∼ q).

Robb T. Koether (Hampden-Sydney College) Conditional Statements Fri, Jan 17, 2014 12 / 26

Page 20: Conditional Statements - Lecture 3 Section 2people.hsc.edu/faculty-staff/robbk/Math262/Lectures/Spring 2014/Le… · Aconditional statementis a statement of the form p !q: p is thehypothesis

The Biconditional

p q p ↔ qT T TT F FF T FF F T

Robb T. Koether (Hampden-Sydney College) Conditional Statements Fri, Jan 17, 2014 13 / 26

Page 21: Conditional Statements - Lecture 3 Section 2people.hsc.edu/faculty-staff/robbk/Math262/Lectures/Spring 2014/Le… · Aconditional statementis a statement of the form p !q: p is thehypothesis

Outline

1 Conditional Statements

2 The Contrapositive

3 Other OperatorsThe BiconditionalThe Exclusive-OrThe NAND OperatorThe NOR Operator

4 Assignment

Robb T. Koether (Hampden-Sydney College) Conditional Statements Fri, Jan 17, 2014 14 / 26

Page 22: Conditional Statements - Lecture 3 Section 2people.hsc.edu/faculty-staff/robbk/Math262/Lectures/Spring 2014/Le… · Aconditional statementis a statement of the form p !q: p is thehypothesis

Exclusive-Or

The exclusive-or of p and q is denoted p ⊕ q.p ⊕ q means “one or the other, but not both.”p ⊕ q is logically equivalent to

(p ∨ q) ∧ ∼ (p ∧ q)

and(p ∧ ∼ q) ∨ (∼ p ∧ q)

and∼ (p ↔ q).

Robb T. Koether (Hampden-Sydney College) Conditional Statements Fri, Jan 17, 2014 15 / 26

Page 23: Conditional Statements - Lecture 3 Section 2people.hsc.edu/faculty-staff/robbk/Math262/Lectures/Spring 2014/Le… · Aconditional statementis a statement of the form p !q: p is thehypothesis

Exclusive-Or

p q p ↔ qT T FT F TF T TF F F

Robb T. Koether (Hampden-Sydney College) Conditional Statements Fri, Jan 17, 2014 16 / 26

Page 24: Conditional Statements - Lecture 3 Section 2people.hsc.edu/faculty-staff/robbk/Math262/Lectures/Spring 2014/Le… · Aconditional statementis a statement of the form p !q: p is thehypothesis

Outline

1 Conditional Statements

2 The Contrapositive

3 Other OperatorsThe BiconditionalThe Exclusive-OrThe NAND OperatorThe NOR Operator

4 Assignment

Robb T. Koether (Hampden-Sydney College) Conditional Statements Fri, Jan 17, 2014 17 / 26

Page 25: Conditional Statements - Lecture 3 Section 2people.hsc.edu/faculty-staff/robbk/Math262/Lectures/Spring 2014/Le… · Aconditional statementis a statement of the form p !q: p is thehypothesis

The NAND Operator

p q p | qT T FT F TF T TF F T

The NAND of p and q is denoted p | q.The operator | is also called the Scheffer stroke.

Robb T. Koether (Hampden-Sydney College) Conditional Statements Fri, Jan 17, 2014 18 / 26

Page 26: Conditional Statements - Lecture 3 Section 2people.hsc.edu/faculty-staff/robbk/Math262/Lectures/Spring 2014/Le… · Aconditional statementis a statement of the form p !q: p is thehypothesis

The NAND Operator

The statement p | q means “not both p and q.”p | q is logically equivalent to ∼ (p ∧ q).

Robb T. Koether (Hampden-Sydney College) Conditional Statements Fri, Jan 17, 2014 19 / 26

Page 27: Conditional Statements - Lecture 3 Section 2people.hsc.edu/faculty-staff/robbk/Math262/Lectures/Spring 2014/Le… · Aconditional statementis a statement of the form p !q: p is thehypothesis

The NAND Operator

The three basic operators (and, or, not) may be defined in termsof NAND.

∼ p ≡ p | p.

p ∧ q ≡ (p | q) | (p | q).

p ∨ q ≡ (p | p) | (q | q).

Prove it!

Robb T. Koether (Hampden-Sydney College) Conditional Statements Fri, Jan 17, 2014 20 / 26

Page 28: Conditional Statements - Lecture 3 Section 2people.hsc.edu/faculty-staff/robbk/Math262/Lectures/Spring 2014/Le… · Aconditional statementis a statement of the form p !q: p is thehypothesis

Outline

1 Conditional Statements

2 The Contrapositive

3 Other OperatorsThe BiconditionalThe Exclusive-OrThe NAND OperatorThe NOR Operator

4 Assignment

Robb T. Koether (Hampden-Sydney College) Conditional Statements Fri, Jan 17, 2014 21 / 26

Page 29: Conditional Statements - Lecture 3 Section 2people.hsc.edu/faculty-staff/robbk/Math262/Lectures/Spring 2014/Le… · Aconditional statementis a statement of the form p !q: p is thehypothesis

The NOR Operator

p q p ↓ qT T FT F FF T FF F T

The NOR of p and q is denoted p ↓ q.The operator ↓ is also called the Pierce arrow.

Robb T. Koether (Hampden-Sydney College) Conditional Statements Fri, Jan 17, 2014 22 / 26

Page 30: Conditional Statements - Lecture 3 Section 2people.hsc.edu/faculty-staff/robbk/Math262/Lectures/Spring 2014/Le… · Aconditional statementis a statement of the form p !q: p is thehypothesis

The NOR Operator

The statement p ↓ q means “neither p nor q.”p ↓ q is logically equivalent to ∼ (p ∨ q).

Robb T. Koether (Hampden-Sydney College) Conditional Statements Fri, Jan 17, 2014 23 / 26

Page 31: Conditional Statements - Lecture 3 Section 2people.hsc.edu/faculty-staff/robbk/Math262/Lectures/Spring 2014/Le… · Aconditional statementis a statement of the form p !q: p is thehypothesis

The NOR Operator

The three basic operators (and, or, not) may be defined in termsof NOR.

∼ p ≡ p ↓ p.

p ∨ q ≡ (p ↓ q) ↓ (p ↓ q).

p ∧ q ≡ (p ↓ p) ↓ (q ↓ q).

Prove it!

Robb T. Koether (Hampden-Sydney College) Conditional Statements Fri, Jan 17, 2014 24 / 26

Page 32: Conditional Statements - Lecture 3 Section 2people.hsc.edu/faculty-staff/robbk/Math262/Lectures/Spring 2014/Le… · Aconditional statementis a statement of the form p !q: p is thehypothesis

Outline

1 Conditional Statements

2 The Contrapositive

3 Other OperatorsThe BiconditionalThe Exclusive-OrThe NAND OperatorThe NOR Operator

4 Assignment

Robb T. Koether (Hampden-Sydney College) Conditional Statements Fri, Jan 17, 2014 25 / 26

Page 33: Conditional Statements - Lecture 3 Section 2people.hsc.edu/faculty-staff/robbk/Math262/Lectures/Spring 2014/Le… · Aconditional statementis a statement of the form p !q: p is thehypothesis

Assignment

AssignmentRead Section 2.2, pages 39 - 48.Exercises 2, 5, 6, 12, 13, 17, 18, 37, 41, 42, 46, page 49.

Robb T. Koether (Hampden-Sydney College) Conditional Statements Fri, Jan 17, 2014 26 / 26