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

questions about prime numbers proving existential
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

CSE 20—Discrete Math

Summer, 2006 July 12 (Day 3) Number Theory Methods of Proof Instructor: Neil Rhodes Even/Odd Numbers

An integer n is even iff n equals twice some integer. An integer n is odd iff n equals twice some integer plus 1.

2

Questions about Even/Odd Numbers

Is 0 even? Is -33 odd? If a and b are integers, is 6a•2b even?

3

Prime Numbers

A prime, p, is a positive integer (greater than 1) whose only positive divisors are 1 and p

Quantified statement:

A positive integer which has a positive divisor not equal one is called composite

Quantified statement:

The set of primes is infinite

∀x∈Z+, ∃y∈Z+: y > x P(y)

4

slide-2
SLIDE 2

Questions about Prime Numbers

Is 1 prime? Is every integer either prime or composite? Is there a range of integers that are either prime or composite? Is the set of primes infinite?

5

Proving Existential Statements

Prove existential statement: ∃x∈D: P(x)

Constructive proof

– Display an x – Give a set of directions for finding x

Nonconstructive proof

– Proof by contradiction (assume non-existence and show a contradiction) – Show x must exist

Example:

– In a group of 367 people, at least two share a birthday

6

Disproving Universal Statements

Disprove universal statement: ∀x∈D, P(x)

Counterexample

– Show an x in D where not P(x)

Example: All primes are of the form 2n - 1

7

Proving Universal Statements

Prove universal statement: ∀x∈D, P(x)Q(X)

Exhaustive enumeration

8

slide-3
SLIDE 3

Proving Universal Statements

Prove universal statement: ∀x∈D, P(x)Q(x)

Generalizing from the generic particular

– “Suppose x is in D and P(x)” – … – Therefore Q(x)

  • 9

Example of Proving Universal Statement

Prove that the square of any odd number is odd

10

How to Write a Proof

Copy what is to be proved

The square of any odd number is odd

Start with Proof: The proof should be self-contained

Identify each variable (declare your variables)

– Suppose m is an integer – Let x be a real number greater than 2

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

Proving Existential Statements

Prove existential statement: ∃x∈D: P(x)

Constructive proof

– Display an x – Give a set of directions for finding x

Nonconstructive proof

– Proof by contradiction (assume non-existence and show a contradiction) – Show x must exist

Example:

– In a group of 367 people, at least two share a birthday

12

slide-4
SLIDE 4

Disproving Existential Statements

Disprove existential statement: ∃x∈D: P(x)

Equivalent to:

– Prove – 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

13

How to Make Mistakes in a Proof

Argue from examples Use the same variable to mean two different things Jumping to a conclusion Begging the question Misuse of the word if

14

Getting Started in a Proof

Figure out:

What is given What is to be proved

Example

Graphs with each of their vertices of even degree contain an Euler Cycle.

15

Ratinoal Numbers

A number r is rational iff r can be written as the quotient of two integers with a non-zero denominator. A real number that is not rational is

16

r is rational <-> exist a, b in Z such that r=a/b and a0

slide-5
SLIDE 5

Questions about Even/Odd Numbers

Is 0 rational? Is 5.7823 rational? Is 5.626262… rational? Are all integers rational?

17

Rationals are Closed under Addition

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

18

Rationals and Irrationals

Rationals are closed under addition, subtraction, multiplication. Are they closed under division? Irrationals are not closed under multiplication

Irrational * irrational may equal rational What about irrational * (non-zero) rational?

19

Number Theory

The study of the properties of integers

Mathematics is the queen of the sciences and number theory is the queen of

  • mathematics. —Gauss

Relationship to Computer Science

Logical thinking Proof for important fundamental CS theorem very related to number-theory

proof

Cryptography

20

slide-6
SLIDE 6

Prime Numbers

Unique Prime Factorization (the fundamental theorem of arithmetic)

Any integer 2 can be written as the product of a unique set of prime

numbers.

21

Show factor tree of 12

Divisibility

For integers n and d, then n is divisible by d iff n=dk for some integer k

d divides n n is a multiple of d d is a divisor of n d is a factor of n d | n

22

Questions about Divisibility

Does 3 divide 36? 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

Proof with Divisibility

If a and b are integers, does 4 divide 4a-4b?

24

slide-7
SLIDE 7

Proof with Divisibility

Proving a number is not a divisor

Prove 3 is not a factor of 98

25

Proof with Divisibility

Given integers a, b, c, if a|b and b|c, then a|c

26

Prime Numbers

Integers m and n are relatively prime if they share no common factors

We write m ⊥ n

27

Quotient-Remainder Theorem

Given any integer n and any positive integer d, there exist unique integers q and r such that

n=dq+r and 0r<d q can be calculated with the div operator r can be calculated with the mod operator

28

slide-8
SLIDE 8

Modulo Arithmetic

If:

x mod m = x’ mod m y mod m = y’ mod m z mod m = z’ mod m

Then

(x + y) mod m = (x’ + y’) mod m (x - y) mod m = (x’ - y’) mod m xy mod m = x’y’ mod m (xy+z) mod m = (x’y’ +z’) mod m

29

Casting out 9’s

Given x, how to calculate x mod 9

Take all the digits of x Add them together. If the result is bigger than 9, use this formula recursively

Shortcut:

As you are adding the digits of x, if you ever have an intermediate value 9,

add its two digits together

If you ever find a 9, throw it away (cast it out) Casting out 9’s

532 + 656 95 ____ 1273

Why it works:

10 mod 9 = 1 mod 9 10n mod 9 = 1 mod 9 10na mod 9 = a mod 9 (10na+10n-1b+10n-2c+…+10y+ z) mod 9 = (a + b + c + … + y + z) mod 9

Limitations:

30

5723386 x 51553 _________ 295057718458

Casting out 11’s

Given x, how to calculate x mod 11

Starting from the right, alternately add and subtract each digit

Why it works

10 mod 11 = -1 mod 11 100 mod 11 = (10•10) mod 11 ! (-1•-1) mod 11 = 1 mod 11 if n is

– even: 10n mod 11 = 1 mod 11 – odd: 10n mod 11 -1 mod 11

10na mod 11 = a mod 11 (or 10na mod 11 = -a mod 11) (10na+10n-1b+10n-2c+…+10y+ z) mod 11

= (z + -1•y + … + -1•c + 1•b + -1•b) mod 11 = (z - y + … -c +b - a) mod 11

31

532 + 656 95 ____ 1823

5723386 x 51553 _________ 259057718458

Application: ISBN Check digit

Check digit for ISBN:

1•first digit + 2•second digit + 3•third digit … + 9•9th’ digit ___________ total mod 11 = check digit

Alternatively:

10•first-digit

+9•second digit +8•third-digit +2•ninth digit +1•check digit ____________ total = 0 mod 11

32