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