0% found this document useful (0 votes)
194 views47 pages

CH 1.4 1.6 Foundation Part 2

This document discusses predicates and quantifiers in predicate logic. Some key points: 1. Predicates are statements involving variables that are neither true nor false until values are specified, such as "x > 3" or "Computer x is functioning properly". 2. Universal quantification (∀x) means a predicate is true for every element considered, while existential quantification (∃x) means there is at least one element for which the predicate is true. 3. Negating quantified statements involves switching universal and existential quantifiers and negating the predicate, such as ¬∀xP(x) ≈ ∃x¬P(x), meaning "not for all x
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
194 views47 pages

CH 1.4 1.6 Foundation Part 2

This document discusses predicates and quantifiers in predicate logic. Some key points: 1. Predicates are statements involving variables that are neither true nor false until values are specified, such as "x > 3" or "Computer x is functioning properly". 2. Universal quantification (∀x) means a predicate is true for every element considered, while existential quantification (∃x) means there is at least one element for which the predicate is true. 3. Negating quantified statements involves switching universal and existential quantifiers and negating the predicate, such as ¬∀xP(x) ≈ ∃x¬P(x), meaning "not for all x
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 47

Chapter-1:

The Foundations: Logic and Proofs

1.4
Predicates and Quantifiers

Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 39
1.4 Predicates and Quantifiers
 Propositional logic, cannot adequately express meaning
of all statements: Drawback
 More powerful logic: “Predicate Logic”
 Predicates:
◼ Consider Statements involving variables:
 “x > 3,” “x = y + 3,” “x + y = z”
 “Computer x is under attack by an intruder”
 “Computer x is functioning properly”
◼ Neither true nor false, if values of variables are not specified

◼ Statement: “x is greater than 3” has two parts


1. Variable x: Subject of the statement
2. Predicate: “is greater than 3”— Property of subject
◼ Above Statement is denoted by P (x)
 P: Predicate “is greater than 3”
 x: Variable

Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 40
1.4 Predicates and Quantifiers
 Ex 1: P(x): Statement “x > 3”
◼ Truth values of P (4) and P (2)?
 Sol:
◼ P(4), for x = 4 : “4 > 3” : True
◼ P(2), for x =2 : “2 > 3” : False

 Ex 2: A(x): “Computer x is under attack by an intruder”


◼ Only CS2 and MATH1 are currently under attack by intruders
◼ Truth values of A(CS1), A(CS2), and A(MATH1)?
 Sol:
◼ A(CS1), for x = CS1
 CS1 is not on the list of computers currently under attack
 A(CS1) : False
◼ CS2 and MATH1 are on the list of computers under attack
 A(CS2) and A(MATH1) : True

Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 41
1.4 Predicates and Quantifiers
 Ex 3: Q(x, y): “x = y + 3”
◼ Truth values of propositions Q(1, 2) and Q(3, 0)?
 Sol:
◼ Q(1, 2), for x = 1 & y = 2 : “1 = 2 + 3,” : False
◼ Q(3, 0): “3 = 0 + 3” : True

 Ex 4: A(c, n): “Computer c is connected to network n”


◼ Computer MATH1 is connected to network CAMPUS2, but not to
network CAMPUS1
◼ What are the values of A(MATH1, CAMPUS1) and A(MATH1,
CAMPUS2)?
 Sol:
◼ MATH1 not connected to CAMPUS1, A(MATH1, CAMPUS1): False
◼ MATH1 connected to CAMPUS2, A(MATH1, CAMPUS2): True

Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 42
1.4 Predicates and Quantifiers
 Ex 5: R(x, y, z): “x + y = z”
◼ Truth values of R(1, 2, 3) and R(0, 0, 1)?
 Sol:
◼ R(1, 2, 3): “1 + 2 = 3” : True
◼ R(0, 0, 1): “0 + 0 = 1” : False
 Ex 6: if x > 0 then x := x + 1 (in computer programs)
◼ Value of x at that point is inserted into P(x)
 If P(x), True: x := x + 1 is executed, x is increased by 1
 If P(x), False: x := x + 1 is not executed, x is unchanged

 PRECONDITIONS AND POSTCONDITIONS


