Week2 (B)
Week2 (B)
Computer Science
Department of Computer Science
9/17/2022
Discrete Structures– Fall 2022 1
1.5 Rules of Inference
◼◼An argument: is a list of statements called premises
(or assumptions or hypotheses) followed by a
statement called the conclusion.
◼◼ Some forms of argument (“valid”) never lead from
correct statements to an incorrect conclusion. Some
other forms of argument (“fallacies”) can lead from
true statements to an incorrect conclusion.
◼◼ A logical argument consists of a list of (possibly
compound) propositions called premises/hypotheses
and a single proposition called the conclusion.
◼◼ Logical rules of inference: methods that depend on
logic alone for deriving a new statement from a set of
other statements. (Templates for constructing valid
9/17/2022
Discrete Structures–arguments.)
Fall 2022 2
Valid Arguments (I)
◼◼ Example: A logical argument
If I dance all night, then I get tired.
I danced all night.
Therefore I got tired.
◼◼ Logical representation of underlying variables:
p: I dance all night. q: I get tired.
◼◼ Logical analysis of argument:
p→q premise 1
p premise 2
q conclusion
9/17/2022
Discrete Structures– Fall 2022 3
Valid Arguments (II)
◼◼ A form of logical argument is valid if
whenever every premise is true, the
conclusion is also true. A form of argument
that is not valid is called a fallacy.
9/17/2022
Discrete Structures– Fall 2022 4
Inference Rules: General Form
◼◼ An Inference Rule is
◼◼A pattern establishing that if we know that
a set of premise statements of certain
forms are all true, then we can validly
deduce that a certain related conclusion
statement is true.
premise 1
premise 2
···
conclusion “” means “therefore”
9/17/2022
Discrete Structures– Fall 2022 5
Inference Rules & Implication
◼◼ Each valid logical inference rule corresponds to
an implication that is a tautology.
premise 1
premise 2 Inference rule
···
conclusion
◼◼ Corresponding tautology:
((premise 1) (premise 2) ) → conclusion
9/17/2022
Discrete Structures– Fall 2022 6
Modus Ponens
◼◼ p Rule of Modus ponens “the mode of
p→q (a.k.a. law of detachment) affirming”
q
◼◼ (p (p →q)) → q is a tautology
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 → q : “If n is divisible by 3
assumed
If then n2 is divisible by 3” TRUE
p : “n is divisible by 3”
Then q : “n2 is divisible by 3” is TRUE
9/17/2022
Discrete Structures– Fall 2022 8
Modus Tollens
◼◼ q Rule of Modus tollens
p→q
“the mode of denying”
p
◼◼ (q (p →q)) → p is a tautology
◼◼ Example
p → q : “If this jewel is really a diamond
If then it will scratch glass” assumed
TRUE
q : “The jewel doesn’t scratch glass”
Then p : “The jewel is not a diamond” is TRUE
9/17/2022
Discrete Structures– Fall 2022 9
More Inference Rules
◼◼ p Rule of Addition
pq Tautology: p → (p q)
◼◼ p
q Rule of Conjunction
pq Tautology: [(p) (q)] → p q
9/17/2022
Discrete Structures– Fall 2022 10
Examples
◼◼ State which rule of inference is the basis of
the following arguments:
◼◼ It is below freezing now. Therefore, it is either
below freezing or raining now.
◼◼ It is below freezing and raining now. Therefore, it
is below freezing now.
◼◼ p: It is below freezing now.
q: It is raining now.
◼◼ p → (p q) (rule of addition)
◼◼ (p q) → p (rule of simplification)
9/17/2022
Discrete Structures– Fall 2022 11
Hypothetical Syllogism
◼◼ p→q Rule of Hypothetical syllogism
q→r Tautology:
p → r [(p → q) (q → r)] → (p → r)
Example: State the rule of inference used in
◼◼
the argument: p
q
“If it rains today, then we will not have a q
barbecue today. If we do not have a barbecue
today, then we will have a barbecue tomorrow.r
Therefore, if it rains today, then we will have a
barbecue tomorrow.” p
9/17/2022 r
Discrete Structures– Fall 2022 12
Disjunctive Syllogism
◼◼ pq Rule of Disjunctive syllogism
p
q Tautology: [(p q) (p)] → q
◼◼ Example
◼◼Ed’s wallet is in his back pocket or it is on
his desk. (p q) p q
◼◼Ed’s wallet is not in his back pocket. (p)
9/17/2022
Discrete Structures– Fall 2022 13
Resolution
◼◼ pq Rule of Resolution
p r Tautology:
qr [(p q) (p r)] → (q r)
◼◼ When q = r:
[(p q) (p q)] → q
◼◼ When r = F:
[(p q) (p)] → q (Disjunctive syllogism)
9/17/2022
Discrete Structures– Fall 2022 14
Resolution: Example
pq
p r
q r
◼◼ Example: Use resolution to show that the
hypotheses “Jasmine is skiing or it is not
r p
snowing” and “It is snowing or Bart is playing
p q
hockey” imply that “Jasmine is skiing or Bart
r q
is playing hockey”
(p q) (p r) → (q r)
9/17/2022
Discrete Structures– Fall 2022 15
Rules of Inference-- Summary
9/17/2022
Discrete Structures– Fall 2022 16
Formal Proofs
9/17/2022
Discrete Structures– Fall 2022 17
Formal Proof Example
◼◼ Suppose we have the following premises:
“It is not sunny and it is cold.”
“We will swim only if it is sunny.”
“If we do not swim, then we will canoe.”
“If we canoe, then we will be home by
sunset.”
2. sunny Simplification of 1.
3. swim → sunny Premise #2.
4. swim Modus tollens on 2 and 3.
5. swim → canoe Premise #3.
6. canoe Modus ponens on 4 and 5.
7. canoe → sunset Premise #4.
8. sunset Modus ponens on 6 and 7.
9/17/2022
Discrete Structures– Fall 2022 20
Common Fallacies
◼◼ A fallacy is an inference rule or other proof
method that is not logically valid.
◼◼A fallacy may yield a false conclusion!
9/17/2022
Discrete Structures– Fall 2022 21
Common Fallacies (cont’d)
◼◼ Fallacy of denying the hypothesis:
◼◼“p → q is true, and p is false, so q must be
(q)
9/17/2022
Discrete Structures– Fall 2022 22
Inference Rules for Quantifiers
◼◼ x P(x)
P(c) (substitute any specific member c in the domain)
◼◼ x P(x)
P(c) (substitute an element c for which P(c) is true)
◼◼M(x): x is a man
1. x [M(x) → L(x)]
2. M(J)
L(J)
9/17/2022
Discrete Structures– Fall 2022 24
x (M(x) → L(x))
Example cont. M(J)
L(J)
◼◼ The proof is
1. x [M(x) → L(x)] Premise 1
2. M(J) → L(J) U. I. from (1)
3. M(J) Premise 2
4. L(J) Modus Ponens from (2) and (3)
9/17/2022
Discrete Structures– Fall 2022 25
Another example
◼◼ Correct or incorrect: “At least one of the
20 students in the class is intelligent.
John is a student of this class.
Therefore, John is intelligent.”
◼◼ First: Separate premises from conclusion
◼◼ Premises:
1. At least one of the 20 students in the
class is intelligent.
2. John is a student of this class.
conclusion.
9/17/2022
Discrete Structures– Fall 2022 28
More Proof Examples
◼◼ Is this argument correct or incorrect?
◼◼“All TAs compose easy quizzes.
Mike is a TA.
Therefore, Mike composes easy quizzes.”
◼◼ First, separate the premises from conclusion:
◼◼Premise 1: All TAs compose easy quizzes.
9/17/2022
Discrete Structures– Fall 2022 29
Answer
◼◼ Next, re-render the example in logic notation.
◼◼ Premise 1: All TAs compose easy quizzes.
◼◼Let the domain = all people
9/17/2022
Discrete Structures– Fall 2022 32
Applications of Logic
9/17/2022
Discrete Structures– Fall 2022 33
Applications of Logic
9/17/2022
Discrete Structures– Fall 2022 34
Applications of Logic
9/17/2022
Discrete Structures– Fall 2022 35
Applications of Logic
◼◼ Construct circuit for the Boolean expression (P∧Q) ∨ ~R
9/17/2022
Discrete Structures– Fall 2022 36