BSCS-I
SAGAR MAL
(DEAR SAGAR)
1
Predicates and Quantifiers
PROPOSITIONAL FUNCTION (open sentence)
Statement involving one or more variables e.g.: x >
5.
This statement has two parts .
First part: The variable x which is the subject
Second part: The predicate ‘ greater than 5’
Propositional function is represented by P(x) where
P is the predicate and x is the variable.
If a value is assigned to the variable x, then P(x)
becomes a proposition. False
What is the truth value of P(2) ?True
What is the truth value of P(9) ?
Consider the propositional function Q(x, y, z)
defined by:
x + y = z.
Here, Q is the predicate and x, y, and z are the
variables. True
What is the truth value of Q(2, 3,False
5) ?
What is the truth value of Q(0,1,2) ?
QUANTIFIER
A quantifier is an operator used to create a
proposition from a propositional function.
UNIVERSAL QUANTIFIER
Let P(x) be a propositional function. The
Universal quantification of P(x) is the
proposition
“ P(x) is true For all values of x in the
universe of discourse”.
Why is it important to specify Universe of
Discourse?
Let x = the character ‘a’
Is ‘a’+1 > ‘a’?
Let x = the state of Pakistan
Is Pakistan+1 > Pakistan?
You need to specify your universe!
Notation: x P(x) “for all x P(x)” or “for
every x P(x)”
The universal quantification x P(x)
implies:
P(x1) P(x2) … P(xn)
x P(x) is either true or false, so it is a
proposition, not a propositional function.
What is the truth value of x P(x), where P(x) is
the statement “x2 <10” and the universe of
discourse consists of positive integers not
exceeding 4?
False
What is the truth value of x (x2 ≥ x) ” if the
universe of discourse consists of i) all real
numbers ii) all integers?
i) False
ii) True
Existential quantification
Let P(x) be a propositional function. The Existential
quantification of P(x) is the proposition “There exists a
value of x in the universe of discourse such that P(x) is
true ”.
Notation : x P(x)
The existential quantification x P(x) implies:
P(x1) P(x2) … P(xn)
What is the truth value of x P(x), where P(x) is the
statement “x2 <10” and the universe of discourse
consists of positive integers not exceeding 4?
True
Let P(x) = x+1 > x
x P(x) “for at least one value of x, x+1>x is
x: true”
P(x) : “for all values of x, x+1>x is true”
In order to show an existential quantification
is true, you only have to find ONE value
In order to show an existential quantification
is false, you have to show it’s false for ALL
values
Let the universe of discourse be the real
numbers.
What does xy (x + y = 320) mean ?
“For everyYesx there exists a y so that x + y = 320.”
Is it true? No
Is it true for natural numbers?
Binding Variables
The occurrence of a variable is said to be
bound when either a quantifier is used on the
variable x or a value is assigned to it.
(x P(x)) Q(x))
The x in Q(x) is not bound; thus not a proposition
(x P(x)) (x Q(x))
Both x values are bound; thus it is a proposition
(x P(x) Q(x)) (y R(y))
All variables are bound; thus it is a proposition
(x P(x) Q(y)) (y R(y))
The y in Q(y) is not bound; this not a proposition
Translate the following statement using quantifiers
“For every student in this class, that student has
studied calculus”
Rephrased: “For every student x in this class, x has
studied calculus”
Let C(x) be “x has studied calculus”
Let S(x) be “x is a student in this class”
x C(x)
Truth Value: True if the universe of discourse is all
students in this class
What about if the universe of discourse is all
students (or all people?)
x (S(x)C(x))
This is wrong! Why?
x (S(x)→C(x)) 12
Translate the following statement using quantifiers
“Some students in this class have visited Mexico”
Let:
S(x) be “x is a student in this class”
M(x) be “x has visited Mexico”
Rephrasing: “There exists a student who has visited
Mexico”
x M(x)
Truth Value: True if the universe of discourse is all
students
What about if the universe of discourse is all people?
x (S(x) → M(x))
This is wrong! Why?
x (S(x) M(x))
Consider: “Every student in this class has
visited Canada or Mexico”
S(x) be “x is a student in this class”
M(x) be “x has visited Mexico”
C(x) be “x has visited Canada”
x (M(x)C(x)
When the universe of discourse is all students
x (S(x)→(M(x)C(x))
When the universe of discourse is all people
Why isn’t x (S(x)(M(x)C(x))) correct?
NEGATING QUANTIFICATIONS
To negate a universal quantification:
You negate the propositional function
AND you change to an existential
quantification
¬x P(x) = x ¬P(x)
To negate An existential quantification:
You negate the propositional function
AND you change to a universal quantification
¬ x P(x) = x ¬P(x)
Every student in this class has taken calculus
Negation: There is a student in this class who has
not taken a course in calculus
There is a student in this class who has taken a
course in calculus.
Negation: Every student in this class has not
taken calculus
What are the negations of the statements x (x2 >x)
and x (x2 =2)
i) x (x2 ≤x)
ii) x (x2 ≠2)
Translate the statements:
“All hummingbirds are richly colored”
“No large birds live on honey”
“Birds that do not live on honey are dull in
color”
“Hummingbirds are small”
Assign our propositional functions
Let P(x) be “x is a hummingbird”
Let Q(x) be “x is large”
Let R(x) be “x lives on honey”
Let S(x) be “x is richly colored”
Let our universe of discourse be all birds
“All hummingbirds are richly colored”
x (P(x)→S(x))
“No large birds live on honey”
¬x (Q(x) R(x))
Alternatively: x (¬Q(x) ¬R(x))
“Birds that do not live on honey are dull in
color”
x (¬R(x) → ¬S(x))
“Hummingbirds are small”
x (P(x) → ¬Q(x))
Translating statements involving Nested
Quantifiers
For the following the universe of discourse is real
x y(x+y=y+x)
numbers
x y z(x+(y+z)=(x+y)+z
Commutative law for addition:
x y(x+y=0)
Associative law for addition:
Existence of Additive inverse:
x y((x>0) (y<0) → (xy<0))
The product of a positive and negative real
number is negative:
Find the negation of x y(xy=1)
x y(xy≠1)
Translate the following statement into english
x (C(x) y(C(y) F(x,y))) where C(x) is “x
has a computer” and F(x,y) is “ x and y are
friends”.
Universe of discourse is all students in
school
For every student x in your school x has a
computer or there is a student y such that
has a computer and x and y are friends.
(Every student in your school has a
computer or has a friend who has a
computer)
ORDER OF QUANTIFIERS
Is order of quantifiers important?
Yes! unless all quantifiers are universal
quantifiers or all are existential quantifiers
xy P(x, y) vs. yx P(x, y)
P(x,y): “x+y=y+x”
x y Q(x, y) vs. yx Q(x, y)
Q(x,y): “x+y=0”
Table : Quantification of Two variables