week 3 - wednesday. what did we talk about last time? basic number theory definitions even and...

30
CS322 Week 3 - Wednesday

Upload: joseph-fitzgerald

Post on 25-Dec-2015

217 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Week 3 - Wednesday.  What did we talk about last time?  Basic number theory definitions  Even and odd  Prime and composite  Proving existential statements

CS322Week 3 - Wednesday

Page 2: Week 3 - Wednesday.  What did we talk about last time?  Basic number theory definitions  Even and odd  Prime and composite  Proving existential statements

Last time

What did we talk about last time? Basic number theory definitions

Even and odd Prime and composite

Proving existential statements Disproving universal statements

Page 3: Week 3 - Wednesday.  What did we talk about last time?  Basic number theory definitions  Even and odd  Prime and composite  Proving existential statements

Questions?

Page 4: Week 3 - Wednesday.  What did we talk about last time?  Basic number theory definitions  Even and odd  Prime and composite  Proving existential statements

Logical warmup

By their nature, manticores lie every Monday, Tuesday and Wednesday and the other days speak the truth

However, unicorns lie on Thursdays, Fridays and Saturdays and speak the truth the other days of the week

A manticore and a unicorn meet and have the following conversation:Manticore: Yesterday I was lying.Unicorn: So was I.

On which day did they meet?

Page 5: Week 3 - Wednesday.  What did we talk about last time?  Basic number theory definitions  Even and odd  Prime and composite  Proving existential statements

Proving Universal Statements

Page 6: Week 3 - Wednesday.  What did we talk about last time?  Basic number theory definitions  Even and odd  Prime and composite  Proving existential statements

Method of exhaustion

If the domain is finite, try every possible value.

Example: x Z+, if 4 ≤ x ≤ 20 and x is even, x can

be written as the sum of two prime numbers

Is this familiar to anyone? Goldbach's Conjecture proposes that

this is true for all even integers greater than 2

Page 7: Week 3 - Wednesday.  What did we talk about last time?  Basic number theory definitions  Even and odd  Prime and composite  Proving existential statements

Generalizing from the generic particular

Pick some specific (but arbitrary) element from the domain

Show that the property holds for that element, just because of that properties that any such element must have

Thus, it must be true for all elements with the property

Example: x Z, if x is even, then x + 1 is odd

Page 8: Week 3 - Wednesday.  What did we talk about last time?  Basic number theory definitions  Even and odd  Prime and composite  Proving existential statements

Direct proof

Direct proof actually uses the method of generalizing from a generic particular, following these steps:1. Express the statement to be proved in the

form x D, if P(x) then Q(x)2. Suppose that x is some specific (but

arbitrarily chosen) element of D for which P(x) is true

3. Show that the conclusion Q(x) is true by using definitions, other theorems, and the rules for logical inference

Page 9: Week 3 - Wednesday.  What did we talk about last time?  Basic number theory definitions  Even and odd  Prime and composite  Proving existential statements

Proof formatting

Write Claim: and then the statement of the theorem

Start your proof with Proof: Define everything Write a justification next to every

line Put QED at the end of your proof

Quod erat demonstrandum: "that which was to be shown"

Page 10: Week 3 - Wednesday.  What did we talk about last time?  Basic number theory definitions  Even and odd  Prime and composite  Proving existential statements

Direct proof example

Prove the sum of any two odd integers is even.

Page 11: Week 3 - Wednesday.  What did we talk about last time?  Basic number theory definitions  Even and odd  Prime and composite  Proving existential statements

Common mistakes

Arguing from examples Goldbach's conjecture is not a proof, though shown for

numbers up to 1018

Using the same letter to mean two different things m = 2k + 1 and n = 2k + 1

Jumping to a conclusion Skipping steps

Begging the question Assuming the conclusion

Misuse of the word "if A more minor problem, but a premise should not be

invoked with "if"

Page 12: Week 3 - Wednesday.  What did we talk about last time?  Basic number theory definitions  Even and odd  Prime and composite  Proving existential statements

Disproving an existential statement

Flipmode is the squad You just negate the statement and

then prove the resulting universal statement

Page 13: Week 3 - Wednesday.  What did we talk about last time?  Basic number theory definitions  Even and odd  Prime and composite  Proving existential statements

Rational NumbersStudent Lecture

Page 14: Week 3 - Wednesday.  What did we talk about last time?  Basic number theory definitions  Even and odd  Prime and composite  Proving existential statements

Rational Numbers

Page 15: Week 3 - Wednesday.  What did we talk about last time?  Basic number theory definitions  Even and odd  Prime and composite  Proving existential statements

Another important definition

A real number is rational if and only if it can be expressed at the quotient of two integers with a nonzero denominator

Or, more formally,r is rational a, b Z r = a/b and b 0

Page 16: Week 3 - Wednesday.  What did we talk about last time?  Basic number theory definitions  Even and odd  Prime and composite  Proving existential statements

Examples

