Lecture 5 (16 5 22)

Download as pdf or txt
Download as pdf or txt
You are on page 1of 25
At a glance
Powered by AI
The key takeaways from the document are the different rules of inference, logical equivalences, predicates, and quantifiers in propositional logic.

The two types of quantifiers discussed are universal quantifiers and existential quantifiers.

A universal quantifier makes a predicate true for every element under consideration, while an existential quantifier makes a predicate true for at least one element under consideration.

Lecture # 5

Propositional Logic

Dr. Shahid Munir Shah, Depratment of Computer 1


Science, Salim Habib University
Discrete
Mathematics
Facilitator: Dr. Shahid Munir shah, Spring
2022

Dr. Shahid Munir Shah, Depratment of Computer 2


Science, Salim Habib University
Class Learning outcomes
After completing this lecture, students should be
able to:
• Differentiate between valid and invalid
statements using rules of inference and the
laws of logical equivalence
• Understand predicates
• Understand Quantifiers
• Apply predicates and quantifiers to the
propositional logic

Dr. Shahid Munir Shah, Depratment of Computer 3


Science, Salim Habib University
Some important logical
equivalent relationships

Dr. Shahid Munir Shah, Department of Computer 4


Science, Salim Habib University
Rules of inference

Different rules of
inference have been
listed in table.
We will understand
all the rules one by
one

Dr. Shahid Munir Shah, Depratment of Computer 5


Science, Salim Habib University
Worked Example-1
Using rules of Inference and the other laws of
logical equivalence, prove that the following
arguments are valid

1. p → q 2. (p ∧ q) → r 3. p → (q ∧ r)
q→r ¬r ¬q
¬r q ∴ ¬p
∴ ¬p ∴ ¬p

Dr. Shahid Munir Shah, Depratment of Computer 6


Science, Salim Habib University
Worked Example-2
Using the rules of inference prove the following arguments
are valid
1. If Rameez work hard then he is a dull boy
If rameez is a dull boy then he will not get a job
Therefore, Rameez will not get job.

2. “If it rains today, then we will not have a barbeque


today.
If we do not have a barbeque today, then we will have
a barbeque tomorrow.
Therefore, if it rains today, then we will have a
barbeque tomorrow.”

Dr. Shahid Munir Shah, Depratment of Computer 7


Science, Salim Habib University
Exercise -1
Prove the validity of the following
arguments using the rules of inference!

pq
(p  q) r
r

Dr. Shahid Munir Shah, Depratment of Computer 8


Science, Salim Habib University
Exercise-2
Using rules of inference or the other logical laws,
determine whether the following arguments are
valid / Invalid (in any case, verify your answer)

a). P  (Q  R)
R
 PQ

b). P  (Q  R)
Q  (P  R)
PR

c). P  Q
PQ  R
R
Dr. Shahid Munir Shah, Depratment of Computer 9
Science, Salim Habib University
Exercise-3

Aziz is a math major or a CS Major


If aziz does not like discrete mathemetics, he
is not a CS Major
If Aziz like discrete Mathematics, he is mart
Aziz is not a math major

Can you conclude “Aziz is smart”

Dr. Shahid Munir Shah, Depratment of Computer 10


Science, Salim Habib University
Exercise-4
Using the rules of inference prove the
following arguments are valid

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. If we take a cane trip
then we will be home by sunset.

Dr. Shahid Munir Shah, Depratment of Computer 11


Science, Salim Habib University
Exercise-5
You are about to leave for school in the morning and
discover that you don’t have your
glasses. You know the following statements are true:
a. If I was reading the newspaper in the kitchen, then my
glasses are on the kitchen table.
b. If my glasses are on the kitchen table, then I saw them
at breakfast.
c. I did not see my glasses at breakfast.
d. I was reading the newspaper in the living room or I was
reading the newspaper in the
kitchen.
e. If I was reading the newspaper in the living room then
my glasses are on the coffee
table.
Where are the glasses?

Dr. Shahid Munir Shah, Depratment of Computer 12


Science, Salim Habib University
Predicates and Quantifiers
Predicates
Propositional logic, studied in previous slides, cannot
adequately express the meaning of all statements in
mathematics and in natural language.

For example, suppose that for the statement “That student


studies CS.”
Its truth value cannot be decided because “That student” is
not specified.

To resolve such ambiguity, predicates are used.

A predicate is a statement with variables written with a


capital letter and the variables listed as arguments,
like P(x,y,z). In other words;
A predicate is a prepositional function that contains a finite
number of variables and becomes a statement when specific
values are substituted for the variables.
Example 1(Predicate)
Q. Let P(x) denote the statement “x > 3.”
What are the truth values of P(4) and
P(2)?
Solution: 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.
Example 2(Predicate)
Q. Let A(x) denote the statement “Computer x is
under attack by an intruder.” Suppose that of the
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)?
Solution: We obtain the statement A(CS1) by setting
x = CS1 in the statement “Computer x
is under attack by an intruder.” Because CS1 is not
on the list of computers currently under
attack, we conclude that A(CS1) is false. Similarly,
because CS2 and MATH1 are on the list of
computers under attack, we know that A(CS2) and
A(MATH1) are true.
Example 3(Predicate)
Q. 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). Hence, Q(1, 2)
is the statement “1 = 2 + 3,” which is false.
The statement Q(3, 0) is the proposition “3
= 0 + 3,” which is true.
Exercise-1(Predicate)
Q. Let R(x, y, z) denote the statement “x + y
= z.” When values are assigned to the
variables x, y, and z, this statement has a
truth value.
What are the truth values of the
propositions R(1, 2, 3) and R(0, 0, 1)?
.
Quantifiers
When the variables in a propositional function are
assigned values, the resulting statement becomes
a proposition with a certain truth value. However,
there is another important way, 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.
In English, the words all, some, many, none, and few
are used in quantifications.
There are two types of quantifiers:
1. Universal Quantifiers
2. Existential quantifier
Universal quantifier makes a predicate true for
every element under consideration, and existential
quantification makes a predicate true for one or
more elements under consideration.
Universal Quantifiers

The universal quantification of P(x) is the


statement
“P(x) for all values of x in the domain.”
The notation ∀xP(x) denotes the universal
quantification of P(x).
Here ∀ is called the universal quantifier.We
read ∀xP(x) as “for all xP(x)” or “for every
xP(x).” An element for which P(x) is false is
called a counterexample to ∀xP(x).
Example 1(Universal
Quantifiers)
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.
Example 2 (Universal
Quantifiers)
Let Q(x) be the statement “x < 2.” What is
the truth value of the quantification
∀xQ(x), where 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
∀xQ(x). Thus, ∀xQ(x) is false.
Existential Quantifiers
The existential quantification of P(x) is the
proposition
“There exists an element x in the domain
such that P(x).”
We use the notation ∃xP(x) for the
existential quantification of P(x).
Here ∃ is called the existential quantifier.
Example1 (Existential
Quantifiers)
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.
Example2 (Existential
Quantifiers)
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.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy