Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
16 views

Discrete Structures Week 4 Predicates and Quantifiers

Uploaded by

mahnooryasir04
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Discrete Structures Week 4 Predicates and Quantifiers

Uploaded by

mahnooryasir04
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 55

Discrete Structures

(Discrete Mathematics)

Week 4
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

• We can then do operations on these Boolean


strings
• Each column is its own Boolean operation

Operations Operator Bit String1 Bit String 2 Result


Bitwise XOR  0101 1010 1011 0100 1110 1110
Bitwise OR  0101 1010 1011 0100 1111 1110
Bitwise AND  0101 1010 1011 0100 00010000
Why Predicate Logic?
• Propositional Logic is not expressive enough
• It cannot adequately express the meaning of statements in
mathematics and in natural language

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.”

Predicate Logic is more expressive


and powerful
Predicate Logic
• Proposition, YES or NO?

•3+2=5 Yes

•X+2=5 No

• X + 2 = 5 for any choice of X in {1, 2, 3} Yes

• X + 4 = 5 for some X in {1, 2, 3} Yes

• Computer X is under attack by an intruder No


Propositional Functions(Example)
• “x is greater than 3” or (x > 3)
• The variable x: subject of the statement
• “is greater than 3”: predicate
• P(x): propositional function P at x

• Let P(x) = x > 3


• P(x) has no truth values (x is not given a value)
• P(10) is true: The proposition 10 > 3 is true.
• P(1) is false: The proposition 1 > 3 is false.
• P(x) will create a proposition when given a value
Propositional Functions(Example)
• Let A(x) = “Computer x is under attack by an intruder.”
• Suppose computers on campus, only CS2 and MATH1
are currently under attack by intruders.
• What are truth values of A(CS1), A(CS2), and A(MATH1)?

• The statement A(CS1) by setting x = CS1 in the statement


“Computer x is under attack by an intruder.”
• CS1 is not on the list of computers currently under attack, A(CS1)
is false.
• CS2 and MATH1 are on the list of computers under attack, A(CS2)
and A(MATH1) are true.
Propositional Functions
• Functions with multiple variables:
• P(x,y) = x + y == 0
• P(1,2) is false, P(1,-1) is true
• P(x,y,z) = x + y == z
• P(3,4,5) is false, P(1,2,3) is true
• P(x1,x2,x3 … xn) = …
• Anatomy of a propositional function
• P(x) = x + 5 > x

variable predicate
Predicates

• A predicate is a declarative statement with at least


one variable (i.e. unknown value).
• A predicate, or propositional function, is a function
that takes some variable(s) as arguments and returns
True or False.
Predicates
• Suppose Q(x,y) = “x > y”

Proposition, YES or NO?


Q(x,y) No

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”

• The meaning of the universal quantification of P(x)


changes when we change the domain. The domain must
always be specified when a universal quantifier is used;
without it, the universal quantification of a statement is not
defined.
Universal Quantifiers
• Let the universe of discourse be the real numbers.
• Let P(x) = x/2 < x
• Not true for the negative numbers!
• Thus, x P(x) is false, When the domain is all the real numbers

• In order to prove that a universal quantification is true, it


must be shown for ALL cases

• In order to prove that a universal quantification is false, it


must be shown to be false for only ONE case
Universal Quantifiers

• Let P(x) is “>0.” To show that the statement ∀xP(x) is false


where the universe of discourse consists of all integers,
we give a counterexample.

• x = 0 is a counterexample because = 0 when x = 0, so


that is not greater than 0 when x = 0.
Universal Quantification
• Given some propositional function P(x) And values in the
universe x1 .. xn

• The universal quantification x P(x) implies:

• P(x1)  P(x2)  …  P(xn)


Question
• What is the truth value of , where is the statement and the
domain consists of the positive integers not exceeding 4?
Question
• What is the truth value of , where is the statement and the
domain consists of the positive integers not exceeding 4?

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

• We can state the following:


• x P(x)
• English translation: “there exists (a value of) x such
that P(x) is true”
• English translation: “for at least one value of x, x+1>x
is true”
• English translation: “for some x, P(x)”
Existential Quantification
• The existential quantifier of P(x) is the
proposition:
• “P(x) is true for some x in the universe of discourse.”

• x P(x) is TRUE if there is an x for which P(x) is


true.
• x P(x) is FALSE if P(x) is false for every single
x.
Existential Quantification
• Note that you still have to specify your universe

• Let P(x) = x+1 < x


• There is no numerical value x for which
x+1<x
• Thus, x P(x) is false
Existential Quantification

• Let P(x) = x+1 > x


• There is a numerical value for which x+1>x
• In fact, it’s true for all of the values of x. Thus,  x
P(x) is true

• In order to show an existential quantification is true, you


only have to find ONE value

• In order to show an existential quantification is false, you


have to show it’s false for ALL values
Existential Quantification

• 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: Because “x > 3” is sometimes true—for


instance, when x = 4 the existential quantification of P(x),
which is ∃xP(x), is true.
Existential Quantification

• Example: Let Q(x) denote the statement “x ==x + 1.”What


is the truth value of the quantification ∃xQ(x), where the
domain consists of all real numbers?

• Solution: Because Q(x) is false for every real number x,


the existential quantification of Q(x), which is ∃xQ(x), is
false.
Existential Quantification
• Given some propositional function P(x) And values in the
universe x1 .. xn