Give an example of a rational number Given an example of an irrational number Is 10/3 rational? Is 0.281 rational? Is 0.12121212… (the digits 12 repeat

forever) rational? Is 0 rational? Is 3/0 rational? Is 3/0 irrational? If m and n are integers and neither is zero, is

(m + n)/mn rational?

Page 17: Week 3 - Wednesday.  What did we talk about last time?  Basic number theory definitions  Even and odd  Prime and composite  Proving existential statements

Prove the following:

Every integer is a rational number The sum of any two rational numbers

is rational The product of any two rational

numbers is a rational number

Page 18: Week 3 - Wednesday.  What did we talk about last time?  Basic number theory definitions  Even and odd  Prime and composite  Proving existential statements

Using existing theorems

Math moves forward not by people proving things purely from definitions but also by using existing theorems

"Standing on the shoulders of giants" Given the following:

1. The sum, product, and difference of any two even integers is even

2. The sum and difference of any two odd integers are even3. The product of any two odd integers is odd4. The product of any even integer and any odd integer is even5. The sum of any odd integer and any even integer is odd

Using these theorems, prove that, if a is any even integer and b is any odd integer, then (a2 + b2 + 1)/2 is an integer

Page 19: Week 3 - Wednesday.  What did we talk about last time?  Basic number theory definitions  Even and odd  Prime and composite  Proving existential statements

Divisibility

Page 20: Week 3 - Wednesday.  What did we talk about last time?  Basic number theory definitions  Even and odd  Prime and composite  Proving existential statements

Definition of divisibility

If n and d are integers, then n is divisible by d if and only if n = dk for some integer k

Or, more formally: For n, d Z,

n is divisible by d k Z n = dk We also say:

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

We use the notation d | n to mean "d divides n"

Page 21: Week 3 - Wednesday.  What did we talk about last time?  Basic number theory definitions  Even and odd  Prime and composite  Proving existential statements

Examples

Is 37 divisible by 3? Is -7 a factor of 7? Does 6 | 256? Is 0 a multiple of 45?

Page 22: Week 3 - Wednesday.  What did we talk about last time?  Basic number theory definitions  Even and odd  Prime and composite  Proving existential statements

More on divisors

If a,b Z and a | b, is a ≤ b? Not necessarily!

But, if a,b Z+ and a | b, then a ≤ b Which integers divide 1? If a,b Z, is 3a + 3b divisible by 3? If k,m Z, is 10km divisible by 5?

Page 23: Week 3 - Wednesday.  What did we talk about last time?  Basic number theory definitions  Even and odd  Prime and composite  Proving existential statements

Transitivity of divisibility

Prove that for all integers a, b, and c, if a | b and b | c, then a | c

Steps: Rewrite the theorem in formal notation Write Proof: State your premises Justify every line you infer from the

premises Write QED after you have demonstrated

the conclusion

Page 24: Week 3 - Wednesday.  What did we talk about last time?  Basic number theory definitions  Even and odd  Prime and composite  Proving existential statements

Divisibility by a prime

Prove that every integer n > 1 is divisible by a prime

Steps: Rewrite the theorem in formal notation Write Proof: State your premises Justify every line you infer from the premises Write QED after you have demonstrated the

conclusion This one is a little more problematic We aren't really ready to prove something like this

yet

Page 25: Week 3 - Wednesday.  What did we talk about last time?  Basic number theory definitions  Even and odd  Prime and composite  Proving existential statements

Prove or disprove:

For all integers a and b, if a | b and b | a, then a = b

How could we change this statement so that it is true?

Then, how could we prove it?

Page 26: Week 3 - Wednesday.  What did we talk about last time?  Basic number theory definitions  Even and odd  Prime and composite  Proving existential statements

Unique factorization theorem For any integer n > 1, there exist a

positive integer k, distinct prime numbers p1, p2, …, pk, and positive integers e1, e2, …, ek such that

And any other expression of n as a product of prime numbers is identical to this except, perhaps, for the order in which the factors are written

kek

eee ppppn ...321321

Page 27: Week 3 - Wednesday.  What did we talk about last time?  Basic number theory definitions  Even and odd  Prime and composite  Proving existential statements

An application of the unique factorization theorem

Let m be an integer such that 8∙7 ∙6 ∙5 ∙4 ∙3 ∙2 ∙m = 17∙16 ∙15

∙14 ∙13 ∙12 ∙11 ∙10 Does 17 | m? Leave aside for the moment that we

could actually compute m

Page 28: Week 3 - Wednesday.  What did we talk about last time?  Basic number theory definitions  Even and odd  Prime and composite  Proving existential statements

Upcoming

Page 29: Week 3 - Wednesday.  What did we talk about last time?  Basic number theory definitions  Even and odd  Prime and composite  Proving existential statements

Next time…

Quotient remainder theorem Proof by cases

Page 30: Week 3 - Wednesday.  What did we talk about last time?  Basic number theory definitions  Even and odd  Prime and composite  Proving existential statements

Reminders

Keep reading Chapter 4 Work on Assignment 2 for Friday