◼ Predicates: Used to check correctness of computer programs:
 Check desired output for given valid input
◼ Preconditions: Statements that Describe valid input
◼ Postconditions: Conditions that the Output should satisfy
Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 43
1.4 Predicates and Quantifiers
 Ex 7: Program: Interchange values of variables x & y
 temp := x
 x := y
 y := temp
◼ Find predicates for: Precondition and postcondition
◼ Verify for: all valid input program does what is intended
 Sol:
◼ Precondition: P(x, y), “x = a, y = b” a, b : Initial values of x, y
◼ Postcondition: Q(x, y), “x = b, y = a”
◼ Verification:
 Precondition P (x, y) holds “x = a and y = b” is True
1. temp := x i.e. x = a, temp = a, and y = b
2. x := y i.e. x = b, temp = a, and y = b
3. x := b i.e. temp = a, and y = a
 Postcondition Q(x, y) holds: statement “x = b and y = a” is True

Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 44
1.4 Predicates and Quantifiers
 Quantifiers: Expresses extent to which predicate is True over a
range of elements:
◼ In English: Words:
 All, some, many, none, and few
◼ Universal quantification: Predicate is true for every element
under consideration
◼ Existential quantification: There is one or more element
under consideration for which the predicate is true

 Predicate Calculus: Logic, deals with predicates & quantifiers

 Def 1: Universal quantification of P(x):


◼ “P(x) for all values of x in the domain”
 ∀x P(x): universal quantification of P(x)
 ∀ is universal quantifier
◼ Read: ∀x P(x) as “for all x P(x)” or “for every x P(x)”
◼ Counter example of ∀x P(x): Element for which P(x) is False
Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 45
1.4 Predicates and Quantifiers

 Ex 8: P(x): “x + 1 > x”
◼ ∀x P(x) ? Domain: All real numbers
 Sol: P(x) True for all real numbers x: ∀x P(x) : True

 Ex 9: Q(x): “x < 2”
◼ ∀x Q(x), Domain: All real numbers
 Solution: Q(x) not True for every real number x:
◼ For instance, Q(3) : False
◼ x = 3, Counterexample for statement ∀x Q(x)
◼ ∀x Q(x) : False

Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 46
1.4 Predicates and Quantifiers
 Ex 10: P(x): “x2 > 0” Show, ∀xP(x) : False
◼ Domain (Universe of discourse): All integers
 Sol: A counterexample: x2 is not > 0 when x = 0

 ∀x P(x): Domain Elements:


◼ x1, x2, ... , xn : Following conjuntion, True:
 P(x1) ∧ P(x2) ∧ ··· ∧ P(xn):
 If and only if P(x1), P(x2), ... , P(xn) all True

 Ex 11: ∀x P(x) ?
◼ If P(x): “x2 < 10”, For positive integers not exceeding 4
 Sol: ∀x P(x) ≈ P(1) ∧ P(2) ∧ P(3) ∧ P(4)
◼ Domain: 1, 2, 3, 4
◼ P(4): “42 < 10” , False:
◼ ∀x P(x) is False

Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 47
1.4 Predicates and Quantifiers
 Ex 12: ∀x N(x) ?
◼ N(x): “Computer x is connected to network”
◼ Domain: All computers on campus
 Sol: “Every computer on campus is connected to network”
 Ex 13: ∀x(x2 ≥ x) ?
1. Domain: All real numbers
2. Domain: All integers
 Sol:
1. False: Ex:
2. True:

 Def 2: Existential quantification of P(x): ∃x P(x)


◼ “There exists an element x in the domain such that P(x)”
◼ ∃ : existential quantifier

Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 48
1.4 Predicates and Quantifiers
 Ex 14: P(x) : “x > 3” ; ∃x P(x) ? Domain: All real numbers
 Sol: “x > 3”, True, for instance : x = 4; ∃x P(x) : True
 Ex 15: Q(x) : “x=x + 1” ; ∃xQ(x) ? Domain: All real numbers
 Sol: Q(x): False, for every real number x; ∃x Q(x) : False
 ∃x P(x): Domain Elements:
◼ x1, x2,...,xn : Following Disjunction is True:
◼ P(x1) ∨ P(x2) ∨···∨ P(xn):
◼ If and only if at least one of P (x1), P (x2), . . . , P (xn) : True

 Ex 16: P(x): “x2 > 10”; ∃x P(x) ?


◼ Domain: Positive integers not exceeding 4
 Sol: Domain: {1, 2, 3, 4}
◼ ∃x P(x) ≈ P(1) ∨ P(2) ∨ P(3) ∨ P(4)
◼ P(4), “42 > 10”: True; ∃x P(x) : True
Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 49
1.4 Predicates and Quantifiers
 Uniqueness quantifier: ∃! or ∃1
◼ “There exists a unique x such that P (x) is true”
◼ “There is exactly one” OR “there is one and only one”
◼ Ex: ∃!x (x − 1 = 0), Domain: real numbers
 True, Only if x = 1, unique real number
 Quantifiers with Restricted Domains
 Ex 17: ∀x < 0 (x2 > 0), ∀y ≠ 0 (y3 ≠ 0), ∃z > 0 (z2 = 2) ?
◼ Domain: Real numbers
 Sol:
◼ ∀x (x < 0 → x2 > 0)
 “Square of a negative real number is positive”
◼ ∀y (y ≠ 0 → y3 ≠ 0)
 “Cube of every nonzero real number is nonzero”
◼ ∃z (z > 0 ∧ z2 = 2)
 “There is a positive square root of 2”
Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 50
1.4 Predicates and Quantifiers
 Precedence of Quantifiers
◼ ∀ and ∃ have higher precedence than all logical operators
 Def 3:
◼ Statements involving predicates and quantifiers are logically
equivalent if and only if they have same truth value
 S ≡ T; statement S & T, logically equivalent
 Ex 19: ∀x(P(x) ∧ Q(x)) ≡ ∀xP(x) ∧ ∀xQ(x)
 Negating Quantified Expressions:

Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 51
1.4 Predicates and Quantifiers
 Ex 20: Find Negations of:
1. “There is an honest politician”
2. “All Americans eat cheeseburgers”
 Sol:
1. H(x): “x is honest”; ∃x H(x): “There is an honest politician”
 ¬∃x H(x) ≈ ∀x ¬H(x): “Not all politicians are honest”
2. C(x): “x eats cheeseburgers”; ∀x C(x): “All Americans eat
cheeseburgers”
 ¬∀x C(x) ≈ ∃x¬C(x): “There is an American who does not eat
cheeseburgers”
 Ex 21: Find Negations of:∀x(x2 > x) and ∃x(x2 = 2)
 Sol:
◼ Negation of ∀x(x2 > x) ≈ ¬∀x(x2 > x) ≈ ∃x¬(x2 > x) ≈
 ∃x(x2 ≤ x)
◼ Negation of ∃x(x2 = 2) ≈ ¬∃x(x2 = 2) ≈ ∀x¬(x2 = 2) ≈
 ∀x(x2 ≠ 2)

Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 52
1.4 Predicates and Quantifiers
 Ex 22: Show: ¬∀x (P(x) → Q(x)) and ∃x (P(x) ∧ ¬Q(x))
◼ Logically equivalent
 Sol:
◼ Fifth logical equivalence, Table 7, Section 1.3:
 ¬(P(x) → Q(x)) and P(x) ∧ ¬Q(x) are logically equivalent
◼ It follows: ¬∀x(P (x) → Q(x)) and ∃x(P (x) ∧ ¬Q(x)) are
logically equivalent
 Translating from English into Logical Expressions
 Ex 23: Express using predicates and quantifiers:
◼ “Every student in this class has studied calculus”
 Sol: ∀x (S(x) → Q(x, calculus))
◼ “For every person x, if person x is a student in this class
then x has studied calculus”
 S(x): Person x, in this class
 Q(x, y): Student x has studied subject y (y: Calculus)
Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 53
1.4 Predicates and Quantifiers
 Ex 24: Express using predicates and quantifiers:
1. “Some student in this class has visited Mexico”
2. “Every student in this class has visited either Canada or
Mexico”
 Sol:
1. ∃x (S(x) ∧ M(x))
 “There is a person x having the properties that x is a
