questions about prime numbers proving existential
play

Questions about Prime Numbers Proving Existential Statements Is 1 - PowerPoint PPT Presentation

Even/Odd Numbers CSE 20 Discrete Math An integer n is even iff n equals twice some integer. An integer n is odd iff n equals twice some integer plus 1. Summer, 2006 July 12 (Day 3) Number Theory Methods of Proof Instructor: Neil Rhodes 2


  1. Even/Odd Numbers CSE 20— Discrete Math An integer n is even iff n equals twice some integer. An integer n is odd iff n equals twice some integer plus 1. Summer, 2006 July 12 (Day 3) Number Theory Methods of Proof Instructor: Neil Rhodes 2 Questions about Even/Odd Numbers Prime Numbers Is 0 even? A prime, p , is a positive integer (greater than 1) whose only positive divisors are 1 and p � Quantified statement: Is -33 odd? A positive integer which has a positive divisor not equal one is If a and b are integers, is 6a•2b even? called composite � Quantified statement: The set of primes is infinite � ∀ x ∈ Z+, ∃ y ∈ Z+: y > x � P(y) 3 4

  2. Questions about Prime Numbers Proving Existential Statements Is 1 prime? Prove existential statement: ∃ x ∈ D: P(x) � Constructive proof – Display an x Is every integer either prime or composite? – Give a set of directions for finding x � Nonconstructive proof – Proof by contradiction (assume non-existence and show a contradiction) – Show x must exist Is there a range of integers that are either prime or composite? � Example: – In a group of 367 people, at least two share a birthday Is the set of primes infinite? 5 6 Disproving Universal Statements Proving Universal Statements Disprove universal statement: ∀ x ∈ D, P(x) Prove universal statement: ∀ x ∈ D, P(x) � Q(X) � Counterexample � Exhaustive enumeration – Show an x in D where not P(x) � Example: All primes are of the form 2 n - 1 7 8

  3. Proving Universal Statements Example of Proving Universal Statement Prove universal statement: ∀ x ∈ D, P(x) � Q(x) Prove that the square of any odd number is odd � Generalizing from the generic particular – “Suppose x is in D and P(x)” – … – Therefore Q(x) � 9 10 How to Write a Proof Proving Existential Statements Copy what is to be proved Prove existential statement: ∃ x ∈ D: P(x) � The square of any odd number is odd � Constructive proof – Display an x Start with Proof: – Give a set of directions for finding x � Nonconstructive proof The proof should be self-contained � Identify each variable (declare your variables) – Proof by contradiction (assume non-existence and show a contradiction) – Show x must exist – Suppose m is an integer � Example: – Let x be a real number greater than 2 – In a group of 367 people, at least two share a birthday Use complete sentences � Don’t just write a sequence of equations � Equations are OK, but should be embedded into sentences Give a reason for assertions you make � By the definition of even, x=2k for some integer k � Note that j is an integer since it is the sum of integers multiplied together Use connective words � Follows from previous thought � New thought � New Variable End with what was to be proved 11 12

  4. Disproving Existential Statements How to Make Mistakes in a Proof Disprove existential statement: ∃ x ∈ D: P(x) Argue from examples � Equivalent to: – Prove Use the same variable to mean two different things – Or, alternatively, – Therefore, best bet is generalizing from the generic particular. � Example: There exists a prime which can be written as the square of an integer > 1 Jumping to a conclusion Begging the question Misuse of the word if 13 14 Getting Started in a Proof Ratinoal Numbers Figure out: A number r is rational iff r can be written as the quotient of two � What is given integers with a non-zero denominator. A real number that is not rational is � What is to be proved r is rational <-> exist a, b in Z such that r=a/b and a � 0 Example � Graphs with each of their vertices of even degree contain an Euler Cycle. 15 16

  5. Questions about Even/Odd Numbers Rationals are Closed under Addition Is 0 rational? A set is closed under an operation if: � the operation yields results that are in the original set If a and b are rationals, a + b is rational Is 5.7823 rational? Is 5.626262… rational? Are all integers rational? 17 18 Rationals and Irrationals Number Theory Rationals are closed under addition, subtraction, multiplication. Are The study of the properties of integers � Mathematics is the queen of the sciences and number theory is the queen of they closed under division? mathematics. — Gauss Relationship to Computer Science � Logical thinking � Proof for important fundamental CS theorem very related to number-theory proof � Cryptography Irrationals are not closed under multiplication � Irrational * irrational may equal rational � What about irrational * (non-zero) rational? 19 20

  6. Prime Numbers Divisibility For integers n and d, then n is divisible by d iff n=dk for some Unique Prime Factorization (the fundamental theorem of integer k arithmetic) � d divides n � Any integer � 2 can be written as the product of a unique set of prime � n is a multiple of d numbers. � d is a divisor of n � d is a factor of n Show factor tree of � d | n 12 21 22 Questions about Divisibility Proof with Divisibility Does 3 divide 36? If a and b are integers, does 4 divide 4a-4b? Is 100 a multiple of 4? Does 3|39? Is 99 a factor of -99? Is 3 a factor of 0? Is 3 a divisor of 99? 23 24

  7. Proof with Divisibility Proof with Divisibility Proving a number is not a divisor Given integers a, b, c, if a|b and b|c, then a|c � Prove 3 is not a factor of 98 25 26 Prime Numbers Quotient-Remainder Theorem Integers m and n are relatively prime if they share no common Given any integer n and any positive integer d , there exist unique factors integers q and r such that � We write m ⊥ n � n=dq+r and 0 � r<d � q can be calculated with the div operator � r can be calculated with the mod operator 27 28

  8. Modulo Arithmetic Casting out 9’s If: Given x, how to calculate x mod 9 � x mod m = x’ mod m � Take all the digits of x � y mod m = y’ mod m � Add them together. If the result is bigger than 9, use this formula recursively � z mod m = z’ mod m Shortcut: Then � As you are adding the digits of x, if you ever have an intermediate value � 9, � (x + y) mod m = (x’ + y’) mod m add its two digits together � (x - y) mod m = (x’ - y’) mod m � If you ever find a 9, throw it away ( cast it out) � xy mod m = x’y’ mod m � Casting out 9’s � (xy+z) mod m = (x’y’ +z’) mod m 532 + 656 5723386 95 x 51553 ____ _________ 1273 295057718458 Why it works: � 10 mod 9 = 1 mod 9 � 10 n mod 9 = 1 mod 9 � 10 n a mod 9 = a mod 9 � (10 n a+10 n-1 b+10 n-2 c+…+10y+ z) mod 9 = (a + b + c + … + y + z) mod 9 Limitations: 29 30 Casting out 11’s Application: ISBN Check digit Given x, how to calculate x mod 11 Check digit for ISBN: � Starting from the right, alternately add and subtract each digit � 1•first digit � + 2•second digit � + 3•third digit 532 � … + 656 5723386 � + 9•9th’ digit 95 x 51553 � ___________ ____ _________ � total mod 11 = check digit 1823 259057718458 Alternatively: Why it works � 10•first-digit � 10 mod 11 = -1 mod 11 +9•second digit � 100 mod 11 = (10•10) mod 11 ! (-1•-1) mod 11 = 1 mod 11 +8•third-digit � if n is +2•ninth digit – even: 10 n mod 11 = 1 mod 11 +1•check digit – odd: 10 n mod 11 -1 mod 11 ____________ � 10 n a mod 11 = a mod 11 (or 10 n a mod 11 = -a mod 11) total = 0 mod 11 � (10 n a+10 n-1 b+10 n-2 c+…+10y+ z) mod 11 = (z + -1•y + … + -1•c + 1•b + -1•b) mod 11 = (z - y + … -c +b - a) mod 11 31 32

Recommend


More recommend