ICS141: Discrete Mathematics For Computer Science I

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

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 7-1


University of Hawaii

Appendix to Lecture 7
Sample Proof for Example in Lecture 7
n  This time a direct proof

n  Proves a more general Theorem first


n  Employs a Lemma
n  Uses Sets Notation

ICS 141: Discrete Mathematics I – Fall 2011 7-2


Direct Proof of University of Hawaii

∀n∈Z: O(3n+2) → O(n)


n  Definitions:
n  DefOdd: O(x∈Z): ∃k∈Z: x=2k+1
n  DefEven: E(x∈Z): ∃k∈Z: x=2k
n  Theorem 1:
n  ∀n,m∈Z: O(n) ∧ E(m) → O(n+m).
n  Proof:
n  O(n) ∧ E(m)
→ ∃x∈Z: n=2x+1∧ ∃y∈Z: m=2y DefOdd, DefEven
→ ∃x,y∈Z: n+m=2x+1+2y=2(x+y)+1
→ ∃k=x+y∈Z: n+m=2k+1 DefOdd
→ O(n+m) ■
ICS 141: Discrete Mathematics I – Fall 2011 7-3
Direct Proof (cont.) of University of Hawaii

∀n∈Z: O(3n+2) → O(n)


n  Lemma: E(-2n-2)
n  -2n-2=2(-n-1)
→ ∃k=-n-1∈Z: -2n-2=2k DefEven
→ E(-2n-2) ■
n  Theorem: ∀n∈Z: O(3n+2) → O(n)
n  Proof: O(3n+2)
→ O(3n+2) ∧ E(-2n-2) Conjunction Rule, Lemma
→ O(3n+2-2n-2) Theorem 1
→ O(3n-2n+2-2)
→ O(n) ■

ICS 141: Discrete Mathematics I – Fall 2011 7-4

You might also like