Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Discrete Mathematics: Chapter 1: The Foundations: Logic and Proofs Section 1.4: Predicates and Quantifiers

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 29

Instructor:

Discrete Mathematics  Dr Ghulam Mustafa

Chapter 1: The Foundations: Logic and Proofs


Section 1.4 : Predicates and Quantifiers 
Introduction
• Propositional logic, cannot adequately express the
meaning of all statements in mathematics and in
natural language
• Example:
“Every computer connected to the university network is
functioning properly.”
No rules of propositional logic allow us to conclude the
truth of the statement
“MATH3 is functioning properly,”
Predicate Logic

• We will see how predicate logic can be used


to express the meaning of a wide range of
statements in mathematics and computer
science in ways that permit us to reason and
explore relationships between objects.
Predicates 

• In mathematics arguments, we will often see


sentences containing variables, such as: 
• x > 0 
• x = y + 3 
• Computer x is functioning properly 
• For each sentence, we call 
• the variables as the subject of the sentence 
• the other part, which describes the property of the
variables, as the predicate of the sentence 
Predicates 

• Take x > 0 as an example 


• x : the subject 
• > 0: the predicate 
• Once the value of x is assigned, the above
sentence becomes a proposition and has a truth
value 
• We can denote it as some function P(x) of x 
• P is called a propositional function 
Predicates 

• Example 1: 
Let P(x ) denote the sentence “x > 0”. 
What are the truth values of P(0) and P(1)? 
• Example 2: 
Let Q(x, y ) denote the sentence “x = y + 3”. 
What are the truth values of Q(1,2) and
Q(3,0)? 
Quantifiers 

• In English, the words all, some, many, none, few


are used to express some property (predicate) is
true over a range of subjects 
• These words are called quantifiers 
• In mathematics, two important quantifiers are
commonly used to create a proposition from a
propositional function: 
universal quantifier and existential quantifier 
Universal Quantifier 

••  Many
mathematical statements say that a
property is true for all values of a variable,
when values are chosen from some domain 
• Examples: 
• z(z + 1)(z + 2) is divisible by 6 for all integer z 
• is rational for all rational number q 
• > 0 for all positive real number r 
• Important Note: Domain needs to be specified! 
Universal Quantifier 

• Universal Quantifier 
The universal quantification of P(x) is the
proposition 
“P(x) for all values of x in the domain.” 
The notation ∀x P(x) represents the above
proposition. 
A value of x making the proposition false is called a
counter-example. 
Universal Quantifier 

••  If
all values in the domain can be listed, say , ,
…, , then ∀ x P(x ) is the same as 
P() ⌃ P() ⌃ … ⌃ P() 
• Example: 
What is the truth value of ∀ x (x ≤ 10 ) when the
domain consists of all positive integers not
exceeding 3? 
What is the truth value of P(1) ⌃ P(2) ⌃ P(3)? 
Test Your Understanding 

••  What is the truth value of 


∀ x ( ≥ x ) 

• if the domain consists of all real numbers? 


• if the domain consists of all integers? 
Test Your Understanding (Solution) 

• False,
  if the domain consists of all real numbers. In particular,
the case 
x = 0.5 
is a counter-example. 

• True, if the domain consists of all integers. To see this, we notice


the following equivalences: 
≥ x ↔x (x – 1) ≥ 0 ↔x ≤ 0 or x ≥ 1 
Thus, ≥ x cannot be false, since there are no integers x with 0 < x
< 1. 
Existential Quantifier 

•• Many
  mathematical statements say that a
property is true for some value of a variable,
when values are chosen from some domain 
• Examples: 
• + 1 is a prime for some non-negative integer z 
• is rational for some irrational numbers r and s 
• Important Note: Domain needs to be specified! 
Existential Quantifier 

• Existential Quantifier 
• The existential quantification of P(x) is the
proposition 
“P(x) for some value of x in the domain.” 
The notation ∃x P(x) represents the above
proposition. 
The proposition is false if and only if P(x) is
false for all values of x. 
Existential Quantifier 

•• If
 all values in the domain can be listed, say , , …, ,
then ∃ x P(x ) is the same as 
P() v P() v … v P() 

• Example: 

What is the truth value of ∃ x (x ≤ 0 ) when the domain


consists of all positive integers not exceeding 3? 
What is the truth value of P(1) v P(2) v P(3)? 
Test Your Understanding 

••  What is the truth value of 


∃ z ( ≥ 10 ) 

• if the domain consists of all positive


integers not exceeding 3? 
• if the domain consists of all integers not
exceeding 3? 
Quantifiers

Quantifiers
Statement When True? When False?
∀x P(x) P(x) is true for every x. There is an x for which P(x) is
false.
∃x P(x) There is an x for which P(x) is P(x) is false for every x.
true.
Quantifiers with Restricted Domain 

••  Sometimes,we want to simplify the writing


