0% found this document useful (0 votes)
23 views38 pages

DS Lecture 5-2

Uploaded by

Mohsin Rasheed
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)
23 views38 pages

DS Lecture 5-2

Uploaded by

Mohsin Rasheed
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/ 38

Department Of Computer Science, CUI

Lahore Campus

CSC102 - Discrete Structures


By
Mahwish Waqas
10/13/2022 CSC102 - Discrete Structures 2

Lecture Outline

• Rules of Inference
• What is an argument and argument form?
• Rules of inference
• Proof using rules of Inference
• Fallacy
10/13/2022 CSC102 - Discrete Structures 3

Rules of Inference
• Rules of inference are templates for constructing valid
arguments.
• Rules of inference are basic tools for establishing the truth
of statements.
• Valid means that the conclusion of the argument must
follow from the truth of the preceding statements of the
argument.
10/13/2022 CSC102 - Discrete Structures 4

Argument
• An Argument is a sequence of propositions.

1. If you have the current password,


then
you can log onto the network.”
2. “You have a current password.”
Therefore,
3. “You can log onto the network.”
10/13/2022 CSC102 - Discrete Structures 5

Premises and Conclusion

1. If you have the current


password, then you can log onto Premises
the network.”
2. “You have a current password.”

Therefore,
3. “You can log onto the network.” Conclusion

• All but the final proposition are called premises.


• The final proposition is called the conclusion.
10/13/2022 CSC102 - Discrete Structures 6

Valid Arguments

1. If you have the current


password, then you can log onto
Premises true
the network.”
2. “You have a current password.”
Therefore,

3. “You can log onto the network.” Conclusion true

• An argument is valid if the truth of all premises


implies that conclusion is true.
10/13/2022 CSC102 - Discrete Structures 7

Valid Arguments

• An Argument form in propositional logic is sequence of


compound propositions involving propositions variables.
An argument form is valid if no matter which particular
propositions are substituted for the propositional variables
in its premises, the conclusion is true if the premises are
all true.
10/13/2022 CSC102 - Discrete Structures 8

Valid Arguments
1. If you have the current password, then you can log onto
the network.”
2. “You have a current password.”
Therefore,
3. “You can log onto the network.”
10/13/2022 CSC102 - Discrete Structures 9

Valid Arguments (Argument Form)


1. If you have the current password, then you can log onto
the network.”
2. “You have a current password.”
Therefore,
3. “You can log onto the network.”
Argument form:
Hypothesis 1
1. If p, then q p→q
2. p p Hypothesis 2
therefore
3. q q q Conclusion
10/13/2022 CSC102 - Discrete Structures 10

Modus Ponens

• The tautology (p  (p→q)) → q is basis of modus ponens.

p q p→q p(p→q)) (p(p→q)) → q


T T T T T
T F F F T
F T T F T
F F T F T

p
p→q
q
10/13/2022 CSC102 - Discrete Structures 11

Modus Ponens

• The tautology (p  (p→q)) → q is basis of modus ponens.


• In particular, modus ponens tells us that if a conditional
statement and the hypothesis of this conditional statement
are both true, then the conclusion must also be true.
10/13/2022 CSC102 - Discrete Structures 12

Modus Ponens Example


• Assume you are given the following two statements:
• “you are in this class”
• “if you are in this class, you will get a grade”

• Let p = “you are in this class”


• Let q = “you will get a grade”
10/13/2022 CSC102 - Discrete Structures 13

Modus Ponens Example


• Assume you are given the following two statements:
• “you are in this class”
• “if you are in this class, you will get a grade”

• Let p = “you are in this class”


• Let q = “you will get a grade”

• By Modus Ponens, you can conclude that “you will get a


grade”.
10/13/2022 CSC102 - Discrete Structures 14

Modus Ponens Example


• Consider the following statements
• “If it snows today, then we will stay at home”
• “It is snowing today”

• Let p = “it is snowing today”


• Let q =“we will stay at home”
10/13/2022 CSC102 - Discrete Structures 15

Modus Ponens Example


• Consider the following statements
• “If it snows today, then we will stay at home”
• “It is snowing today”

• Let p = “it is snowing today”


• Let q =“we will stay at home”

• By Modus Ponens, you can conclude that “We will stay at


home”.
10/13/2022 CSC102 - Discrete Structures 16

Modus Tollens
• Assume that we know: ¬q and p → q
• Recall that p → q  ¬q → ¬p
• Thus, we know ¬q and ¬q → ¬p
• We can conclude ¬p

q
p→q
p
10/13/2022 CSC102 - Discrete Structures 17

Modus Tollens Example


• Assume you are given the following two statements:
• “you will not get a grade”
• “if you are in this class, you will get a grade”

• Let p = “you are in this class”


• Let q = “you will get a grade”
10/13/2022 CSC102 - Discrete Structures 18

Modus Tollens Example


• Assume you are given the following two statements:
• “you will not get a grade”
• “if you are in this class, you will get a grade”

• Let p = “you are in this class”


• Let q = “you will get a grade”

• By Modus Tollens, you can conclude that you are not in


this class
10/13/2022 CSC102 - Discrete Structures 19

Addition & Simplification


• Addition: If you know that p is true, then p  q will
ALWAYS be true i.e. p → p  q
p
pq

• Simplification: If p  q is true, then p will ALWAYS be true


i.e. p  q → p
pq
p
10/13/2022 CSC102 - Discrete Structures 20

Addition Example
• Assume you are given the following statements:
• “ It is below freezing now. Therefore, it is either below
freezing or raining now”

• Let p = “It is below freezing now”.


• Let q = “It is raining now”.

• Then this argument is of the form


p
pq
10/13/2022 CSC102 - Discrete Structures 21

Simplification Example
• Assume you are given the following statements:
• “ It is below freezing and raining now. Therefore, it is
below freezing now”

• Let p = “It is below freezing now”.


• Let q = “It is raining now”.

• This argument is of the form


pq
p
10/13/2022 CSC102 - Discrete Structures 22

Hypothetical Syllogism
• If p → q is true, and q → r is true, then p → r must be true

p→q
q→r
∴p→r
10/13/2022 CSC102 - Discrete Structures 23

Hypothetical Syllogism Example


• Assume you are given the following statements:
• If it rains today, then we will not have a barbecue today. If
we do not have a barbecue today, then we will have a
barbecue tomorrow. Therefore, if it rains today, then we
will have a barbecue tomorrow.
10/13/2022 CSC102 - Discrete Structures 24

Hypothetical Syllogism Example


• Assume you are given the following statements:
• If it rains today, then we will not have a barbecue today. If
we do not have a barbecue today, then we will have a
barbecue tomorrow. Therefore, if it rains today, then we
will have a barbecue tomorrow.

• Let p = “It is raining today,”


• Let q = “We will not have a barbecue today,”
• Let r =“We will have a barbecue tomorrow.”
10/13/2022 CSC102 - Discrete Structures 25

Hypothetical Syllogism Example


• Assume you are given the following statements:
• If it rains today, then we will not have a barbecue today. If we
do not have a barbecue today, then we will have a barbecue
tomorrow. Therefore, if it rains today, then we will have a
barbecue tomorrow.

• Let p = “It is raining today,”


• Let q = “We will not have a barbecue today,”
• Let r =“We will have a barbecue tomorrow.”

• Then this argument is of the form


p→q
q→r
∴p→r
10/13/2022 CSC102 - Discrete Structures 26

Exercise
• 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.
Addition
b) Jerry is a mathematics major and a computer science
major. Therefore, Jerry is a mathematics major.
Simplification
c) If it is rainy, then the pool will be closed. It is rainy.
Therefore, the pool is closed.
Modus Ponens
10/13/2022 CSC102 - Discrete Structures 27

Exercise

d) If it snows today, then university will close. The


university is not closed today. Therefore, it did not snow
today.
Modus Tollens
d) 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.
Hypothetical Syllogism
10/13/2022 CSC102 - Discrete Structures 28

Steps for Proof

• Identify the atomic propositions and represent using


propositional variable.
• Make the argument from
• Proof using rules of inference
10/13/2022 CSC102 - Discrete Structures 29

Example Proof
• We have the 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”
• Can it lead to the conclusion that “we will be home by
sunset”?
• (( s  c)  (m → s)  ( m → t)  (t → h)) → h ???
• Where
• s = “It is sunny this afternoon”; c = “it is colder than yesterday”
• m = “We will go swimming”; t = “we will take a canoe trip”
• h = “we will be home by sunset”
10/13/2022 CSC102 - Discrete Structures 30

H1: s  c
Example of Proof H2: m→s
H3: m → t
1. ¬s  c 1st hypothesis H4 t →h

2. ¬s Simplification using step 1 C:  h

3. m→s 2nd hypothesis


4. ¬m Modus tollens using steps 2 & 3
5. ¬m → t 3rd hypothesis
6. t Modus ponens using steps 4 & 5
7. t→h 4th hypothesis
8. h Modus ponens using steps 6 & 7
10/13/2022 CSC102 - Discrete Structures 31

Example Proof

• “If it does not rain or it is not foggy, then the sailing race
will be held and the lifesaving demonstration will go on”
• ( r   f) → (s  d)
• “If the sailing race is held, then the trophy will be
awarded”
• s→t
• “The trophy was not awarded”
• t
H1: (r  f ) → ( s  d )
• Can you conclude: “It rained”?
H2: s → t
H3: t
C: r
10/13/2022 CSC102 - Discrete Structures 32

H1: (r  f ) → ( s  d )
Example of Proof H2: s → t
H3: t
1. ¬t 3rd hypothesis
2. s→t 2nd hypothesisC: r
3. ¬s Modus tollens using steps 1 & 2
4. (¬r¬f)→(sd) 1st hypothesis
5. ¬(sd)→¬(¬r¬f) Contrapositive of step 4
6. (¬s¬d)→(rf) DeMorgan’s law and double
negation law
7. ¬s¬d Addition from step 3
8. rf Modus ponens using steps 6 & 7
9. r Simplification using step 8
10/13/2022 CSC102 - Discrete Structures 33

Fallacies
• Several common fallacies arise in incorrect arguments.

• The proposition 𝑝 → 𝑞 ∧ 𝑞 → 𝑝 is not a tautology,


because it is false when p is false and q is true.

• There are many incorrect arguments that treat this as a


tautology

• This type of incorrect reasoning is called the fallacy of


affirming the conclusion
10/13/2022 CSC102 - Discrete Structures 34

Example
• Consider the following argument
• If you do the every problem in this book, then you will
learn discrete mathematics. You learned discrete
mathematics
Therefore
You did every problem in this book
Let p = “you do the every problem in this book”
q = “you learned discrete mathematics”
p→q
q
p
10/13/2022 CSC102 - Discrete Structures 35

Summary: Rules of Inference


Rules of Inference Tautology Name
p (p ∧ (p → q)) → q Modus ponens
p→q
∴q
¬q (¬q ∧ (p → q))→¬p Modus tollens
p→q
∴ ¬p
p→q ((p → q) ∧ (q → r)) → (p Hypothetical syllogism
q→r → r)
∴p→r
p∨q ((p ∨ q)∧¬p) → q Disjunctive syllogism
¬p
∴q
10/13/2022 CSC102 - Discrete Structures 36

Summary: Rules of Inference


Rules of Inference Tautology Name
p p → (p ∨ q) Addition
∴p∨q
p∧q (p ∧ q) → p Simplification
∴p
p ((p) ∧ (q)) → (p ∧ q) Conjunction
q
∴p∧q
p∨q ((p ∨ q) ∧ (¬p ∨ r)) → (q Resolution
¬p ∨ r ∨ r)
∴q∨r
10/13/2022 CSC102 - Discrete Structures 37

Example Proof
• We have hypotheses
“If you send me an e-mail message, then I will finish writing the
program,”
“If you do not send me an e-mail message, then I will go to sleep
early,”
“If I go to sleep early, then I will wake up feeling refreshed”
The conclusion “If I do not finish writing the program, then I will wake
up feeling refreshed.”
H1: p → q
• Let p = “You send me an e-mail message,”
• q = “I will finish writing the program,”
H2: p → r
• r = “I will go to sleep early,” H3: r → s
• s = “I will wake up feeling refreshed.”
C: q → s
10/13/2022 CSC102 - Discrete Structures 38

H1: p → q
Example Proof H2: p → r
H3: r→s
C: q → s
1. p → q 1st Hypothesis
2. ¬q →¬p Contrapositive of 1
3. ¬p → r 2nd Hypothesis
4. ¬q → r Hypothetical syllogism using 2 and 3
5. r → s 3rd Hypothesis
6. ¬q → s Hypothetical syllogism using 4 and 5

You might also like