1 / 38

Original author of the slides: Vadim Bulitko University of Alberta http://www.cs.ualberta.ca/~bulitko/W04 Modified by T.

Original author of the slides: Vadim Bulitko University of Alberta http://www.cs.ualberta.ca/~bulitko/W04 Modified by T. Andrew Yang ( yang@uhcl.edu ). Ch. 3.5, 3.6, 3.7, 3.8. Floor & ceiling Proof by contradiction and contraposition Infinitude of primes Irrationality of sqrt(p).

eyal
Download Presentation

Original author of the slides: Vadim Bulitko University of Alberta http://www.cs.ualberta.ca/~bulitko/W04 Modified by T.

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Original author of the slides: Vadim Bulitko University of Alberta http://www.cs.ualberta.ca/~bulitko/W04 Modified by T. Andrew Yang (yang@uhcl.edu)

  2. Ch. 3.5, 3.6, 3.7, 3.8 • Floor & ceiling • Proof by contradictionand contraposition • Infinitude of primes • Irrationality of sqrt(p)

  3. Floor & Ceiling • Definitions • Different from the textbook’s • floor(x) = max{nZ st nx} • ceiling(x) = min{nZ st nx} • Examples • floor(5.75) • 5 • floor(-5.75) • -6 • ceiling(5.75) • 6 • ceiling(-5.75) • -5 floor(x) x ceiling(x)

  4. Equivalence to text’s defs and more • Theorem • For any xR-Z, floor(x) and ceiling(x) are defined, unique, and ceiling(x)=floor(x)+1 • Proof • Part 1: existence • Part 2: uniqueness • Part 3: relationship • Corollary • xR [floor(x)  x < floor(x)+1] • xR [ceiling(x)-1 < x  ceiling(x)]

  5. Lemma Galore… • mZ floor(m)=ceiling(m)=m • x,yR ceiling(x+y)ceiling(x)+ceiling(y) • xR mZ floor(x+m)=floor(x)+m • nZ [floor(n/2)=n/2 iff n is even] and [floor(n/2)=(n-1)/2 iff n is odd]

  6. Types of Proofs • Many interesting statements are of the type: n S(n) • Two primary proof methods: • Direct • Take an arbitrary n, prove S(n), generalize • If S(n)  P(n)Q(n) • Then can prove ~Q(n)~P(n) instead • Indirect • Show that n ~S(n) would lead to a contradiction

  7. Contraposition & Contradiction • Suppose the statement to prove is: n [ P(n)Q(n) ] • Direct proof by contraposition: • Take an arbitrary (but generic) n • Show that if ~Q(n) holds for that n then ~P(n) holds • Indirect proof (by contradiction): • Assume P(n) and ~Q(n) hold for some n • Show ~P(n) • Contradiction : cannot have P(n) and ~P(n)

  8. Illustration • If n2 is even then n is even n [ P(n)Q(n) ] P(n) = n2 is even Q(n) = n is even • Direct proof by contraposition: • Assume ~Q(n) : n is not even • n is odd • Then n=2k+1 • n2=4k2+4k+1 • n2is odd : n2is not even : ~P(n)

  9. Illustration • If n2 is even then n is even n [ P(n)Q(n) ] • Indirect proof (by contradiction): • Assume P(n) and ~Q(n) • n2is even • n is not even : n is odd • Then n=2k+1 • n2=4k2+4k+1 • n2is odd : n2is even : contradiction

  10. The third proof • Theorem: n2 is even  n is even • How about a direct proof without contraposition? • Proof • Assume n2 is even • 2 | n2 • p|ab  p|a v p|b (Euclid’s 1st theorem) • 2|n v 2|n • Then n is even

  11. Infinitude of Primes • There is no greatest prime: n m [ prime(n)  m>n & prime(m) ] • Theorem 3.7.4 in the book • Will prove three lemmas first…

  12. Lemma 0 • If p|a and p|a+1 then p=1 v p=-1 • Proof • direct • p|a  a=pn • p|a+1  a+1=pm • p(m-n)=1 • p=+1 v p=-1 (proved before)

  13. Lemma 1 • For any integer a and a prime p if p|a then ~(p|a+1) • Proof • indirect • Suppose such prime p exists • p|a and p|a+1 • Then by Lemma 0: p=+1 or p=-1 • p cannot be prime • contradiction

  14. Lemma 2 • A natural n>1 is not prime iff there is a prime p<n such that p|n • Proof (direct): •  • If n is not prime then it has non-trivial divisors (proved before) • Then one of them has a prime factor p (proved before) •  • Know that p<n and p|n • Then p is a non-trivial factor of n • Thus n is not prime

  15. Proof: Infinitude of Primes • Indirect (i.e., by contradiction) • Suppose not • Then • n m [ prime(n) & (mn v ~prime(m)) ](*) • Thus, denote the only primes as p1, …, pk (that is, pk is n above) • Then consider m=p1*p2* … *pk + 1 • m>pi • m>n=pk • Is prime(m)? • None of the primes pi divides it (by lemma 2) • But there are no other prime numbers (by supposition) • Thus, m is a prime (by lemma 1) • Contradiction with (*) • c.f., the proof on p.183

  16. Irrationality of sqrt(2) • Define sqrt(x)=y such that yR, y*y=x • Let’s prove that sqrt(2) is irrational • Proof • Indirect (by contradiction) • Suppose not: sqrt(2)=n/m and hcf(n,m)=1 • Then 2=n2/m2, 2m2=n2 • n2is even  n is even (proved earlier) • Then 2m2=4k2 • Then m2is even and so m is even • Thus, hcf(n,m) is at least 2 • Contradiction

  17. Questions?

  18. Divisibility • Integers n, d; d0 • d (wholly) divides n • d is a divisor of n • d is a factor of n • n is a multiple of d • n is divisible by d • d | n • iff: • kZ [ n=dk ]

  19. Positive Divisors • If a|b and a,b>0 then ab • prove • prime(n) iff (n>1 &n’s only positive divisors are 1 and n) • prove

  20. Properties • Transitivity: • a|b, b|c  a|c • Reflexivity: • a|a • Anti-symmetry (for naturals): • a|b & b|a  a=b • Let’s prove this

  21. Quotient-remainder Theorem • For any integer n • For any integer d>0 • There exist unique integers q and r • Such that • n=dq+r • 0r<d • q is the quotient : q=n div d • r is the remainder : r=n mod d

  22. Highest Common Factor • Consider integers a>0, b>0 • Consider set F(a,b)={xZ s.t. x|a & x|b} • xF(a,b) [ xa & xb ] • So F(a,b) is upper bounded thus has a maximum element (by the well-ordering principle) • Call max F(a,b)highest common factor: • hcf(a,b) • Also called gcd (greatest common divisor)

  23. Example

  24. Euclid’s Algorithm Idea • Works fine for small numbers • What about hcf(4453,1314) ? • Here is an idea: • Lemma.a>b, a=qb+r then hcf(a,b)=hcf(b,r) • Proof. • Consider F(a,b)={x st x|a & x|b} • Consider F(b,r)={x st x|r & x|b} • If x1F(b,r) then x1|a, thusx1F(a,b) • If x2F(a,b) then x2|r, thusx2F(b,r)

  25. Euclid’s Algorithm

  26. Euclid’s Algorithm

  27. Flow Chart

  28. Correctness • The algorithm is correct: • For any valid inputs • It terminates in a finite amount of time • And produces a correct output • Challenge: • Prove this at home • Must be your original proof

  29. Another Example

  30. Going Back

  31. Going Back

  32. Corollary • For any integer p,q (one of them is not 0) • If • h=hcf(p,q) • then • there exist integers x,y s.t. xp+qy=h

  33. Factoring • Finding divisors (factors) of a number is called factoring • A straightforward but expensive operation (recall the RSA challenges) • Consider 24: • 24=1*24 • 24=(-1)*(-24) • 24=(-1)*4*2*(-3) • … • Is there a “canonical” representation?

  34. Fundamental Theorem Of Arithmetic • Any integer z0 can be represented as: • z = (-1)k p1k1 p2k2 … pnkn • where: • p1<…<pn are prime numbers • k is 0 or 1 • k1,…,kn are natural >0 • This factorization is unique • Examples: • 24=(-1)0 23 31 • -7=(-1)1 71

  35. Proof (existence) • Let’s prove that for any nZ, n>0 such a representation exists • Steps: • Lemma 0. There are n integers between 1 and n • Lemma 1. Non-trivial factors of a natural n are strictly less than n • Lemma 2. Every integer n>1 is divisible by a prime number • Corollary: can get exclusively prime factors for n>1

  36. Proof (uniqueness) • Let’s prove that such representation is unique • Steps: • Lemma 3. If h=hcf(p,q) then there exist integers x,y s.t. xp+qy=h • Lemma 4 (E1stT). If p|ab and prime(p) then p|a or p|b • Proof: • Suppose not. Then two different factorizations exist • Then arrive at a contradiction

  37. Further Information • Lecture notes (we reproduced some parts from): • http://www.mat.bham.ac.uk/P.J.Flavell/teaching/Foundation/LectureNotes/ • Some background: • http://mathworld.wolfram.com/EuclidsTheorems.html • How to discover the proof: • http://www.dpmms.cam.ac.uk/~wtg10/FTA.html

  38. Questions?

More Related