by using short-hand notation 
• Assuming the domain consists of all
integers, guess what does each of the
following mean? 
• ∀ x < 0 ( > 0 ) 
• ∃ z > 0 ( = 10 ) 
Quantifiers with Restricted Domain 

•∀
  x < 0 ( > 0 ) means 
“For every x in the domain with x < 0, > 0.” 
That is, it states “The square of a negative integer is positive.”
The proposition is the same as: 
∀ x (x < 0 → > 0 ) 

• ∃ z > 0 ( = 10 ) means 
“There is some z in the domain with z > 0, = 10.” 
That is, it states “There is a positive square root of 2.”
The proposition is the same as: 
∃ z (z > 0 ^ = 10 ) 
Precedence of Quantifiers

• The quantifiers ∀ and ∃ have higher precedence than


all logical operators
• For Example:
• ∀xP(x) ∨ Q(x) is the disjunction of ∀xP(x) and Q(x).
In other words,
• it means (∀xP(x)) ∨ Q(x) rather than ∀x(P(x) ∨ Q(x)).
Binding Variables 

• If there is a quantifier used on a variable x, we


say the variable is bound. Else it is free. 
Ex: In ∃x (x + y = 1 ) , x is bound and y is free 

• If all variables in a propositional function are


bound, the function becomes a proposition 
Ex: ∀ y ∃x (x + y = 1 ) is a proposition 
Multiple Quantifiers 

• In the last example, we have a proposition 


∀y ∃x (x + y = 1 ) 
with two quantifiers, where 
∀ y is applied to ∃x (x + y = 1 ), and 
∃x is applied to x + y = 1 
• The part of the logical expression where a
quantifier is applied is called the scope of that
quantifier 
The Order of Quantifiers 
• Order in which quantifiers appear is important 
• Example: 
Suppose that the domain for both x and y are
integers. What are the truth values of the
following? 

1. ∀ y ∃ x (x + y = 1 ) 
2. ∃ x ∀y (x + y = 1 ) 
The Order of Quantifiers 

• Two special cases where the order of quantifiers


is not important are: 
1.All quantifiers are universal quantifiers 
2.All quantifiers are existential quantifiers 
• Example: 
∃ x ∃ y (x + y = 1 ) 
means the same as 
∃ y ∃ x (x + y = 1 ) 
Negating Quantified Expressions
• “Every student in your class has taken a course in calculus.”
∀xP(x)
where P(x) is the statement “x has taken a course in calculus”
and the domain consists of the students in your class.
• The negation of this statement is
• “It is not the case that every student in your class has taken a course in calculus.”
This is equivalent to
• “There is a student in your class who has not taken a course in calculus.”
∃x⌝ P(x).
• This example illustrates the equivalence ⌝∀xP(x) ≡ ∃x⌝ P(x).
Negating Quantified Expressions
• “There is a student in this class who has taken a course in
calculus.” This is the existential quantification ∃xQ(x),
where Q(x) is the statement “x has taken a course in calculus.”
The negation of this statement is the proposition
“It is not the case that there is a student in this class who has taken
a course in calculus.”
This is equivalent to
• “Every student in this class has not taken calculus,” ∀x⌝ Q(x).
• This example illustrates the equivalence
• ⌝ ∃xQ(x) ≡ ∀x ⌝ Q(x).
Logical Equivalences 
• De Morgan’s Laws for Quantifiers
1. ¬ ∃ x P(x ) ≡ ∀ x ¬ P(x ) 
2. ¬ ∀ x P(x ) ≡ ∃ x ¬ P(x ) 
De Morgan’s Laws for Quantifiers
Negation Equivalent Statement When Is Negation True? When False?
¬ ∃ x P(x ) ∀ x ¬ P(x ) For every x, P(x) is There is an x for which
false P(x) is true
¬ ∀ x P(x ) ∃ x ¬ P(x )  There is an x for which P(x) is true for every x.
P(x) is false
Applications: English Translation 
• How to translate the following sentence 
“Every student in this class has studied Calculus.” 
into a logical expression, if 
C(x ) denotes “x has studied Calculus”, and the domain
of x is all students in this class? ∀xC(x)
• What if the domain of x consists of all people?
• “For every person x, if person x is a student in this class
then x has studied calculus.”
• If S(x) represents the statement that person x is in this class, we see that our
statement can be expressed as ∀x(S(x) → C(x)).
Applications: English Translation 

• How to translate the following sentences 


1.“All lions are fierce.” 
2.“Some lion does not drink coffee.” 
3.“Some fierce creatures do not drink coffee.” 
into logical expressions, if 
P(x ) := “x is a lion”, Q(x ) := “x is fierce”, 
R(x ) := “x drinks coffee”,  ∀x(P(x) → Q(x)).
and the domain of x consists of all creatures?  ∃x(P(x) ∧⌝ R(x)).
∃x(Q(x) ∧⌝ R(x)).

You might also like