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 π‘₯ is an arbitrary
element of 𝐷 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 βˆƒπ‘₯ in 𝐷 such
that 𝑃(π‘₯) and ~𝑄(π‘₯)
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 𝑛 are integers with no common factors and 𝑛 β‰  0,
𝑛
by definition of rational.
π‘š2 = 2𝑛2 , by squaring and multiplying both sides with 𝑛2
π‘š2 is even, then π‘š is even. Let π‘š = 2π‘˜ for some integer π‘˜.
(2π‘˜)2 = 4π‘˜ 2 = 2𝑛2 , by substituting π‘š = 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𝑏
by dividing both sides by 3.
π‘Ž βˆ’ 𝑏 and 3𝑏 are integers and 3𝑏 β‰  0 by the zero product property.
Hence 2 is quotient of the two integers π‘Ž βˆ’ 𝑏 and 3𝑏 with 3𝑏 β‰  0, so 2 is rational
by the definition of rational. This contradicts the fact that 2 is irrational.
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 π‘Ž and a prime number 𝑝 such that 𝑝 | π‘Ž and
𝑝 | (π‘Ž + 1).
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/𝑝 is not an integer, thus 𝑠 βˆ’ π‘Ÿ is not an
integer, which is a contradict 𝑠 βˆ’ π‘Ÿ is an integer since π‘Ÿ and 𝑠 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 q. Because q is prime, q must
equal one of the prime numbers 2, 3, 5, 7, 11, . . . , 𝑝.
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 𝑏 be integers that are not both zero. The greatest common divisor of
π‘Ž and 𝑏, denoted gcd(a, b), is that integer 𝑑 with the following properties:
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 1020 , 630 = 220 , since 1020 = 220 βˆ™ 520 and 630 = 230 βˆ™ 330
13
Greatest Common Divisor (GCD)
Lemma 4.8.1
If π‘Ÿ is a positive integer, then gcd(π‘Ÿ, 0) = π‘Ÿ.
Proof:
Suppose π‘Ÿ is a positive integer. [We must show that the greatest common divisor
of both π‘Ÿ and 0 is π‘Ÿ.]
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 π‘Ÿ can be a common divisor of π‘Ÿ and 0 (since no integer
larger than π‘Ÿ can divide π‘Ÿ).
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 π‘ž and π‘Ÿ are any integers
such that π‘Ž = π‘π‘ž + π‘Ÿ, then
gcd(π‘Ž, 𝑏) = gcd(𝒃, π‘Ÿ)
Proof:
[The proof is divided into two sections: (1) proof that gcd(π‘Ž, 𝑏) ≀ gcd(𝑏, π‘Ÿ ), and
(2) proof that gcd(𝑏, π‘Ÿ ) ≀ gcd(π‘Ž, 𝑏). Since each gcd 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 π‘Ž and 𝑏 is also a common
divisor of 𝑏 and π‘Ÿ.]
Let π‘Ž and 𝑏 be integers, not both zero, and let 𝑐 be a common divisor of π‘Ž
and 𝑏. Then 𝑐 | π‘Ž and 𝑐 | 𝑏, 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 π‘ž and π‘Ÿ are any integers
such that π‘Ž = π‘π‘ž + π‘Ÿ, then
gcd(π‘Ž, 𝑏) = gcd(𝒃, π‘Ÿ)
Proof (cont’):
1. gcd(𝒂, 𝒃) ≀ gcd(𝒃, 𝒓):
a. [We will first show that any common divisor of π‘Ž and 𝑏 is also a common
divisor of 𝑏 and π‘Ÿ.]
𝑛𝑐 = (π‘šπ‘)π‘ž + π‘Ÿ.
Then solve for π‘Ÿ :
π‘Ÿ = 𝑛𝑐 βˆ’ (π‘šπ‘)π‘ž = (𝑛 βˆ’ π‘šπ‘ž)𝑐.
But 𝑛 βˆ’ π‘šπ‘ž is an integer, and so, by definition of divisibility, 𝑐 | π‘Ÿ . Because
we already know that 𝑐 | 𝑏, we can conclude that 𝑐 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 π‘ž and π‘Ÿ are any integers such
that π‘Ž = π‘π‘ž + π‘Ÿ, then
gcd(π‘Ž, 𝑏) = gcd(𝒃, π‘Ÿ)
Proof (cont’):
1. gcd(𝒂, 𝒃) ≀ gcd(𝒃, 𝒓):
b. [Next we show that gcd(π‘Ž, 𝑏) ≀ gcd(𝑏, π‘Ÿ).]
By part (a), every common divisor of π‘Ž and 𝑏 is a common divisor of 𝑏 and
π‘Ÿ . It follows that the greatest common divisor of π‘Ž and 𝑏 is defined because
π‘Ž and 𝑏 are not both zero, and it is a common divisor of 𝑏 and π‘Ÿ . But then
gcd(π‘Ž, 𝑏) (being one of the common divisors of 𝑏 and π‘Ÿ) is less than or equal
to the greatest common divisor of 𝑏 and π‘Ÿ :
gcd(π‘Ž, 𝑏) ≀ gcd(𝑏, π‘Ÿ ).
2.
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 π‘ž and
a remainder π‘Ÿ:
𝐴 = π΅π‘ž + π‘Ÿ where 0 ≀ π‘Ÿ < 𝐡
– By Lemma 4.8.2, we have gcd(𝐴, 𝐡) = gcd(𝐡, π‘Ÿ), where 𝐡 and π‘Ÿ
are smaller numbers than 𝐴 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 101 + 𝑑0
where π‘˜ is nonnegative integer and all the 𝑑𝑖 are integers
from 0 to 9 inclusive.
𝑛 = π‘‘π‘˜ 10π‘˜ + π‘‘π‘˜βˆ’1 10π‘˜βˆ’1 + β‹― + 𝑑1 101 + 𝑑0
= π‘‘π‘˜ (9999 β‹― 999 + 1) + π‘‘π‘˜βˆ’1 (9999 β‹― 999 + 1) + β‹― + 𝑑1 (9 + 1) + 𝑑0
π‘˜ 9β€² 𝑠
π‘˜βˆ’1 9β€² 𝑠
= 9 π‘‘π‘˜ 11 β‹― 11 + π‘‘π‘˜βˆ’1 11 β‹― 11 + β‹― + 𝑑1 + π‘‘π‘˜ + π‘‘π‘˜βˆ’1 + β‹― + 𝑑1 + 𝑑0
π‘˜ 1β€² 𝑠
π‘˜βˆ’1 1β€² 𝑠
= an integer divisible by 9 + the sum of the digits of 𝑛
25
Homework #5 Problems
Theorem: The sum of any two even integers equals 4k for
some integer k.
β€œProof: Suppose m and n are any two even integers. By
definition of even, m = 2k for some integer k and n = 2k
for some integer k. By substitution,
m + n = 2k + 2k = 4k.
This is what was to be shown.”
What’s the mistakes in this proof?
26