0% found this document useful (0 votes)
23 views23 pages

Rys DSGT Lect4

Uploaded by

SAURABH DEULKAR
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views23 pages

Rys DSGT Lect4

Uploaded by

SAURABH DEULKAR
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 23

Predicates and Quantifiers

Puzzle
Real use
• An important type of programming language is designed to reason
using the rules of predicate logic. Prolog (from Programming in
Logic), developed in the 1970s by computer scientists working in
the area of artificial intelligence, is an example of such a
language. Prolog programs include a set of declarations consisting
of two types of statements, Prolog facts and Prolog rules.
• Prolog facts define predicates by specifying the elements that
satisfy these predicates.
• Prolog rules are used to define new predicates using those already
defined by Prolog facts.
Quantifiers as Conjunctions/Disjunctions

• If the domain is finite then universal/existential


quantifiers can be expressed by conjunctions/
disjunctions.
• If U consists of the integers 1,2, and 3, then

• Even if the domains are infinite, you can still think of


the quantifiers in this fashion, but the equivalent
expressions without quantifiers will be infinitely long.
Negation for Quantifiers
• The rules for negating quantifiers are:
• We can say, De Morgan’s Law for Quantifiers
Negating Quantifiers
• Consider the quantified statement:
– “Every student has at least one course where the
lecturer is a teaching assistant.”
– Its negation is the statement:
– “There is a student such that in every course the
lecturer is not a teaching assistant.”
Negate each of the following statements

(a) All students live in the dormitories.


(b) All mathematics majors are males.
(c) Some students are 25 years old or older.
solution
(a) At least one student does not live in the dormitories.
(Some students do not live in the dormitories.)
(b) At least one mathematics major is female. (Some
mathematics majors are female.)
(c) None of the students is 25 years old or older. (All the
students are under 25.)
Negate each of the following statements:

(a) ∃x ∀y, p(x, y);


