0% found this document useful (0 votes)
37 views

DM 4 Predicates Quantifires

The statement "x>3" is true for some real numbers like 4, 5 etc. Therefore, the existential quantification ∃x P(x) is true.

Uploaded by

psychopsycho485
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)
37 views

DM 4 Predicates Quantifires

The statement "x>3" is true for some real numbers like 4, 5 etc. Therefore, the existential quantification ∃x P(x) is true.

Uploaded by

psychopsycho485
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/ 42

1

1.4 Predicates and Quantifiers


Course Code: CSC 1204 Course Title: Discrete Mathematics

Dept. of Computer Science


Faculty of Science and Technology

Lecturer No: 4 Week No: 2 Semester:


Asst. Prof. Nuzhat Tabassum
2

Lecture Outline

1.3 Predicates and Quantifiers


• Predicates
• Quantifiers
• Universal Quantifier, 
• Existential Quantifier, 
• Precedence of Quantifiers
• Negating Quantified Expressions
• Translating from English into Logical Expressions
4

Why do we need predicates?

• So far, we studied propositional logics and equivalence.


• However, propositional logics cannot adequately express the meaning
of all statements in mathematics and in natural language. For
example, suppose that we know that “Every computer connected to
the university network is functioning properly”
• No rules of propositional logic allow us to conclude the truth of the
statement “MATH3 is functioning properly,” where MATH3 is one of
the computers connected to the university network.
• A more powerful type of logic called predicate logic can be used to
express the meaning.
5

Predicates

• Predicate: A property that the subject of the statement can have.


• Example: “ x > 3 ”
x: variable
>3: predicate
• We can denote the statement “x is greater than 3” by P(x), where P denotes
the predicate “is greater than” and x is the variable. The statement P(x) is also
said to be the value of the propositional function P at x.
• P(x): x>3
• The value of the propositional function P at x
• Note: Once a value has been assigned to the variable x, the statement P(x)
becomes a proposition and has a truth value (either TRUE or FALSE)
6

Predicates

• A predicate is a sentence that contains a finite number of variables and


becomes a proposition when specific values are substituted for the variables.
• A predicate, or propositional function, is a function that takes some
variable(s) as arguments and returns True or False.
• A PREDICATE is symbolized by a CAPITAL LETTER and the variable(s) by small
letter(s).
• The sentence “x is a bachelor” is symbolized as P(x),
where x is a variable. When concrete values are substituted in place of x, a
proposition results(with a truth value, either True or False). P(x) is also called a
propositional function , because each choice of x produces a proposition P(x)
that is either true or false.
7

Example 1

• Let P(x) denote the statement “x>3”.


What are the truth values of P(4) and P(2)?

 Solution: Given ==> P(x) : “x>3”


• We obtain the statement P(4) by setting x = 4 in the
statement “x>3”. Hence P(4), which is the statement
“4>3”, is true.
• However, P(2) which is the statement “2>3”, is false.

8

Example 2

• Let, A(x) : “Computer x is under attack by an intruder”. Suppose


that of the computers on campus, only C1 and C7 are currently
under attack by intruders. What are the truth values of A (C1),
A(C3), A(C7)?
 Solution:
• A(C1): “Computer C1 is under attack by an intruder” is true
• A(C7): “Computer C7 is under attack by an intruder” is true
• A(C3): “Computer C3 is under attack by an intruder” is false
Why ? Because C3 is not in the list of computers that are attacked by intruders.
9

Multivariable Predicates
• Multivariable Predicates ==> Predicates that have
more than one variable.
• For example, Q(x, y): “x = y + 3” ,
where x and y are variables and Q is the predicate.

 Note: When values are assigned to the variables x and


y, the statement Q(x, y) has a truth value.
10

Example 3

Let Q(x, y) denote the statement “x = y + 3”.


What are the truth values of the propositions Q(1,2)
and Q(3,0)?
 Solution:
