Presentation is loading. Please wait.

Presentation is loading. Please wait.

COT 3100, Spring 2001 Applications of Discrete Structures

Similar presentations


Presentation on theme: "COT 3100, Spring 2001 Applications of Discrete Structures"— Presentation transcript:

1 COT 3100, Spring 2001 Applications of Discrete Structures
Section #1089X - MWF 4th period Dr. Michael P. Frank Lecture #19 Wed., Feb. 21, 2001 2/21/01 Lecture #19

2 Administrivia HW5, Quiz5 being returned Lecture Today: Friday:
Finish §2.3, the Integers and Division. Basic number theory. Friday: Quiz on § 2/21/01 Lecture #19

3 Review of §2.3 So Far a|b  “a divides b”  cZ: b=ac
“p is prime”  p>1  aN: (1<a<p  a|p) Terms factor, divisor, multiple, composite. 2/21/01 Lecture #19

4 Fundamental Theorem of Arithmetic
Its "Prime Factorization" Every positive integer has a unique representation as the product of a non-decreasing series of zero or more primes. 1 = (product of empty series) = 1 2 = 2 (product of series with one element) 4 = 2·2 (product of series 2,2) 2000 = 2·2·2·2·5·5·5; = 3·23·29 2/21/01 Lecture #19

5 Primes are Important When you visit a secure web site ( , lock or key icon unbroken), the browser and web site are using RSA encryption. This scheme uses public keys containing the product pq of two random large primes p and q which must be kept secret within your browser. So the security of your web transactions depends critically on the fact that all known factoring algorithms are intractable! (Exc. quantum algs.) 2/21/01 Lecture #19

6 The Division “Algorithm”
Really just a theorem, not an algorithm… Name used for historical reasons. For any integer dividend a and divisor d>0, there is a unique quotient q and remainder r such that a=dq+r and 0r<d. a,dZ, d>0, !q,r: 0r<d, a=dq+r. Can find q and r by q=ad, r=aqd. 2/21/01 Lecture #19

7 Greatest Common Divisor
The greatest common divisor gcd(a,b) of integers a,b (not both 0) is the largest (most positive) integer d that is a divisor both of a and of b. Example: gcd(24,36)=? Positive common divisors: 1,2,3,4,6,12… Greatest is 12. 2/21/01 Lecture #19

8 GCD shortcut If the prime factorizations are written as a=p1a1 p2a2 …pnan and b=p1b1 p2b2 …pnbn, then the GCD is given by gcd(a,b) = p1min(a1,b1) p2min(a2,b2) …pnmin(an,bn). Example: a=84=2·2·3· = 22·31·71 b=96=2·2·2·2·2·3 = 25·31·70 gcd(84,96) = 22·31·70 = 2·2·3 = 12. 2/21/01 Lecture #19

9 Relative Primality Integers a and b are called relatively prime iff their gcd = 1. Example: 21 and 10 are not prime, but they are relatively prime. 21=3·7 and 10=2·5, so they have no common factors > 1, so their gcd = 1. Integers a1,a2… are pairwise relatively prime if any two pairs ai, aj, ij, are rel. pr. 2/21/01 Lecture #19

10 Least Common Multiple lcm(a,b) of positive integers a, b, is the smallest positive integer that is a multiple both of a and of b. E.g. lcm(6,10)=30 If the prime factorizations are written as a=p1a1 p2a2 …pnan and b=p1b1 p2b2 …pnbn, then the LCM is given by lcm(a,b) = p1max(a1,b1) p2max(a2,b2) …pnmax(an,bn). 2/21/01 Lecture #19

11 The mod operator An integer “division remainder” operator.
Let a,dZ with d>1. Then a mod d denotes the remainder r from the division “algorithm” with dividend a and divisor d; i.e. the remainder when a is divided by d. (Using e.g. long division.) Can compute a mod d using ada/d. In C programming language, “%” = mod. 2/21/01 Lecture #19

12 Modular Congruence Let Z+={nZ | n>0}, the positive integers.
Let a,bZ, mZ+. Then a is congruent to b modulo m, written “ab (mod m)”, iff m|ab. Also equivalent to (ab) mod m=0. (Note this is a different use of “” than the meaning “is defined as” I’ve used before.) 2/21/01 Lecture #19

13 Useful Congruence Theorems
Let a,bZ, mZ+. Then ab (mod m)  kZ a=b+km. Let a,b,c,dZ, mZ+. Then if ab (mod m) and cd (mod m), then: a+c  b+d (mod m), and ac  bd (mod m) 2/21/01 Lecture #19


Download ppt "COT 3100, Spring 2001 Applications of Discrete Structures"

Similar presentations


Ads by Google