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

PREDICATE & QUANTIFIERS

Lecture 2
Predicates
• A predicate or propositional function is a sentence that contains one
or more variables and becomes a statement when specific values are
substituted for the variables.
• For example:
– “x+2 = 7”,
– “X is American”,
– “x < y”,
– “p is a prime number”
• The truth value of the predicate depends on the value assigned to its
variables.
• For instance if we replace x with 1 in the predicate “x+2 = 7” we
obtain “1+2 = 7”, which is false, but if we replace it with 5 we get “5
+ 2 = 7”, which is true.
• We represent a predicate by a letter followed by the variables
enclosed between parentheses: P(x), Q(x, y), etc.
Predicates
• Each variable in a predicate is assumed to belong to
a universe (or domain) of discourse,
• The domain D of a predicate variable consists of all
values that may be substituted in place of the
variable
• For instance in the predicate
– P(n): n is an odd integer – ‘n’ represents an integer, so the
universe of discourse of n is the set of all integers.
– P(x): x is American - we may assume that x is a human
being, so in this case the universe of discourse is the set
of all human beings.
Quantifiers
• Quantifiers are words that refer to quantities
such as “all”, “every”, or “some” and tell for
how many elements a given predicate is true.
• Basically there are two quantifiers:
1. Universal quantifier
2. Existential quantifier
Universal quantifier
••The  Universal quantifier is denoted by the symbol
•Let P(x) be a predicate and D the domain of x.
• A universal statement is a statement of the form “∀x ∈ D, P(x) ” is defined to
be true if, and only if, P(x) is true for every x in D.
• It is defined to be false if, and only if, P(x) is false for at least one x in D.
• The sentence “for all x, P(x)”—also “for any x, P(x)”, “for every x, P(x)”,
“for each x, P(x)”—, represented as xP(x), has a definite truth value.
• An element for which P(x)is false is called a counterexample of ∀x, P(x).
• Example: if P(x) is “x + 2 = 7” and the universe of discourse is the integers,
then xP(x) is false.
Existential Quantifier
•• The
  existential quantifier is denoted by the symbol ) -
“there exists”.
• Given a predicate P(x) and D the domain of x, the
statements: “for some x, P(x)” or “there is some x such
that P(x)”, represented “x∈ D , P(x)”, is defined to be true
if, and only if, P(x) is true for at least one x in D.
• It is defined to be false if, and only if, P(x) is false for all x
in D.
• Example: if P(x) is “x + 2 = 7” with the integers as
universe of discourse, then x, P(x) is true, since there is
indeed an integer, namely 5, such that P(5) is a true
statement.
Precedence of Quantifiers

• The quantifiers ∀ and ∃ have higher


precedence than all logical operators from
propositional calculus.
• 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))
Negation of Universal Statements
• Let P(x) be a predicate and D the domain of x.
• The negation of a universal statement of the
form:
• ∀x ∈ D, P(x) is logically equivalent to ∃x ∈ D,
~P(x)
• Symbolically:
Example
• Write the following statement using quantifiers. Find its negation and
determine whether the statement or its negation is true, giving a brief reason.
“Every real number is either positive or negative.”

• The true statement is the negation because x= 0 is neither positive