• To obtain Q(1,2), set x=1 and y=2 in the statement
Q(x,y).
Therefore, Q(1,2): “1 = 2 + 3” is false
Similarly, Q(3,0): “3 = 0 + 3” is true
11

Quantifiers

• Quantification: Two Categories –


• Universal quantification: A predicate is true for every element in
the domain
• Existential quantification: There is one or more elements in the
domain for which a predicate is true

 Domain /domain of discourse/universe of discourse:


The values a variable in a propositional function may take.
12

Quantifiers

1. Universal Quantifier:  is called the universal quantifier.


“” reads “for All”

2. Existential Quantifier:  is called the existential quantifier.


“” reads “there Exists”
13

The Universal Quantifier

Definition: The universal quantification of P(x) is the


statement “P(x) for all values of x in the domain”.
• The notation x P(x) denotes the universal
quantification of P(x).
• We read x P(x) as “for all x P(x)” or “for every x P(x)”
• An element for which P(x) is false is called a counter
example of x P(x)
14

The Universal Quantifier

• “x P (x)” is true when every instance of x makes P (x)


true when plugged in

• Like taking conjunction over the entire universe:


x P (x )  P (x1) P (x2)  P (x3)  …  P(xn)
15

Example 8

Let P(x) be the statement “x + 1 > x”


What is the truth value of the quantification x P(x ), if
the domain consists of all real numbers?

Solution: Because P(x) is true for all real numbers x, the


truth value of the quantification x P (x ) is true.

Note: If we add 1 to any real number x, that number is


always bigger than x
16

Example 9

• Let Q(x) be the statement “x<2”. What is the truth value


of the quantification x Q(x ), if the domain consists of
all real numbers?

• Solution: Q(x) is not true for every real number x,


because, for instance, Q(3) is false. That is, x = 3 is a
counterexample for the statement x Q(x ).
Thus, the truth value of x Q(x ) is false.
17

(Modified) Example 10

Let P(x) be the statement “x2>0”. What is the truth value


of the quantification x P(x ), if the universe of discourse
consists of all integers?

Solution: P(x) is not true for all integers.


We can give a counter example. We see that x = 0 is a
counterexample, because x2 = 0 when x = 0, so that x2 is
not greater than 0 when x = 0.
Therefore, truth value of x P(x ) is false.
18

Example 11

What is the truth value of x P(x ), if P(x) is the


statement “x2<10” and the domain consists of the
positive integers not exceeding 4?

Solution: The statement x P(x ) is the same as the


conjunction P(1)  P(2)  P(3)  P(4), because the
domain consists of the integers 1, 2, 3, and 4.
Because P(4), which is the statement “42<10”, is false, it
follows that x P(x ) is false.
19

Another Example

What is the truth value of x P(x ), where P(x) is the statement “x2<10” and the
domain consists of the positive integers less than 4?

Solution: The statement x P(x ) is the same as the conjunction P(1)  P(2) 
P(3) , because the domain consists of the integers 1, 2, 3.
So, the truth value of x P(x ) is true.

How?----------See Below-------------------------------------
P(1): “12<10”, is true
P(2): “22<10” is true
P(3): “32<10” is true
P(1)  P(2)  P(3)  T  T  T  T
20

Practice

What is the truth value of x P(x ), where P(x) is the statement “x3<10” and the
domain consists of the positive integers not exceeding 3?

Solution: The statement x P(x ) is the same as the conjunction P(1)  P(2) 
P(3) , because the domain consists of the integers 1, 2, 3.
So, the truth value of x P(x ) is false for x=3 as 3x3x3 =27.

What is the truth value of  x P(x ), where P(x) is the statement “x3<10” and the
domain consists of the positive integers not exceeding 3?

Solution: True as it is true for x=1 and x=2


21

The Existential Quantifier

 Definition: The existential quantification of P(x) is the


proposition “There exists an element x in the domain such
that P(x)”.
 We denote the existential quantification of P(x) by x P(x)
 Existential quantification x P(x) is read 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)”