student in this class and x has visited Mexico”
◼ S(x) : “x is a student in this class”
◼ M(x) : “x has visited Mexico”
2. ∀x(S(x) → (C(x) ∨ M(x)))
 “For every person x, if x is a student in this class, then x
has visited Mexico or x has visited Canada”
◼ S(x) : “x is a student in this class”
◼ C(x) : “x has visited Canada”
◼ M(x) : “x has visited Mexico”
Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 54
1.4 Predicates and Quantifiers
 Using Quantifiers in System Specifications
 Ex 25: Express using predicates and quantifiers:
1. “Every mail message larger than one megabyte will be
compressed”
2. “If a user is active, at least one network link will be
available”
 Sol:
1. ∀m (S(m, 1) → C(m))
 S(m, y) : “Mail message m is larger than y megabytes”
 C(m) : “Mail message m will be compressed”
2. ∃u A(u) → ∃n S(n, available)
 A(u) : “User u is active”
 S(n, x) : “Network link n is in state x”
Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 55
1.4 Predicates and Quantifiers
 Ex 26: First two : Premises, Third : Conclusion, Entire set :
Argument
◼ P(x) : “x is a lion”, Q(x) : “x is fierce”, R(x) : “x drinks coffee”
1. “All lions are fierce” : ∀x (P(x) → Q(x))
2. “Some lions do not drink coffee” : ∃x (P(x) ∧ ¬R(x))
3. “Some fierce creatures do not drink coffee” : ∃x (Q(x) ∧ ¬R(x))

 EX 27: First Three : Premises, Fourth : Valid Conclusion


◼ P(x) : “x is a hummingbird”, Q(x) : “x is large”, R(x) : “x lives
on honey”, S(x) : “x is richly colored”
1. “All hummingbirds are richly colored” : ∀x (P(x) → S(x))
2. “No large birds live on honey” : ¬∃x (Q(x) ∧ R(x))
3. “Birds that do not live on honey are dull in color” : ∀x (¬R(x) →
¬S(x))
4. “Hummingbirds are small” : ∀x (P(x) → ¬Q(x))

Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 56
Section Summary
 1.4 Predicates and Quantifiers
◼ Predicates
◼ Variables
◼ Quantifiers
◼ Universal Quantifier
◼ Existential Quantifier
◼ Negating Quantifiers
◼ De Morgan’s Laws for Quantifiers
◼ Translating English to Logic

 Next Section:
◼ 1.5 Nested Quantifiers
Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 57
Chapter-1:
The Foundations: Logic and Proofs

1.5
Nested Quantifiers

Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 58
1.5 Nested Quantifiers
 Nested quantifiers:
◼ One quantifier within scope of another: Ex: ∀x ∃y (x + y = 0)
◼ Considered as propositional function, Above proposition:
 ∀x Q(x), Where Q(x): ∃y P(x, y) Where P(x, y): x + y = 0
 Understanding Statements Involving Nested Quantifiers
 Ex 1: Domain: variables x & y : consists All real numbers
1. ∀x ∀y (x + y = y + x) : x + y = y + x for all x and y
 Commutative law for addition of real numbers
2. ∀x ∃y (x + y = 0) : For every x there is y such that x + y = 0
 Every real number has an additive inverse
3. ∀x ∀y ∀z (x + (y + z) = (x + y) + z)
 Associative law for addition of real numbers
 Ex 2: Translate into English statement:
◼ ∀x ∀y ((x > 0) ∧ (y < 0) → (xy < 0)), Domain: All real numbers
 Sol: “The product of a positive real number and a negative real
number is always a negative real number”
Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 59
1.5 Nested Quantifiers
 Ex 3: P(x, y): “x + y = y + x”, Domain: All real numbers
◼ Find ∀x ∀y P(x, y) and ∀y ∀x P(x, y)
 Sol: P(x, y), true for all x and y,∀x ∀y P(x, y) : True
◼ ∀y ∀x P(x, y):
 “For all real numbers y, for all real numbers x, x + y = y + x” ≈
 “For all real numbers x, for all real numbers y, x + y = y + x”
 ∀x ∀y P(x, y) & ∀y ∀x P(x, y) have same meaning, and both True
 Ex 4: Q(x, y) : “x + y = 0”, Domain: All real numbers
