Vous êtes sur la page 1sur 48

Discrete Mathematics

Department of Informatics
Predicate and Quantifier
Predicate

• Statements involving variables, such as


“x > 3,” “x = y + 3,” “x + y = z,”
are often found in mathematical assertions, in computer
programs, and in system specifications
• The statement “x is greater than 3” has two parts. The first
part, the variable x, is the subject of the statement. The second
part—the predicate, “is greater than 3”—refers to a property
that the subject of the statement can have
• We can denote the statement “x is greater than 3” by P(x)
Exercise

15. Let Q(x,y) denote the statement “x is the capital of y.”


What are these truth values?
a. Q(Jakarta, Indonesia)
b. Q(Manila, Cambodia)
c. Q(New York, USA)
d. Q(UK, London)
Quantifiers

• There is another importantway, called quantification, to


create a proposition from a propositional function
• Quantification expresses the extent to which a predicate
is true over a range of elements
• There are 3 kinds of quantifier:
1. Universal Quantifier
2. Existential Quantifier
3. Uniqueness Quantifier
Universal Quantifiers

• Denoted by Ɐ
• Example:
We read “Ɐx P(x)” as “for all x P(x)” or “for every x P(x)”
Existential Quantifiers

• Denoted by ∃
• Example:
We read “∃x P(x)” as “There is an x such that P(x),” or “There
is at least one x such that P(x),” or “For some x P(x).”
Uniqueness Quantifiers

• Denoted by !
• Example:
We read “!x P(x)” as “There exists a unique x such that P(x)
is true.”
Exercise

16. 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. ∃𝑥 𝑃 𝑥
b. ∃𝑥 ≦𝑃(𝑥)
c. ∀𝑥 𝑃(𝑥)
d. ∀𝑥 ≦𝑃(𝑥)
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)).
Exercise

17. Translate each of these statements into logical expressions


using predicates, quantifiers, and logical connectives..
a. No one is perfect.
b.Not everyone is perfect.
c. All your friends are perfect.
d.At least one of your friends is perfect.
e. Everyone is your friend and is perfect.
f. Not everybody is your friend or someone is not perfect.
Binding Variables

• When a quantifier is used on the variable x, we say that


this occurrence of the variable is bound.
• An occurrence of a variable that is not bound by a
quantifier or set equal to a particular value is said to be
free
• The part of a logical expression to which a quantifier is
applied is called the scope of this quantifier
Binding Variables - Example

• Statement ∃x(x + y = 1)
• variable x is bound by the existential quantification ∃x, but the
variable y is free
• Statement ∃x(P(x) ∧ Q(x)) ∨ ∀xR(x)
• all variables are bound
• the scope of the first quantifier, ∃x, is the expression P(x) ∧ Q(x)
• the scope of the second quantifier, ∀x, is the expression R(x)
Exercise

18. Determine the truth value of each of these statements if


the domain of each variable consists of all real numbers.
a. ∃𝑥 𝑥2 = 2
b. ∃𝑥 𝑥 2 = −1
c. ∀𝑥 𝑥2 + 2 ≥ 1
d. ∀𝑥 𝑥2 ≠ 𝑥
Logical Equivalences Involving
Quantifier

• Statements involving predicates and quantifiers are


logically equivalent if and only if they have the same truth
value no matter which predicates are substituted into
these statements and which domain of discourse is used
for the variables in these propositional functions.
• We use the notation S ≡ T to indicate that two statements
S and T involving predicates and quantifiers are logically
equivalent.
Negating Quantified Expressions
“Every student in your class has taken a course in calculus.”
This statement is a universal quantification, namely,
∀xP(x),
The negation of this statement is
¬∀xP(x)  “Not every student in your class has taken a course
in calculus”
Alternately we can express it with:
“There is at least a student in your class who has not taken a
course in calculus”  ∃x ¬P(x)

This example illustrates the following logical equivalence:


¬∀xP(x) ≡ ∃x ¬P(x).
Exercise

19. Find a counterexample, if possible, to these universally


quantified statements, where the domain for all variables
consists of all integers.
a. ∀𝑥 𝑥2 ≥ 𝑥
b. ∀𝑥 𝑥 >0∨𝑥 <0
c. ∀𝑥 𝑥=1
Nested Quantifier

• When one quantifier is within the scope of another, it’s


called Nested Quantifier
• Example:
∀𝑥∃𝑦 𝑥 + 𝑦 = 0
“For all x there is y such that x + y = 0”
Exercise
Let Q(x,y) be the statement “x telah mengirim e-mail kepada y,”
where the domain for both x and y consists of all students in your
class. Express each of these quantifications.
a) ∃𝑥∃𝑦𝑄(𝑥, 𝑦)
b) ∃𝑥∀𝑦𝑄(𝑥, 𝑦)
c) ∀𝑥∃𝑦𝑄(𝑥, 𝑦)
d) ∃𝑦∀𝑥𝑄(𝑥, 𝑦)
e) ∀𝑦∃𝑥𝑄(𝑥, 𝑦)
f) ∀𝑥∀𝑦𝑄(𝑥, 𝑦)
Excercise
S(x) : “x is a student,”
F(x) : “x is a faculty member,”
A(x,y) : “x has asked y a question,”
where the domain consists of all people associated with your
school. Use quantifiers to express each of these statements.
a) Lois has asked Professor Michaels a question.
b)Every student has asked Professor Gross a question.
c) Every faculty member has either asked Professor Miller a
question or been asked a question by Professor Miller.
d)Some student has not asked any faculty member a question.
e)There is a faculty member who has never been asked a
question by a student.
f) Some student has asked every faculty member a
question.
g)There is a faculty member who has asked every other
faculty member a question.
h)Some student has never been asked a question by a
faculty member.
Quantifications of Two Variables

Statement When True? When False?


∀𝑥∀𝑦𝑃 𝑥, 𝑦 𝑃(𝑥, 𝑦) is true for every There is a pair 𝑥, 𝑦 for
∀𝑦∀𝑥𝑃(𝑥, 𝑦) pair 𝑥, 𝑦 which 𝑃(𝑥, 𝑦) is false
∀𝑥∃𝑦𝑃(𝑥, 𝑦) For every 𝑥 there is a 𝑦 There is an 𝑥 such that
for which 𝑃(𝑥, 𝑦) is true 𝑃(𝑥, 𝑦) is false for every
𝑦
∃𝑥∀𝑦𝑃(𝑥, 𝑦) There is an 𝑥 for which For every 𝑥 there is a 𝑦
𝑃 𝑥, 𝑦 is true for every 𝑦 for which 𝑃(𝑥, 𝑦) is false
∃𝑥∃𝑦𝑃 𝑥, 𝑦 There is a pair 𝑥, 𝑦 for 𝑃(𝑥, 𝑦) is false for every
∃𝑦∃𝑥𝑃(𝑥, 𝑦) which 𝑃(𝑥, 𝑦) is true pair 𝑥, 𝑦
Valid Arguments

• Given the example propositions


“If you have a current password, then you can log onto the
network.”
“You have a current password.”
Therefore,
“You can log onto the network.”
Valid Arguments

“You have a current password.” is represented by p


“You can log onto the network.” is represented by q
Then, the argument has this form:
𝑝→𝑞 Premise 1
𝑝 Premise 2
∴𝑞
Conclusion
where ∴ is the symbol that denotes “therefore.”
Can also be denoted as 𝑝 → 𝑞 ∧ 𝑝 → 𝑞, which is a tautology
Rules of Inference
Rules of Inference (2)
Example 1

• State which rule of inference is the basis of the following


argument: “It is below freezing now. Therefore, it is either
below freezing or raining now.”
• Solution: Let p be the proposition “It is below freezing now”
and q the proposition “It is raining now.” Then this argument is
of the form
p
∴p∨q
This is an argument that uses the addition rule.
Example 2

• State which rule of inference is the basis of the following


argument: “It is below freezing and raining now. Therefore, it is
below freezing now.”
• Solution: Let p be the proposition “It is below freezing now,”
and let q be the proposition “It is raining now.” This argument
is of the form
p∧q
∴p
This argument uses the simplification rule.
Example 3

• Show that the premises “It is not sunny this afternoon


and it is colder than yesterday,” “We will go swimming
only if it is sunny,” “If we do not go swimming, then we
will take a canoe trip,” and “If we take a canoe trip, then
we will be home by sunset” lead to the conclusion “We
will be home by sunset.”
Example 3 (solution)

• Solution: Let p be the proposition “It is sunny this afternoon,” q


the proposition “It is colder than yesterday,” r the proposition
“We will go swimming,” s the proposition “We will take a canoe
trip,” and t the proposition “We will be home by sunset.” Then
the premises become ¬p ∧ q, r → p,¬r → s, and s → t . The
conclusion is simply t . We need to give a valid argument with
premises ¬p ∧ q, r → p, ¬r → s, and s → t and conclusion t .
• We construct an argument to show that our premises lead to
the desired conclusion as follows.
Exercises
What rule of inference is used in each of these arguments?
a) Alice is a mathematics major. Therefore, Alice is either a
mathematics major or a computer science major.
b)Jerry is a mathematics major and a computer science major.
Therefore, Jerry is a mathematics major.
c) If it is rainy, then the pool will be closed. It is rainy. Therefore,
the pool is closed.
d)If it snows today, the university will close. The university is not
closed today. Therefore, it did not snow today.
e) If I go swimming, then I will stay in the sun too long. If I stay in
the sun too long, then I will sunburn. Therefore, if I go
swimming, then I will sunburn.
Fallacies

• Fallacy of confirming the conclusion


If the day is sunny, then I will go out.
I will go out
The day is sunny
• Fallacy of denying the hypothesis
If tomorrow is Saturday, then I will go home.
Tomorrow is Thursday.
I won’t go home
Rules of Inference for Quantified
Statements
• Universal instantiation
∀xP(x)
∴ P(c)
• Universal generalization
P(c) for an arbitrary c
∴ ∀xP(x)
• Existential instantiation
∃xP(x)
∴ P(c) for some element c
• Existential generalization
P(c) for some element c
∴ ∃xP(x)
Universal Instantiation

• is the rule of inference used to conclude that 𝑃(𝑐) is true,


where 𝑐 is a particular member of the domain, given the
premise ∀𝑥𝑃(𝑥)
• Universal instantiation is used when we conclude from
the statement “All women are wise” that “Lisa is wise,”
where Lisa is a member of the domain of all women
Unversal Generalization

• Is the rule of inference that states that ∀𝑥𝑃(𝑥) is true,


given the premise that 𝑃(𝑐) is true for all elements 𝑐 in
the domain
• Universal generalization is used when we show that
∀𝑥𝑃(𝑥) is true by taking an arbitrary element 𝑐 from the
domain and showing that 𝑃(𝑐) is true
• The element c that we select must be an arbitrary, and
not a specific, element of the domain
Existential Instatiation

• is the rule that allows us to conclude that there is an


element c in the domain for which 𝑃(𝑐) is true if we know
that ∃𝑥𝑃(𝑥) is true
• We cannot select an arbitrary value of c here, but rather it
must be a c for which 𝑃(𝑐) is true
• Usually we have no knowledge of what c is, only that it
exists. Because it exists, we may give it a name (c) and
continue our argument.
Existential Generalization

• is the rule of inference that is used to conclude that