22

The Existential Quantifier

• “x P (x)” is true when an instance can be found


which when plugged in for x, makes P (x) true.

• Like taking disjunction over the entire domain


x P (x )  P (x1)  P (x2)  P (x3)  … P(xn)
23

Example 14

• Let P(x) denote the statement “x>3”. What is the


truth value of the quantification x P (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 x P (x), is true.
24

Example 15

 Let Q(x) denote the statement “x = x+1”. What is the


truth value of the quantification x Q(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 x Q(x),
is false.
• Note: If we add 1 to any real number x, that number
will NEVER be equal to x, it will be always 1 bigger
than x
25

Example 16
• What is the truth value of x P(x), where P(x) is the statement
“x2>10” and the universe of discourse consists of the positive
integers not exceeding 4?

• Solution: Because the domain is { 1, 2, 3, 4}, the proposition x


P(x) is the same as the disjunction
P(1) P(2)  P(3) P(4) .
Because P(4), which is the statement “42>10” , is true, it follows
that truth value of x P(x) is true.
26

Class Work

1. Let P(x) denote the statement “x>0”. What is the truth value of the quantification
x P (x)” , where the domain consists of integers?
2. Let P(x) denote the statement “x>0”. What is the truth value of the quantification
x P (x)” , where the domain consists of non-negative integers?
3. Let P(x) denote the statement “x>0”. What is the truth value of the quantification
x P (x)” , where the domain consists of negative integers?
4. Let P(x) denote the statement “x<2”. What is the truth value of the quantification
x P (x)” , where the domain consists of all prime numbers?
5. Let P(x) denote the statement “x ≤ 2”. What is the truth value of the
quantification x P (x)” , where the domain consists of all prime numbers?
27

Answers

1. True
2. False
3. False
4. False
5. True
28

Universal & Existential Quantifiers:


When True? When False?
29

Precedence of Quantifiers

• The quantifiers  and  have higher precedence


than all logical operators from propositional
calculus.
• For example, x P(x)Q(x) is the disjunction of
x P(x) and Q(x).
In other words, it means (x P(x))  Q(x) rather than
x ( P(x)  Q(x) )
30

Negating Quantified Expressions:


De Morgan’s Laws for Quantifiers
• The rules for negations for quantifiers are called De Morgan’s laws for
quantifiers
• Recall De Morgan’s identities/Laws:
• Negation of Conjunction: (p1p2…pn)  (p1p2…pn)
• Negation of Disjunction: (p1p2…pn)  (p1p2…pn)

 Since the quantifiers are the same as taking a bunch of AND’s () or OR’s (),
we have:
• Universal Negation:  x P(x )  x P(x )

• Existential Negation:  x P(x )  x P(x )


31

Translating from English into Logical


Expressions
Example 23 (p.40): Express the statement “Every student in the class has studied
calculus” using predicates and quantifiers.

Solution: First, we rewrite the statement so that we can clearly identify the
appropriate quantifiers to use. Doing so, we obtain:
“For every student in the class, that student has studied calculus”.
Next, we introduce a variable x so that our statement becomes –
“For every student x in the class, x has studied calculus”
Continuing, we introduce the predicate C(x), which is the statement “x has studied
calculus”
Consequently, if the universe of discourse for x consists of the students in the
class, we can translate our statement as x C(x).
32

Example 23 (p.40)
Note: There are other correct approaches; different domains of discourse and
other predicates can be used. For example, If we change the domain to
consists of all people, we need to express our statement as
“For every person x, if person x is a student in this class, then x has studied
calculus.”
If S(x) represents the statement that person x is in this class, our statement can be
expressed as  x S(x) → C(x).

Note: For the second way (when the domain is all people), we always want to use
conditional statements with universal quantifiers and conjunctions with
existential quantifiers.
33

Extra Example

• Express the statement “Someone in your school has studied


calculus” using predicates and quantifiers. Let the domain consists
of all people.
• Solution:
Let, S(x) be the propositional functions “ x is in your school” and
C(x) be the propositional function “x has studied calculus”.
x ( S(x)  C(x) )

 Note that if the domain consists of the students in your school,


then we can write x C(x)
34

Exercise 9 (p.43)

• Let P(x) be the statement “x can speak Russian” and let Q(x) be the
statement “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.
a) There is a student at your school who can speak Russian and who knows
C++.
b) There is a student at your school who can speak Russian but who doesn’t
know C++.
c) Every student at your school either can speak Russian or knows C++.
d) No student at your school can speak Russian or knows C++
35

