The Integers and Division. Outline Division: Factors, multiples Exercise 2.3 Primes: The Fundamental Theorem of Arithmetic. The Division Algorithm Greatest.

Slides:



Advertisements
Similar presentations
CS 202 Epp section ?? Aaron Bloomfield
Advertisements

CSE115/ENGR160 Discrete Mathematics 03/15/12
5.1 Number Theory. The study of numbers and their properties. The numbers we use to count are called the Natural Numbers or Counting Numbers.
1 Section 2.4 The Integers and Division. 2 Number Theory Branch of mathematics that includes (among other things): –divisibility –greatest common divisor.
22C:19 Discrete Structures Integers and Modular Arithmetic
CSE 311 Foundations of Computing I Lecture 13 Number Theory Autumn 2012 CSE
Chapter Primes and Greatest Common Divisors ‒Primes ‒Greatest common divisors and least common multiples 1.
February 19, 2015Applied Discrete Mathematics Week 4: Number Theory 1 The Growth of Functions Question: If f(x) is O(x 2 ), is it also O(x 3 )? Yes. x.
Number Theory and Cryptography
CSE115/ENGR160 Discrete Mathematics 03/15/11
Chapter II. THE INTEGERS
1 Integers and Division CS/APMA 202 Rosen section 2.4 Aaron Bloomfield.
Number Theory and Cryptography
Fall 2002CMSC Discrete Structures1 Let us get into… Number Theory.
CS555Spring 2012/Topic 61 Cryptography CS 555 Topic 6: Number Theory Basics.
BY MISS FARAH ADIBAH ADNAN IMK
The Integers and Division
Divisibility October 8, Divisibility If a and b are integers and a  0, then the statement that a divides b means that there is an integer c such.
Integers Number Theory = Properties of Integers
The Fundamentals: Algorithms, Integers, and Matrices CSC-2259 Discrete Structures Konstantin Busch - LSU1.
Number Theory and Cryptography
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 3 (Part 2): The Fundamentals: Algorithms, the.
1 Properties of Integers Objectives At the end of this unit, students should be able to: State the division algorithm Apply the division algorithm Find.
9/2/2015Discrete Structures1 Let us get into… Number Theory.
CSE 504 Discrete Mathematics & Foundations of Computer Science
February 24, 2015Applied Discrete Mathematics Week 4: Number Theory 1 Modular Arithmetic Let a be an integer and m be a positive integer. We denote by.
3.4/3.5 The Integers and Division/ Primes and Greatest Common Divisors Let each of a and b be integers. We say that a divides b, in symbols a | b, provided.
Discrete Mathematics CS 2610 March 17, Number Theory Elementary number theory, concerned with numbers, usually integers and their properties or.
Chapter The Integers and Division Division
Introduction to Cryptography
Section 2.2: Affine Ciphers; More Modular Arithmetic Shift ciphers use an additive key. To increase security, we can add a multiplicative parameter. –For.
Number Theory 이재원 School of Information Technology Sungshin W. University.
Chapter 2 (Part 1): The Fundamentals: Algorithms, the Integers & Matrices The Integers and Division (Section 2.4)
22C:19 Discrete Structures Integers and Modular Arithmetic Fall 2014 Sukumar Ghosh.
Elements of Coding and Encryption 1. Encryption In the modern word, it is crucial that the information is transmitted safely. For example, Internet purchases,
Foundations of Discrete Mathematics Chapter 4 By Dr. Dalia M. Gil, Ph.D.
Module #9 – Number Theory 1/5/ Algorithms, The Integers and Matrices.
Foundations of Computing I CSE 311 Fall Review: Division Theorem Let a be an integer and d a positive integer. Then there are unique integers q.
Unit 2 Modular Arithmetic and Cryptography IT Disicipline ITD1111 Discrete Mathematics & Statistics STDTLP 1 Unit 2 Modular Arithmetic and Cryptography.
Discrete Mathematics
CSE 311: Foundations of Computing Fall 2013 Lecture 11: Modular arithmetic and applications.
Divisibility and Modular Arithmetic
1 Discrete Structures – CNS2300 Text Discrete Mathematics and Its Applications Kenneth H. Rosen (5 th Edition) Chapter 2 The Fundamentals: Algorithms,
The Fundamentals: Algorithms, Integers, and Matrices CSC-2259 Discrete Structures Konstantin Busch - LSU1.
Ch04-Number Theory and Cryptography 1. Introduction to Number Theory Number theory is about integers and their properties. We will start with the basic.
Module #9 – Number Theory 6/11/20161 Chapter 3 Algorithms, Integers and Matrices.
Chapter 4 With Question/Answer Animations 1. Chapter Motivation Number theory is the part of mathematics devoted to the study of the integers and their.
Number Theory Lecture 1 Text book: Discrete Mathematics and its Applications, 7 th Edition.
CSE 311 Foundations of Computing I Lecture 12 Modular Arithmetic and Applications Autumn 2012 CSE
CSE 311 Foundations of Computing I Lecture 11 Modular Exponentiation and Primes Autumn 2011 CSE 3111.
Chapter 3 The Fundamentals: Algorithms, the integers, and matrices Section 3.4: The integers and division Number theory: the part of mathematics involving.
Number Theory. Introduction to Number Theory Number theory is about integers and their properties. We will start with the basic principles of divisibility,
CS 210 Discrete Mathematics The Integers and Division (Section 3.4)
CSE15 Discrete Mathematics 03/20/17
Introduction to Cryptography
Integers and Division Section 3.4.
CMSC Discrete Structures
MATH301- DISCRETE MATHEMATICS Copyright © Nahid Sultana Dr. Nahid Sultana Chapter 4: Number Theory and Cryptography.
Applied Discrete Mathematics Week 3: Algorithms
Applied Discrete Mathematics Week 4: Number Theory
Number Theory.
Enough Mathematical Appetizers!
CSE 311 Foundations of Computing I
CMSC 203, Section 0401 Discrete Structures Fall 2004 Matt Gaston
Copyright © Zeph Grunschlag,
Divisibility and Modular Arithmetic
Applied Discrete Mathematics Week 10: Introduction to Counting
Number Theory.
Module #9: Basic Number Theory
Presentation transcript:

The Integers and Division

Outline Division: Factors, multiples Exercise 2.3 Primes: The Fundamental Theorem of Arithmetic. The Division Algorithm Greatest Common Divisors: Relatively prime Least Common Multiples Modular Arithmetic: Congruence Applications of Congruence: Cryptology

Division Definition Let a and b be integers with a  0. Then, we say that a divides b (and we note a | b) if there is an integer c such that b = ac. –a is called a factor of b, and b is multiple of a. –We note a ¬| b when a does not divide b I used above notation for lack of strike vertical in PP. –Examples 3 | 12, but 3 ¬| 14 –Note P(a, b): a | b is a predicate, with values True or False. Theorem Let a, b, c be integers with a  0. Then, –if a | b and a | c, then a | (b+c); –if a | b, then a | bc; –if a | b and b | c, then a | c.

Exercise 2.3a

Primes Definition A positive integer p greater than 1 is called prime if the only positive factors of p are 1 and p. –A positive integer that is greater than 1 and is not prime is called composite. –Examples 7 is prime. 9 is composite. –Note 1 is not prime, nor composite. –Some primes: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47… The Fundamental Theorem of Arithmetic Every positive integer can be written uniquely as the product of primes, in increasing order. –Examples. 100 = 2 2  5 2, 641 = 641, 999 = 3 3  37, and 1024 = 2 10.

Primes – Cont. Theorem If n is a composite integer, then n has a prime divisor less than or equal to  n. An integer n is prime if it is not divisible by any prime less than or equal to  n. –101 is prime, since 101 is not divisible by 2, 3, 5, or 7 (the only primes less or equal than  101.) Prime factorization of 7007: –Divide 7007 by primes, starting with 2, 3, 7… 7007/7 = –Divide 1001 by primes, starting with 7… 1001/7 = 143. –Divide 143 by primes, starting with 7… 143/11 = 13. –Stop, since 13 is prime = 7 2  11  13

The Division Algorithm The Division Algorithm Let a be an integer and d a positive integer. Then there are unique integers q and r, with 0  r < d, such that a = dq + r. –d is called the divisor, –a is called the dividend, –q is called the quotient, –r is called the reminder. –Examples 101 = 11  How about: 101 = 11  ? -11 = 3(-4) + 1. How about: -11 = 3(-3) - 2?

Greatest Common Divisors Definition Let a and b be integers, not both zero. The largest integer d such that d | a and d | b, denoted by gcd(a, b), is called the greatest common divisor of a and b. –Examples gcd(24, 36) = 12. gcd(17, 22) = 1.

