Number Theory Notes Spring 2011

Similar documents
Elementary Number Theory MARUCO. Summer, 2018

Theory of RSA. Hiroshi Toyoizumi 1. December 8,

Basic elements of number theory

Basic elements of number theory

Numbers. Çetin Kaya Koç Winter / 18

Number Theory. CSS322: Security and Cryptography. Sirindhorn International Institute of Technology Thammasat University CSS322. Number Theory.

Lecture 4: Number theory

CPSC 467b: Cryptography and Computer Security

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

Mathematics of Cryptography

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

The Euclidean Algorithm and Multiplicative Inverses

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

Ch 4.2 Divisibility Properties

ECE596C: Handout #11

ICS141: Discrete Mathematics for Computer Science I

Mathematical Foundations of Cryptography

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

Congruence Classes. Number Theory Essentials. Modular Arithmetic Systems

Number Theory A focused introduction

ECE 646 Lecture 5. Mathematical Background: Modular Arithmetic

Elementary Properties of the Integers

Number Theory Proof Portfolio

Chapter 5. Modular arithmetic. 5.1 The modular ring

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

Public Key Cryptography

CSC 474 Information Systems Security

Homework #2 solutions Due: June 15, 2012

Elementary Number Theory Review. Franz Luef

CMPUT 403: Number Theory

Intermediate Math Circles February 29, 2012 Linear Diophantine Equations I

Intermediate Math Circles February 26, 2014 Diophantine Equations I

Some Facts from Number Theory

Mathematics for Cryptography

Number Theory and Group Theoryfor Public-Key Cryptography

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?

Beautiful Mathematics

MTH 346: The Chinese Remainder Theorem

Encryption: The RSA Public Key Cipher

3 The fundamentals: Algorithms, the integers, and matrices

Lecture 7 Number Theory Euiseong Seo

Discrete Mathematics with Applications MATH236

NUMBER THEORY AND CODES. Álvaro Pelayo WUSTL

For your quiz in recitation this week, refer to these exercise generators:

Lecture 2. The Euclidean Algorithm and Numbers in Other Bases

4 Number Theory and Cryptography

Introduction to Public-Key Cryptosystems:

ECEN 5022 Cryptography

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?

MATH 145 Algebra, Solutions to Assignment 4

Outline. Number Theory and Modular Arithmetic. p-1. Definition: Modular equivalence a b [mod n] (a mod n) = (b mod n) n (a-b)

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

Applied Cryptography and Computer Security CSE 664 Spring 2017

NOTES ON SIMPLE NUMBER THEORY

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

download instant at

Divisibility. Def: a divides b (denoted a b) if there exists an integer x such that b = ax. If a divides b we say that a is a divisor of b.

A Readable Introduction to Real Mathematics

CS250: Discrete Math for Computer Science

CPSC 467: Cryptography and Computer Security

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

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

ALGEBRA. 1. Some elementary number theory 1.1. Primes and divisibility. We denote the collection of integers

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

Chapter 4 Finite Fields

Number theory (Chapter 4)

Topics in Cryptography. Lecture 5: Basic Number Theory

Lecture Notes. Advanced Discrete Structures COT S

Number Theory. For Teachers

CPSC 467b: Cryptography and Computer Security

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

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

This is a recursive algorithm. The procedure is guaranteed to terminate, since the second argument decreases each time.

CISC-102 Fall 2017 Week 6

Introduction to Cryptography CS 355 Lecture 3

Modular Arithmetic. Examples: 17 mod 5 = 2. 5 mod 17 = 5. 8 mod 3 = 1. Some interesting properties of modular arithmetic:

Discrete Mathematics GCD, LCM, RSA Algorithm

Number Theory. Zachary Friggstad. Programming Club Meeting

Lecture 5: Arithmetic Modulo m, Primes and Greatest Common Divisors Lecturer: Lale Özkahya

Number Theory. Modular Arithmetic

Integers and Division

Elementary Number Theory. Franz Luef

Ma/CS 6a Class 2: Congruences

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

Clock Arithmetic and Euclid s Algorithm

CPSC 467: Cryptography and Computer Security

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

7.2 Applications of Euler s and Fermat s Theorem.

ECE 646 Lecture 5. Motivation: Mathematical Background: Modular Arithmetic. Public-key ciphers. RSA keys. RSA as a trap-door one-way function

Introduction to Cryptography. Lecture 6

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

cse 311: foundations of computing Fall 2015 Lecture 12: Primes, GCD, applications

Fall 2017 September 20, Written Homework 02

Math 110 FOUNDATIONS OF THE REAL NUMBER SYSTEM FOR ELEMENTARY AND MIDDLE SCHOOL TEACHERS

cse 311: foundations of computing Spring 2015 Lecture 12: Primes, GCD, applications

Chapter 1. Greatest common divisor. 1.1 The division theorem. In the beginning, there are the natural numbers 0, 1, 2, 3, 4,...,

Lecture 7: Number Theory Steven Skiena. skiena

4. Congruence Classes

Senior Math Circles Cryptography and Number Theory Week 2

Transcription:

PRELIMINARIES The counting numbers or natural numbers are 1, 2, 3, 4, 5, 6.... The whole numbers are the counting numbers with zero 0, 1, 2, 3, 4, 5, 6.... The integers are the counting numbers and zero and negative numbers.... -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6... The counting numbers are also called the positive integers. The whole numbers are also called the non-negative integers. Meaning of addition a+b is the number of objects when combining a group of a objects with a group of b objects. Meaning of multiplication a b is the number of objects in a groups with b objects in each group. Definition: An Arithmetic Sequence is a sequence created by starting with a number. Each subsequent entry is obtained from the previous entry by adding the same fixed number. Alternately, an arithmetic sequence is a sequence in which there is a constant difference between successive terms. Example: A +3 cricket that starts at 2, hops out an arithmetic sequence: 2, 5, 8, 11, 14, 17,... A formula for the nth number in the sequence is given by 2+3 n. When n=0 the cricket is on 2, when n=1 the cricket is on 5, etc. Definition: An Arithmetic Progression is an arithmetic sequence in both directions. Example: If consider where the +3 cricket was before she got to 2, we could still use the formula, 2+3 n, but consider negative values of n. The entire progression may be written, in part by... -13, -10, -7, -4, -1, 2, 5, 8, 11, 14, 17,... (n,m) Combination Chart A (n,m) Combination Chart, is created on a square grid by starting at 0 and adding n for each step in the positive x-direction and adding m for each step in the positive y-direction. Combination Charts can also be extended backwards to include negative combinations downwards and to the left. 1

Example: This shows part of a (3,5)-Combination Chart. That shaded part are positive combinations of positive. Going down from the shaded region, combinations have negative multiples of 5. Going left of the shaded region, combinations have negative multiples of 3. 10 13 16 19 22 25 28 31 34 37 40 5 8 11 14 17 20 23 26 29 32 35 0 3 6 9 12 15 18 21 24 27 30-5 -2 1 4 7 10 13 16 19 22 25-10 -7-4 -1 2 5 8 11 14 17 20-15 -12-9 -6-3 0 3 6 9 12 15-20 -17-14 -11-8 -5-2 1 4 7 10-25 -22-19 -16-13 -10-7 -4-1 2 5-30 -27-24 -21-18 -15-12 -9-6 -3 0-35 -32-29 -26-23 -20-17 -14-11 -8-5 -40-37 -34-31 -28-25 -22-19 -16-13 -10 Notice: Each row going right and each column going up in a combination chart is an arithmetic sequence. The chart may be continued to include negative numbers. Then each row and each column is an arithmetic progression. The numbers on any diagonal also form an arithmetic progression. In fact any arrow combination, produces an arithmetic progression. Example: Think of a cricket that hops on each hop. If this cricket starts on 3 on this (3,5) CC, it will hop out the sequence 3, 16, 29, 42,... If it starts on -6 it hops out the sequence -62, 15, 28, 41,... 2

Definitions and Basic Properties of Integers Addition Multiplication There is an unique additive identity named 0 a +0 = a There is an unique multiplicative identity named 1 a 1 = a Inverses: a + -a = 0 1 and -1 are the only For any integer there is integers that have a unique additive inverse integer multiplicative inverses, they are called units Associative Property: (a + b) + c = a + (b + c) (a b) c = a (b c) Commutative Property: a + b = b + a a b = b a The Distributive Property: a (b + c) = a b + a c (Gives a relationship between addition and multiplication) 3

