0% found this document useful (0 votes)
22 views33 pages

Chapter1 - Part3_Logic

Uploaded by

ahda.dzia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views33 pages

Chapter1 - Part3_Logic

Uploaded by

ahda.dzia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 33

Chapter 1 (Part 3)

Fundamental of
Logic
CCS3003
DISCRETE STRUCTURE
Chapter Outline
1. Basic operators

2. Truth table

3. Logic Implication

4. Logic equivalence: Laws of Logic

5. Predicates and Quantifiers

6. Rules of Inference
Rules of Inference

•Valid Arguments
•Inference Rules for Propositional Logic
•Using Rules of Inference to Build Arguments

CCS3003_DRNS_SEM1_2024/2025 3
Valid Arguments

• We will show how to construct valid arguments in


propositional logic
• The rules of inference are the essential building
block in the construction of valid arguments.
✓ Propositional Logic
• Inference Rules

CCS3003_DRNS_SEM1_2024/2025 4
Arguments in Propositional Logic
• An argument is a sequence of propositions.
• All but the final proposition are called premises. The last statement is
the conclusion.
• The argument is valid if the premises imply the conclusion.
• If the premises are p1 ,p2, …,pn and the conclusion is q then
(p1 ∧ p2 ∧ … ∧ pn ) → q is a tautology.
• Inference rules are all simple argument forms that will be used to
construct more complex argument forms.

CCS3003_DRNS_SEM1_2024/2025 5
Rules of Inference: Modus Ponens
The rule of logic which states that if a conditional
statement (‘if p then q ’) is accepted, and the
Corresponding Tautology:
antecedent ( p ) holds, then the consequent ( q ) (p ∧ (p →q)) → q
may be inferred.

Example:
Let p be “It is snowing.”
Let q be “I will study discrete math.”

“If it is snowing, then I will study discrete math.”


“It is snowing.”

“Therefore , I will study discrete math.”

CCS3003_DRNS_SEM1_2024/2025 6
Rules of Inference: Modus Tollens
The rule of logic which states that if a conditional statement
(‘if p then q ’) is accepted, and the consequent does not hold
Corresponding Tautology:
( not-q ) then the negation of the antecedent ( not-p ) can be (¬q ∧ (p →q))→¬p
inferred.

Example:
Let p be “it is snowing.”
Let q be “I will study discrete math.”

“If it is snowing, then I will study discrete math.”


“I will not study discrete math.”

“Therefore , it is not snowing.”

CCS3003_DRNS_SEM1_2024/2025 7
Rules of Inference: Hypothetical Syllogism
Hypothetical syllogism is a valid argument form Corresponding Tautology:
which is a syllogism having a conditional statement ((p →q) ∧ (q→r))→(p→ r)
for one or both of its premises.

Other name: Transitivity

Example:
Let p be “it snows.”
Let q be “I will study discrete math.”
Let r be “I will get an A.”

“If it snows, then I will study discrete math.”


“If I study discrete math, I will get an A.”

“Therefore , If it snows, I will get an A.”

CCS3003_DRNS_SEM1_2024/2025 8
Rules of Inference: Disjunctive Syllogism
Disjunctive syllogism (historically known as modus tollendo Corresponding Tautology:
ponens (MTP), Latin for "mode that affirms by denying") is (¬p∧(p ∨q))→q
a valid argument form which is a syllogism having
a disjunctive statement for one of its premises.

Other name: Elimination


Example:
Let p be “I will study discrete math.”
Let q be “I will study English literature.”

“I will study discrete math or I will study English literature.”


“I will not study discrete math.”

“Therefore , I will study English literature.”

CCS3003_DRNS_SEM1_2024/2025 9
Rules of Inference: Addition
Corresponding Tautology:
p →(p ∨q)

Example:
Let p be “I will study discrete math.”
Let q be “I will visit Las Vegas.”

“I will study discrete math.”

“Therefore, I will study discrete math or I will visit


Las Vegas.”

