0% found this document useful (0 votes)
62 views36 pages

Week2 (B)

This document discusses rules of inference in logic. It begins by defining an argument and logical rules of inference. It then explains several common rules of inference like modus ponens, modus tollens, addition, simplification, conjunction, disjunctive syllogism, resolution and hypothetical syllogism. Examples are provided to illustrate how each rule works. The document concludes by defining what a formal proof is in logic.

Uploaded by

Young Coders
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)
62 views36 pages

Week2 (B)

This document discusses rules of inference in logic. It begins by defining an argument and logical rules of inference. It then explains several common rules of inference like modus ponens, modus tollens, addition, simplification, conjunction, disjunctive syllogism, resolution and hypothetical syllogism. Examples are provided to illustrate how each rule works. The document concludes by defining what a formal proof is in logic.

Uploaded by

Young Coders
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/ 36

Discrete Mathematics for

Computer Science
Department of Computer Science

Lecturer: Nazeef Ul Haq

Reference Book: Discrete Mathematics and its applications BY


Kenneth H. Rosen – 8th edition

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

◼◼ Notice that the first row is the only one where


premises are all true
9/17/2022
Discrete Structures– Fall 2022 7
Modus Ponens: Example
p → q : “If it snows today
If then we will go skiing” assumed TRUE
p : “It is snowing today”
Then q : “We will go skiing” is TRUE

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
pq Tautology: p → (p  q)

◼◼ pq Rule of Simplification


p Tautology: (p  q) → p

◼◼ p
q Rule of Conjunction
pq 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
◼◼ pq 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)

◼◼Therefore, Ed’s wallet is on his desk. (q)

9/17/2022
Discrete Structures– Fall 2022 13
Resolution
◼◼ pq Rule of Resolution
p  r Tautology:
qr [(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
pq
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

◼◼ A formal proof of a conclusion C, given


premises p1, p2,…, pn consists of a sequence
of steps, each of which applies some
inference rule to premises or previously-
proven statements to yield a new true
statement (the conclusion).

◼◼ A proof demonstrates that if the premises


are true, then the conclusion is true.

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.”

◼◼ Given these premises, prove the conclusion


“We will be home by sunset” using
inference rules.
9/17/2022
Discrete Structures– Fall 2022 18
Proof Example cont.
◼◼ Step 1: Identify the propositions (Let us adopt
the following abbreviations)
◼◼ sunny = “It is sunny”; cold = “It is cold”;
swim = “We will swim”; canoe = “We will
canoe”; sunset = “We will be home by
sunset”.
◼◼ Step 2: Identify the argument. (Build the
argument form)
sunny  cold It is not sunny and it is cold.
swim → sunny We will swim only if it is sunny.
swim → canoe If we do not swim, then we will canoe.
canoe → sunset If we canoe, then we will be home by sunset.

 sunset We will be home by sunset.


9/17/2022
Discrete Structures– Fall 2022 19
Proof Example cont.
◼◼ Step 3: Verify the reasoning using the rules
of inference sunny  cold
swim → sunny
swim → canoe
Step Proved by canoe → sunset
1. sunny  cold Premise #1.  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!

◼◼ Fallacy of affirming the conclusion:


◼◼“p → q is true, and q is true, so p must be
true.” (No, because F → T is true.)
◼◼ Example

◼◼ If David Cameron (DC) is president of the US,


then he is at least 40 years old. (p → q)
◼◼ DC is at least 40 years old. (q)

◼◼ Therefore, DC is president of the US. (p)

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

false.” (No, again because F → T is true.)


◼◼ Example
◼◼If a person does arithmetic well then his/her

checkbook will balance. (p → q)


◼◼I cannot do arithmetic well. (p)

◼◼Therefore my checkbook does not balance.

(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)

◼◼ P(c) (for an arbitrary element c of the domain)


x P(x)

◼◼ x P(x)
P(c) (substitute an element c for which P(c) is true)

◼◼ P(c) (for some element c in the domain)


x P(x)
9/17/2022
Discrete Structures– Fall 2022 23
Example
◼◼ Every man has two legs. John Smith is a man.
Therefore, John Smith has two legs.
◼◼ Proof

◼◼ Define the predicates:

◼◼M(x): x is a man

◼◼L(x): x has two legs

◼◼J: John Smith, a member of the universe

◼◼ The argument becomes

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)

◼◼ Note: Using the rules of inference requires


lots of practice.
◼◼Try example problems in the textbook.

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: John is intelligent.


9/17/2022
Discrete Structures– Fall 2022 26
Answer
◼◼ Next, translate the example in logic notation.
◼◼ Premise 1: At least one of the 20 students in the
class is intelligent.
Let the domain = all people
C(x) = “x is in the class”
I(x) = “x is intelligent”
Then Premise 1 says: x(C(x)  I(x))
◼◼ Premise 2: John is a student of this class.
Then Premise 2 says: C(John) x (C(x)  I(x))
◼◼ And the Conclusion says: I(John)
C(John)
 I(John)
9/17/2022
Discrete Structures– Fall 2022 27
x (C(x)  I(x))
C(John)
Answer (cont’d)  I(John)

◼◼ No, the argument is invalid; we can disprove it


with a counter-example, as follows:
◼◼ Consider a case where there is only one intelligent
student A in the class, and A  John.
◼◼ Then by existential instantiation of the premise

x (C(x)  I(x)), C(A)  I(A) is true,


◼◼ But the conclusion I(John) is false, since A is

the only intelligent student in the class, and


John  A.
◼◼ Therefore, the premises do not imply the

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.

◼◼Premise 2: Mike is a TA.

◼◼ Conclusion: Mike composes 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

◼◼Let T(x) = “x is a TA”

◼◼Let E(x) = “x composes easy quizzes”

◼◼Then Premise 1 says: x(T(x) → E(x))

◼◼ Premise 2: Mike is a TA.


◼◼Let M = Mike

◼◼Then Premise 2 says: T(M)


x (T(x) → E(x))
T(M)
◼◼ And the Conclusion says: E(M)  E(M)
9/17/2022
Discrete Structures– Fall 2022 30
The Proof in Gory Detail
◼◼ The argument is correct, because it can be reduced
to a sequence of applications of valid inference
rules, as follows: x (T(x) → E(x))
T(M)
 E(M)

◼◼Statement How obtained


1. x(T(x) → E(x)) (Premise #1)
2.T(M) → E(M) (Universal Instantiation)
3.T(M) (Premise #2)
4.E(M) (Modus Ponens from #2 and #3)
9/17/2022
Discrete Structures– Fall 2022 31
Applications of Logic

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

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy