Implications Reading: EC 1.5 Peter J. Haas INFO 150 Fall Semester - - PowerPoint PPT Presentation

implications
SMART_READER_LITE
LIVE PREVIEW

Implications Reading: EC 1.5 Peter J. Haas INFO 150 Fall Semester - - PowerPoint PPT Presentation

Implications Reading: EC 1.5 Peter J. Haas INFO 150 Fall Semester 2019 Lecture 4 1/ 19 Implications Definition and Examples The Logic of Implications Negating Implications Contrapositives, Converses, and Inverses The Language of


slide-1
SLIDE 1

Implications

Reading: EC 1.5 Peter J. Haas INFO 150 Fall Semester 2019

Lecture 4 1/ 19

slide-2
SLIDE 2

Implications Definition and Examples The Logic of Implications Negating Implications Contrapositives, Converses, and Inverses The Language of Implication Logic Puzzles Revisited

Lecture 4 2/ 19

slide-3
SLIDE 3

Implications

Informal examples

  • 1. If I am voting at a polling place, then there is an election today
  • 2. If it is snowing, then the streets are slippery
  • 3. If you are an Informatics major, then you must take 6 core courses
  • 4. If a real number x satisfies x2 > 4, then x > 2

Lecture 4 3/ 19

slide-4
SLIDE 4

Implications

Informal examples

  • 1. If I am voting at a polling place, then there is an election today
  • 2. If it is snowing, then the streets are slippery
  • 3. If you are an Informatics major, then you must take 6 core courses
  • 4. If a real number x satisfies x2 > 4, then x > 2

Definitions I Implication: A statement of the form “if p is true, then q is true” I Notation: p → q means “p implies q” [→ has lower precedence than ∧, ∨, ¬] I p is the hypothesis and q is the conclusion [can be propositions or predicates]

Lecture 4 3/ 19

slide-5
SLIDE 5

Implications

Informal examples

  • 1. If I am voting at a polling place, then there is an election today
  • 2. If it is snowing, then the streets are slippery
  • 3. If you are an Informatics major, then you must take 6 core courses
  • 4. If a real number x satisfies x2 > 4, then x > 2

Definitions I Implication: A statement of the form “if p is true, then q is true” I Notation: p → q means “p implies q” [→ has lower precedence than ∧, ∨, ¬] I p is the hypothesis and q is the conclusion [can be propositions or predicates] Implications with predicates

  • 1. For all real numbers x, if x2 > 4, then x > 2.

∀x ∈ R, (x2 > 4) → (x > 2)

  • 2. For all students s at UMass Amherst, if s is an Informatics major, then s must

take 6 core courses. ∀s ∈ U, (x ∈ I) → (s must take 6 core courses)

Lecture 4 3/ 19

slide-6
SLIDE 6

More Implication Examples

Problem: Identify the domain D, hypothesis P, and conclusion Q, so that the implication is of the form “for all x ∈ D, if P(x), then Q(x)” I If a triangle has three equal sides, then it has three equal angles: D = set of all triangles, P(t) = “t has three equal sides, Q(t) = “t has three equal angles I If an integer ends with a 2, it is a multiple of two: I If a real number x has a real square root, then x is not negative:

Lecture 4 4/ 19

D

  • set
  • f integers

I

Pln )

  • n

ends

with

a 2 ,

Qin

  • n

is

a multiple of

2

D=

IR PCH )

=

X

has

a

real square

root

Qcx )

= 7 ( X 2e )

I

LX ?

0 )
slide-7
SLIDE 7

The Logic of Implications: Example

Example: I A trooper walks into a pub: Al, Betty, Chen, and Darmendra are drinking I Bartender says everyone is obeying the law I The law: “if you are drinking beer, then you are at least 21 years of age” I In front of each person is a card with age on one side and beverage on the other Problem: I Identify D, P, and Q to form the implication: “for all x ∈ D, if P then Q” I Whose cards does the trooper need to turn over to check that everyone is

  • beying the law? Why does she not need to turn over the other cards?

Lecture 4 5/ 19

19 Coke Beer 25

Al Betty Dharmendra Chen

D=

students

in

pub

,

RX )

  • x

is drinking

beer Q Cx)

=

X

is

at least

21

Years of age Needs to turn

  • ver

Al

and Chen P ( Betty )

  • f
so no need

to

check age

Q

C

Dharmendra )

=

T

so
  • k
no matter what he

drinks

slide-8
SLIDE 8

The Logic of Implications

19 Coke Beer 25

Al Betty Dharmendra Chen

“If you are drinking beer, then you are at least 21” Example summary: The only time that p → q is false is if p is true and q is false

Truth table for implication

p q p → q T T T T F F F T T F F T

Lecture 4 6/ 19

Betty {

slide-9
SLIDE 9

More Examples

Problem: For every positive integer n, if n is odd, then n3 − n is divisible by 4 I Hypothesis: I Conclusion: I Is the statement true or false? Problem: For all integers n, if 3n = 9, then n2 = 9 I Why is the above statement true? Problem: For all integers n, if n2 > 9, then n > 3 I Why is the above statement false?

Lecture 4 7/ 19

n n3 − n Divisible by 4? 1 3 5 7 n n3 − n Divisible by 4? 2 4 6 8 n

  • Hyp. (3n = 9)
  • Concl. (n2 = 9)
  • 3

3 10

0=4×0 24 24 ' 4×6

if

@

is

:÷÷÷i::÷

.

"÷÷

:*

6 NO Go

Yes

40 NO no

counterexample

504

Yes

F

T

  • 4

is a

counterexample

,

p

IF

T

f

f

slide-10
SLIDE 10

Summary

Rule 1 For a statement of the form “if hypothesis, then conclusion” to be false, it must be the case that the hypothesis is true and the conclusion is false Rule 2 For a quantified statement of the form “∀x, P(x) → Q(x)” to be false, it must be the case that at least one value of x is a counterexample such that P(x) is true but Q(x) is false.

Lecture 4 8/ 19

slide-11
SLIDE 11

Negating Implications

Proposition 1 The negation of p → q is p ∧ ¬q Proof: p q p → q ¬(p → q) ¬q p ∧ ¬q T T T F F F T F F T T T F T T F F F F F T F T F Note: The negation of an implication is not an implication! Proposition 2 The negation of ∀x ∈ D, P(x) → Q(x) is ∃x ∈ D, P(x) ∧ ¬Q(x) Proof: ¬

  • ∀x ∈ D, P(x) → Q(x)
  • = ∃x ∈ D, ¬
  • P(x) → Q(x)
  • = ∃x ∈ D, P(x) ∧ ¬Q(x)

Lecture 4 9/ 19

slide-12
SLIDE 12

Negating Implications: Examples

Problem: Negate each of the following statements: I If Bob has an 8:00 class today, then it is Tuesday I If Juanita gets chocolate, then she has a happy birthday I For all real numbers x, if x > 2, then x2 > 4

Lecture 4 10/ 19

Bob

has

an

8 :

a e class today , but today is not Tuesday

Juanita

gets chocolate

, but has an

unhappy

birthday

there exist xc.IR

,

said that

X

>

L

but

x 's 4

slide-13
SLIDE 13

Contrapositives, Converses, and Inverses

Example: P(n) = “n ends in the digit 2” and Q(n) = “n is divisible by 2 True or False (if False give a counterexample): I P(n) → Q(n): “If n ends in the digit 2, then n is divisible by 2” I Q(n) → P(n): “If n is divisible by 2, then n ends in the digit 2” I ¬P(n) → ¬Q(n): “If n does not end in the digit 2, then n is not divisible by 2” I ¬Q(n) → ¬P(n): “If n is not divisible by 2, then n does not end in the digit 2” Definition: for the implication ∀x ∈ D, P(x) → Q(x): I The converse is ∀x ∈ D, Q(x) → P(x) I The inverse is ∀x ∈ D, ¬P(x) → ¬Q(x) I The contrapositive is ∀x ∈ D, ¬Q(x) → ¬P(x) Analogous definitions for proposition p → q: I Converse: q → p I Inverse: ¬p → ¬q I Contrapositive: ¬q → ¬p

Lecture 4 11/ 19

T

[

C

F f T

slide-14
SLIDE 14

More on Contrapositives, Converses, and Inverses

Proposition

  • 1. An implication and its contrapositive are logically equivalent
  • 2. The converse and inverse of an implication are logically equivalent
  • 3. An implication is not logically equivalent to its converse (nor its inverse)

implication converse inverse contrapositive Example: I A true implication whose converse is false: (a and b are odd) → (a + b is even) I A true implication whose converse is true: (n is even) → (n2 is even)

Lecture 4 12/ 19 converse

counterexample

D= 2 ,

b

  • H

Cath

is

even ) →

Lgb

are
  • dd)
slide-15
SLIDE 15

The Language of Implication

Don’t confuse sentence rearrangement with logical converse I Statement: If an integer m ends in the digit 0, then m is a multiple of 5 I Same statement: An integer m is a multiple of 5 if it ends in the digit 0 I Converse: If an integer m is a multiple of 5, then m ends in the digit 0

Lecture 4 13/ 19

slide-16
SLIDE 16

The Language of Implication

