MATH 501 Discrete Mathematics. Lecture 6: Number theory. German University Cairo, Department of Media Engineering and Technology.

Similar documents
MATH 433 Applied Algebra Lecture 4: Modular arithmetic (continued). Linear congruences.

MATH 145 Algebra, Solutions to Assignment 4

cse547, math547 DISCRETE MATHEMATICS Professor Anita Wasilewska

NOTES ON SIMPLE NUMBER THEORY

Homework #2 solutions Due: June 15, 2012

Chuck Garner, Ph.D. May 25, 2009 / Georgia ARML Practice

Applied Cryptography and Computer Security CSE 664 Spring 2017

4 Powers of an Element; Cyclic Groups

Math 109 HW 9 Solutions

Number Theory Solutions Packet

COMP239: Mathematics for Computer Science II. Prof. Chadi Assi EV7.635

Integers and Division

2.3 In modular arithmetic, all arithmetic operations are performed modulo some integer.

Exercises Exercises. 2. Determine whether each of these integers is prime. a) 21. b) 29. c) 71. d) 97. e) 111. f) 143. a) 19. b) 27. c) 93.

INTEGERS. In this section we aim to show the following: Goal. Every natural number can be written uniquely as a product of primes.

Number Theory Proof Portfolio

4 Number Theory and Cryptography

All variables a, b, n, etc are integers unless otherwise stated. Each part of a problem is worth 5 points.

3 The fundamentals: Algorithms, the integers, and matrices

CS 5319 Advanced Discrete Structure. Lecture 9: Introduction to Number Theory II

An Algorithm for Prime Factorization

1 Overview and revision

PUTNAM TRAINING NUMBER THEORY. Exercises 1. Show that the sum of two consecutive primes is never twice a prime.

Math.3336: Discrete Mathematics. Primes and Greatest Common Divisors

Math 131 notes. Jason Riedy. 6 October, Linear Diophantine equations : Likely delayed 6

MTH 346: The Chinese Remainder Theorem

A field F is a set of numbers that includes the two numbers 0 and 1 and satisfies the properties:

Lecture Notes. Advanced Discrete Structures COT S

MATH 420 FINAL EXAM J. Beachy, 5/7/97

Chapter 3 Basic Number Theory

2x 1 7. A linear congruence in modular arithmetic is an equation of the form. Why is the solution a set of integers rather than a unique integer?

Algorithmic number theory. Questions/Complaints About Homework? The division algorithm. Division

Exam 2 Review Chapters 4-5

CMPUT 403: Number Theory

CSE 20 DISCRETE MATH. Winter

Ma/CS 6a Class 2: Congruences

Basic elements of number theory

Basic elements of number theory

The Chinese Remainder Theorem

Number Theory and Group Theoryfor Public-Key Cryptography

a the relation arb is defined if and only if = 2 k, k

MATH 361: NUMBER THEORY FOURTH LECTURE

Elementary Number Theory Review. Franz Luef

PRACTICE PROBLEMS: SET 1

EUCLID S ALGORITHM AND THE FUNDAMENTAL THEOREM OF ARITHMETIC after N. Vasiliev and V. Gutenmacher (Kvant, 1972)

Math.3336: Discrete Mathematics. Primes and Greatest Common Divisors

Executive Assessment. Executive Assessment Math Review. Section 1.0, Arithmetic, includes the following topics:

12x + 18y = 50. 2x + v = 12. (x, v) = (6 + k, 2k), k Z.

CHAPTER 6. Prime Numbers. Definition and Fundamental Results

Number theory (Chapter 4)

10 Problem 1. The following assertions may be true or false, depending on the choice of the integers a, b 0. a "

Chapter 5. Number Theory. 5.1 Base b representations

Ch 4.2 Divisibility Properties

A number that can be written as, where p and q are integers and q Number.

2 Arithmetic. 2.1 Greatest common divisors. This chapter is about properties of the integers Z = {..., 2, 1, 0, 1, 2,...}.

A Few Primality Testing Algorithms

Mathematical Foundations of Public-Key Cryptography

Lecture notes: Algorithms for integers, polynomials (Thorsten Theobald)

M381 Number Theory 2004 Page 1

Fall 2017 Test II review problems

Wednesday, February 21. Today we will begin Course Notes Chapter 5 (Number Theory).

0 Sets and Induction. Sets

7.2 Applications of Euler s and Fermat s Theorem.

2x 1 7. A linear congruence in modular arithmetic is an equation of the form. Why is the solution a set of integers rather than a unique integer?

Notes on Systems of Linear Congruences

An integer p is prime if p > 1 and p has exactly two positive divisors, 1 and p.

