Download presentation

1
**Quotient-Remainder Theory, Div and Mod**

If 𝑛 and 𝑑 are integers and 𝑑>0, then 𝑛 𝑑𝑖𝑣 𝑑=𝑞 and 𝑛 𝑚𝑜𝑑 𝑑=𝑟 ⟺ 𝑛=𝑑𝑞+𝑟 where 𝑞 and 𝑟 are integers and 0≤𝑟<𝑑. Quotient: q=𝑛 𝑑𝑖𝑣 𝑑= 𝑛 𝑑 Reminder: r=𝑛 𝑚𝑜𝑑 𝑑=𝑛−𝑑𝑞

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. What values are 𝑑, 𝑞, and 𝑟?

3
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

4
**Floor & Ceiling Floor: If 𝑥 is a real number and 𝑛 is an integer, then**

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 𝑥= 𝑥

5
**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 Proof by contradiction proves the statement by showing that the negation of the statement leads logically to a contradiction. Suppose 𝑥 is an arbitrary element of 𝐷 such that ~𝑄(𝑥) ~𝑃(𝑥) Sequence of steps Suppose ∃𝑥 in 𝐷 such that 𝑃(𝑥) and ~𝑄(𝑥) Same sequence of steps Contradiction: 𝑃(𝑥) and ~𝑃(𝑥)

6
**Summary of Chapter 4 Number theories: Proofs:**

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

7
**𝑟 is rational ⇔ ∃ integers 𝑎 and 𝑏 such that 𝑟 = 𝑎 𝑏 and 𝑏 ≠ 0.**

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.

8
**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.

9
**Irrationality of 1+3 2 Proof by contradiction: Starting point:**

Negation: is rational. To show: A contradiction.

10
**1+3 2 = 𝑎 𝑏 for some integers 𝑎 and 𝑏 with 𝑏≠0.**

Irrationality of Proof by contradiction: By definition of rational, = 𝑎 𝑏 for some integers 𝑎 and 𝑏 with 𝑏≠0. It follows that 3 2 = 𝑎 𝑏 − 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.

11
**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 𝑛=𝑑∙𝑘

12
**Infinitude of the Primes**

Theorem 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 (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.]

13
**Greatest Common Divisor (GCD)**

The greatest common divisor of two integers a and b is the largest integer that divides both 𝑎 and 𝑏. Exercise: gcd 72,63 =9, since 72=9∙8 and 63=9∙7 gcd , = 2 20 , since = 2 20 ∙ 5 20 and = 2 30 ∙ 3 30 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: 𝑑 is common divisor of both a and b, in other words, 𝑑 | 𝑎, and 𝑑 | 𝑏. 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≤𝑑.

14
**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 𝑟.] 𝑟 is a common divisor of both 𝑟 and 0 because r divides itself and also 𝑟 divides 0 (since every positive integer divides 0). 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.

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: [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.] gcd(𝒂, 𝒃) ≤ gcd(𝒃, 𝒓): [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 𝑛𝑐 = (𝑚𝑐)𝑞 + 𝑟.

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’): gcd(𝒂, 𝒃) ≤ gcd(𝒃, 𝒓): [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].

17
**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’): gcd(𝒂, 𝒃) ≤ gcd(𝒃, 𝒓): [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(𝑏, 𝑟 ). gcd(𝒃, 𝒓) ≤ gcd(𝒂, 𝒃): The second part of the proof is very similar to the first part. It is left as an exercise.

18
**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 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) = 𝑥 𝑟=𝐴 𝑚𝑜𝑑 𝐵

19
**The Euclidean Algorithm - Exercise**

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

20
**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

21
**An alternative to Euclidean Algorithm**

If 𝑎≥ 𝑏> 0, then gcd(𝑎,𝑏)=gcd(𝑏, 𝑎−𝑏)

22
**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.

23
**Homework #5 Problems Converting decimal to rational numbers.**

4.2.2: 4.2.7: …

24
Homework #5 Problems 1. Converting decimal to rational numbers : Solution: = ∗10000= : … Solution: let X = x = …. 10x = … x – 10x = X = / 99990

25
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 +⋯+ 𝑑 𝑑 0 where 𝑘 is nonnegative integer and all the 𝑑 𝑖 are integers from 0 to 9 inclusive. = 𝑑 𝑘 ( 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 + 𝑑 0 = an integer divisible by 9 + the sum of the digits of 𝑛

26
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?

Similar presentations

Presentation is loading. Please wait....

OK

(CSC 102) Discrete Structures Lecture 10.

(CSC 102) Discrete Structures Lecture 10.

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google

Ppt on fdi in hindi Ppt on object-oriented programming pdf Ppt on review writing for kids Ppt on planet mars Ppt on voltage sag mitigation Ppt on poem song of the rain Ppt on solids in maths Ppt on inhabiting other planets with oxygen Ppt on the happy prince Ppt on seven segment display