Lesson 3 Predicate Logic and Quantifiers
Lesson 3 Predicate Logic and Quantifiers
PA R A Ñ A Q U E C I T Y C A M P U S
PREDICATE LOGIC
Examples of predicates:
WHAT IS A PREDICATE?
1. The computer x contains a Trojan
A predicate is an expression of one or virus.
more variables determined on some 2. 5x > 20
specific domain. A predicate with 3. x + y = z
variables can be made a proposition by 4. x is married to y.
either authorizing a value to the variable 5. A Filipino x who is 18 years or
or by quantifying the variable. older, is eligible to vote.
2. Let A(c, n) denote the statement “Cellphone c is connected to network n,” where c is a
variable representing a computer and n is a variable representing a network.
QUANTIFIERS
In predicate logic, predicates are used
alongside quantifiers to express the extent Two types of Quantification:
to which a predicate is true over a range of
elements. Using quantifiers to create such 1. Universal Quantification
propositions is called quantification. 2. Existential Quantification
UNIVERSAL QUANTIFIERS
The universal quantification of P(x) is the statement
“P(x) for all values of x in the domain.”
The notation ∀xP(x) denotes the universal quantification of P(x). Here ∀ is called the universal
quantifier. We read ∀xP(x) as “for all xP(x)” or “for every xP(x).” An element for which P(x) is false is
called a counterexample to ∀xP(x).
EXAMPLE 1: Let P(x) be the statement “x + 1 > x.” What is the truth value of the quantification ∀xP(x),
where the domain consists of all real numbers?
EXAMPLE 2: Let Q(x) be the statement “x < 2.” What is the truth value of the quantification ∀xQ(x),
where the domain consists of all real numbers?
EXISTENTIAL QUANTIFIERS
The existential quantification of P(x) is the proposition.
We use the notation ∃xP(x) for the existential quantification of P(x). Here ∃ is called the
existential quantifier.
EXAMPLE 1: Let Q(x) denote the statement “x = x + 1.” What is the truth value of the quantification
∃xQ(x), where the domain consists of all real numbers?
EXAMPLE 2: Let P(x) denote the statement “x > 3.” What is the truth value of the quantification
∃xP(x), where the domain consists of all real numbers?
2. For every real number n, there will be a real number r such that
This statement is a universal quantification, namely, ∀xP(x), where P(x) is the statement “x has taken a
course in MMW” 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 MMW.” This is equivalent to
“There is a student in your class who has not taken a course in MMW.” And this is simply the
existential quantification of the negation of the original propositional function, namely, ∃x ¬P(x).
Solution: Let S(m,y) be “Mail message m is larger than y megabytes,” where the variable x has
Extra Examples the domain of all mail messages and the variable y is a positive real number, and let
C(m) denote “Mail message m will be compressed.” Then the specification “Every mail message
larger than one megabyte will be compressed” can be represented as ∀m(S(m, 1) → C(m)).
Let A(u) represent “User u is active,” where the variable u has the domain of all users, let
S(n,x) denote “Network link n is in state x,” where n has the domain of all network links and x has
the domain of all possible states for a network link. Then the specification “If a user is active, at least
one network link will be available” can be represented by ∃uA(u) → ∃n S(n, available)
Consider these statements. The first two are called premises and the third
is called the conclusion. The entire set is called an argument.
Let P(x), Q(x), and R(x) be the statements “x is a lion,” “x is fierce,” and
“x drinks coffee,” respectively. Assuming that the domain consists of all
creatures, express the statements in the argument using quantifiers and
P(x), Q(x), and R(x).
NESTED QUANTIFIERS
Nested quantifiers are quantifiers that
occur within the scope of other
quantifiers.
Example: ∀x∃yP(x, y)
Suppose: P(x, y) : x + y = 7, where the universe of discourse for each variable is the real
numbers. The following propositions are possible:
1. ∀x ∃y P(x, y) 2. ∃y ∀x P(x, y)
3. ∀y ∃x P(x, y) 4. ∃x ∀y P(x, y)
5. ∀y ∀x P(x, y) 6. ∀x ∀y P(x, y)
7. ∃y ∃x P(x, y) 8. ∃x ∃y P(x, y)