0% found this document useful (0 votes)
42 views

ICS141: Discrete Mathematics For Computer Science I

This document summarizes a lecture on rules of inference and formal proofs in discrete mathematics. It introduces resolution as a rule of inference and provides an example of using resolution. It then discusses formal proofs, giving an example proof to derive the conclusion "We will be home by sunset" from given premises. Finally, it discusses common fallacies in reasoning, inference rules for quantifiers, and provides an example proof using universal and existential quantifiers.
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)
42 views

ICS141: Discrete Mathematics For Computer Science I

This document summarizes a lecture on rules of inference and formal proofs in discrete mathematics. It introduces resolution as a rule of inference and provides an example of using resolution. It then discusses formal proofs, giving an example proof to derive the conclusion "We will be home by sunset" from given premises. Finally, it discusses common fallacies in reasoning, inference rules for quantifiers, and provides an example proof using universal and existential quantifiers.
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/ 27

University of Hawaii

ICS141:
Discrete Mathematics for
Computer Science I
Dept. Information & Computer Sci., University of Hawaii

Jan Stelovsky
based on slides by Dr. Baek and Dr. Still
Originals by Dr. M. P. Frank and Dr. J.L. Gross
Provided by McGraw-Hill

ICS 141: Discrete Mathematics I - Fall 2011 6-1


University of Hawaii

Lecture 6
Chapter 1. The Foundations
1.5 Rules of Inference

ICS 141: Discrete Mathematics I - Fall 2011 6-2


Previously…
University of Hawaii

n  Rules of inference


n  Modus ponens

n  Modus tollens

n  Hypothetical syllogism

n  Disjunctive syllogism

n  Resolution

n  Addition

n  Simplification

n  Conjunction Table 1 in pp.66

ICS 141: Discrete Mathematics I - Fall 2011 6-3


Resolution
University of Hawaii

n  p∨q Rule of Resolution


¬p ∨ r Tautology:
∴q∨r [(p ∨ q) ∧ (¬p ∨ r)] → (q ∨ r)

n  When q = r:
[(p ∨ q) ∧ (¬p ∨ q)] → q
n  When r = F:
[(p ∨ q) ∧ (¬p)] → q (Disjunctive syllogism)

ICS 141: Discrete Mathematics I - Fall 2011 6-4


Resolution: Example
University of Hawaii

p∨q
¬p ∨ r
∴q∨r

n  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)
ICS 141: Discrete Mathematics I - Fall 2011 6-5
Formal Proofs
University of Hawaii

n  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).

n  A proof demonstrates that if the premises are


true, then the conclusion is true.

ICS 141: Discrete Mathematics I - Fall 2011 6-6


Formal Proof Example
University of Hawaii

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

n  Given these premises, prove the conclusion


“We will be home by sunset” using
inference rules.

ICS 141: Discrete Mathematics I - Fall 2011 6-7


Proof Example cont.
University of Hawaii

n  Step 1: Identify the propositions (Let us adopt


the following abbreviations)
n  sunny = “It is sunny”; cold = “It is cold”;
swim = “We will swim”; canoe = “We will
canoe”; sunset = “We will be home by
sunset”.
n  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.


ICS 141: Discrete Mathematics I - Fall 2011 6-8
Proof Example cont.
University of Hawaii

n  Step 3: Verify the reasoning using the rules


of inference ¬sunny ∧ cold
swim → sunny
¬swim → canoe
Step Proved by canoe → sunset
∴ sunset
1. ¬sunny ∧ cold Premise #1.
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.
ICS 141: Discrete Mathematics I - Fall 2011 6-9
Common Fallacies
University of Hawaii

n  A fallacy is an inference rule or other proof


method that is not logically valid.
n  A fallacy may yield a false conclusion!

n  Fallacy of affirming the conclusion:


n  “p → q is true, and q is true, so p must be

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


n  Example
n  If David Cameron (DC) is president of the US,
then he is at least 40 years old. (p → q)
n  DC is at least 40 years old. (q)
n  Therefore, DC is president of the US. (p)
ICS 141: Discrete Mathematics I - Fall 2011 6-10
Common Fallacies (cont’d)
University of Hawaii

n  Fallacy of denying the hypothesis:


n  “p → q is true, and p is false, so q must be

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


n  Example
n  If a person does arithmetic well then his/her

checkbook will balance. (p → q)


n  I cannot do arithmetic well. (¬p)

n  Therefore my checkbook does not balance.

(¬q)

ICS 141: Discrete Mathematics I - Fall 2011 6-11


Inference Rules for Quantifiers
University of Hawaii

n  ∀x P(x)
∴P(c) (substitute any specific member c in the domain)

n  P(c) (for an arbitrary element c of the domain)


∴∀x P(x)

n  ∃x P(x)
∴P(c) (substitute an element c for which P(c) is true)

n  P(c) (for some element c in the domain)


∴∃x P(x)

ICS 141: Discrete Mathematics I - Fall 2011 6-12


Example
University of Hawaii

n  Every man has two legs. John Smith is a man.


Therefore, John Smith has two legs.
n  Proof
n  Define the predicates:

n  M(x): x is a man

n  L(x): x has two legs

n  J: John Smith, a member of the universe

n  The argument becomes

1. ∀x [M(x) → L(x)]
2. M(J)
∴ L(J)
ICS 141: Discrete Mathematics I - Fall 2011 6-13
∀x (M(x) → L(x))
Example cont.
University of Hawaii

M(J)
∴ L(J)
n  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)

n  Note: Using the rules of inference requires


lots of practice.
n  Try example problems in the textbook.

ICS 141: Discrete Mathematics I - Fall 2011 6-14


Another example
University of Hawaii

n  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.”
n  First: Separate premises from conclusion
n  Premises:
1. At least one of the 20 students in the class
is intelligent.
2. John is a student of this class.

