Discrete Structures Lecture 3
Discrete Structures Lecture 3
(Discrete Mathematics)
Fall 2017
Lecture - 3
Predicates and
Quantifiers
Bitwise Operations
• Computer represents information using bits. A bit
is a symbol with two possible values, namely, 0
(zero) and 1 (one).
• 1 represents T (true) and 0 represents (false).
• A variable is called a Boolean Variable if its value
is either true or false.
• A Boolean Variable can be represented by a bit.
• A bit string is a series of Boolean values. Length
of the string is the number of bits.
• 101010011 is nine Boolean values in one string
Bitwise Operations
Example 1:
“Every computer connected to the university
network is functioning properly.”
• No rules of propositional logic allow us to
conclude the truth of the statement.
Why Predicate Logic?
Example 2:
• “There is a computer on the university network that is
under attack by an intruder.”
•3+2=5 Yes
•X+2=5 No
variable predicate
Predicates
Q(3,4) Yes
Q(x,9) No
Predicate, YES or NO?
Q(x,y) Yes
Q(3,4) No
Q(x,9) Yes
Quantification
• Quantification expresses the extent to which a predicate is
true over a range of elements.
• In English, the words all, some, many, none, and few are
used in quantifications.
• The area of logic that deals with predicates and
quantifiers is called the predicate calculus.
Types of Quantifiers
• A quantifier is “an operator that limits the
variables of a proposition”.
• Two types:
• Universal
• Existential
Universal Quantifiers
• Represented by an upside-down A:
• It means “for all”
• Let P(x) = x+1 > x
• We can state the following:
• x P(x)
• English translation: “for all values of x, P(x) is
true”
• English translation: “for all values of x, x+1>x is
true”
Besides “for all”, universal quantification can be expressed
in many other ways: “for every”, “all of”, “for each”, “given
any”, “for arbitrary”, “for each” and “for any”
Universal Quantifiers
• You need to specify the universe of quantification!
• What values can represent
• Called the “domain of discourse” or “universe of
discourse”
• Or just “domain” or “universe”
Solution:
• The statement is the same as the conjunction
,
• Because , is false, it follows that is false.
Existential Quantification
• Represented by an backwards E:
• It means “there exists”, there is”, “for some”, etc.
• Let P(x) = x+1 > x
• Examples:
• P(x) x is free
• P(5) x is bound to 5
• x P(x) x is bound by quantifier
Binding Variables
• 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) because ∃x is applied only to P(x) ∧ Q(x), and not
to the rest of the statement.
• Similarly, the scope of the second quantifier, ∀x, is the
expression R(x).
• That is, the existential quantifier binds the variable x in
P(x) ∧ Q(x) and the universal quantifier ∀x binds the
variable x in R(x).
Binding Variables
• x (x + y =1)
• x is bound by x and y is free; thus not a proposition
• (x P(x)) Q(x)
• The x in Q(x) is not bound; thus not a proposition
• (x P(x)) (x Q(x))
• Both x values are bound; thus it is a proposition
• x (P(x) Q(x)) (y R(y))
• All variables are bound; thus it is a proposition
• (x P(x) Q(y)) (y R(y))
• The y in Q(y) is not bound; thus not a proposition
A note on quantifiers
• Recall that P(x) is a propositional function
• Let P(x) be “x == 0”
• Recall that a proposition is a statement that is either
true or false
• P(x) is not a proposition
• There are two ways to make a propositional function
into a proposition:
• Supply it with a value
• For example, P(5) is false, P(0) is true
• Provide a quantification
• For example, x P(x) is false and x P(x) is true
• Let the universe of discourse be the real numbers
Translating From English to Logical Expressions
• Express the statement “Every student in this class has
studied calculus” using predicates and quantifiers.
• Solution:
• Assume domain is students in the class
“For every student in this class, that student has studied calculus.”
“For every student x in this class, x has studied calculus.”
∀xC(x)
Negating Quantified Expressions
• Consider the statement
“Every student in this class has studied calculus.”
• This statement is a universal quantification, namely,
∀xC(x),
• C(x) is the statement “x has studied calculus”
• Domain consists of the students in the class.
• The negation of this statement is
• “It is not the case that every student in this class has studied
calculus.”
• This is equivalent to “There is a student in this class who has not
studied calculus.”
• This is simply the existential quantification of the negation
of the original propositional function, namely, ∃x ¬ C(x).
Negating Quantified Expressions
Solution:
• Let H(x) denote “x is honest.” Then the statement “There is an
honest politician” is represented by ∃xH(x), where the domain
consists of all politicians.
• The negation of this statement is ¬∃ xH(x), which is equivalent
to ∀x ¬ H(x). This negation can be expressed as “Every
politician is dishonest.” or Not all politicians are honest.”
Negating Quantified Expressions
Solution:
• C(x) denote “x eats cheeseburgers.” Then the
statement “All Americans eat cheeseburgers” is
represented by ∀xC(x), where the domain consists
of all Americans.
• The negation of this statement is ¬∀ xC(x), which is
equivalent to ∃x ¬ C(x). This negation can be
expressed as “Some American does not eat
cheeseburgers” and “There is an American who does
not eat cheeseburgers.”
Negating Quantified Expressions
• What are the negations of the statements
De Morgan’s Laws for Quantifiers
•
•
Translating From English to Logical Expressions
• Let C(x) = “x has studied calculus.”
S(x) = “person x is student in this class.”
The domain for x consists of all people.
x (B(x) R(x))
All hummingbirds are richly colored.
No large birds live on honey. x (L(x) H(x))
x (H(x) R(x))
Example
• Use predicates and quantifiers to express the system
specifications “Every mail message larger than one megabyte
will be compressed.”
• Where the variable m has the domain of all mail messages and
the variable y is a positive real number