Greatest Common Divisors -Cont Procedure to find gcd(a, b): –Find the prime factorization of a and b. –If a = p 1 a 1 p 2 a 2 … p n a n, b = p 1 b 1 p 2 b 2 … p n b n, then gcd(a, b) = p 1 min(a 1,b 1 ) p 2 min(a 2,b 2 ) … p n min(a n,b n ) –Examples 120 = 2 3  3  5 and 500 = 2 2  5 3 = 2 2  3 0  5 3 gcd(120, 500) = 2 2  3 0  5 1 = 20.

Relatively Prime Integers Definition The integers a and b are relatively prime if gcd(a, b) = 1. –Example 17 and 22 are relatively prime. Definition The integers a 1, a 2, …, a n are pairwise relatively prime if gcd(a i, a j )=1 whenever 1  i<j  n. –Examples 10, 17 and 21 are pairwise relatively prime. 10, 17 and 24 are not pairwise relatively prime.

Least Common Multiples Definition Let a and b be positive integers. The least common multiple of a and b is the smallest positive integer that is divisible by both a and b. It is denoted by lcm(a, b). –If a = p 1 a 1 p 2 a 2 … p n a n, b = p 1 b 1 p 2 b 2 … p n b n, then lcm(a, b) = p 1 max(a 1,b 1 ) p 2 max(a 2,b 2 ) … p n max(a n,b n ) –Example lcm( , ) = Theorem  a  +  b  + ab = gcd(a, b)  lcm(a, b)

Modular Arithmetic Definition Let a be an integer and m a positive integer. a mod m denotes the reminder when a is divided by m. –a mod m = r, where 0  r < m and a = qm + r. –Examples 17 mod 5 = 2 (since 17 = 3  ) -133 mod 9 = mod 101 = 82 –The function f m : Z → {0, 1, 2, …, m-1}, where f m (a) = a mod m is onto, but not one-to-one.

Congruence Definition If a and b are integers and m a positive integer, then a is congruent to b modulo m (a  b (mod m)) if m divides (a – b). –Note a  b (mod m)  a mod m = b mod m –Examples 17  5 (mod 6), since 17-5 = 12 = 6  2 is a multiple of 6. Note also that 17 mod 6 = 5 mod 6 = ¬  14 (mod 6) I used above notation for lack of strike  in PP.

Congruence – Cont. Theorem  m  Z +  a  Z  b  Z a  b (mod m)   k  Z a = b + km Theorem If a  b (mod m) and c  d (mod m), then: a+c  b+d (mod m), and ac  bd (mod m).

Applications of Congruence Hashing Functions Pseudorandom Numbers –Linear congruential method Cryptology –Caesar cipher

Hashing Functions Records are identified by a key (integer k). –For example, using Social Security number To record k, assign memory location –h(k) = k mod m, where m is the number of available memory locations. h(k) is easily evaluated; it is also onto. Example. If m=111, the record with k= is assigned to location 14 since h( ) = mod 111 = 14. Collision may occur since h(k) is not one-to-one. –Resolve by assigning next free location.

Pseudorandom Numbers Linear congruential method –Choose: modulus m, multiplier a, increment c, and seed x 0, with 2  a < m, 0  c, x 0 < m –Generate the sequence {x n } x n+1 = (a x n + c) mod m. –Example m = 9, a = 7, c = 4, and x 0 = 3: x 1 = 7x 0 +4 mod 9 = 7  mod 9 = 25 mod 9 = 7 x 2 =8, x 3 =6, x 4 =1, x 5 =2, x 6 =0, x 7 =4, x 8 =5, x 9 =3. –Usually, a pure multiplicative generator is used: Increment c=0, modulus m=2 31 – 1, multiplier a=7 5 =16,807.

Cryptology Caesar’s encryption process: –Represent each letter by an integer from 0 to 25 –Replace a letter represented by p by the letter represented by f(p) = (p + 3) mod 26. –Example M  12, f (12) = (12+3) mod 26 = 15  P “Meet you in the park’’ is replaced by “Phhw brx lq wkh sdun” –Decryption. To recover the original message, use the inverse function f -1 (p)= (p - 3) mod 26.

Cryptology – Cont. Caesar cipher can be generalized: –Shift cipher: f(p) = (p + k) mod 26. –Affine transformation: f(p) = (ap + b) mod 26, where a and be are integers chosen so that f is a bijection. Example f(p) = (7p + 3) mod 26, K? –K  10, f (10) = (7  ) mod 26 = 73 mod 26 = 21  V. –K is replaced by V in the encrypted message.