∃𝑥𝑃(𝑥) is true when a particular element 𝑐 with 𝑃(𝑐) true
is known
• That is, if we know one element 𝑐 in the domain for which
𝑃(𝑐) is true, then we know that ∃𝑥𝑃(𝑥) is true
Exercises

Reorder the following premises and draw a valid conclusion from


them
1. When I work a logic example without grumbling, you may be
sure it is one I understand.
2. The arguments in these examples are not arranged in regular
order like the ones I am used to.
3. No easy examples make my head ache.
4. I can’t understand examples if the arguments are not arranged
in regular order like the ones I am used to.
5. I never grumble at an example unless it gives me a headache.
Proofs

• A proof is a valid argument that establishes the truth of a


mathematical statement.
• To prove a theorem of the form ∀x(P(x) → Q(x)), our goal
is to show that P(c) → Q(c) is true, where c is an arbitrary
element of the domain, and then apply universal
generalization.
• Note that to prove the statement p → q, we need only
show that q is true if p is true.
Direct Proof

• A direct proof of a conditional statement p → q is


constructed with three steps:
1. The assumption that p is true
2. Subsequent steps are constructed using rules of inference.
3. Showing that q must also be true
Example

Give a direct proof that if m and n are both perfect squares, then
nm is also a perfect square.
(An integer a is a perfect square if there is an integer b such that
a = b2.)

Solution:
• By the definition of a perfect square, it follows that there are
integers s and t such that 𝑚 = 𝑠 and 𝑛 = 𝑡 2
2

• 𝑚𝑛 = 𝑠 2 𝑡 2 = 𝑠𝑠 𝑡𝑡 = 𝑠𝑡 𝑠𝑡 = (𝑠𝑡)2
• By the definition of perfect square, it follows that mn is alsoa
perfect square, because it is the square of st, which is an
integer
Proof by Contraposition

• Indirect proofs technique


• Make use of the fact that the conditional statement p → q
is equivalent to its contrapositive, ¬q →¬p
• Conditional statement p → q can be proved by showing
that its contrapositive, ¬q →¬p, is true
Example

• Prove that if n = ab, where a and b are positive integers, then 𝑎 ≤ 𝑛 or


𝑏 ≤ 𝑛.
Solution:
• Assume that the statement 𝑎 ≤ 𝑛 ∨ 𝑏 ≤ 𝑛 is false
• With De Morgan’s law, this implies that 𝑎 > 𝑛 and b > 𝑛
• using the fact that if 0 < 𝑠 < 𝑡 and 0 < 𝑢 < 𝑣, then su < tv,
• We obtain 𝑎𝑏 > 𝑛 ⋅ 𝑛, this shows that 𝑎𝑏 ≠ 𝑛
• Because the negation of the conclusion of the conditional statement
implies that the hypothesis is false, the original conditional statement is
true
Proof by Contradiction

• Indirect proofs technique


• Because the statement r ∧¬r is a contradiction whenever
r is a proposition, we can prove that p is true if we can
show that ¬p → (r ∧¬r) is true for some proposition r
Example
• Give a proof by contradiction of the theorem “If 3𝑛 + 2 is odd,
then n is odd.”
Solution:
• Let p be “3𝑛 + 2 is odd” and q be “n is odd.”
• Assume that both p and ¬q (n is not odd) are true
• Because n is even, there is an integer k such that n = 2k
• This implies that 3𝑛 + 2 = 3 2𝑘 + 2 = 6𝑘 + 2 = 2 3𝑘 + 1
• Because 3𝑛 + 2 is 2𝑡 , where 𝑡 = 3𝑘 + 1, so 3𝑛 + 2 is even
• statement “3𝑛 + 2 is even” is equivalent to the statement
¬p, because an integer is even if and only if it is not odd
• Because both p and ¬p are true, we have a contradiction
• This completes the proof by contradiction, proving that if 3n +
2 is odd, then n is odd
THANK
YOU

Vous aimerez peut-être aussi