Professional Documents
Culture Documents
PREDICATED LOGIC
LECTURE BY:
MS. CHERRY ROSE ESTABILLO
CS201 - CRRESTABILLO
UNIVERSITY OF SANTO TOMAS
INSTITUTE OF INFORMATION AND COMPUTING SCIENCES
PREDICATED LOGIC
Predicate Logic is an extension of
Propositional Logic.
It was used to express the meaning of
wide range of statements in
mathematics and computer science in
ways that permit us to reason and
explore relationships between objects
CS201 - CRRESTABILLO
UNIVERSITY OF SANTO TOMAS
INSTITUTE OF INFORMATION AND COMPUTING SCIENCES
Two components:
Consider, x > 5
variable: x
P: is greater than 5
Propositional function P at x: P(x)
P(8)
P(1)
CS201 - CRRESTABILLO
UNIVERSITY OF SANTO TOMAS
INSTITUTE OF INFORMATION AND COMPUTING SCIENCES
Consider, x=y+2
variable: x, y
Predicate: Q
Propositional function Q at x,y: Q(x,y)
Q(1,3)
Q(7,5)
CS201 - CRRESTABILLO
UNIVERSITY OF SANTO TOMAS
INSTITUTE OF INFORMATION AND COMPUTING SCIENCES
Exercise
1.) Let P(x) denote the statement
x4. What are the truth values?
a.) P(0) b) P(4) c.) P(6)
2.) Let P(x) denote the statement the
word x contains the letter a. What are
the truth values?
a.) P(orange) b) P(lemon)
c.) P(true) d) P(false)
CS201 - CRRESTABILLO
UNIVERSITY OF SANTO TOMAS
INSTITUTE OF INFORMATION AND COMPUTING SCIENCES
PROPOSITIONAL FUNCTION
Let P(x) be a statement involving the
variable x and let D be a set. We call P a
PROPOSITIONAL FUNCTION (wrt D) if for
each x in D, P(x) is a PROPOSITION. We
call D the DOMAIN OF DISCOURSE.
CS201 - CRRESTABILLO
UNIVERSITY OF SANTO TOMAS
INSTITUTE OF INFORMATION AND COMPUTING SCIENCES
Let:
P(x) : x + 2x2 is a rational number.
D: set of rational numbers
QUANTIFICATION
- used to create a proposition from a
propositional function. It expresses
the extent to which a predicate is true
over a range of elements.
CS201 - CRRESTABILLO
UNIVERSITY OF SANTO TOMAS
INSTITUTE OF INFORMATION AND COMPUTING SCIENCES
CS201 - CRRESTABILLO
UNIVERSITY OF SANTO TOMAS
INSTITUTE OF INFORMATION AND COMPUTING SCIENCES
Examples
(1)Let P(x) be the statement x + 2 > 2.
What is the truth value of the
quantification xP(x), where the domain
consist of all non-negative integers?
(2) What is the truth value of xP(x), where
P(x) is the statement x2 < 9 and the
domain consists of the positive integers
less than 3?
CS201 - CRRESTABILLO
UNIVERSITY OF SANTO TOMAS
INSTITUTE OF INFORMATION AND COMPUTING SCIENCES
CS201 - CRRESTABILLO
UNIVERSITY OF SANTO TOMAS
INSTITUTE OF INFORMATION AND COMPUTING SCIENCES
Examples
(1)Let P(x) be the statement x + 2 > 2.
What is the truth value of the
quantification xP(x), where the domain
consist of all non-negative integers?
(2) What is the truth value of xP(x), where
P(x) is the statement x2 < 9 and the
domain consists of the positive integers
not exceeding 3?
CS201 - CRRESTABILLO
UNIVERSITY OF SANTO TOMAS
INSTITUTE OF INFORMATION AND COMPUTING SCIENCES
Exercises
Let P(x) be the statement x has visited
the Museum where the domain consists
of the students UST. Express each of
these quantifications in English.
(1)xP(x)
(2)x P(x)
(3)xP(x)
(4)x P(x)
CS201 - CRRESTABILLO
UNIVERSITY OF SANTO TOMAS
INSTITUTE OF INFORMATION AND COMPUTING SCIENCES
Exercises
Translate these statements into English,
where C(x) is x is a comedian and F(x) is
x is funny and the domain consists of
all people.
(1)x(C(x) F(x))
(2)x (C(x) F(x))
(3)x(C(x) F(x))
(4)x (C(x) F(x))
CS201 - CRRESTABILLO
UNIVERSITY OF SANTO TOMAS
INSTITUTE OF INFORMATION AND COMPUTING SCIENCES
Exercise
Let C(x) be the statement x has a cat, let D(x) be the
statement x has a dog, and let H(x) be the statement x
has a hamster. Express each of these statement in terms
of C(x), D(x), H(x), quantifiers, and logical connectives. Let
the domain consist of all students in your class.
1.) A student in your class has a cat, a dog and a hamster.
2.) All student in your class has a cat, a dog or a hamster.
3.) Some student in your class has a cat and a hamster, but
not a dog.
CS201 - CRRESTABILLO
UNIVERSITY OF SANTO TOMAS
INSTITUTE OF INFORMATION AND COMPUTING SCIENCES
OTHER QUANTIFIERS
UNIQUENESS QUANTIFIER
The statement There exists a unique x
such that P(x) is true or there is exactly
one or there is one and only one is an
example of quantification using
UNIQUENESS QUANTIFIER.
And this can be written as !xP(x).
CS201 - CRRESTABILLO
UNIVERSITY OF SANTO TOMAS
INSTITUTE OF INFORMATION AND COMPUTING SCIENCES
Example 2: y0 (y 0) where
the domain is all real numbers
The cube of a nonzero real number is nonzero.
y(y0 y0)
CS201 - CRRESTABILLO
UNIVERSITY OF SANTO TOMAS
INSTITUTE OF INFORMATION AND COMPUTING SCIENCES
PRECEDENCE QUANTIFIER
The quantifiers and have higher
precedence than all logical operations.
Example.
The conjunction of xP(x) and Q(x) :
(xP(x))Q(x) rather than x(P(x)Q(x)).
CS201 - CRRESTABILLO
UNIVERSITY OF SANTO TOMAS
INSTITUTE OF INFORMATION AND COMPUTING SCIENCES
DEFINITION
The occurrence of the variable is said to be
BOUND when the quantifier is used on the
variable.
The occurrence of the variable that is not bound
by a quantifier is said to be FREE.
The part of a logical expression to which a
quantifier is applied called the SCOPE of
quantifier.
CS201 - CRRESTABILLO
UNIVERSITY OF SANTO TOMAS
INSTITUTE OF INFORMATION AND COMPUTING SCIENCES
Example
(1) x(4x + 4y <2z)
Bound: x (by universal quantifier)
Free: y & z
(2) x(P(x)Q(x))xR(x)
Bound: all variables
Free: DOES NOT EXIST
Scope of x: P(x)Q(x) Scope of x: R(x)
CS201 - CRRESTABILLO
UNIVERSITY OF SANTO TOMAS
INSTITUTE OF INFORMATION AND COMPUTING SCIENCES
Examples
What are the negations of
1.) x(x>x)
2.) x(x=9)
CS201 - CRRESTABILLO
UNIVERSITY OF SANTO TOMAS
INSTITUTE OF INFORMATION AND COMPUTING SCIENCES
NESTED QUANTIFIERS
Two quantifiers are NESTED if one quantifier is
within the scope of the other quantifier.
EXAMPLE
xy((x<0)(y<0))(xy < 0)
Consider that the domain of discourse for both
variables are real numbers.
For all real number x and for all real number y,
if x is less than 0 or y less than 0, then xy is
less than 0.
CS201 - CRRESTABILLO
UNIVERSITY OF SANTO TOMAS
INSTITUTE OF INFORMATION AND COMPUTING SCIENCES
Exercise
Let P(x,y) be the statement student x has
taken y, where domain of x consists of all
students of IICS and y consists of all Math
courses. Express each of these
quantifications in English sentences.
1.) xyP(x,y) 4.) xyP(x,y)
2.) yxP(x,y) 5.) xyP(x,y)
3.) xyP(x,y) 6.) yxP(x,y)
CS201 - CRRESTABILLO
UNIVERSITY OF SANTO TOMAS
INSTITUTE OF INFORMATION AND COMPUTING SCIENCES
CS201 - CRRESTABILLO
UNIVERSITY OF SANTO TOMAS
INSTITUTE OF INFORMATION AND COMPUTING SCIENCES
Exercise
Let P(x, y): 2x + y =5
What are the truth values of
xyP(x, y) yxP(x, y)
xyP(x, y) xyP(x, y)
xyP(x, y) yxP(x, y)
where the domain for all variables consists
of all integers?
CS201 - CRRESTABILLO
UNIVERSITY OF SANTO TOMAS
INSTITUTE OF INFORMATION AND COMPUTING SCIENCES
Exercise
1.)Let P(x, y): x + 1 > y + 1
What are the truth values of
a.)xyP(x, y) c.) xyP(x, y)
b.) xyP(x, y) d.) xyP(x, y)
where the domain for all variables consists of all
integers?
2.) Express the negations of each statements so that
negation symbols immediately precedes predicates.
a.) xy(P(x,y)Q(x,y))
b.) xyP(x,y)xyQ(x,y)
CS201 - CRRESTABILLO
UNIVERSITY OF SANTO TOMAS
INSTITUTE OF INFORMATION AND COMPUTING SCIENCES
PRACTICE
Let Q(x) be the statement x+1>2x. If the
domain consists of the integers, what are
the truth values?
(1)Q(0) (4) xQ(x)
(2)Q(-1) (5) xQ(x)
(3)Q(1) (6) xQ(x)
(7) xQ(x)
CS201 - CRRESTABILLO
UNIVERSITY OF SANTO TOMAS
INSTITUTE OF INFORMATION AND COMPUTING SCIENCES
PRACTICE
Determine the truth value of each of these
statements if the domain for all variables
consists of integers.
1.) nm(n<m)
2.) nm(n+m=0)
3.) nm(n<m)
4.) nm(n+m=5)
CS201 - CRRESTABILLO
UNIVERSITY OF SANTO TOMAS
INSTITUTE OF INFORMATION AND COMPUTING SCIENCES
PRACTICE
Let P(x, y): x+2=3xy
What are the truth values of
xyP(x, y) xyP(x, y)
xyP(x, y) xyP(x, y)
where the domain for all variables consists of
a.) integers
b.) nonzero real numbers
c.) non-negative real numbers
CS201 - CRRESTABILLO