DIVISION Meaning of division a d is how many groups can be made of a objects, if there are d objects in each group. OR it is how many objects in each group if a objects are grouped into d groups. Division does not always have a whole number solution, but we can divide and keep track of the remainder: Theorem 1 The Division Algorithm Given two integers, m and n > 0, there exist unique integers q and r, with m = q n + r, and 0 r < n Proof: Repeatedly subtract n from m. Stop the last time you are able to subtract without going less than zero. q is the number of times you subtracted n and r is the amount left over. Examples: If m = 100, n = 23, then q=4 and r=8. 100 = 4 23 + 8 If m = 124, n = 4, then q=41 and r=0. 124 = 41 4 + 0 If m = 60, n = 7, then q=8 and r=4. 60 = 8 7 + 4 Examples with negative numbers: If m = -60, n = 7, then q=-9 and r=3. -60 = -9 7 + 3 NOT -60 = -8 7-1 because r must be positive. If m = 60, n = -7, then q=-8 and r=4. 60 = -8-7 + 4 If m = -60, n = -7, then q=9 and r=3., -60 = 9-7 + 3 The special case when r = 0 is worth special terminology and notation: 4

DIVISIBILITY Definition: For d, a integers, we say that d divides a and we write, d a -- if there is an unique integer, q, such that a=q d. In this case, we may also write a d q = q or a d = q or d) a. In more familiar language, we also say that d is a factor of a or that a is a multiple of d. Theorem 1.1: If d a, then 0 < d a. In particular, d cannot be zero, that is we cannot divide by zero. Even 0 cannot be divided by 0. Theorem 1.2 a) d a if and only if d -a b) d a if and only if -d a c) ±1 a, for every integer a. d) If d ±1, then d= ±1. e) If a b and b a, then a = ±b. Theorem 1.3 a) If a b and b c, then a c b) If d a and d b, then d a+b c) If d a, then d c a for every integer c. d) If d a and d b, then d x a+y b for arbitrary integers x and y. 5

GREATEST COMMON DIVISOR Definition: The greatest common divisor of two or more non-zero numbers is the greatest positive integer that divides all of the numbers. The greatest common divisor of two non-zero integers A and B is abbreviate: gcd(a, B). Sometimes in elementary school it is called the greatest common factor. Euclidian Algorithm: The Euclidean Algorithm uses repeated subtraction to find the gcd(a,b). The following theorem is the major step we need to justify finding the gcd(a, B) using the Euclidean Algorithm. Theorem 1.4 If A - q B = r, then gcd(a,b)=gcd(b,r) This theorem shows how the Euclidean Algorithm can be use to find the gcd of two numbers, A and B. The Euclidean algorithm, like long division, has many steps. First we use the division algorithm to write A - q 1 B = r 1 Now our problem (by Thm 1.4) has been reduced to finding gcd (B, r) since, by Theorem 1.6, gcd(a,b)=gcd(b,r), so B is our new A and r is our new B. B - q 2 r = r 2 Notice that gcd(a,b)=gcd(b,r)=gcd(r, r 2 ) r - q 3 r 2 = r 3 r n-1 q n-1 r n = r last and we can continue for as many steps as needed until we see what the gcd must be. Now gcd(a,b)=gcd(b,r)=gcd(r, r 2 )= gcd(r 2, r 3 ). It is important to notice that the algorithm will eventually stop because the r s are getting smaller and smaller. Eventually some last r will be 0, r n q n r last = 0 and so gcd(a,b)=gcd(b,r)=gcd(r, r 2 )= gcd(r 2, r 3 )... gcd(r last,0). But the least common divisor of any number and zero has to be that number itself so r last is the least common divisor of A and B as well. 6

Theorem 2 The Extended Euclidean Algorithm The equation A N + B M = C has a solution N and M, integers, if and only if gcd (A, B) C. (Note: this is equivalent to saying that C must be on the (A, B) - Combination Chart.) A (B * Q) = R N M R = A*N + B*M A 1 0 B 0 1 A B Q=int(A/B) R=A-Q*B N2-Q*N1 M2-Q*M1 7

IMPORTANT CONSEQUENCES OF THE EUCLIDEAN ALGORITHM Theorem 2.1 If m a b and if gcd(a,m) =1, then m b. In particular, if p a b where p is a prime number, then p a or p b. Proof: Find N and M such that a N+m M=1. Multiply both sides by b to get a b N+m b M=b. m divides both terms on the left hand side, so m divides b as well. The following theorem is too important to have a number. It is just known by it s name: Fundamental Theorem of Arithmetic Every positive integer can be factored uniquely as a product of prime numbers. 8

