Chapter 4.7 & 4.8 - Help-A-Bull

Download Report

Transcript Chapter 4.7 & 4.8 - Help-A-Bull

Quotient-Remainder Theory, Div and Mod

If 𝑛 and 𝑑 are integers and 𝑑 > 0 , then 𝑛 𝑑𝑖𝑣 𝑑 = π‘ž and 𝑛 π‘šπ‘œπ‘‘ 𝑑 = π‘Ÿ ⟺ 𝑛 = π‘‘π‘ž + π‘Ÿ where π‘ž and π‘Ÿ are integers and 0 ≀ π‘Ÿ < 𝑑 .

𝑛 Quotient: q = 𝑛 𝑑𝑖𝑣 𝑑 = 𝑑 Reminder: r = 𝑛 π‘šπ‘œπ‘‘ 𝑑 = 𝑛 βˆ’ π‘‘π‘ž 1

Exercise

Prove that for all integers

a

and

b

, if

a mod

7 = 5 and

b mod

7 = 6 then

ab mod

7 = 2.

What values are

𝑑

,

π‘ž

, and

π‘Ÿ

?

2

Exercise

Prove that for all integers

a

and

b

, if

a mod

7 = 5 and

b mod

7 = 6 then

ab mod

7 = 2.

Hint:

𝑑 = 7 π‘Ž = 7π‘š + 5 , b = 7𝑛 + 6 π‘Žπ‘ = 7π‘š + 5 7𝑛 +

6

= 49π‘šπ‘› + 42π‘š + 35𝑛 + 30 = 7 7π‘šπ‘› + 6π‘š + 3𝑛 + 4 + 2 3

Floor & Ceiling

Definition:

β€’ Floor: If π‘₯ is a real number and 𝑛 π‘₯ = 𝑛 ⟺ 𝑛 ≀ is an integer, then π‘₯ < 𝑛 + 1 β€’ Ceiling: if π‘₯ is a real number and 𝑛 π‘₯ = 𝑛 is an integer, then ⟺ 𝑛 βˆ’ 1 < π‘₯ ≀ 𝑛 π‘₯ 𝑛 𝑛 + 1 floor of π‘₯ = π‘₯ π‘₯ 𝑛 βˆ’ 1 𝑛 ceiling of π‘₯ = π‘₯ 4

Relations between Proof by Contradiction and Proof by Contraposition

β€’ To prove a statement βˆ€π‘₯ in 𝐷, if 𝑃 π‘₯ then 𝑄(π‘₯) β€’ Proof by contraposition proves the statement by giving a direct proof of the equivalent statement βˆ€π‘₯ in 𝐷, if 𝑄 π‘₯ is false then 𝑃 π‘₯ is false Suppose π‘₯ element of 𝐷 is an arbitrary such that ~𝑄(π‘₯) Sequence of steps ~𝑃(π‘₯) β€’ Proof by contradiction proves the statement by showing that the negation of the statement leads logically to a contradiction.

Suppose βˆƒπ‘₯ that 𝑃(π‘₯) in and 𝐷 such ~𝑄(π‘₯) Same sequence of steps Contradiction: 𝑃(π‘₯) and ~𝑃(π‘₯) 5

Summary of Chapter 4

β€’ Number theories: – Even, odd, prime, and composite – Rational, divisibility, and quotient-remainder theorem – Floor and ceiling – The irrationality of 2 and gcd β€’ Proofs: – Direct proof and counterexample – Indirect proof by contradiction and contraposition 6

The Irrationality of 2

How to proof: β€’ Direct proof?

β€’ Proof by contradiction?

β€’ Proof by contraposition?

If π‘Ÿ is a real number, then π‘Ÿ is rational ⇔ βˆƒ integers π‘Ž and 𝑏 such that π‘Ÿ = π‘Ž 𝑏 and 𝑏 β‰  0 .

A real number that is not rational is

irrational

.

7

The Irrationality of 2