Answers

a)  x (p(x)  Q(x))

b)  x (p(x)   Q(x))

c)  x (P(x )  Q(x))

d)  x  (P(x )  Q(x))
36

Exercise 25 (p. 44)

Translate each of the statements into logical expressions


using predicates, quantifiers, and logical connectives.
Let the domain be all people
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.
37

Solution

Let P(x) be “x is perfect”; let F(x) be “x is your friend”.

a) x  P(x )
b)  x P(x )
c) x ( F(x) P (x) )
d)  x (F(x)  P(x))
e)  x (F(x )  P(x)) or (x (F(x ))  (x P(x))
f) (¬x (F(x )) ∨ ( x¬ P(x ))
38

Practice: Translate each of the statements into logical expressions


using predicates, quantifiers, and logical connectives.

Let the domain be all students in your university


• There is a person in your university who is Bangladeshi.
 x B(x) where B(x) be “x is Bangladeshi”

• No student in your university has studied DM.


• (here no is for the students who has studied DM)
x  D(x ) where D(x) be “x has studied DM”
=   x D(x)

• Everyone in your class is perfect.


x P (x ) where P(x) be “x is perfect”
39

Practice: Translate each of the statements into logical expressions


using predicates, quantifiers, and logical connectives.

Let the domain be all students in your university

• Not Everyone in your class is perfect.


(here not is for the quantifier which is everyone )
 x P (x ) where P(x) be “x is perfect”

• Someone in your class can speak russian.


 x H(x) where H(x) be “ x can speak Russian”
Difference between Propositional logic and
Predicate logic
Propositional Logic Predicate Logic

Propositional logic is the logic that deals with a collection of Predicate logic is an expression consisting of variables with a
declarative statements which have a truth value, true or false. specified domain. It consists of objects, relations and
functions between the objects.

It is the basic and most widely used logic. Also known as It is an extension of propositional logic covering predicates
Boolean logic. and quantification.

A proposition has a specific truth value, either true or false. A predicate’s truth value depends on the variables’ value.

It is a more generalized representation. more specialized representation.

It cannot deal with sets of entities. It can deal with set of entities with the help of quantifiers

Propositions are combined with Logical Operators or Logical


Connectives like Negation(¬), Disjunction(∧), Conjunction(∨), Predicate Logic adds by introducing quantifiers to the existing
Exclusive OR(⊕), Implication(⇒), Bi-Conditional or Double proposition.
Implication(⇔).
41

Practice @ Home

• Relevant Odd-Numbered Exercises first


• Then Even-Numbered Exercises
Books

1. Discrete Mathematics and its applications with


combinatorics and graph theory (7th edition) by Kenneth H.
Rosen [Indian Adaptation by KAMALA KRITHIVASAN],
published by McGraw-Hill
2. A textbook of Discrete Mathematics by Swapan Kumar
Sarkar
References

1. Discrete Mathematics, Richard Johnsonbaugh, Pearson education, Inc.


2. Discrete Mathematical Structures, Bernard Kolman, Robert C. Busby,
Sharon Ross, Prentice-Hall, Inc.
3. SCHAUM’S outlines Discrete Mathematics(2nd edition), by Seymour
Lipschutz, Marc Lipson

You might also like