Logic of Informatics
Rules of Inference
Last Lecture
• Converse
• Inverse
• Contrapositive
• Tautology
• Contradiction
What is an argument?
An argument is a sequence of statements or
premises that end in a conclusion.
Ex:
If I jump I will fall
I jump
Therefore, I will fall
q
p
q
p


This argument has the form:
Another Example
Ex:
Premise: If I eat too much, my stomach will be hurt
Premise: My stomach doesn’t hurt
Conclusion: Therefore, I don’t eat too much
p q
This argument has the form:
p q
q
p



The purpose of rules of inference
We use rules of inference to construct valid
arguments.
A valid argument is one in which it is not possible for
the conclusion to be false if the premises are true.
The argument is valid iff the truth of all premises
implies the conclusion is true
How to determine the validity of
argument?
The argument form with premises
q
p
p
p n 


 )
( 2
1 
and conclusion q
is valid when
n
p
p
p ,
,
, 2
1 
is a tautology
The Rules of Inference -
Modus Ponens
q
p
q
p


If I am late, my teacher is angry to me
I am late
Therefore, my teacher is angry to me
The Rules of Inference -
Modus Tollens
p q
q
p



If grass is blue, then trees are blue
Trees are not blue
Therefore, grass is not blue
The Rules of Inference -
Hypothetical Syllogism
p q
q r
p r


 
If today is raining, then we are late
If we are late, then our teacher will be angry
Therefore, if today is raining then our teacher will be angry
The Rules of Inference -
Disjunctive Syllogism
p q
q
p



p q
p
q



OR
My wallet is in my pocket or left behind at home
No wallet in my pocket
Therefore, my wallet left behind at home
The Rules of Inference -
Conjunction
p
q
p q
 
He takes Discrete Mathematics Lecture
He repeats Algorithms Lecture
Therefore, he takes Discrete Mathematics and repeats
Algorithms
The Rules of Inference -
Addition
p
p q
 
q
p q
 
OR
𝑝 = I like tea, 𝑞 = I like coffee
I like tea
Therefore, I like tea or coffee
The Rules of Inference -
Simplification
p q
p


p q
q


OR
I am clever in mathematic and computer science
Therefore, I am clever in mathematic
The Rules of Inference -
Dilemma
p q
p r
q r
r




Either we increase the price or we decrease the quality.
If we increase the price, sales will slump.
If we decrease the quality, sales will slump.
Therefore, sales will slump.
Exercise 1
• Determine whether the following argument is
valid / Invalid
a). P  (Q  R)
R
 P  Q
b). P  (Q  R)
Q  (P  R)
 P  R
Exercise 2
One day, you want to go to college and realized that you do not wear glasses.
Having to remember, there are some facts that you make sure the truth:
1. If the glasses are on the kitchen table, then I would have seen it as
breakfast.
2. I read the newspaper in the living room or I read it in the kitchen.
3. If I read the newspaper in the living room, then surely put my glasses on
the coffee table.
4. I do not see my glasses at breakfast time.
5. If I read a book in bed, then put my glasses on the bedside table.
6. If I read the newspaper in the kitchen, then my glasses are on the kitchen
table.
Based on these facts, prove / show that the glasses left on the coffee table!
p q

r s

r t

q

u w

s p

Exercise 3
• Prove the validity of the following arguments using
the rules of inference!
p  q
(p  q)  r
 r

Logic_of_Informatics_-_Rules_of_Inference.pptx

  • 1.
  • 2.
    Last Lecture • Converse •Inverse • Contrapositive • Tautology • Contradiction
  • 3.
    What is anargument? An argument is a sequence of statements or premises that end in a conclusion. Ex: If I jump I will fall I jump Therefore, I will fall q p q p   This argument has the form:
  • 4.
    Another Example Ex: Premise: IfI eat too much, my stomach will be hurt Premise: My stomach doesn’t hurt Conclusion: Therefore, I don’t eat too much p q This argument has the form: p q q p   
  • 5.
    The purpose ofrules of inference We use rules of inference to construct valid arguments. A valid argument is one in which it is not possible for the conclusion to be false if the premises are true. The argument is valid iff the truth of all premises implies the conclusion is true
  • 6.
    How to determinethe validity of argument? The argument form with premises q p p p n     ) ( 2 1  and conclusion q is valid when n p p p , , , 2 1  is a tautology
  • 7.
    The Rules ofInference - Modus Ponens q p q p   If I am late, my teacher is angry to me I am late Therefore, my teacher is angry to me
  • 8.
    The Rules ofInference - Modus Tollens p q q p    If grass is blue, then trees are blue Trees are not blue Therefore, grass is not blue
  • 9.
    The Rules ofInference - Hypothetical Syllogism p q q r p r     If today is raining, then we are late If we are late, then our teacher will be angry Therefore, if today is raining then our teacher will be angry
  • 10.
    The Rules ofInference - Disjunctive Syllogism p q q p    p q p q    OR My wallet is in my pocket or left behind at home No wallet in my pocket Therefore, my wallet left behind at home
  • 11.
    The Rules ofInference - Conjunction p q p q   He takes Discrete Mathematics Lecture He repeats Algorithms Lecture Therefore, he takes Discrete Mathematics and repeats Algorithms
  • 12.
    The Rules ofInference - Addition p p q   q p q   OR 𝑝 = I like tea, 𝑞 = I like coffee I like tea Therefore, I like tea or coffee
  • 13.
    The Rules ofInference - Simplification p q p   p q q   OR I am clever in mathematic and computer science Therefore, I am clever in mathematic
  • 14.
    The Rules ofInference - Dilemma p q p r q r r     Either we increase the price or we decrease the quality. If we increase the price, sales will slump. If we decrease the quality, sales will slump. Therefore, sales will slump.
  • 15.
    Exercise 1 • Determinewhether the following argument is valid / Invalid a). P  (Q  R) R  P  Q b). P  (Q  R) Q  (P  R)  P  R
  • 16.
    Exercise 2 One day,you want to go to college and realized that you do not wear glasses. Having to remember, there are some facts that you make sure the truth: 1. If the glasses are on the kitchen table, then I would have seen it as breakfast. 2. I read the newspaper in the living room or I read it in the kitchen. 3. If I read the newspaper in the living room, then surely put my glasses on the coffee table. 4. I do not see my glasses at breakfast time. 5. If I read a book in bed, then put my glasses on the bedside table. 6. If I read the newspaper in the kitchen, then my glasses are on the kitchen table. Based on these facts, prove / show that the glasses left on the coffee table! p q  r s  r t  q  u w  s p 
  • 17.
    Exercise 3 • Provethe validity of the following arguments using the rules of inference! p  q (p  q)  r  r