Proof by contradiction: Starting point: Negation: 2 is rational.

To show: A contradiction.

2 = π‘š , where π‘š 𝑛 and by definition of rational.

𝑛 π‘š 2 = 2𝑛 2 ,

are integers

with no common factors and by squaring and multiplying both sides with 𝑛 2 𝑛 β‰  0 , π‘š 2 is even, then (2π‘˜) 2 = 4π‘˜ 2 = 2𝑛 π‘š 2 is even. Let π‘š = 2π‘˜ , by substituting for some integer π‘š = 2π‘˜ into π‘š 2 = 2𝑛 2 π‘˜ .

.

𝑛 2 is even, and so 𝑛 is even. Hence both π‘š and 𝑛 have a common factor of 2.

8

Irrationality of 1 + 3 2

Proof by contradiction: Starting point: Negation: 1 + 3 2 is rational.

To show: A contradiction.

9

Irrationality of 1 + 3 2

Proof by contradiction: By definition of rational, 1 + 3 2 = π‘Ž 𝑏 for some integers π‘Ž and 𝑏 with 𝑏 β‰  0 .

It follows that 3 2 = = π‘Ž 𝑏 π‘Ž βˆ’ 1 βˆ’ 𝑏 𝑏 𝑏 π‘Žβˆ’π‘ = 𝑏 by subtracting 1 from both sides by substitution by the rule for subtracting fractions with a common denominator Hence, 2 = π‘Žβˆ’π‘ 3𝑏 π‘Ž βˆ’ 𝑏 and 3𝑏 by dividing both sides by 3.

are integers and 3𝑏 β‰  0 by the zero product property. Hence 2 is quotient of the two integers π‘Ž βˆ’ 𝑏 by the definition of rational. This contradicts and 3𝑏 with 3𝑏 β‰  0 , so the fact that 2 is irrational.

2 is rational 10

Property of a Prime Divisor

Proposition 4.7.3

For any integer π‘Ž and any prime number 𝑝 , if 𝑝|π‘Ž then 𝑝 | (π‘Ž + 1) If a prime number divides an integer, then it does not divide the next successive integer. Starting point: there exists an integer π‘Ž 𝑝 | (π‘Ž + 1) .

and a prime number 𝑝 such that 𝑝 | π‘Ž and To show: a contradiction.

π‘Ž = π‘π‘Ÿ and π‘Ž + 1 = 𝑝𝑠 for some integers π‘Ÿ and 𝑠 by definition of divisibility. It follows that 1 = (π‘Ž + 1) βˆ’ π‘Ž = 𝑝𝑠 βˆ’ π‘π‘Ÿ = 𝑝(𝑠 βˆ’ π‘Ÿ ), 𝑠 βˆ’ π‘Ÿ = 1/𝑝 , by dividing both sides with 𝑝 .

𝑝 > 1 because 𝑝 is prime, hence, 1/𝑝 integer, which is a contradict 𝑠 βˆ’ π‘Ÿ is not an integer, thus is an integer since π‘Ÿ and 𝑠 𝑠 βˆ’ π‘Ÿ is not an are integers.

if 𝑛 and 𝑑 𝑑|𝑛 are integers and 𝑑 β‰  0 : ⟺ βˆƒ an integer π‘˜ such that 𝑛 = 𝑑 βˆ™ π‘˜

Infinitude of the Primes

Theorem 4.7.4 Infinitude of the Primes

The set of prime numbers is infinite.

Proof by contradiction: Starting point: the set of prime number is finite.

To show: a contradiction.

Assume a prime number 𝑝 is the largest of all the prime numbers 2, 3, 5, 7, 11, . . . , 𝑝.

Let 𝑁 be the product of all the prime numbers plus 1: 𝑁 = (2 Β· 3 Β· 5 Β· 7 Β· 11 Β· Β· Β· 𝑝) + 1 Then 𝑁 > 1 , and so, by Theorem 4.3.4 (any integer larger than 1 is divisible by a prime number) , 𝑁 is divisible by some prime number equal one of the prime numbers 2, 3, 5, 7, 11, . . . , 𝑝 .

q

. Because

q

is prime,

q

must Thus, by definition of divisibility, π‘ž divides 2 Β· 3 Β· 5 Β· 7 Β· 11 Β· Β· Β· 𝑝 , and so, by Proposition 4.7.3, π‘ž does not divide (2 Β· 3 Β· 5 Β· 7 Β· 11 Β· Β· Β· 𝑝) + 1 , which equals 𝑁 .

Hence

N

is divisible by

q

and

N

is not divisible by

q

, and we have reached a contradiction.

[Therefore, the supposition is false and the theorem is true.]

12

Greatest Common Divisor (GCD)

β€’ The greatest common divisor of two integers

a

and

b

is the largest integer that divides both π‘Ž and 𝑏 .

Definition

Let π‘Ž π‘Ž and and 𝑏 𝑏 be integers that are not both zero. The , denoted

gcd(a, b)

, is that integer 𝑑

greatest common divisor

with the following properties: of 1.

𝑑 is common divisor of both a and b, in other words, 𝑑 | π‘Ž , and 𝑑 | 𝑏 .

2. For all integers 𝑐 , if 𝑐 is a common divisor of both π‘Ž and 𝑏 , then 𝑐 is less than or equal to 𝑑 . In other words, for all integers 𝑐 , if 𝑐 | π‘Ž , and 𝑐 |𝑏 , then c ≀ 𝑑 . β€’ β€’ Exercise: gcd 72,63 = 9 , since 72 = 9 βˆ™ 8 and 63 = 9 βˆ™ 7 gcd 10 20 , 6 30 = 2 20 , since 10 20 = 2 20 βˆ™ 5 20 and 6 30 = 2 30 βˆ™ 3 30 13

Greatest Common Divisor (GCD)

Lemma 4.8.1

If

π‘Ÿ

is a positive integer, then

gcd(π‘Ÿ, 0) = π‘Ÿ

.

Proof: Suppose π‘Ÿ

of both

π‘Ÿ is a positive integer.

and

0

is

π‘Ÿ

.] [We must show that the greatest common divisor

1.

π‘Ÿ is a common divisor of both π‘Ÿ and 0 because

r

divides itself and also π‘Ÿ divides 0 (since every positive integer divides 0). 2. No integer larger than π‘Ÿ larger than π‘Ÿ can divide π‘Ÿ can be a common divisor of ). π‘Ÿ and 0 (since no integer Hence π‘Ÿ is the greatest common divisor of π‘Ÿ and 0 .

14

Greatest Common Divisor (GCD)

Lemma 4.8.2

If

π‘Ž

and

𝑏

are any integers not both zero, and if such that

π‘Ž = π‘π‘ž + π‘Ÿ

, then

gcd(π‘Ž, 𝑏) = gcd(𝒃, π‘Ÿ) π‘ž

and

π‘Ÿ

are any integers

Proof:

( [The proof is divided into two sections: (

1

) proof that

2

) proof that

gcd(𝑏, π‘Ÿ ) ≀ gcd(π‘Ž, 𝑏)

. Since each

gcd gcd(π‘Ž, 𝑏) ≀ gcd(𝑏, π‘Ÿ )

, and is less than or equal to the other, the two must be equal.]

1.

gcd(𝒂, 𝒃) ≀ gcd(𝒃, 𝒓)

:

a. [We will first show that any common divisor of divisor of

𝑏

and

π‘Ÿ

.]

π‘Ž

and

𝑏

is also a common

Let and π‘Ž and 𝑏 𝑏 . Then be integers, not both zero, and let 𝑐 | π‘Ž and 𝑐 | 𝑏 𝑐 be a common divisor of , and so, by definition of divisibility, π‘Ž π‘Ž = 𝑛𝑐 and 𝑏 = π‘šπ‘ , for some integers 𝑛 and π‘š . Now substitute into the equation π‘Ž = π‘π‘ž + π‘Ÿ to obtain 𝑛𝑐 = (π‘šπ‘)π‘ž + π‘Ÿ.

15

Greatest Common Divisor (GCD)

Lemma 4.8.2

If

π‘Ž

and

𝑏

are any integers not both zero, and if

π‘ž

such that

π‘Ž = π‘π‘ž + π‘Ÿ

, then

gcd(π‘Ž, 𝑏) = gcd(𝒃, π‘Ÿ)

and

π‘Ÿ

are any integers

Proof (cont ’):

1.

gcd(𝒂, 𝒃) ≀ gcd(𝒃, 𝒓)

:

a. [We will first show that any common divisor of

π‘Ž

divisor of

𝑏

and

π‘Ÿ

.]

𝑛𝑐 = (π‘šπ‘)π‘ž + π‘Ÿ.

Then solve for π‘Ÿ :

and

𝑏 π‘Ÿ = 𝑛𝑐 βˆ’ (π‘šπ‘)π‘ž = (𝑛 βˆ’ π‘šπ‘ž)𝑐

.

is also a common

But 𝑛 βˆ’ π‘šπ‘ž is an integer, and so, by definition of divisibility, 𝑐 | π‘Ÿ we already know that 𝑐 | 𝑏 , we can conclude that 𝑐 . Because is a common divisor of 𝑏 and π‘Ÿ

[as was to be shown]

.

16

Greatest Common Divisor (GCD)

Lemma 4.8.2

If

π‘Ž

and

𝑏

are any integers not both zero, and if

π‘ž

that

π‘Ž = π‘π‘ž + π‘Ÿ

, then

gcd(π‘Ž, 𝑏) = gcd(𝒃, π‘Ÿ)

and

π‘Ÿ

are any integers such

Proof (cont ’):

1.

gcd(𝒂, 𝒃) ≀ gcd(𝒃, 𝒓)

:

2.

b. [Next we show that

gcd(π‘Ž, 𝑏) ≀ gcd(𝑏, π‘Ÿ)

.]

By part (a), every common divisor of π‘Ž and 𝑏 is a common divisor of 𝑏 to the greatest common divisor of 𝑏 and π‘Ÿ : gcd(π‘Ž, 𝑏) ≀ gcd(𝑏, π‘Ÿ )

.

and π‘Ÿ π‘Ž . It follows that the greatest common divisor of and 𝑏 gcd(π‘Ž, 𝑏) π‘Ž and are not both zero, and it is a common divisor of (being one of the common divisors of 𝑏 and π‘Ÿ 𝑏 𝑏 is defined because and π‘Ÿ . But then ) is less than or equal gcd(𝒃, 𝒓) ≀ gcd(𝒂, 𝒃)

:

The second part of the proof is very similar to the first part. It is left as an exercise.

17

The Euclidean Algorithm

β€’ Problem: – Given two integer A and B with 𝐴 > 𝐡 β‰₯ 0 , find gcd(𝐴, 𝐡) β€’ Idea: – The Euclidean Algorithm uses the division algorithm repeatedly.

– If B=0, by Lemma 4.8.1 we know gcd(𝐴, 𝐡) = 𝐴 .

– If B>0, division algorithm can be used to calculate a quotient π‘ž a remainder π‘Ÿ : and 𝐴 = π΅π‘ž + π‘Ÿ where 0 ≀ π‘Ÿ < 𝐡 – By Lemma 4.8.2, we have gcd(𝐴, 𝐡) = gcd(𝐡, π‘Ÿ) , where 𝐡 are smaller numbers than 𝐴 and 𝐡 .

and π‘Ÿ β€’ gcd(𝐴, 𝐡) = gcd(𝐡, π‘Ÿ) = β‹― = gcd(π‘₯, 0) = π‘₯ π‘Ÿ = 𝐴 π‘šπ‘œπ‘‘ 𝐡 18

The Euclidean Algorithm - Exercise

Use the Euclidean algorithm to find gcd(330, 156).

19

The Euclidean Algorithm - Exercise

Use the Euclidean algorithm to find gcd(330, 156).

Solution: gcd(330,156) = gcd(156, 18) 330 mod 156 = 18 = gcd(18, 12) 156 mod 18 = 12 = gcd(12, 6) 18 mod 12 = 6 = gcd(6, 0) 12 mod 6 = 0 = 6 20

An alternative to Euclidean Algorithm If

π‘Ž β‰₯ 𝑏 > 0

, then

gcd(π‘Ž, 𝑏) = gcd(𝑏, π‘Ž βˆ’ 𝑏) 21

An alternative to Euclidean Algorithm If

π‘Ž β‰₯ 𝑏 > 0

, then

gcd(π‘Ž, 𝑏) = gcd(𝑏, π‘Ž βˆ’ 𝑏)

Hint: Part 1: proof

gcd(π‘Ž, 𝑏) ≀ gcd(𝑏, π‘Ž βˆ’ 𝑏) every common divisor of a and b is a common divisor of b and a-b

Part 2: proof

gcd(π‘Ž, 𝑏) β‰₯ gcd(𝑏, π‘Ž βˆ’ 𝑏) every common divisor of b and a-b is a common divisor of a and b.

22

Homework #5 Problems

Converting decimal to rational numbers.

4.2.2: 4.6037

4.2.7: 52.4672167216721… 23

Homework #5 Problems

1. Converting decimal to rational numbers.

4.2.2: 4.6037

Solution: 4.6037 = 4.6037

10000 βˆ— 10000 = 46037 10000 4.2.7: 52.4672167216721… Solution: let X = 52.4672167216721 . . . 100000x = 5246721.67216721…. 10x = 524.67216721… 100000x – 10x = 5246197 X = 5246197 / 99990 24

Exercise

Prove that for any nonnegative integer 𝑛 , if the sum of the digits of 𝑛 is divisible by 9, then 𝑛 is divisible by 9.

Hint: by the definition of decimal representation 𝑛 = 𝑑 π‘˜ 10 π‘˜ + 𝑑 π‘˜βˆ’1 10 π‘˜βˆ’1 + β‹― + 𝑑 1 10 1 + 𝑑 0 where π‘˜ is nonnegative integer and all the 𝑑 𝑖 from 0 to 9 inclusive.

𝑛 = 𝑑 π‘˜ 10 π‘˜ + 𝑑 π‘˜βˆ’1 10 π‘˜βˆ’1 + β‹― + 𝑑 1 10 1 + 𝑑 0 are integers = 𝑑 π‘˜ (9999 β‹― 999 π‘˜ 9 β€² 𝑠 + 1) + 𝑑 π‘˜βˆ’1 (9999 β‹― 999 π‘˜βˆ’1 9 β€² 𝑠 + 1) + β‹― + 𝑑 1 (9 + 1) + 𝑑 0 = 9 𝑑 π‘˜ 11 β‹― 11 π‘˜ 1 β€² 𝑠 + 𝑑 π‘˜βˆ’1 11 β‹― 11 π‘˜βˆ’1 1 β€² 𝑠 + β‹― + 𝑑 1 = + 𝑑 π‘˜ + 𝑑 π‘˜βˆ’1 + β‹― + 𝑑 1 + 𝑑 0 an integer divisible by 9 + the sum of the digits of 𝑛 25

Homework #5 Problems

Theorem:

The sum of any two even integers equals 4

k

for some integer

k

.

β€œ

Proof:

Suppose

m

and

n

are any two even integers. By definition of even,

m

= 2

k

for some integer

k

and

n

= 2

k

for some integer

k

. By substitution,

m

+

n

= 2

k

+ 2

k

= 4

k.

This is what was to be shown .” What’s the mistakes in this proof?

26