nor negative.
Negation of Existential Quantifiers
• Let P(x) be a predicate and D the domain of x.
• The negation of an existential statement of the
form:
∃x ∈ D, P(x) is logically equivalent to ∀x ∈ D, ~P(x)
• Symbolically:
Example
Example
• Write the following statement using quantifiers. Find its
negation
“Some dogs are vegetarians.”
• Let D be the set of dogs
Practice
• Let P(x)be the statement “x spends more than
five hours every weekday in class,” where the
domain for x consists of all students. Express
each of these quantifications in English.
a) ∃xP (x) b)∀xP (x)
c) ∃x¬P(x) d)∀x¬P(x)
Solution
a. There is a student who spends more than 5
hours every weekday in class.
b. Every student spends more than 5 hours
every weekday in class.
c. There is a student who does not spend more
than 5 hours every weekday in class.
d. No student spends more than 5 hours every
weekday in class.
Multiple Quantifiers
• When a statement contains multiple quantifiers their
order must be applied as written and will produce
different results for the truth set.
• Write the following statements using quantifiers:
“Everybody loves somebody.”
• Let H be the set of people.
– Statement: ∀x ∈ H, ∃y ∈ H, x loves y.
“Somebody loves everyone.”
• Let H be the set of people.
– Statement: ∃x ∈ H, ∀y ∈ H, x loves y.
Example
• Use predicates and quantifiers to express the system
specifications
“If a user is active, at least one network link will be available.”
Solution
• 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)→∃nS(n, available)
Practice
• Consider these statements, of which the first three are
premises and the fourth is a valid conclusion.
“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.”
• Let P(x),Q(x),R(x), and S(x)be the statements “x is a
hummingbird,” “x is large,” “x lives on honey,” and “x is
richly colored,” respectively. Assuming that the domain
consists of all birds, express the statements in the
argument using quantifiers and P(x),Q(x),R(x), and S(x).
Solution
• We can express the statements in the
argument as
∀x(P(x)→S(x)).
¬∃x(Q(x)∧R(x)).
∀x(¬R(x)→¬S(x)).
∀x(P(x)→¬Q(x)).
More Practice
1. 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.
a) ∀x(C(x)→F(x)) b)∀x(C(x)∧F(x))
c) ∃x(C(x)→F(x)) d)∃x(C(x)∧F(x))
2. Let P(x)be the statement “x can speak Russian” and let Q(x)be the statement
“x knows the computer language C++.” Express each of these sentences in
terms of P(x), Q(x), quantifiers, and logical connectives. The domain for
quantifiers consists of all students at your school.
a. There is a student at your school who can speak Russian and who knows C++.
b. There is a student at your school who can speak Russian but who doesn’t
know C++.
c. Every student at your school either can speak Russian or knows C++.
d. No student at your school can speak Russian or knows C++.
Solutions
1. a) Every comedian is funny.
b) Every person is a funny comedian.
c) There exists a person such that if she or he is a
comedian, then she or he is funny.
d) Some comedians are funny.
2. a) ∃x(P(x)∧Q(x))
b) ∃x(P(x)∧¬Q(x))
c) ∀x(P(x)∨Q(x))
d) ∀x¬(P (x)∨Q(x))
Nested Quantifiers
Predicates & Quantifiers
• In
  predicates with more than one variable it is possible
to use several quantifiers at the same time, for
instance , meaning “for all x and all y there is some z
such that P(x, y, z)”.
• The existential and universal quantifiers cannot be
swapped, i.e., in general means something different
from.
• For instance if x and y represent human beings and P(x,
y) represents “x is a friend of y”, then
– means that “everybody is a friend of someone”, but
– means that “there is someone such that everybody is his or
her friend”.
Example
• Let Q(x, y)be the statement “x has sent an e-mail message to y,” where the
domain for both x and y consists of all students in your class. Express each of
these quantifications in English.
a) ∃x∃yQ(x, y) -There is some student in your class who has sent a message to
some student in your class.
b) ∃x∀yQ(x, y) - There is some student in your class who has sent a message to
every student in your class.
c) ∀x∃yQ(x, y) - Every student in your class has sent a message to at least one
student in your class.
d) ∃y∀xQ(x, y) - There is a student in your class who has been sent a message
by every student in your class.
e) ∀y∃xQ(x, y) - Every student in your class has been sent a message from at
least one student in your class.
f) ∀x∀yQ(x, y)- Every student in the class has sent a message to every student
in the class.
Translating from Nested Quantifiers into
English
• Expressions with nested quantifiers expressing
statements in English can be quite
complicated.
• The first step in translating such an expression
is to write out what the quantifiers and
predicates in the expression mean.
• The next step is to express this meaning in a
simpler sentence.
Example
Translate the statement
∀x(C(x) ∨ ∃y(C(y) ∧ F(x, y)))
into English, where C(x)is “x has a computer,” F(x, y)is
“x and y are friends,” and the domain for both x and y
consists of all students in your school.
Solution:
The statement says that “for every student x in your
school, x has a computer or there is a student y such
that y has a computer and x and y are friends.
In other words, “every student in your school has a
computer or has a friend who has a computer”.
Translating English Sentences into Logical
Expressions
Example:
• Express the statement
“If a person is female and is a parent, then
this person is someone’s mother”
as a logical expression involving predicates,
quantifiers with a domain consisting of all
people, and logical connectives.
Solution:
• The statement
“If a person is female and is a parent, then this person is someone’s
mother”
can be expressed as
“For every person x, if person x is female and person x is a parent, then
there exists a person y such that person x is the mother of person y.”
• We introduce the propositional functions
F(x)to represent “x is female,”
P(x)to represent “x is a parent,” and
M(x, y)to represent “x is the mother of y.”
• The original statement can be represented as
∀x((F (x)∧P(x))→∃yM(x, y)).
• This can be further simplified to:
∀x∃y((F (x)∧P(x))→M(x, y)).

You might also like