Chapter 2. Divisibility. 2.1 Common Divisors

Number Theory Marathon. Mario Ynocente Castro, National University of Engineering, Peru

NUMBER THEORY AND CODES. Álvaro Pelayo WUSTL

Introduction to Cryptography CS 355 Lecture 3

The set of integers will be denoted by Z = {, -3, -2, -1, 0, 1, 2, 3, 4, }

CHAPTER 3. Congruences. Congruence: definitions and properties

MATH 215 Final. M4. For all a, b in Z, a b = b a.

ECE596C: Handout #11

MONOALPHABETIC CIPHERS AND THEIR MATHEMATICS. CIS 400/628 Spring 2005 Introduction to Cryptography

(e) Commutativity: a b = b a. (f) Distributivity of times over plus: a (b + c) = a b + a c and (b + c) a = b a + c a.

Ma/CS 6a Class 2: Congruences

Number Theory Math 420 Silverman Exam #1 February 27, 2018

D-MATH Algebra I HS18 Prof. Rahul Pandharipande. Solution 1. Arithmetic, Zorn s Lemma.

Mathematical Foundations of Cryptography

Proof 1: Using only ch. 6 results. Since gcd(a, b) = 1, we have

Introduction to Information Security

Intermediate Math Circles February 29, 2012 Linear Diophantine Equations I

NUMBER SYSTEMS. Number theory is the study of the integers. We denote the set of integers by Z:

Outline. Some Review: Divisors. Common Divisors. Primes and Factors. b divides a (or b is a divisor of a) if a = mb for some m

Outline. AIT 682: Network and Systems Security. GCD and Euclid s Algorithm Modulo Arithmetic Modular Exponentiation Discrete Logarithms

WORKSHEET ON NUMBERS, MATH 215 FALL. We start our study of numbers with the integers: N = {1, 2, 3,...}

PROBLEMS ON CONGRUENCES AND DIVISIBILITY

Proofs. Methods of Proof Divisibility Floor and Ceiling Contradiction & Contrapositive Euclidean Algorithm. Reading (Epp s textbook)

SEVENTH EDITION and EXPANDED SEVENTH EDITION

Math 312/ AMS 351 (Fall 17) Sample Questions for Final

The Euclidean Algorithm and Multiplicative Inverses

MATH 145 Algebra, Solutions to Assignment 4

CPSC 467b: Cryptography and Computer Security

Simultaneous Linear, and Non-linear Congruences

Know the Well-ordering principle: Any set of positive integers which has at least one element contains a smallest element.

CSC 474 Network Security. Outline. GCD and Euclid s Algorithm. GCD and Euclid s Algorithm Modulo Arithmetic Modular Exponentiation Discrete Logarithms

Modular Arithmetic Instructor: Marizza Bailey Name:

A Readable Introduction to Real Mathematics

Chapter 3: The Euclidean Algorithm and Diophantine. Math 138 Burger California State University, Fresno

Transcription:

MATH 501 Discrete Mathematics Lecture 6: Number theory Prof. Dr. Slim Abdennadher, slim.abdennadher@guc.edu.eg German University Cairo, Department of Media Engineering and Technology 1 Number theory Number theory 1.1 Examples Some examples Number theory revolves around integers. Some simple examples: Can the sum of two squares be a square? Are 8 and 9 the only consecutive powers? Ask for the solution to X a y b = 1 in integers Every natural number is the sum of four integer squares 1.2 Divisibility Some operations Number theory revolves around integers. Some simple operations: A number m divides n if m > 0 and there is a k such that mk = n m\n m > 0 and k. n = mk The remainder of a division is given through the modulo operation: remainder n {}}{ n = m + n mod m }{{ m } quotient 1

LCM and GCD Comparing multiples and divisors of two numbers The least common multiple lcm(n, m) of two numbers n and m is defined as lcm(n, m) = min{k k > 0, n\k and m\k} Rational number arithmetic (finding the least common denominator) Real-time systems (finding the period of a set of rates) The greatest common divisor gcd(n, m) of two numbers n and m is defined as gcd(n, m) = max{k k\n and k\m} Finding the lowest terms of a rational number Cryptography Greatest common divisor The gcd is usually found using the Euclidean algorithm: gcd(n, n) = n This can be rephrased as Greatest common divisor Note that gcd(n, m) = gcd(max(n, m) min(n, m), min(n, m)) gcd(0, m) = m gcd(n, m) = gcd(m mod n, n) k\n and k\m k\ gcd(n, m) Also: n, m Z. n, m Z. n n + m m = gcd(n, m) Greatest common divisor: A property Consider and We claim: x Z Def. = {xz z Z} x Z + y Z Def. = {xu + yz u, z Z} a Z + b Z = d Z d = gcd(a, b). 2

Greatest common divisor: A property Proof: a Z + b Z = gcd(a, b) Z. Showing a Z + b Z gcd(a, b) Z Let k a Z + b Z. Then k = ax + by for some x, y Z. Since gcd(a, b)\ax and gcd(a, b)\by we have the gcd(a, b)\k. Thus k gcd(a, b) Z. Showing a Z+b Z gcd(a, b) Z Let k gcd(a, b) Z. Then k = gcd(a, b) n for some n. We know that there exists an a and a b such that a a + b b = gcd(a, b). Thus k = n gcd(a, b) = na a + nb b a Z + b Z. Least Common Multiple The lcm could be found using the gcd: 1.3 Primes Definition lcm(n, m) = n m gcd(n, m) Definition 1 (Prime). A positive integer p is called prime if it has just two divisors: 1 and p. by convention 1 is not prime. 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43,... A number which is not prime (precisely: which has nontrivial divisors) is called composite Any number n > 1 is either prime or composite. Prime factorization Primes form the scaffold of all positive integers Every positive integer n can be written as a product n = p 1 p m = of prime numbers p 1,..., p m. Show by course-of-value induction. 1 k m This prime factorization is unique (short of permutations): For every positive integer n there is exactly one prime factorization. Show by course-of-value induction. In the induction step assume that more than one factorization exists and derive a contradiction. p k 3

Prime factorization Moreover, every positive integer n can be uniquely written in the form n = p np p prime where n p 0 is the count of each prime p in the unique prime factorization of n. 60 = 2 2 3 5 = 2 2 3 1 5 1 7 0 11 0 13 0 = p np, with n p = 2, 1, 1, 0, 0, 0,... p prime Prime factorization We can think of the sequence n 2, n 3, n 5,... as a number system for positive integers, as each uniquely represents a number. To multiply numbers in this system...... simply add their representations. Example 2. 26: 1, 0, 0, 0, 0, 1, 0,... 28: 2, 0, 0, 1, 0, 0, 0,... 26 28: 3, 0, 0, 1, 0, 1, 0,... represents 728 Prime factorization The uniqueness of the prime factorization is called the... Theorem 3 (Fundamental Theorem of Arithmetic). Every positive integer n can be uniquely decomposed into prime factors. How many prime numbers are there? Let s assume there are only k primes for some k > 0 Then we can find a number M = 2 3 5... p k + 1 However, there is no prime p i {2, 3,..., p k } such that p i \M (because each of them divides M 1). Thus, either M is prime or there are primes p x1,..., p xm factorize M. Contradiction! {2, 3,..., p k } that So there are infinitely many primes. 4

GCD is MIN of Exponents of Prime Factors STEP 1: Find the prime factorization of each integer. 375 = 3 5 3 525 = 3 5 2 7 STEP 2: List the common prime divisors (factors) with the least power of all the given integers. 375 = 3 5 3 = 3 5 2 5 525 = 3 5 2 7 = 3 5 2 7 Common Prime Divisors (Factors) with Least Power: 3 and 5 2 STEP 3: Multiply the common prime divisors (factors) to find the GCD 3 5 2 = 75 GCD is MIN of Exponents of Prime Factors STEP 3: Multiply the common prime divisors (factors) to find the GCD 3 5 2 = 75 LCM is MAX of Exponents of Prime Factors STEP 1: Find the prime factorization of each integer. 4 = 2 2 10 = 2 5 45 = 3 2 5 STEP 2: List the prime divisors (factors) with the greatest power of all the given integers. 4 = 2 2 10 = 2 5 45 = 3 2 5 Prime Divisors (Factors) with Greatest Power: 2 2, 3 2, and 5 LCM is MAX of Exponents of Prime Factors STEP 3: Multiply the prime divisors to find the lcm 2 2 3 2 5 = 180 5

Relative primality We call n and m relative prime iff gcd(n, m) = 1. n m Def. gcd(n, m) = 1 Note: Likewise: n gcd(n, m) m gcd(n, m) k n and k m k nm 2 Modulo arithemtics 2.1 Modulo congruence The congruence relation We define: a b (mod m) Def. a mod m = b mod m Example 4. Since 9 16 (mod 5) 9 mod 5 = 4 = ( 16) mod 5. Arithmetics with congruences Some examples for calculating with congruences: Let a b (mod m) and c d (mod m). Then a + c b + d (mod m) a c b d (mod m) a c b d (mod m) Also And a b a n b n (mod m) d m (ad bd a b (mod m)) 6