• The existential quantification x P(x) implies:

• P(x1)  P(x2)  …  P(xn)


Summary

Statement When True? When False?


xP(x) P(x) is true for every x. There is an x for which
P(x) is false.
∃x P(x) There is an x for which P(x) is false for every x.
P(x) is true.
Precedence of Quantifiers
• The quantifiers  and  have higher precedence then all
logical operators from propositional calculus.
• e.g x P(x)  Q(x) is the disjunction of x P(x) and Q(x).
Binding Variables

• When a quantifier is used on a 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 the quantifier.

• All the variables that occur in a logical expression must be


bound or set equal to a particular value to turn into a
proposition.
Binding Variables

• 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).
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.”

C(x) = “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

Statement When True? When False?


xP(x) P(x) is true for every x. There is an x for which
P(x) is false.
∃x P(x) There is an x for which P(x) is false for every x.
P(x) is true.

Negation Equivalent When is When False?


Statement Negation True?
¬∃ xP(x) ∀x ¬ P(x) For every x, P(x) There is an x for
is false. which
P(x) is true.
¬∀ xP(x) ∃x ¬ P(x) There is an x for P(x) is true for
which P(x) is every x.
false.
Negating Quantified Expressions
• Example:
What are the negations of the statements “There is an
honest politician” and “All Americans eat cheeseburgers”?

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.

• “For every person x, if person x is a student in this class


then x has studied calculus.”

• The statement can be expressed as ∀x(S(x) → C(x)).


Translating From English to Logical Expressions
• Let P(x) = “x can speak Russian”
Q(x) = “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.
• There is a student at your school who can speak Russian
and who knows C++.

• There is a student at your school who can speak Russian


but who doesn’t know C++.
Translating From English to Logical Expressions
• Every student at your school either can speak Russian or
knows C++.

• No student at your school can speak Russian or knows


C++.
The Four Aristotelian Forms

1. All A's are B's


2. Some A's are B's
3. No A's are B's
4. Some A's are not B's

• These are four of the most common quantificational


sentences used in quantificational reasoning.
The First Aristotelian Form

• The Form: All A's are B's


• Example: All comedian are funny.
• Rephrase: For every x, if x is a comedian then x is funny
• Translation: ∀x (Comedian(x) Funny(x))
• This translation has the form: ∀x (A(x) B(x))
• General Fact
• All A's are B's translates as ∀x (A(x) B(x))
The Second Aristotelian Form
• The Form: Some A's are B's
• Example: Some comedian are funny
• Rephrase: Some thing x is both comedian and funny
• Translation: x (Comedian(x)  Funny(x))
• This translation has the form: x (A(x)  B(x))
• General Fact
• Some A's are B's translates as x (A(x)  B(x)
The Second Aristotelian Form
• We've learned two facts:
1. All A's are B's translates as ∀x (A(x) B(x))
2. Some A's are B's translates as x (A(x)  B(x))
The Third Aristotelian Form

• The Form: No A's are B's


• Example: No students are failed
• Rephrase: For every x, if x is a student then x is not failed
• Translation: ∀x (Student(x)Failed(x))
• This translation has the form: ∀x (A(x) B(x))
• General Fact
• No A's are B's translates as ∀x (A(x) B(x))
The Fourth Aristotelian Form

• The Form: Some A's are not B's


• Example: Some excuses are not believable
• Rephrase: For some x, x is an excuse and x is not believable
• Translation: x (Excuse(x)  Believable(x))
• This translation has the form: x (A(x)  B(x))
• General Fact
• Some A's are not B's translates as x (A(x)  B(x))
Summary
• The Aristotelian Forms and Their Translations
• All A's are B's ∀x (A(x) B(x))
• Some A's are B's x (A(x) B(x))
• No A's are B's ∀x (A(x) B(x))
• Some A's are not B's x (A(x) B(x))
Predicates - Examples
L(x) = “x is a lion.” Universe of discourse
is all creatures
F(x) = “x is fierce.”
C(x) = “x drinks coffee.”
x (L(x)  F(x))
All lions are fierce.
Some lions don’t drink coffee. x (L(x)  C(x))
Some fierce creatures don’t drink coffee.
x (F(x)  C(x))
Predicates - Examples
B(x) = “x is a hummingbird.” Universe of discourse
is all creatures
L(x) = “x is a large bird.”
H(x) = “x lives on honey.”
R(x) = “x is richly colored.”

x (B(x)  R(x))
All hummingbirds are richly colored.
No large birds live on honey.  x (L(x) H(x))

Birds that do not live on honey are dully colored.

x (H(x)  R(x))
Example
• Express each of these statements using quantifiers. Then
form the negation of the statement, so that no negation is
to the left of a quantifier. Next, express the negation in
simple English.
a) Some old dogs can learn new tricks.
b) No rabbit knows calculus.
c) Every bird can fly.
d) There is no dog that can talk.
e) There is no one in this class who knows French and
Russian.
Chapter Reading
• Chapter 1, Kenneth H. Rosen, Discrete Mathematics and
Its Applications, Section 1.4
Chapter Exercise (For Practice)

• Question # 1, 2, 5, 6, 7, 8, 10, 11, 12, 14, 17, 18, 35, 36,


59(a, b, c), 60( a, b, c), 61(a, b, c, d)

You might also like