Professional Documents
Culture Documents
Structures/Mathematics
Dr. Qaiser Abbas
Faculty of Computer and Information Systems
Islamic University of Madinah, SA
qabbas@iu.edu.sa
1
CO2: Translate the Predicates and Quantifiers in some different
examples to English sentences or vice versa.
2
1.4 Predicates and Quantifiers
• Propositional logic: cannot adequately
express the meaning of all statements in
mathematics and in natural language.
3
Predicates
• Statements involving variables i.e., “x is greater than 3” has two
parts.
– Variable: x is the subject of the statement
– Predicate: “is greater than 3”, (refers to a property the subject
has).
• Represent “x is greater than 3” by P (x), where P denotes the
predicate “is greater than 3” and x is the variable.
• We can also have statements that involve more than one variabl,
e.g., “x = y + 3.” We can denote this statement by Q(x, y), where x
and y are variables and Q is the predicate.
4
Predicates
• Example
– Let A(c, n) denote the statement “Computer c is connected to network
n,” where c is a variable representing a computer and n is a variable
representing a network. Suppose that the computer MATH1 is connected
to network CAMPUS2, but not to network CAMPUS1. What are the values
of A(MATH1, CAMPUS1) and A(MATH1, CAMPUS2)?
• Solution:
– A(MATH1, CAMPUS1) = F
– A(MATH1, CAMPUS2) = T.
6
THE UNIVERSAL QUANTIFIER: ∀
• DEFINITION 1
– The universal quantification of P (x) is the
statement “P (x) is true for all values of x in the
domain”
– The notation ∀xP(x) denotes the universal
quantification of P(x) and read as “for all x P(x)” or
“for every x P(x).”
7
THE UNIVERSAL QUANTIFIER: ∀
• EXAMPLE
– 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?
– Solution: Because P (x) is true for all real numbers x, the
quantification ∀xP(x) is true.
• if the domain is empty, then ∀xP(x) is true for any propositional
function P (x) because there are no elements x in the domain for
which P (x) is false.
• Can be expressed in many other ways, including “all of,” “for each,”
“given any,” “for arbitrary,” “for any”, “for all” and “for every”.
• Avoid using “for any x” because it is often ambiguous as to
whether “any” means “every” or “some.”
8
THE UNIVERSAL QUANTIFIER: ∀
• EXAMPLE
– What is the truth value of ∀xP (x), where P (x) is the
statement “x2 < 10” and the domain consists of the
positive integers not exceeding 4?
– Solution:
– Domain=1,2,3,4
– ∀xP (x) = P(1) ∧ P(2) ∧ P(3) ∧ P(4)
– for P (4), the statement “42 < 10” is false, it follows that
∀xP (x) is false.
• Section 1.4: Example 9, 10, 12 (Read it by yourself)
9
THE UNIVERSAL QUANTIFIER: ∀
• EXAMPLE (Read it by yourself)
– What is the truth value of ∀x(x2 ≥ x) if the domain consists
of all real numbers? What is the truth value of this
statement if the domain consists of all integers?
• Solution:
– If Domain = All real numbers
– For x = 0.5, the statement P(x) = (0.5)2 ≥ 0.5 is false.
– hence P(x) is false for real numbers.
– If Domain = All integers = 0,1,2,3,4,………..
– The statement P(x) = ∀x(x2 ≥ x) is true for all integers as we have not
found any false evidence.
10
THE EXISTENTIAL QUANTIFIER: ∃
• DEFINITION
– The existential quantification of P (x) is the proposition
“There exists at least one element x in the domain
such that P (x) is true for that.”
– We use the notation ∃xP(x) for the existential
quantification of P(x).
• Other ways include “there exists”, “for some,” “for
at least one,” or “there is.”
• ∃xP (x) is read as “There is an x such that P(x)”
“There is at least one x such that P(x),” or
“For some x P(x).”
11
THE EXISTENTIAL QUANTIFIER: ∃
• EXAMPLE
– 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?
• Solution:
– As P(x) = “x > 3”, when x = 4, then ∃xP (x) will become true.
13
Precedence of Quantifiers
• The quantifiers ∀ and ∃ have higher precedence than
all logical operators from propositional calculus.
• For example, ∀xP (x) ∨ Q(x) means (∀xP (x)) ∨ Q(x)
rather than ∀x (P (x) ∨ Q(x)).
14
Binding of Quantifier’s Variable
• Bound Variable: When a quantifier is used on
the variable x, this occurrence of the variable
is bound.
• Free Variable: An occurrence of a variable that
is not bound by a quantifier or not set to a
particular value is said to be free.
• Scope of Quantifier: The part of a logical
expression to which a quantifier is applied is
called the scope of this quantifier.
15
Binding of Quantifier’s Variable
• EXAMPLE I
– In the statement ∃x(x + y = 1),
– The variable x is bound by the existential quantification
∃.
– The variable y is free because it is not bound by a
quantifier and no value is assigned to this variable.
• Example II: (Read it Yourself)
– In the statement ∃x(P (x) ∧ Q(x)) ∨ ∀xR(x),
– Binding of ∃x = P (x) ∧ Q(x) and binding of ∀x = R(x). So,
All variables are bound to quantifiers.
– Similarly, the scope of ∃ quantifier = P (x) ∧ Q(x) and the
scope of ∀ quantifier = R(x).
16
Logical Equivalences Involving Quantifiers
• DEFINITION
– Statements involving predicates and quantifiers
are logically equivalent if and only if they have the
same truth value.
– We use the notation S ≡ T to indicate that two
statements S and T involving predicates and
quantifiers are logically equivalent.
17
Logical Equivalences Involving Quantifiers
• EXAMPLE
– Show that ∀x (P (x ) ∧ Q(x )) and ∀x P (x ) ∧ ∀x Q(x ) are logically equivalent
where the same domain is used throughout.
– Solution:
– First, suppose that ∀x(P (x) ∧ Q(x)) is true. This means that if ‘a’ is in the
domain, then P (a) is true and Q(a) is true. we can conclude that ∀xP (x) and
∀xQ(x) are both true, and their conjunction ∀xP (x) ∧ ∀xQ(x) is also true.
– Second, suppose that ∀xP (x) ∧ ∀xQ(x) is true. It follows that ∀xP (x) is true
and ∀xQ(x) is true. Hence, if a is in the domain, then P (a) is true and Q(a) is
true. It follows that for all a, P (a) ∧ Q(a) is true. It follows that ∀x(P (x) ∧ Q(x))
is true.
– We can now conclude that ∀x(P (x) ∧ Q(x)) ≡ ∀xP (x) ∧ ∀xQ(x).
18
Negating Quantified Expressions
• Understanding with example: Consider the negation of the statement
“Every student in your class has taken a course in calculus.”
– P(x) = “x has taken a course in calculus”
– Domain = students in your class.
– Negation = “It is not the case that every student in your class has
taken a course in calculus.”
– Representation = ¬∀xP (x).
– Logical Equivalent = “There is a student in your class who has not
taken a course in calculus.”
– Representation = ∃x¬P(x).
19
Negating Quantified Expressions
• Section 1.4: Example 20 (Read it by yourself)
• EXAMPLE
– What are the negations of the statements ∀x(x2 > x) and ∃x(x2 = 2)?
– Solution:
– Negation of ∀x(x2 > x) = ¬∀x(x2 > x) = ∃x¬(x2 > x) = ∃x(x2 ≤ x).
– Negation of ∃x(x2 = 2) = ¬∃x(x2 = 2) = ∀x¬(x2 = 2) = ∀x(x2 ̸= 2).
– The truth values of these statements depend on the domain.
20
Negating Quantified Expressions
• EXAMPLE
– Show that ¬∀x (P (x ) → Q(x )) and ∃x (P (x ) ∧ ¬Q(x )) are
logically equivalent.
26
Nested Quantifiers
• EXAMPLE: Express the statement “Everyone has exactly one best friend” as a
logical expression involving predicates, quantifiers with a domain consisting
of all people, and logical connectives.
• Solution:
– Rephrased = “For every person x, person x has exactly one best friend.”
– Let B(x, y) = “y is the best friend of x,”
– To represent the concept of “exactly one best friend” means that there is a person y
who is the best friend of x, and for every person z, if person z is not person y, then z
is not the best friend of x.
– Then statement = ∃y(B(x, y) ∧ ∀z((z ̸= y) → ¬B(x, z))).
31
Rules of Inference
• EXAMPLE: 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 = “It is below freezing now”
and q = “It is raining now.” Then
– Argument form used = p(p v q)
and it is called addition rule.
33
Rules of Inference
• EXAMPLE: 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.”
• Solution: Suppose
– p = “it is sunny this afternoon”
– q = “it is colder than yesterday”
– r = ”we will go swimming”
– s = “we will take a canoe trip”
– t = “we will be home by sunset”
35
Proofs by Rule of Inference
• Clause: is a disjunction of variables or
negations of these variables.
– we can replace the statement p ∨ (q ∧ r) by two
statements p ∨ q and p ∨ r, each of which is a
clause.
– Replace a statement of the form ¬(p ∨ q) by the
two statements ¬p and ¬q (De Morgan’s law)
– Replace a conditional statement p → q with the
equivalent disjunction ¬p ∨ q.
36
Proofs by Rule of Inference
• EXAMPLE
– Show that the premises (p ∧ q) ∨ r and r → s imply the
conclusion p ∨ s.
– Solution:
• Rewrite the premises (p ∧ q) ∨ r as two clauses, p ∨ r and q ∨
r. (Distributive Law: Table 6)
• Replace r → s by the equivalent clause ¬r ∨ s. (1 st Law: Table 7)
• Using the two clauses p ∨ r and ¬r ∨ s, we can use resolution
to conclude p ∨ s.
38
Rules of Inference for Quantified
Statements
• Universal Generalization: We show that ∀xP (x) is
true by taking an arbitrary element c from the
domain and showing that P (c) is true.
39
Rules of Inference for Quantified
Statements
• Existential instantiation: If we know that ∃xP(x) is
true, then there is an element c (not arbitrary) from
the domain for which P (c) is true.
40
Rules of Inference for Quantified
Statements
• Existential generalization: If we know one
element c (not arbitrary) in the domain for
which P (c) is true, then we know that ∃xP (x)
is true.
41
Rules of Inference for Quantified
Statements
• EXAMPLE
Show that the premises “Everyone in this discrete mathematics class has taken a course in computer
science” and “Marla is a student in this class” imply the conclusion “Marla has taken a course in computer
science.”
• Solution:
D(x) = “x is in this discrete mathematics class,” and
C(x) = “x has taken a course in computer science.”
Premises = ∀x(D(x) → C(x)) and D(Marla).
Conclusion = C(Marla).
The following steps can be used to establish the conclusion from the premises.
42
Combining Rules of Inference for
Propositions and Quantified Statements
• Universal Modus Ponens. This is the combination of
Universal instantiation and modus ponens which are
used so often.
43
Combining Rules of Inference for
Propositions and Quantified Statements
• EXAMPLE
Assume that “For all positive integers n, if n is greater than 4,
then n2 is less than 2n” is true. Use universal modus ponens
to show that 1002 < 2100.
• Solution:
Let G(n) = “n > 4” and L(n) = “n2 < 2n.”
Statement = ∀n(G (n) → L(n))
Domain = all positive integers.
Assume ∀n(G (n) → L(n)) = true.
Then for particular element a = 100, G (100) = true as 100 > 4.
L(100) = 1002 < 2100 = true by Universal Modus Penens
44
Combining Rules of Inference for
Propositions and Quantified Statements
• Universal modus tollens combines universal
instantiation and modus tollens and can be
expressed in the following way:
46