Don’t confuse sentence rearrangement with logical converse I Statement: If an integer m ends in the digit 0, then m is a multiple of 5 I Same statement: An integer m is a multiple of 5 if it ends in the digit 0 I Converse: If an integer m is a multiple of 5, then m ends in the digit 0 “For all” statements can be written as an implication or not I Suppose D is a subset of a larger set U I Then we can write ∀x ∈ D, Q(x) or ∀x ∈ U, x ∈ D → Q(x) (The latter is preferable for proof-writing)

Lecture 4 13/ 19

slide-17
SLIDE 17

The Language of Implication

Don’t confuse sentence rearrangement with logical converse I Statement: If an integer m ends in the digit 0, then m is a multiple of 5 I Same statement: An integer m is a multiple of 5 if it ends in the digit 0 I Converse: If an integer m is a multiple of 5, then m ends in the digit 0 “For all” statements can be written as an implication or not I Suppose D is a subset of a larger set U I Then we can write ∀x ∈ D, Q(x) or ∀x ∈ U, x ∈ D → Q(x) (The latter is preferable for proof-writing) Example: D = set of UMass Informatics students & U = set of UMass students I Statement: For all s ∈ D, s must take discrete math I Implication: For all s ∈ U, if s is an Informatics student, then s must take discrete math I Negation of statement: there exists an Informatics student who does not have to take discrete math I Negation of implication: There exists a UMass student who is an Informatics student but does not have to take discrete math

Lecture 4 13/ 19

slide-18
SLIDE 18

The Language of Implication: Examples

Problem: Rewrite each quantified predicate as an implication using R and Z as domains I ∀ even integer m, m ends in the digit 0, 2, 4, or 8: I ∀x > 0, x2 > x: I For every positive odd integer n, n3 − n is divisible by 4:

Lecture 4 14/ 19

I

tf

me

I

,

Cm

even )

c

in

end is in

0,44 , 8)

Vx

ER

,

( x

>
  • )

L X

' >

x )

tf

X

GTI

,

Lx

>
  • )

n

IX odd )

l n'

un

div

. by4)
slide-19
SLIDE 19

The Language of Implication: Bidirectionality

Bidirectional statements: p ↔ q I When both p → q and q → p I Also written: “p if and only if q” or “p iff q” or “if p, then q, and conversely” I “p is a necessary and sufficient condition for q” (“necessary” = “if” means q → p and “sufficient” = “only if” means p → q) I Ex: What are the two implicational statements expressed by the statement “The integer n is a multiple of 10 if and only if n is even” (Is each true or false?)

Lecture 4 15/ 19

(

n

is

a

malt

.
  • f

to )

c

n is

even )

(

n

is even)

( n

is

a

multi

  • f 10%
slide-20
SLIDE 20

Logic Puzzles Revisited

Example: I A says: “If B is truthful, then so am I” (q → p) I B says: “At least one of us is lying” Statement 1 Statement 2 p q If B is truthful so is A At least one of us is lying T T T F T F T T *F T F T F F T T

Lecture 4 16/ 19

p

  • .

A

is

truthful

q

:

B

is truthful

)
slide-21
SLIDE 21

Logic Puzzles II

Example: I A says: “If B is truthful, then so am I” (q → p) I B says: “A is lying” Statement 1 Statement 2 p q If B is truthful so is A A is lying T T T F F T F F

Lecture 4 17/ 19

n p > T

f

so . ' T

f

es

f

T

T

T

ambiguous

( one

is

a

liar

  • ne

is

a

graph tell but

we don't

know

Which

is which)

slide-22
SLIDE 22

Logic Puzzles III

Example: I A says: “If B is lying, then so is C” (¬q → ¬r) I B says: “C is truthful” I C says “At least one of us is lying” Statement 1 Statement 2 Statement 3 p q r If B is lying, then so is C C is truthful At least one of us is lying T T T T T F T F T T F F F T T F T F F F T F F F

Lecture 4 18/ 19

slide-23
SLIDE 23

Industrial-Strength Predicates

Example I Domain D = set of all cars I “For any red sports car, you can find an expensive car that is safer” I S(x) = “x is a sports car” I E(x) = “x is expensive” I R(x) = “x is red” I A(x, y) = “x is safer than y” I ∀x ∈ D,

  • S(x) ∧ R(x)
  • ∃y ∈ D, E(y) ∧ A(y, x)
  • I Negation: ∃x ∈ D, S(x) ∧ R(x) ∧
  • ∀y ∈ D, ¬E(y) ∨ ¬A(y, x)
  • I “There exists a red sports car such that any car is either not more expensive or

is less safe”’

Lecture 4 19/ 19