MODULAR ARITHMETIC Definition: a b (mod m) means that m (a - b) or equivalently that a b is a multiple of m or that m is a factor of a b. Theorem 3.0 a b (mod m) if and only if a and b both have the same remainder when divided by m. Definition: The least residues mod m are the positive integers from 0 to m-1. Theorem 3.1 a a (mod m) Theorem 3.2 If a b (mod m), then b a (mod m) Theorem 3.3 If a b (mod m) and b c (mod m), then a c (mod m) Theorem 3.4 If a b (mod m), then a+c b+c (mod m) Theorem 3.5 If a b (mod m), then a c b c (mod m) Theorem 3.6 If a b (mod m) and c d (mod m), then a c b d (mod m) Theorem 3.7 If a b (mod m) and c d (mod m), then a+c b+d (mod m) Theorem 3.8 If If a b (mod m) and k is any natural number, then a k b k (mod m) 9

Definition: We say that two positive integers, a and b, are relatively prime when gcd(a,b)=1. Cipher fact: An integer, k, makes a good multiplicative key if and only if k and 26 are relatively prime [gcd(k, 26)=1]. Reason: Multiplicative key k is a good key if there is a multiplicative inverse for k, that is, there is a number, N, such that k N 1(mod26). Which means that k N 1 is a multiple of 26. That is, k N 1=26 M OR k N 26M=1. We know from the Extended Euclidean Algorithm that this Diophantine equation has solutions if and only if gcd(k, 26)=1. In general, Definition: Given integers a and b, we say that b is the inverse of a mod m if and only if a b 1 (mod m) Theorem 2.9: For any integers a and m, a has an inverse (mod m) if and only if gcd(a, m)=1. Proof: We can find the inverse by using the extended Euclidean Algorithm to solve a N-m M=1 Theorem 2.10: The congruence equation ax b (mod ) m has solutions if and only if ( a, m) b EXAMPLE: Compare congruence equation ax b (mod m ) to linear Diophantine equation ax + my = b.. Definition: Least residue (mod m) means numbers from 0 to m-1. Theorem 2.11: If ( a, m ) = 1 then ax b (mod m ) has exactly one least residue solution. Proof: Because a is relatively prime to m, a has an inverse mod m. Multiply both sides of the congruence by the inverse of a, so x = (inverse of a) b. Theorem 2.12: If ( a, m) = d and d b then ax b (mod m ) has exactly d least residue solutions. If d does not divide b, there are no solutions. 10

Here are two theorems we ve know for some time: Theorem 3.1 If a b m and if gcd(a,m) =1 then a b Theorem 3.2 If a c b c (mod m) and if gcd(c,m) =1, then a b (mod m) Theorem 4.1: If gcd (a,m)=1, then the least residues of the numbers a, 2a, 3a, 4a,, (m-1) a are the numbers 1, 2, 3, 4,, (m-1). Fermat s Theorem 4.2: If p is prime and if gcd (a,p)=1, than a p-1 1 mod p. Definition: We call the set of all positive numbers that are relatively prime to m and less than m the reduced residue system mod m. Theorem 5.1 If gcd(a,m)=1, then the set of all products a x, where x is relatively is in the reduced residue is the reduced residue system. Definition: The number of integers in the reduced residue system mod m is called φ(m). Theorem 5.2 φ(p)=p-1 if p is a prime number. Theorem 5.3 φ(p q)=(p-1) (q-1) if p and q are prime numbers. Theorem 5.4 If gcd(a,n)=1, then a φ(n) 1 mod n. Theorem 5.5 If gcd(m,n)=1, then m φ(n) k+1 m mod n. Theorem 5.6 If n=p q, then m φ(n) k+1 m (mod n), for all integers, m. This is the theorem that tells us that RSA encryption works. That is, if we make a public key, (N, e), base on two prime numbers, p and q, and encode messages by raising to the e th power, then raising the encrypted numbers to the d th power will undo the encryption. Theorem 5.7 If N= p q, where p and q are prime numbers and if e is relatively prime to φ(n)=(p-1) (q-1) and if d is the inverse of e mod φ(n)=(p-1) (q-1) and if C m e (mod N) then m C d (mod N). 11

12