19
Chapter 7 Logic, Sets, and Counting Section 1 Logic

Chapter 7 Logic, Sets, and Counting

  • Upload
    venice

  • View
    60

  • Download
    3

Embed Size (px)

DESCRIPTION

Chapter 7 Logic, Sets, and Counting. Section 1 Logic. Logic . - PowerPoint PPT Presentation

Citation preview

Page 1: Chapter 7 Logic, Sets, and Counting

Chapter 7

Logic, Sets, and Counting

Section 1Logic

Page 2: Chapter 7 Logic, Sets, and Counting

2

Logic

Logic is not only the foundation of mathematics, but also is important in numerous fields including law, medicine, and science. Although the study of logic originated in antiquity, it was rebuilt and formalized in the 19th and early 20th century.George Boole (Boolean algebra) introduced mathematical methods to logic in 1847, while Georg Cantor did theoretical work on sets and discovered that there are many different sizes of infinite sets.

Page 3: Chapter 7 Logic, Sets, and Counting

3

Statements or Propositions

A proposition or statement is a declaration which is either true or false.

Some examples: “2 + 2 = 5” is a statement because it is a false

declaration. “Orange juice contains vitamin C” is a statement that

is true. “Open the door.” This is not considered a statement

since we cannot assign a true or false value to this sentence. It is a command, but not a statement or proposition.

Page 4: Chapter 7 Logic, Sets, and Counting

4

Negation

The negation of a statement p is “not p”, denoted by ¬ p Truth table:

If p is true, then its negation is false. If p is false, then its negation is true.

p ¬ pT FF T

Page 5: Chapter 7 Logic, Sets, and Counting

5

Disjunction

A disjunction is of the form p q and is read “p or q.”Truth table for disjunction:

A disjunction is true in all cases except when both p and q are false.

p q p qT T TT F TF T TF F F

Page 6: Chapter 7 Logic, Sets, and Counting

6

Conjunction

A conjunction is of the form p q and is read “p and q.”Truth table for conjunction:

A conjunction is only true when both p and q are true.

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

Page 7: Chapter 7 Logic, Sets, and Counting

7

Conditional

A conditional is of the form p q and is read “if p then q.”Truth table for conditional:

A conditional is only false if p is true and q is false, otherwise it is true.

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

Page 8: Chapter 7 Logic, Sets, and Counting

8

Conditional(continued)

To understand the logic behind the truth table for the conditional statement, consider the following statement.

“If you get an A in the class, I will give you five bucks.” Let p be the statement “You get an A in the class” Let q be the statement “I will give you five bucks.” Think of the statement as a contract. The statement is T if the contract is satisfied, and F if the contract is broken.Now, if p is true (you got an A) and q is true (I give you the five bucks), the truth value of p q is T. The contract was satisfied and both parties fulfilled the agreement.

Page 9: Chapter 7 Logic, Sets, and Counting

9

Conditional(continued)

Now, suppose p is true (you got the A) and q is false (you did not get the five bucks). You fulfilled your part of the bargain, but weren’t rewarded with the five bucks. p q is false since the contract was broken by the other party. Suppose p is false and q is true (you did not get an A, but received five bucks anyway.) No contract was broken. There was no obligation to receive five bucks, but is was not forbidden, either. The truth value of p q is T. Finally, if both p and q are false, the contract was not broken. You did not receive the A and you did not receive the five bucks. The statement is again T.

Page 10: Chapter 7 Logic, Sets, and Counting

10

Tautologies, Contradictions and Contingencies

The disjunction, conjunction and conditional statements introduced on previous slides are examples of contingencies because their truth values depend on the truth of its components. Some of the entries in the last column of the truth tables are true, and some are false.

A proposition is a tautology if each entry in its column of the truth table is T, and a contradiction if each entry is F.

Page 11: Chapter 7 Logic, Sets, and Counting

11

Tautologies and Contradictions (continued)

p p p p p p

T F T F

F T T F

For example, p p is a tautology because it is always true, and p p is a contradiction because it is always false.

Page 12: Chapter 7 Logic, Sets, and Counting

12

Variations of the Conditional

The converse of p q is q p. The contrapositive of p q is q p.

Page 13: Chapter 7 Logic, Sets, and Counting

13

Example

Let p = “your score is 90%”Let q = “your letter grade is A”Conditional:p → q means “If your score is 90%, then your letter grade will be an A.”Let’s assume this is true.Converse: q → p means “If your letter grade is A, then your score is 90%.”Is the statement true? No. A student with a score of 95% also gets an A.

Page 14: Chapter 7 Logic, Sets, and Counting

14

Example(continued)

Contrapositive:

q p means

“If your letter grade is not an A, then your score was not 90%.”

Is this true? Yes.If the original statement is true, the contrapositive will also be true because a statement and its contrapositive are logically equivalent.We will explain what that means on the next slide.

Page 15: Chapter 7 Logic, Sets, and Counting

15

Logically Equivalent Statements

Two statements are logically equivalent if they have the same truth tables. isExample:Show that p q is logically equivalent to p q.

Page 16: Chapter 7 Logic, Sets, and Counting

16

Logically Equivalent Statements

Two statements are logically equivalent if they have the same truth tables. isExample:Show that p q is logically equivalent to p q.

We will construct the truth tables for both sides and determine that the truth values for each statement are identical.

Page 17: Chapter 7 Logic, Sets, and Counting

17

Logically Equivalent Statements(continued)

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

These two columns represent logically equivalent statements, so we can say that

p q p q.

Page 18: Chapter 7 Logic, Sets, and Counting

18

Logical Implications

Consider the compound propositions P and Q. If whenever P is true, Q is also true, we say that P logically implies Q, or that P Q is a logical implication, and write

P QWe can determine if a logical implication exists by examining a truth table.

Page 19: Chapter 7 Logic, Sets, and Counting

19

Logical EquivalencesExample

To verify P Q P Q

construct the following truth table:

Note that whenever P Q is true (which is only in the third row), P Q is also true.

P Q P Q P Q

T T F T

T F F T

F T T T

F F F F