CCS3003_DRNS_SEM1_2024/2025 10
Rules of Inference: Simplification
Example: Corresponding Tautology:
Let p be “I will study discrete math.”
Let q be “I will study English literature.” (p∧q) →p

“I will study discrete math and English literature”

pq
“Therefore, I will study discrete math.”

p

CCS3003_DRNS_SEM1_2024/2025 11
Rules of Inference: Conjunction
Corresponding Tautology:
Example: ((p) ∧ (q)) →(p ∧ q)
Let p be “I will study discrete math.”
Let q be “I will study English literature.”

“I will study discrete math.”


“I will study English literature.”

“Therefore, I will study discrete math and I will study English


literature.”

CCS3003_DRNS_SEM1_2024/2025 12
Rules of Inference: Resolution
Resolution plays an important role in Corresponding Tautology:
AI and is used in Prolog. ((¬p ∨ r ) ∧ (p ∨ q)) →(q ∨ r)

Example:
Let p be “I will study discrete math.”
Let r be “I will study English literature.”
Let q be “I will study databases.”

“I will not study discrete math or I will study English literature.”


“I will study discrete math or I will study databases.”

“Therefore, I will study databases or I will English literature.”

CCS3003_DRNS_SEM1_2024/2025 13
Example: Modus Ponens

p→q
q
p

(1) If Margaret Thatcher is the president of the U.S., then she is at


least 35 years old.

(2) Margaret Thatcher is at least 35 years old.

(3) Therefore, Margaret Thatcher is the president of the US.

CCS3003_DRNS_SEM1_2024/2025 14
Example: Modus Ponens

p→q
q
p

(1) If the sum of the digits of 371,487 is divisible by 3, then 371,487 is


divisible by 3.
(2) The sum of the digits of 371,487 is divisible by 3.
(3) 371,487 is divisible by 3.

CCS3003_DRNS_SEM1_2024/2025 15
Example: Modus Tollens

(1) If Zeus is human, then Zeus is mortal.


(2) Zeus is not mortal.
(3) Therefore, Zeus is not human.

CCS3003_DRNS_SEM1_2024/2025 16
Modus Ponens and Modus Tollens
a) If there are more pigeons than there are pigeonholes , then at least two
pigeons roost in the same hole.
There are more pigeons than there are pigeonholes.
Therefore,
at least two pigeons roost in the same hole

b) If 870,232 is divisible by 6, then it is divisible by 3.


870,232 is not divisible by 3.
Therefore,
870,232 is not divisible by 6

CCS3003_DRNS_SEM1_2024/2025 17
Valid Arguments
Example 1: From the single proposition

Show that q is a conclusion.


Solution:

CCS3003_DRNS_SEM1_2024/2025 18
Valid Arguments
Example 2:
• With these hypotheses:
“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 canoe trip, then we will be home by
sunset.”
• Using the inference rules, construct a valid argument for
the conclusion:
“We will be home by sunset.”

Solution:
1. Choose propositional variables:
p : “It is sunny this afternoon.”
r : “We will go swimming.”
t : “We will be home by sunset.”
q : “It is colder than yesterday.”
s : “We will take a canoe trip.”
2. Translation into propositional logic:

CCS3003_DRNS_SEM1_2024/2025 19
Validity of Argument
Demonstrate the validity of the argument:
p→r
p → q
q→s
p→r r →  p
¬r → s
p → q r → q
q→s r → s
 r → s

Steps Reasons
1) p → r Premise
2) r → p Step (1) and p → r ≡ r → p (contrapositive of (1))
3) p → q Premise
4) r → q Steps (2) and (3) and transitivity
5) q → s Premise
6) r → s Steps (4) and (5) and the transitivity

CCS3003_DRNS_SEM1_2024/2025 20
Validity of the argument
Establish the validity of the argument
p→q
q → (r  s)
r  (t  u)
pt
u

Steps Reasons
1) p → q Premise
2) q → (r  s) Premise
3) p → (r  s) Steps (1) and (2) and transitivity
4) p  t Premise
5) p Simplification on (4)
6) r  s Steps (5) and (3) and the modus ponens
7) r Simplification on (6)
8) r  (t  u) Premise
9) t  u Step (7) and (8), and elimination
10) t Step (4) and simplification
11) u Steps (9) and (10) and elimination

CCS3003_DRNS_SEM1_2024/2025 21
CCS3003_DRNS_SEM1_2024/2025 22
SCL
Solve the following quests and present your answers
afterwards.
Work in a group of 5

CCS3003_DRNS_SEM1_2024/2025 23
SCL - Class Activity 1
What rule of inference is used in each of these arguments?
a) Alice is a mathematics major. Therefore, Alice is either a mathematics major or a
computer science major.
b) Jerry is a mathematics major and a computer science major. Therefore, Jerry is a
mathematics major.
c) If it is rainy, then the pool will be closed. It is rainy. Therefore, the pool is closed.
d) If it snows today, the university will close. The university is not closed today.
Therefore, it did not snow today.
e) If I go swimming, then I will stay in the sun too long. If I stay in the sun too long,
then I will sunburn. Therefore, if I go swimming, then I will sunburn.

CCS3003_DRNS_SEM1_2024/2025 24
SCL - Class Activity 2
You are about to leave for school in the morning and discover 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.
Using rules of inference determine where are the glasses?

CCS3003_DRNS_SEM1_2024/2025 25
Solution: Class Activity 2
Using
𝒑 − I was reading the newspaper in the kitchen.
𝒒 − My glasses are on the kitchen table.
𝒓 − I saw my glasses at breakfast.
𝒔 − I was reading the newspaper in the living room.
𝒕 − My glasses are on the coffee table.

1. 𝑝 → 𝑞 premise
2. 𝑞 → 𝑟 premise
3. 𝑝 → 𝑟 by transitivity of (1) & (2)
4. ¬𝑟 premise
5.¬𝑝 by modus tollens of (3) & (4)
6. 𝑠 ∨ 𝑝 premise
7. 𝑠 by elimination of (5) & (6)
8. 𝑠 → 𝑡 premise
9. ∴ 𝑡 by modus ponens of (7) & (8) Hence, the glasses are on the coffee table!

CCS3003_DRNS_SEM1_2024/2025 26
SCL - Class Activity 3
If the band could not play rock music or the refreshments were not delivered on time, then the New Year’s party would
have been canceled and Alicia would have been angry. If the party were canceled, then refunds would have had to be
made. No refunds were made. The above statement imply the conclusion the band could play rock music.

First we convert the given argument into symbolic form by using the following statement assignments:
p: The band could play rock music.
q: The refreshments were delivered on time.
r: The New Year’s party was canceled.
s: Alicia was angry.
t: Refunds had to be made.

CCS3003_DRNS_SEM1_2024/2025 27
Solution: Class Activity 3
The argument becomes:
(p  q) → (r  s)
r→t
t
p

Therefore, the band could play rock music.

CCS3003_DRNS_SEM1_2024/2025 28
SCL - Class Activity 4

• Use rules of inference to show that the hypotheses “Randy


works hard,” “If Randy works hard, then he is a dull boy,”
and “If Randy is a dull boy, then he will not get the job”
imply the conclusion “Randy will not get the job.”

CCS3003_DRNS_SEM1_2024/2025 29
Solution: Class Activity 4

CCS3003_DRNS_SEM1_2024/2025 30
SCL - Class Activity 5
Use rules of inference to show that the hypotheses:

”If it does not rain or if it is not foggy, then the sailing race will be held
and the lifesaving demonstration will go on,”, ”If the sailing race is held,
then the trophy will be awarded,” and ”The trophy was not awarded”
imply the conclusion ”It rained.”

CCS3003_DRNS_SEM1_2024/2025 31
Solution: Class Activity 5

CCS3003_DRNS_SEM1_2024/2025 32
TERIMA KASIH
THANK YOU
谢谢
Xièxiè
நன்றி
Naṉṟi
‫شكرا‬
ً
Shukran

CCS3003_DRNS_SEM1_2024/2025 33

You might also like