Discrete Structures: Rules of Inference
Discrete Structures: Rules of Inference
Discrete Structures: Rules of Inference
Rules of inference
Prof. Mohsin Riaz
1
Rules of Inference
Valid Arguments in Propositional Logic
Assume you are given the following two
statements:
“if you are in this class, then you will get a grade”
“you are in this class”
Therefore,
“You will get a grade”
2
Modus Ponens
(Latin for “the way that affirms by affirming”
4
Modus Tollens
(Latin for "the way that denies by denying")
● 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”
5
Addition
• If you know that p is true, then p q will
ALWAYS be true i.e. p → p q
6
Addition
• If you know that p is true, then p q will
ALWAYS be true i.e. p → p q
8
Simplification
• If p q is true, then p will ALWAYS be true i.e.
pq→p
11
Resolution
13
Rules of Inference to Build Arguments
• 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
_______________________________
• We will be home by sunset (Conclusion)
• p: It is sunny this afternoon
• q: It is colder than yesterday
• r: We will go swimming
• s: We will take a canoe trip
• t: We will be home by sunset
14
Rules of Inference to Build Arguments
• 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 𝑠 → 𝑡
_______________________________
• We will be home by sunset (Conclusion) 𝒕
• p: It is sunny this afternoon
• q: It is colder than yesterday
• r: We will go swimming
• s: We will take a canoe trip
• t: We will be home by sunset
[ ¬𝒑 ∧ 𝒒 ∧ 𝒓 → 𝒑 ∧ ¬𝒓 → 𝒔 ∧ (𝒔 → 𝒕)] → 𝒕
15
Definitions
● An Argument in propositional logic is a
sequence of propositions that end with c
conclusion.
● All except the final proposition are called
premises.
● The final proposition is called conclusion.
● An argument is valid if the truth of all
premises implies that the conclusion is true.
i.e. (𝑝1 𝑝2 … 𝑝𝑛) 𝑞 is a tautology.
Rules of Inference to Build Arguments
• [ ¬𝒑 ∧ 𝒒 ∧ 𝒓 → 𝒑 ∧ ¬𝒓 → 𝒔 ∧ (𝒔 → 𝒕)] → 𝒕
𝒑∧𝒒 → 𝒑
17
Rules of Inference to Build Arguments
• [ ¬𝒑 ∧ 𝒒 ∧ 𝒓 → 𝒑 ∧ ¬𝒓 → 𝒔 ∧ (𝒔 → 𝒕)] → 𝒕
18
Rules of Inference to Build Arguments
• [ ¬𝒑 ∧ 𝒒 ∧ 𝒓 → 𝒑 ∧ ¬𝒓 → 𝒔 ∧ (𝒔 → 𝒕)] → 𝒕
19
Rules of Inference to Build Arguments
• [ ¬𝒑 ∧ 𝒒 ∧ 𝒓 → 𝒑 ∧ ¬𝒓 → 𝒔 ∧ (𝒔 → 𝒕)] → 𝒕
20
• 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
____________________________________
• If I do not finish writing the program, then I
will wake up feeling refreshed
21
• 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 𝒓 → 𝒔
____________________________________
• If I do not finish writing the program, then I will wake
up feeling refreshed ¬𝒒 → 𝒔
[ 𝒑 → 𝒒 ∧ ¬𝒑 → 𝒓 ∧ 𝒓 → 𝒔 ] → (¬𝒒 → 𝒔)
22
• [(𝒑 → 𝒒) ∧ (¬𝒑 → 𝒓) ∧ (𝒓 → 𝒔)] → (¬𝒒 → 𝒔)
23
• [(𝒑 → 𝒒) ∧ (¬𝒑 → 𝒓) ∧ (𝒓 → 𝒔)] → (¬𝒒 → 𝒔)
24
• [(𝒑 → 𝒒) ∧ (¬𝒑 → 𝒓) ∧ (𝒓 → 𝒔)] → (¬𝒒 → 𝒔)
25
• [(𝒑 → 𝒒) ∧ (¬𝒑 → 𝒓) ∧ (𝒓 → 𝒔)] → (¬𝒒 → 𝒔)
26
• [(𝒑 → 𝒒) ∧ (¬𝒑 → 𝒓) ∧ (𝒓 → 𝒔)] → (¬𝒒 → 𝒔)
27
• Hypotheses: 𝑝 ∧ 𝑞 ∨ 𝑟 and 𝑟 → 𝑠 imply the
conclusion: 𝑝 ∨ 𝑠
• 𝒑∧𝒒 ∨𝒓 ∧ 𝒓→𝒔 →𝒑∨𝒔
• 𝑝 ∧ 𝑞 ∨ 𝑟 ≡ 𝑝 ∨ 𝑟 ∧ (𝑞 ∨ 𝑟) de Morgan’s law
• 𝑟 → 𝑠 ≡ ¬𝑟 ∨ 𝑠
• 𝑝 ∨ 𝑟 ∨ ¬𝑟 ∨ 𝑠 ≡ p ∨ 𝑠 resolution
28
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
29
Example
• If you do every problem in this book, then you
will learn discrete mathematics.
• You learned discrete mathematics.
• Therefore, you did every problem in this book.
30
• If you do every problem in this book, then you
will learn discrete mathematics.
• You learned discrete mathematics.
______________________________________
• Therefore, you did every problem in this book.
31
• If you do every problem in this book, then you
will learn discrete mathematics.
• You learned discrete mathematics.
______________________________________
• Therefore, you did every problem in this book.
• p: You did every problem in this book
• q: You learned discrete mathematics
• If 𝑝 → 𝑞 and 𝑞 then 𝑝
• 𝑝→𝑞 ∧𝑞 →𝑝
32
• If you do every problem in this book, then you will
learn discrete mathematics.
• You learned discrete mathematics.
______________________________________
• Therefore, you did every problem in this book.
• p: You did every problem in this book
• q: You learned discrete mathematics
• If 𝑝 → 𝑞 and 𝑞 then 𝑝
• 𝑝 → 𝑞 ∧ 𝑞 → 𝑝 Fallacy
• It is possible for you to learn discrete mathematics in
some way other than by doing every problem in this
book (Reading, Listening Lectures, doing some but not
all problems).
33
Rules of Inference for
Quantified Statements
34
35
36
Example
• Show that the premises:
• "Everyone in this discrete mathematics class has
taken a course in computer science" and “Aslam
is a student in this class"
• Imply the conclusion “Aslam has taken a course in
computer science.“
37
• D(x): x is in this discrete mathematics class
• C(x): x has taken a course in computer science
• Premises: ∀x(D(x) → C(x)) and D(Aslam)
• Conclusion: C(Aslam)
38
• D(x): x is in this discrete mathematics class
• C(x): x has taken a course in computer science
• Premises: ∀x(D(x) → C(x)) and D(Aslam)
• Conclusion: C(Aslam)
• Steps Reason
• ∀x(D(x) → C(x)) Premise
• D(Aslam) → C(Aslam) Universal instantiation
39
• D(x): x is in this discrete mathematics class
• C(x): x has taken a course in computer science
• Premises: ∀x(D(x) → C(x)) and D(Aslam)
• Conclusion: C(Aslam)
• Steps Reason
• ∀x(D(x) → C(x)) Premise
• D(Aslam) → C(Aslam) Universal instantiation
• D(Aslam) Premise
40
• D(x): x is in this discrete mathematics class
• C(x): x has taken a course in computer science
• Premises: ∀x(D(x) → C(x)) and D(Aslam)
• Conclusion: C(Aslam)
• Steps Reason
• ∀x(D(x) → C(x)) Premise
• D(Aslam) → C(Aslam) Universal instantiation
• D(Aslam) Premise
• C(Aslam) Modus ponens
• A→B ∧A →B 41
Example
• Show that the premises “A student in this class
has not read the book,” and “Everyone in this
class passed the first exam” imply the conclusion
“Someone who passed the first exam has not read
the book.”
42
• Show that the premises “A student in this class
has not read the book,” and “Everyone in this
class passed the first exam” imply the conclusion
“Someone who passed the first exam has not
read the book.”
• C(x): “x is in this class”
• B(x): “x has read the book”
• P(x): “x passed the first exam”
• Premises: ???
43
• Show that the premises “A student in this class
has not read the book,” and “Everyone in this
class passed the first exam” imply the conclusion
“Someone who passed the first exam has not
read the book.”
• C(x): “x is in this class”
• B(x): “x has read the book”
• P(x): “x passed the first exam”
• Premises: ∃x(C(x)∧¬B(x)) and ∀x(C(x) → P(x)).
• The conclusion???
44
• Show that the premises “A student in this class
has not read the book,” and “Everyone in this
class passed the first exam” imply the conclusion
“Someone who passed the first exam has not
read the book.”
• C(x): “x is in this class”
• B(x): “x has read the book”
• P(x): “x passed the first exam”
• Premises: ∃x(C(x) ∧¬B(x)) and ∀x( C(x) → P(x) ).
• The conclusion: ∃x( P(x) ∧¬B(x) )
45
• Premises: ∃x(C(x) ∧¬B(x)) and ∀x( C(x) → P(x) ).
• The conclusion: ∃x( P(x) ∧¬B(x) )
46
• Premises: ∃x(C(x) ∧¬B(x)) and ∀x( C(x) → P(x) ).
• The conclusion: ∃x( P(x) ∧¬B(x) )
47
• Premises: ∃x(C(x) ∧¬B(x)) and ∀x( C(x) → P(x) ).
• The conclusion: ∃x( P(x) ∧¬B(x) )
48
• Premises: ∃x(C(x) ∧¬B(x)) and ∀x( C(x) → P(x) ).
• The conclusion: ∃x( P(x) ∧¬B(x) )
49
• Premises: ∃x(C(x) ∧¬B(x)) and ∀x( C(x) → P(x) ).
• The conclusion: ∃x( P(x) ∧¬B(x) )
50
• Premises: ∃x(C(x) ∧¬B(x)) and ∀x( C(x) → P(x) ).
• The conclusion: ∃x( P(x) ∧¬B(x) )
51
• Premises: ∃x(C(x) ∧¬B(x)) and ∀x( C(x) → P(x) ).
• The conclusion: ∃x( P(x) ∧¬B(x) )
52
• Premises: ∃x(C(x) ∧¬B(x)) and ∀x( C(x) → P(x) ).
• The conclusion: ∃x( P(x) ∧¬B(x) )
53