◼ Find ∃y ∀x Q(x, y) and ∀x ∃y Q(x, y)
 Sol:
◼ ∃y ∀x Q(x, y): “There is a real number y such that for every real
number x, Q(x, y)”
 No real number y such that x + y = 0 for all real numbers x: False
◼ ∀x ∃y Q(x, y): “For every real number x there is a real number y
such that Q(x, y)”
 For any x, there is a y: such that x + y = 0; namely, y = −x: True
Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 60
1.5 Nested Quantifiers
 Table 1 summarizes meanings of different possible
quantifications involving two variables:

Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 61
1.5 Nested Quantifiers
 Ex 5: Q(x, y, z): “x + y = z”, Domain: All real numbers
◼ Find ∀x ∀y ∃z Q(x, y, z) and ∃z ∀x ∀y Q(x, y, z)
 Sol:
◼ If x & y, assigned values : There exists z such that x + y = z
◼ ∀x ∀y ∃z Q(x, y, z) :
 “For all real numbers x and for all real numbers y there is a real
number z such that x + y = z” : True
◼ ∃z ∀x ∀y Q(x, y, z) :
 “There is a real number z such that for all real numbers x and for
all real numbers y it is true that x + y = z” : False
 No value of z, satisfies equation x + y = z for all values of x and y

 Ex 6: Translate to logical expression:


◼ “The sum of two positive integers is always positive”
 Sol:
◼ ∀x ∀y ((x > 0) ∧ (y > 0) → (x + y > 0))
◼ Also be express as: ∀x ∀y (x + y > 0)
Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 62
1.5 Nested Quantifiers
 Ex 7: Translate:
◼ “Every real number except zero has a multiplicative inverse”
◼ Multiplicative inverse of real number x is y such that xy = 1
 Sol:
◼ ∀x ((x ≠ 0) → ∃y (xy = 1))

 Ex 9: Translate to English: ∀x (C(x) ∨ ∃y (C(y) ∧ F(x, y)))


◼ C(x) : “x has a computer” F(x, y): “x and y are friends”
◼ Domain, x and y : All students in school
 Sol:
1. For every student x in school, x has a computer or there is a
student y such that y has a computer and x and y are friends
2. Every student in school has a computer or has a friend who
has a computer

Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 63
1.5 Nested Quantifiers
 Ex 10: Translate: ∃x ∀y ∀z ((F(x, y) ∧ F(x, z) ∧ (y ≠ z)) → ¬F(y, z))
◼ F(a, b) : a & b are friends, Domain, x, y, z: all students in school
 Sol:
1. If x and y are friends, and x and z are friends, and, if y and z are
not the same student, then y and z are not friends
2. There is a x such that for all y and all z other than y, if x and y
are friends and x and z are friends, then y and z are not friends
3. There is a student none of whose friends are also friends with
each other

 Ex 11: Express as logical expression:


◼ “If a person is female and is a parent, then this person is
someone’s mother”, Domain: All people, logical connectives
 Sol:
◼ ∀x ((F (x) ∧ P (x)) → ∃y M(x, y)) ≈
◼ ∀x ∃y ((F (x) ∧ P (x)) → M(x, y))
◼ F(x): “x is female” P(x): “x is parent” M(x, y): “x is mother of y”
Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 64
1.5 Nested Quantifiers
 Ex 12: Express as logical expression:
◼ “Everyone has exactly one best friend”, Domain: People
 Sol: ∀x ∃y (B(x, y) ∧ ∀z ((z ≠ y) → ¬B(x, z))) ≈
◼ ∀x ∃!y B(x, y), ∃! : “uniqueness quantifier”

 Ex 13: Express as logical expression:


◼ “There is a woman who has taken a flight on every airline in
the world”
 Sol: ∃w ∀a ∃f (P(w, f) ∧ Q(f, a))
◼ P(w, f) : “w has taken f ” and Q(f, a) : “f is a flight on a”

 Ex 14: Express negation of: ∀x ∃y (xy = 1)


 Sol: By, De Morgan’s laws in Table 2 of Section 1.4:
◼ ¬∀x ∃y (xy = 1) ≈ ∃x ∀y (xy ≠ 1)

Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 65
1.5 Nested Quantifiers
 Ex 15: Express: “There does not exist a woman who has
taken a flight on every airline in the world”
 Sol:
◼ P(w, f) : “w has taken f ” and Q(f, a) : “f is a flight on a”
◼ ∀w ¬∀a ∃f (P(w, f) ∧ Q(f, a))
≡ ∀w ∃a ¬∃f (P(w, f) ∧ Q(f, a))
≡ ∀w ∃a ∀f ¬(P(w, f) ∧ Q(f, a))
≡ ∀w ∃a ∀f (¬P(w, f) ∨ ¬Q(f, a))

◼ “For every woman there is an airline such that for all flights,
this woman has not taken that flight or that flight is not on
this airline”

Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 66
Section Summary
 1.5 Nested Quantifiers
◼ Nested Quantifiers
◼ Order of Quantifiers
◼ Translating from Nested Quantifiers into English
◼ Translating Mathematical Statements into
Statements involving Nested Quantifiers
◼ Translated English Sentences into Logical
Expressions
◼ Negating Nested Quantifiers

 Next Section:
◼ 1.6 Rules of Inference

Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 67
Chapter-1:
The Foundations: Logic and Proofs

1.6
Rules of Inference

Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 68
1.6 Rules of Inference
 Introduction
 Proofs: Valid arguments
◼ Establishs truth of mathematical statements
 Argument: Sequence of propositions, end with conclusion
 Valid Argument: if the truth of all its premises implies that the
conclusion is true
 Premises: All, excluding final proposition in the argument
 Conclusion: Final proposition in the argument
 Rules of Inference: Basic tools for establishing truth of
statements (Used to produce valid arguments)
 Fallacies: Common forms of incorrect reasoning
◼ Lead to invalid arguments
 Argument form: Sequence of compound propositions involving
propositional variables

 Argument form with premises p1, p2,...,pn and conclusion q is


valid, when (p1 ∧ p2 ∧···∧ pn) → q is a tautology
Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 69
1.6 Rules of Inference
 Valid Arguments in Propositional Logic
 Consider following argument involving propositions:
1. “If you have a current password, then you can log onto the network”
2. “You have a current password”
Therefore,
3. “You can log onto the network”
 Determine whether (3) is a valid argument
◼ i.e. Conclusion (3) must be true when, premises (1) & (2) both true
◼ p: “You have a current password” p→q
◼ q: “You can log onto the network” p
◼ Then, the argument has the form:
◼ ∴ symbol denotes “therefore” q
◼ ((p → q) ∧ p) → q is tautology (Modus Ponens or Law of Detachment)
◼ When both p → q and p are true, q must also be true
◼ This form of argument is valid because whenever all its premises are
true, the conclusion must also be true

◼ Premises can be expressed, above line & Conclusion, below line

Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 70
1.6 Rules of Inference
 Rules of Inference for Propositional Logic
 Can always use truth table to validate the 'Argument Form'
◼ But, can be a tedious approach
◼ Ex: If an argument form involves 10 propositional variables:
 Requires 210 = 1024 different rows
◼ Instead, Rules of inference can be used
 Ex 1: Conditional statement “If it snows today, then we will go
skiing” and its hypothesis, “It is snowing today” are True ?
◼ By modus ponens: Conclusion, “We will go skiing” is True

 Ex 2: Determine: Argument, valid? and its conclusion, True?


◼ “If √2 > (3/2) , then (√2)2 > (3/2)2”
 (√2)2 = 2 > (3/2)2 = 9/4
 Sol: p: “√2 > 3/2” and q: “2 > ( 3/2 )2”
◼ Premises p → q and p, & Conclusion, q: Valid, (Modus Ponens)
◼ But, Premise, (√2 > 3/2) : False, Cannot conclude, Conclusion is True
◼ Conclusion of argument: False, as 2 < 9/4
Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 71
1.6 Rules of Inference

Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 72
1.6 Rules of Inference
 Ex: Modus Ponens:
◼ p: “It is snowing”
◼ q: “I will study discrete math”
◼ “If it is snowing, then I will study discrete math”
 “It is snowing”, Therefore , “I will study discrete math”
 Ex: Modus Tollens:
◼ p: “It is snowing”
◼ q: “I will study discrete math”
◼ “If it is snowing, then I will study discrete math”
 “I will not study discrete math” Therefore, “It is not snowing”
 Ex: Hypothetical Syllogism:
◼ p: “It snows”
◼ q: “I will study discrete math”
◼ r: “I will get an A”
◼ “If it snows, then I will study discrete math”
 “If I study discrete math, I will get an A” Therefore, “If it snows,
I will get an A”
Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 73
1.6 Rules of Inference
 Ex: Disjunctive Syllogism:
◼ p: “I will study discrete math”
◼ q: “I will study English literature”
◼ “I will study discrete math or I will study English literature”
 “I will not study discrete math”, ∴ “I will study English literature”

 Ex: Addition:
◼ p: “I will study discrete math”
◼ q: “I will visit Las Vegas”
◼ “I will study discrete math”
 Therefore, “I will study discrete math or I will visit Las Vegas”

 Ex: Simplification:
◼ p: “I will study discrete math”
◼ q: “I will study English literature”
◼ “I will study discrete math and English literature”
 Therefore, “I will study discrete math”

Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 74
1.6 Rules of Inference
 Ex: Conjunction:
◼ p: “I will study discrete math”
◼ q: “I will study English literature”
◼ “I will study discrete math”
◼ “I will study English literature”
 ∴ “I will study discrete math and I will study English literature”

 Ex: Resolution:
◼ p: “I will study discrete math”
◼ r: “I will study English literature”
◼ q: “I will study databases”
◼ “I will not study discrete math or I will study English literature”
◼ “I will study discrete math or I will study databases”
 ∴ “I will study databases or I will study English literature”

Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 75
1.6 Rules of Inference
 Using Rules of Inference to Build Arguments
 Ex 6: Premises:
◼ “It is not sunny this afternoon and it is colder than yesterday”
◼ “We will go swimming only if it is sunny,”
◼ “If we do not go swimming, then we will take a canoe trip”
◼ “If we take a canoe trip, then we will be home by sunset”
◼ Conclusion: “We will be home by sunset”
 Sol:
◼ p: It is sunny this afternoon
◼ q: It is colder than yesterday
◼ r: We will go swimming
◼ s: We will take a canoe trip
◼ t: We will be home by sunset
◼ Premises (Hypotheses):
¬p ∧ q, r → p, ¬r → s, s → t
◼ Conclusion: t
◼ Argument can be constructed:
Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 76
1.6 Rules of Inference
 Ex 7: Premises:
◼ “If you send me an e-mail message, then I will finish writing the
◼ program”
◼ “If you do not send me an e-mail message, then I will go to sleep
early”
◼ “If I go to sleep early, then I will wake up feeling refreshed”
◼ Conclusion: “If I do not finish writing the program, then I will wake
up feeling refreshed”
 Sol:
◼ p: You send me an e-mail message
◼ q: I will finish writing the program
◼ r: I will go to sleep early
◼ s: I will wake up feeling refreshed
◼ Premises:
p → q, ¬p → r, and r → s
◼ Desired conclusion: ¬q → s
◼ Argument form:

Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 77
1.6 Rules of Inference
 Ex 8: Use resolution to show that the hypotheses:
◼ “Jasmine is skiing or it is not snowing” and
◼ “It is snowing or Bart is playing hockey” imply that
◼ “Jasmine is skiing or Bart is playing hockey”
 Sol:
◼ p: “It is snowing”, q: “Jasmine is skiing”, r: “Bart is playing hockey”
◼ Represent hypotheses: ¬p ∨ q and p ∨ r,
◼ Using resolution, proposition q ∨ r :
 “Jasmine is skiing or Bart is playing hockey” follows
 Ex 9: Show: premises (p ∧ q) ∨ r & r → s imply conclusion p ∨ s
 Sol: (Clause: disjunction of variables or negations of these variables)
◼ Rewrite premises, (p ∧ q) ∨ r as two clauses:
 p ∨ r and q ∨ r
◼ Replace r → s by equivalent clause ¬r ∨ s
◼ Using, clauses p ∨ r and ¬r ∨ s
◼ Using resolution to conclude: p ∨ s

Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 78
1.6 Rules of Inference
 Ex 10: Is following argument valid?:
◼ “If you do every problem in this book, then you will learn discrete
mathematics.You learned discrete mathematics”
◼ “Therefore, you did every problem in this book”
 Sol:
◼ p: “You did every problem in this book”
◼ q: “You learned discrete mathematics”
◼ The Argument is of form: if p → q and q, then p
◼ Example of incorrect argument using fallacy of affirming conclusion
◼ Indeed, Possible, to learn discrete mathematics in some way other
than by doing every problem in this book
◼ Learn discrete mathematics by reading, listening to lectures, doing
some, but not all, the problems in this book, and so on..
◼ Proposition ((p → q) ∧ ¬p) → ¬q is not a tautology
 Because it is false when p is false and q is true

◼ This type of incorrect reasoning, called fallacy of denying hypothesis


Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 79
1.6 Rules of Inference
 Handling Quantified Statements
 Universal Instantiation (UI):
◼ Ex: Lisa is a member of domain of all women xP ( x )
◼ “All women are wise”  P ( c)
◼ ∴ “Lisa is wise”

 Universal Generalization (UG): P ( c ) for an arbitrary c


◼ Used often implicitly in Mathematical Proofs
xP ( x )
 Existential Instantiation (EI):
Ex:
xP ( x )

◼ “There is someone who got an A in the course”
◼ “Let’s call her a and say that a got an A”  P ( c ) for some element c
 Existential Generalization (EG):
◼ Ex: P ( c ) for some element c
◼ “Michelle got an A in the class” xP ( x )
◼ “Therefore, someone got an A in the class”

Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 80
1.6 Rules of Inference

Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 81
1.6 Rules of Inference
 Ex: Using rules of inference, construct valid argument to show:
 “John Smith has two legs”, Consequence of premises:
 “Every man has two legs” and “John Smith is a man”
 Sol:
◼ M(x): “x is a man” and L(x): “ x has two legs”
◼ John Smith is member of domain
◼ Valid Argument:

Step Reason
1. x ( M ( x ) → L ( x ) ) Premise
2. M ( J ) → L ( J ) UI from (1)
3. M ( J ) Premise
4. L ( J ) Modus Ponens using ( 2) and ( 3)
Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 82
1.6 Rules of Inference
 Ex: Construct valid argument showing conclusion:
◼ “Someone who passed the first exam has not read the book”
◼ Follows from premises: “A student in this class has not read the
book” and “Everyone in this class passed the first exam”
 Sol: C(x): “x is in this class”, B(x): “ x has read the book”
x ( C ( x )  B ( x ) )
P(x): “x passed the first exam”
◼ Translate premises & conclusion into symbolic form: x ( C ( x ) → P ( x ) )
x ( P ( x )  B ( x ) )
◼ Valid Argument:

Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 83
1.6 Rules of Inference
 Universal Modus Ponens
◼ Combines universal instantiation
and modus ponens into one rule:

 Universal Modus Tollens


◼ Combines universal instantiation
and modus tollens into one rule:

 Ex 14: Assume:
1. “For all positive integers n, if n is greater than 4, then n2 is less
than 2n ” is true
2. Use universal modus ponens to show that 1002 < 2100
 Sol: P(n): “n > 4” and Q(n): “n2 < 2n”
◼ Statement 1 can be represented : ∀n(P(n) → Q(n))
◼ P(100): True because 100 > 4
◼ It follows by universal modus ponens:
 Q(100) is true, namely that 1002 < 2100

Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 84
Section Summary
 1.6 Rules of Inference
◼ Valid Arguments
◼ Inference Rules for Propositional Logic
◼ Using Rules of Inference to Build Arguments
◼ Rules of Inference for Quantified Statements
◼ Building Arguments for Quantified Statements

 Next Section:
◼ 1.7 Introduction to Proofs

Source: "Discrete Mathematics and Its Applications", By Kenneth H. Rosen, 7th Edition 85

You might also like