Number Theory 이재원 School of Information Technology Sungshin W. University.

Slides:



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

CSE115/ENGR160 Discrete Mathematics 03/15/12
1 Section 2.4 The Integers and Division. 2 Number Theory Branch of mathematics that includes (among other things): –divisibility –greatest common divisor.
CSE115/ENGR160 Discrete Mathematics 03/13/12 Ming-Hsuan Yang UC Merced 1.
Number Theory and Cryptography
CSE115/ENGR160 Discrete Mathematics 03/15/11
Chapter II. THE INTEGERS
Congruence of 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
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
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 3 (Part 3): The Fundamentals: Algorithms, the.
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.
CompSci 102 Discrete Math for Computer Science February 16, 2012 Prof. Rodger.
Copyright © Curt Hill Divisibility and Modular Arithmetic A Topic in Number Theory.
Chapter The Integers and Division Division
CompSci 102 Discrete Math for Computer Science
Chapter Integers and Algorithms Representations of integers
Section 2.2: Affine Ciphers; More Modular Arithmetic Shift ciphers use an additive key. To increase security, we can add a multiplicative parameter. –For.
Chapter 2 (Part 1): The Fundamentals: Algorithms, the Integers & Matrices The Integers and Division (Section 2.4)
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.
Chapter 4 With Question/Answer Animations. Section 4.1.
1 Section Congruences In short, a congruence relation is an equivalence relation on the carrier of an algebra such that the operations of the algebra.
Module #9 – Number Theory 1/5/ Algorithms, The Integers and Matrices.
Greatest Common Divisors & Least Common Multiples  Definition 4 Let a and b be integers, not both zero. The largest integer d such that d|a and d|b is.
Ref: Pfleeger96, Ch.31 Properties of Arithmetic Reference: Pfleeger, Charles P., Security in Computing, 2nd Edition, Prentice Hall, 1996.
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
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.
Fuw-Yi Yang1 Textbook: Introduction to Cryptography 2nd ed. By J.A. Buchmann Chap 1 Integers Department of Computer Science and Information Engineering,
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/15/17
Integers and Division Section 3.4.
CMSC Discrete Structures
Number Theory and Cryptography
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.
Foundations of Discrete Mathematics
Week #5 – 23/25/27 September 2002 Prof. Marie desJardins
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.
Number Theory.
Discrete Mathematics Chapter 4 Number Theory. Discrete Mathematics Chapter 4 Number Theory.
Presentation transcript:

Number Theory 이재원 School of Information Technology Sungshin W. University

Division DEFINITION 1 If a and b are integers with a≠0, we say that a divides b if there is an integer c such that b=ac. When a divides b we say that a is a factor of b and that b is a multiple of a. The notation a | b denotes that a divides b. We write a ł b when a does not divide b. ex) 3 ł 7, 3|12

Division Cont. THEOREM 1 Let a, b, and c be integers. Then (i) if a | b and a | c, then a | (b + c); (ii) if a | b and a | bc, for all integers c; (iii) if a | b and b | c, then a | c. COROLLARY 1 If a, b, and c are integers such that a | b and a | c then a | mb + nc whenever m and n are integers.

Division Cont. 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. THEOREM 2 In the equality given in the division algorithm, d is called the divisor, a is called the dividend, q is called the quotient, and r is called the remainder. q = a div d, r = a mod d. (101/11?, -11/3?)

Modular Arithmetic DEFINITION 3 If a and b are integers and m is a positive integer, then a is congruent to b modulo m if m divides a – b. a  b (mod m) THEOREM 3 Let a and b be and let m be a positive integer, then a  b (mod m) if and only if a mod m = b mod m. 17  5 (mod 6) ? Yes. 24  14 (mod 6) ? No.

Modular Arithmetic Cont. THEOREM 4 Let m be a positive integer. The integer a and b are congruent modulo m if and only if there is an integer k such that a = b + km THEOREM 5 Let m be a positive integer. If a  b (mod m) and c  d (mod m), then (a + c)  (b + d) (mod m) and ac  bd (mod m). ex) 7  2 (mod 5) and 11  1 (mod 5) => 18  3 (mod 5) and 77  2 (mod 5)

Modular Arithmetic Cont. COROLLARY 2 Let m be a positive integer and let a and b are integers. Then, (a + b) mod m = ((a mod m) + (b mod m)) mod m and ab mod m = ((a mod m)(b mod m)) mod m Proof) a  (a mod m) (mod m) and b  (b mod m) (mod m) -> a + b  (a mod m) + (b mod m) (mod m) …

Applications of Congruences Hashing Functions h(k) = k mod m Pseudorandom Numbers x n+1 = (ax n + c) mod m Ex) if we choose m=9, a=7, c=4, and x 0 =3, we get 3, 7, 8, 6, 1, 2, 0, 4, 5, 3, 7, 8, 6, …

Applications of Congruences Cryptology Caesar’s encryption: f (p) = (p + 3) mod m EXAMPLE 9 secret message from “MEET YOU IN THE PARK” using Caesar’s cipher? “PHHW BRX LQ WKH SUDN” enhancing security: f (p) = (ap + b) mod 26

Primes and GCDs DEFINITION 1 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. The primes less than 100 are 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, and 97.