(b) ∃x ∀y, p(x, y);
(c) ∃y ∃x ∀z, p(x, y, z).
Use ¬∀ x p(x) ≡ ∃x ¬ p(x) and ¬∃ x p(x) ≡ ∀x ¬
p(x);
Solution
(a) ¬ (∃x∀y, p(x, y)) ≡ ∀x∃y ¬ p(x, y)
(b) ¬ (∀x∀y, p(x, y)) ≡ ∃x∃y ¬ p(x, y)
(c) ¬ (∃y ∃x ∀z, p(x, y, z)) ≡ ∀y ∀x ∃z ¬ p(x, y, z)
Express the statement “Every student in this class has
studied calculus” using predicates and quantifiers.
– rewrite the statement
– “For every student in this class, that student has studied calculus.”
– “For every student x in this class, x has studied calculus.”
C(x): “x has studied calculus.”
– domain for x consists of the students in the class
– we can translate our statement as ∀xC(x)
– If we change the domain to consist of all people
– “For every person x, if person x is a student in this class then x has
studied calculus.”
S(x): person x is in this class
∀x(S(x) → C(x)).
– Our statement cannot be expressed as ∀x(S(x) ∧ C(x)) because this
statement says that all people are students in this class and have
studied calculus!
– As this property, P⟶ Q ≡ ~ P ˅ Q
• Express the statements “Some student in this class has visited
Mexico” and “Every student in this class has visited either
Canada or Mexico” using predicates and quantifiers
– “There is a student in this class with the property that the
student has visited Mexico.”
– “There is a student x in this class having the property that x
has visited Mexico.”
– M(x): x has visited Mexico
• domain for x consists of the students in this class, then
∃xM(x).
– Domain: all people.
– “There is a person x having the properties that x is a
student in this class and x has visited Mexico.”
– S(x):“x is a student in this class.”
– Now, ∃x(S(x) ∧ M(x))
Means: there is a person x who is a student in this class and
who has visited Mexico.
– Our statement cannot be expressed as ∃x(S(x) → M(x)),
which is true when there is someone not in the class
because, in that case, for such a person x, S(x) → M(x)
becomes either F→T or F→F, both of which are true.
– Statement becomes,
– “For every x in this class, x has the property that x has
visited Mexico or x has visited Canada.”
Example to transfer from English to Logical
• Consider these statements. The first two are premises and the third is
the conclusion.
– “All lions are fierce.”
– “Some lions do not drink coffee.”
– “Some fierce creatures do not drink coffee.”
• Solution
– Let P(x),Q(x) and R(x) be the statements “x is a lion”, “x is fierce” and
“x drinks coffee.” respectively. Let the domain consists of all creatures.
Now the statements are:
– ∀ x (P(x)→ Q(x)).
– ∃x (P(x)∧¬R(x)).
– ∃x (Q(x) ∧¬R(x)).
• Not okay:
– ∃x (P(x) →¬R(x)) here ,if creature is not lion then also they drink coffee.
– ∃x (Q(x) →¬R(x))
• Not exact -- both are true even if P(x) and Q(x) both are not true!
• Consider these statements. 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.”
• Solution
– Let P(x): “x is a hummingbird” ,
– Q(x): “x is large”,
– R(x): “x lives on honey”,
– S(x) : “x is richly colored.”
– Let the domain consists of all birds. So the statements are:
– ∀x (P(x)→S(x)).
– ¬∃x (Q(x)∧R(x)).
– ∀x (¬R(x) →¬S(x)).
– ∀x (P(x) →¬Q(x)).
Propositions for More than one variable
Let B ={1, 2, 3, . . . , 9}and let p(x, y) denote “x +y =10”
Then p(x, y) is a propositional function.
– The following is a statement since there is a quantifier for
each variable:
• ∀x∃y,p(x, y), that is, “For every x, there exists a y such that x + y =
10”
• This statement is true. For example, if x = 1, let y = 9; if x = 2, let y =
8, and so on.
– The following is also a statement:
• ∃y∀x,p(x, y), that is, “There exists a y such that, for every x, we have
x + y = 10”
• No such y exists; hence this statement is false.
– Note: Change of order for different quantifiers can change the
meaning.
Quantifications of Two Variables
Statement
Examples
• Determine the truth value of each of the following
statements where U = {1, 2, 3} is the universal set:
(a) ∃x∀ y, x2 < y + 1;
(b) ∀ x∃ y, x2 + y2 < 12;
Solution
(c) True. For if x = 1, then 1, 2, and 3 are all solutions
to 1 < y + 1.
(d) True. For each x0, let y = 1; it is a true statement.
If we change order meaning can get
changed.
• Examples:
• ∀x∃y [x is married to y] is true,
however, ∃y ∀x[x married to y] asserts that there is some
person in the universe who married to everyone, this is false .
• ∀x ∃y [x+y=0] (for all x, there exists a y such that x+y=0 is true,
since for any value of s there is a value of y (i.e, -x) which makes
it true.
However,
• ∃y ∀x [x+y=0] (There exists a y such that for all x, x+y=0) asserts
that value of y can be chosen independently of the value of x,
since no y exists which yields zero when added to arbitrary
integer x , this is false.
Examples in Mathematics Nested
Quantifiers
• Translate the logical statement into Logical.
1. The sum of two integers is always positive.
– To solve this, Read “For every two integers, if these
integers are both positive, then the sum of these integers is
positive”.

or
2. “Every real number expect zero has a multiplicative
inverse” (A multiplicative index of a real number x
is a real number y such that xy=1.)
Solution:
We can rewrite as, “For every real number x expect 0, x has a
multiplicative inverse.”
“For every real number x, if x ≠ 0”, then there exists a real
number y such that xy=1”
Valid, Satisfiable and unsatisfiable
• If P(x1,x2,… xn) is true for all values C1,C2,… Cn from
the universe U, then P(x1,x2,… xn) is valid in U.
• If P(x1,x2,… xn) is true for some values of C1,C2,… Cn
from the universe U, then P(x1,x2,… xn) is
Satisfiable in U.
• If P(x1,x2,… xn) is not true for any values of C1,C2,…
Cn from the universe U, then P(x1,x2,… xn) is
Unsatisfiable in U.
Nested Quantifiers

Complex meanings require nested quantifiers.


“Every real number has an inverse w.r.t. addition.”
Let the domain U be the real numbers. Then the property is
expressed by

“Every real number except zero has a multiplicative


inverse.”
Let the domain U be the real numbers. Then the property is
expressed by
Examples on Negation
Negate the following :
“There does not exist a woman who has taken a flight
on every airline in the world ”
Solution:
“There is a woman who has taken a flight on every airline
in the world ” we can express,

Where, P(w, ) is “w has taken ” is “ is a flight on a”.


By applying Demorgon’s law for quantifiers we can move
negation inside successive quantifiers and by applying this in
last step we will get the equation equivalent this.

You might also like