n  Conclusion: John is intelligent.


ICS 141: Discrete Mathematics I - Fall 2011 6-15
Answer
University of Hawaii

n  Next, translate the example in logic notation.


n  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))
n  Premise 2: John is a student of this class.
Then Premise 2 says: C(John) ∃x (C(x) ∧ I(x))
n  And the Conclusion says: I(John) C(John)
∴ I(John)
ICS 141: Discrete Mathematics I - Fall 2011 6-16
∃x (C(x) ∧ I(x))

Answer (cont’d) C(John) University of Hawaii

∴ I(John)

n  No, the argument is invalid; we can disprove it


with a counter-example, as follows:

n  Consider a case where there is only one intelligent


student A in the class, and A ≠ John.
n  Then by existential instantiation of the premise

∃x (C(x) ∧ I(x)), C(A) ∧ I(A) is true,


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

the only intelligent student in the class, and


John ≠ A.
n  Therefore, the premises do not imply the
conclusion.
ICS 141: Discrete Mathematics I - Fall 2011 6-17
More Proof Examples
University of Hawaii

n  Is this argument correct or incorrect?


n  “All TAs compose easy quizzes.

Mike is a TA.
Therefore, Mike composes easy quizzes.”
n  First, separate the premises from conclusion:
n  Premise 1: All TAs compose easy quizzes.

n  Premise 2: Mike is a TA.

n  Conclusion: Mike composes easy quizzes.

ICS 141: Discrete Mathematics I - Fall 2011 6-18


Answer
University of Hawaii

n  Next, re-render the example in logic notation.


n  Premise 1: All TAs compose easy quizzes.
n  Let the domain = all people

n  Let T(x) = “x is a TA”

n  Let E(x) = “x composes easy quizzes”

n  Then Premise 1 says: ∀x(T(x) → E(x))

n  Premise 2: Mike is a TA.


n  Let M = Mike

n  Then Premise 2 says: T(M)


∀x (T(x) → E(x))
T(M)
n  And the Conclusion says: E(M) ∴ E(M)

ICS 141: Discrete Mathematics I - Fall 2011 6-19


The Proof in Gory Detail
University of Hawaii

n  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)

n 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)
ICS 141: Discrete Mathematics I - Fall 2011 6-20
Another Example
University of Hawaii

n  Prove that the sum of a rational number and an


irrational number is always irrational.

n  First, you have to understand exactly what the


question is asking you to prove:
n  “For all real numbers x,y,

if x is rational and y is irrational,


then x+y is irrational.”
n  ∀x,y: Rational(x) ∧ Irrational(y) → Irrational(x+y)

ICS 141: Discrete Mathematics I - Fall 2011 6-21


Answer
University of Hawaii

n  Next, think back to the definitions of the terms


used in the statement of the theorem:
n  ∀ reals r : Rational(r) ↔
∃ Integer(i) ∧ Integer(j with ≠ 0): r = i/j.
n  ∀ reals r : Irrational(r) ↔ ¬Rational(r)

n  You almost always need the definitions of the


terms in order to prove the theorem!

n  Next, let’s go through one valid proof:

ICS 141: Discrete Mathematics I - Fall 2011 6-22


What you might write
University of Hawaii

n  Theorem:
∀x,y : Rational(x) ∧ Irrational(y) → Irrational(x+y)
n  Proof: Let x, y be any rational and irrational numbers,
respectively. … (universal generalization)
n  Now, just from this, what do we know about x and y?
Think back to the definition of a rational number:
n  … Since x is rational, we know (from the very definition
of rational) that there must be some integers i and j
such that x = i /j. So, let ix,jx be such integers …
n  Notice that gave them the unique names ix and jx so we
can refer to them later.

ICS 141: Discrete Mathematics I - Fall 2011 6-23


What next?
University of Hawaii

n  What do we know about y? Only that y is


irrational: ¬∃ integers i,j: y = i/j.
n  But, it’s difficult to see how to use a direct
proof in this case. So let’s try to use proof by
contradiction.
n  So, what are we trying to show?
Just that x+y is irrational.
That is, ¬∃i,j: (x + y) = i/j.
n  Now we need to hypothesize the negation of
this statement!

ICS 141: Discrete Mathematics I - Fall 2011 6-24


More writing…
University of Hawaii

n  Suppose that x+y were not irrational.


Then x + y would be rational, so ∃ integers i,j:
x + y = i /j. So, let is and js be any such
integers where x + y = is / js.
n  Now, with all these things named, we can see
what happens when we put them together.
n  So, we have that (ix/jx) + y = (is/js).
n  Notice: We have enough information now to
conclude something useful about y, by solving
this equation for it!

ICS 141: Discrete Mathematics I - Fall 2011 6-25


Finishing the Proof
University of Hawaii

n  Solving that equation for y, we have:


y = (is/js) – (ix/jx)
= (isjx – ixjs)/(jsjx)
n  Now, since the numerator and denominator of this
expression are both integers, y is rational
(by definition of a rational number).
n  This contradicts the assumption that y is irrational.
Therefore, our hypothesis that x+y is rational must
be false, and so the theorem is proved.

ICS 141: Discrete Mathematics I - Fall 2011 6-26


Example of a Wrong Answer
University of Hawaii

n  1 is rational. √2 is irrational. 1+√2 is irrational.


Therefore, the sum of a rational number and an
irrational number is irrational.
(Attempting a direct proof.)

n  Why does this answer deserve no credit?


n  We attempted to use an example to prove

a universal statement.
This is always invalid!
n  Even as an example, it’s incomplete, because

we never even proved that 1+√2 is irrational!


ICS 141: Discrete Mathematics I - Fall 2011 6-27

You might also like