Implications
Reading: EC 1.5 Peter J. Haas INFO 150 Fall Semester 2019
Lecture 4 1/ 19
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
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 Implication Logic Puzzles Revisited
Lecture 4 2/ 19
Implications
Informal examples
Lecture 4 3/ 19
Implications
Informal examples
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
Implications
Informal examples
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
∀x ∈ R, (x2 > 4) → (x > 2)
take 6 core courses. ∀s ∈ U, (x ∈ I) → (s must take 6 core courses)
Lecture 4 3/ 19
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
I
Pln )
ends
with
a 2 ,Qin
is
a multiple of2
D=
IR PCH )
=X
has
areal square
root
Qcx )
= 7 ( X 2e )I
LX ?
0 )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
Lecture 4 5/ 19
19 Coke Beer 25
Al Betty Dharmendra Chen
D=
students
in
pub
,RX )
is drinking
beer Q Cx)
=X
is
at least
21
Years of age Needs to turn
Al
and Chen P ( Betty )
to
check age
Q
C
Dharmendra )
=T
sodrinks
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 {
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
3 10
0=4×0 ✓ 24 24 ' 4×6if
is
:÷÷÷i::÷
.
Yes
40 NO nocounterexample
504Yes
FT
is a
counterexample
,p
f
f
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
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: ¬
Lecture 4 9/ 19
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 TuesdayJuanita
gets chocolate
, but has anunhappy
birthday
there exist xc.IR
,said that
X
>L
but
x 's 4
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
More on Contrapositives, Converses, and Inverses
Proposition
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
Cath
is
even ) →Lgb
areThe 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
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
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
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
Itf
meI
,Cm
even )
→
c
inend is in
0,44 , 8)
Vx
ER
,( x
>→
L X
' >x )
tf
X
GTI
,Lx
>n
IX odd )
→
l n'
undiv
. by4)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
amalt
.to )
→
c
n is
even )
(
nis even)
→( n
is
amulti
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
q
:B
is truthful
)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 > Tf
so . ' Tf
f
T
T
T
ambiguous
( one
is
aliar
is
agraph tell but
we don't
know
Which
is which)
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
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,
is less safe”’
Lecture 4 19/ 19