Primes and GCDs THEOREM 2 If n is a composite integer, then n has a prime divisor less than or equal to. EXAMPLE 3 Show that 101 is prime. Solution: The only primes not exceeding are 2, 3, 5, and 7. … EXAMPLE 4 Find the prime factorization of /7 = 1001, 1001/7 = 143, … 7007 = 7 2 ·11·13

Representation of Integers THEOREM 1 Let b be a positive integer greater than 1. Then if n is a positive integer, it can be expressed uniquely in the form n= a k b k + a k-1 b k-1 + … + a 1 b 1 + a 0 Where k is a nonnegative integer, a 0, a 1, …, a k are nonnegative integers less than b and a k ≠ 0.

Cont. The representation of n given in Theorem 1 is called base b expansion of n. The base b expansion of n is denoted by (a k a k-1 …a 1 a 0 ) b For instance, (245) 8 represents 2· ·8 + 5 = 165.

Cont. Example 1 What is the decimal expansion of the integer that has ( ) 2 as its binary expansion? Solution: ( ) 2 = 1· · · · · · · · ·2 0 = 351.

Cont. Example 3 Find the base 8, or octal, expansion of (12345) 10. Solution: = 8· = 8· = 8· = 8· = 8· (12345) 10 = (30071) 8

Modular Exponentiation Example 11 Find mod 645. Solution: 를 2 진수로 표현하면 ( ) 2 이다. 따 라서 644 = 이며, = (3 의 2 9 승 ) · (3 의 2 7 승 ) · (3 의 2 2 승 ) 이다. - 세 수의 곱을 645 로 나눈 나머지는 각각의 수를 644 로 나눈 나머지들을 모두 곱한 후 다시 645 로 나눈 나머지와 같다 ( 교재 205 페이지의 따름정리 (corollary) 2 참고 ). - 이 원리를 이용하여 만들어진 알고리즘 5 에 의해,

Modular Exponentiation Cont. i=0: a 0 =0, x=1, p=3 2 mod 645 = 9 mod 645 = 9; i=1: a 1 =0, x=1, p=9 2 mod 645 = 81 mod 645 = 81 (3 의 2 2 승 ); i=2: a 2 =1, x=(1·81) mod 645 = 81, p=81 2 mod 645 = 6561 mod 645 = 111; ( (6561 · 6561) mod 645 = (111 · 111) mod 645 ) i=3: a 3 =0, x=81, p=111 2 mod 645 = 12,321 mod 645 = 66; i=4: a 4 =0, x=81, p=66 2 mod 645 = 4356 mod 645 = 486; i=5: a 5 =0, x=81, p=486 2 mod 645 = 236,196 mod 645 = 126; i=6: a 6 =0, x=81, p=126 2 mod 645 = 15,876 mod 645 = 396; i=7: a 7 =1, x=(81·396) mod 645 = 471, p=396 2 mod 645 = 156,816 mod 645 = 81; i=8: a 8 =0, x=471, p=81 2 mod 645 = 6561 mod 645 = 111; i=9: a 9 =1, x=(471·111) mod 645 = 52,281 mod 645 = 36.

Modular Exponentiation Cont. ALGORITHM 5 Modular Exponentiation Procedure modular exponentiation(b: integer, n = (a k-1 a k-2, …, a 1 a 0 ) 2, m: positive integer) x := 1 power := b mod m for i = 0 to k -1 begin if a i = 1 then x := (x · power) mod m power := (power · power) mod m end (x equals b n mod m)

The Euclidean Algorithm More efficient method of finding the greatest common divisor Finding gcd(91, 287) = 91 · any divisor of 91 and 287 must also be a divisor of · 3 = 14. Also, any divisor of 91 and 14 must also be a divisor of 287 = 91 · Hence, the greatest common divisor of 91 and 287 is the same as the greatest common divisor of 91 and 14.

The Euclidean Algorithm Cont. - This means that the problem of finding gcd(91, 287) has been reduced to the problem of finding gcd(91, 14). - Next, divide 91 by 14 to obtain - 91 = 14 · Continue by dividing 14 by 7(gcd(91, 14) = gcd(14, 7)) - 14 = 7 · 2 - Because 7 divides 14, it follows that gcd(14, 7) = 7. Furthermore, because gcd(287, 91) = gcd (91, 14) …, the original problem has been solved.

The Euclidean Algorithm Cont. LEMMA 1 Let a = bq + r, where a, b, q, and r are integers. Then gcd(a, b) = gcd(b, r). Proof: Suppose that d divides both a and b. Then d also divides a – bq = r (from Theorem 1 of section 3.4). Hence, any common divisor of a and b is also a common divisor of b and r. Likewise, suppose that d divides both b and r. Then d also divides bq + r = a. Hence, any common divisor of b and r is also a common divisor of a and b. => gcd(a, b) = gcd(b, r)

The Euclidean Algorithm Cont. EXAMPLE 12 Find the greatest common divisor of 414 and 662. Solution: Successive uses of the division algorithm give: 662 = 414 · = 248 · = 166 · = 82 · = 2 · 41. Hence, gcd(414, 662) = 2, because 2 is the last nonzero remainder.

The Euclidean Algorithm Cont. ALGORITHM 6 The Euclidean Algorithm Procedure gcd(a, b: positive integers) x := a y := b while y ≠ 0 begin r := x mod y x := y y := r end (gcd(a, b) is x)