Number Theory Basics Z = {..., 2, 1, 0, 1, 2,...} For, b Z, we say that divides b if z = b for some. Notation: b Fact: for all, b, c Z:

Similar documents
Homework #2 solutions Due: June 15, 2012

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

NOTES ON SIMPLE NUMBER THEORY

Ch 4.2 Divisibility Properties

Math Circle Beginners Group February 28, 2016 Euclid and Prime Numbers Solutions

1. (16 points) Circle T if the corresponding statement is True or F if it is False.

4 Powers of an Element; Cyclic Groups

2 Elementary number theory

Basic Algorithms in Number Theory

Arithmetic Algorithms, Part 1

MAT 243 Test 2 SOLUTIONS, FORM A

2. THE EUCLIDEAN ALGORITHM More ring essentials

Ma/CS 6a Class 2: Congruences

11 Division Mod n, Linear Integer Equations, Random Numbers, The Fundamental Theorem of Arithmetic

Number Theory Proof Portfolio

a + bi by sending α = a + bi to a 2 + b 2. To see properties (1) and (2), it helps to think of complex numbers in polar coordinates:

Mat Week 8. Week 8. gcd() Mat Bases. Integers & Computers. Linear Combos. Week 8. Induction Proofs. Fall 2013

1 Overview and revision

Student Responsibilities Week 8. Mat Section 3.6 Integers and Algorithms. Algorithm to Find gcd()

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

Greatest Common Divisor MATH Greatest Common Divisor. Benjamin V.C. Collins, James A. Swenson MATH 2730

8 Primes and Modular Arithmetic

Chapter 5: The Integers

MAT246H1S - Concepts In Abstract Mathematics. Solutions to Term Test 1 - February 1, 2018

Foundations of Computer Science Lecture 10 Number Theory

4 Number Theory and Cryptography

NOTES ON INTEGERS. 1. Integers

CISC-102 Winter 2016 Lecture 11 Greatest Common Divisor

The Euclidean Algorithm and Multiplicative Inverses

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

Remainders. We learned how to multiply and divide in elementary

Number theory (Chapter 4)

The following is an informal description of Euclid s algorithm for finding the greatest common divisor of a pair of numbers:

Fall 2017 Test II review problems

The Fundamental Theorem of Arithmetic

Homework 7 solutions M328K by Mark Lindberg/Marie-Amelie Lawn

1. Factorization Divisibility in Z.

Direct Proof Divisibility

MTH 310, Section 001 Abstract Algebra I and Number Theory. Sample Midterm 1

Definition 6.1 (p.277) A positive integer n is prime when n > 1 and the only positive divisors are 1 and n. Alternatively

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

Further linear algebra. Chapter II. Polynomials.

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

Applied Cryptography and Computer Security CSE 664 Spring 2017

Prime Factorization and GCF. In my own words

Chapter 1 A Survey of Divisibility 14

Number Theory and Divisibility

Inverses. Today: finding inverses quickly. Euclid s Algorithm. Runtime. Euclid s Extended Algorithm.

Chapter 2. Divisibility. 2.1 Common Divisors

Number Theory Solutions Packet

Chapter 3 Basic Number Theory

Primes and Modular Arithmetic! CSCI 2824, Fall 2014!!

Definition For a set F, a polynomial over F with variable x is of the form

Solution Sheet (i) q = 5, r = 15 (ii) q = 58, r = 15 (iii) q = 3, r = 7 (iv) q = 6, r = (i) gcd (97, 157) = 1 = ,

3 The fundamentals: Algorithms, the integers, and matrices

5: The Integers (An introduction to Number Theory)

2301 Assignment 1 Due Friday 19th March, 2 pm

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

CPSC 467b: Cryptography and Computer Security

Divisibility in Z. Definition Let a, b Z be integers. We say that b divides a, if there exists c Z such that a = b c; we write b a.

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

4. Number Theory (Part 2)

Mathematics for Computer Science Exercises for Week 10

Fall 2015 Lecture 14: Modular congruences. cse 311: foundations of computing

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

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.

Writing Assignment 2 Student Sample Questions

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

CPSC 467: Cryptography and Computer Security

Primes. Rational, Gaussian, Industrial Strength, etc. Robert Campbell 11/29/2010 1

Induction. Induction. Induction. Induction. Induction. Induction 2/22/2018

4.3 - Primes and Greatest Common Divisors

Notes on Systems of Linear Congruences

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

Lecture Notes. Advanced Discrete Structures COT S

Elementary Algebra Chinese Remainder Theorem Euclidean Algorithm

CSE 311: Foundations of Computing. Lecture 12: Two s Complement, Primes, GCD

MATH 55 - HOMEWORK 6 SOLUTIONS. 1. Section = 1 = (n + 1) 3 = 2. + (n + 1) 3. + (n + 1) 3 = n2 (n + 1) 2.

Contents. 4 Arithmetic and Unique Factorization in Integral Domains. 4.1 Euclidean Domains and Principal Ideal Domains

Contribution of Problems

CSE 311 Lecture 13: Primes and GCD. Emina Torlak and Kevin Zatloukal

CHAPTER 3. Number Theory

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

CHAPTER 6. Prime Numbers. Definition and Fundamental Results

CSE20: Discrete Mathematics

Elementary Properties of the Integers

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.

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?

IF A PRIME DIVIDES A PRODUCT... ζ(s) = n s. ; p s

1. multiplication is commutative and associative;

Carmen s Core Concepts (Math 135)

Chapter 5. Number Theory. 5.1 Base b representations

Direct Proof Divisibility

18 Divisibility. and 0 r < d. Lemma Let n,d Z with d 0. If n = qd+r = q d+r with 0 r,r < d, then q = q and r = r.

Number Theory Homework.

not to be republished NCERT REAL NUMBERS CHAPTER 1 (A) Main Concepts and Results

MATH10040 Chapter 1: Integers and divisibility

Chapter 4 Finite Fields

CISC-102 Fall 2017 Week 6

Beautiful Mathematics

Transcription:

Number Theory Basics Z = {..., 2, 1, 0, 1, 2,...} For, b Z, we say that divides b if z = b for some z Z Notation: b Fact: for all, b, c Z:, 1, and 0 0 = 0 b and b c = c b and c = (b + c) b and b = ±b 1

Division with remainder property Let, b Z with b > 0 There exist unique q, r Z such that = bq + r and 0 r < b Proof: see class notes q = /b r = mod b 0 r b 2b 3b a 4b 2

Greatest Common Divisors For, b Z, we call d Z a common divisor of and b if d and d b d is called a greatest common divisor if d is non-negative, and all other common divisors of and b divide d Fact: greatest common divisors are unique: Suppose d and d are greatest common divisors of and b We must have d d and d d, so d = ±d Since d and d are non-negative, we must have d = d Notation: gcd(, b) But... we still need to prove that gcd(, b) always exists (according to our definition) We will give an algorithm that computes it 3

Algorithm E clid(, b): On input, b, where and b are integers such that b 0, compute gcd(, b) as follows: if b = 0 then return else return E clid(b, mod b) Correctness (induction on b): b = 0: gcd(, 0) = b > 0: write = bq + r d & d b d b & d r Example: = 100, b = 35 gcd(100, 35) = 5 0 1 2 3 100 35 30 5 b 35 30 5 0 4

Running Time: On input (, b) with b > 0: algorithm performs one division step then calls itself recursively on input (, b ), where := b and b := mod b so b > b It follows that # of division steps is at most b Better bound: O(log b) division steps Proof: if b > 0, the algorithm performs another division step, and calls itself again on input (, b ), where := b and b := b mod b, so that b > b q := b/b 1 b = b q + b b + b > 2b after two division steps, second argument to Euclid is < b/2 # of division steps 2 log 2 b 5

Bezout s Lemma Let, b Z and d := gcd(, b) (i) We have s + bt = d for some s, t Z (ii) For every d Z, we have d d s + bt = d Part (ii) follows easily from part (i): If d d, then dz = d, so set s := sz, t := tz for some s, t Z If s + bt = d, then since d and d b, it follows that d ( s + bt ) = d For part (i), we can modify the Euclidean Algorithm so that it computes s and t together with d 6

Algorithm ExtE clid(, b): On input, b, where and b are integers such that b 0, compute (d, s, t), where d = gcd(, b) and s and t are integers such that s + bt = d, as follows: if b = 0 then d, s 1, t 0 else q /b, r mod b (d, s, t ) ExtE clid(b, r) s t, t s qt return (d, s, t) Correctness (induction): = bq + r, bs + rt = d Substitute r := bq and re-arrange: t + b(s qt ) = d 7

Example: = 100, b = 35 0 1 2 3 100 35 30 5 b 35 30 5 0 s 1 1 0 1 t 3 1 1 0 q 2 1 6 s := t +1 and t := s +1 q t +1 d = 5, s = s 0 = 1, t = t 0 = 3 s + bt = 100 ( 1) + 35 (3) = 5 = d 8

Relatively prime numbers Let, b Z We say, b are relatively prime if gcd(, b) = 1 In other words, ±1 are the only common divisors of and b Special case of Bezout s Lemma: and b are relatively prime s + bt = 1 for some s, t Z Theorem 1: Let, b, c Z such that c divides b, and and c are relatively prime. Then c b Proof: Assume c b, gcd(, c) = 1. Want to show: c b gcd(, c) = 1 = s + ct = 1 for some s, t Z (Bezout) Multiply by b: bs + cbt = b c cbt, c bs, c b 9

Primes and composites Let n be a positive integer n is prime if n > 1 and the only positive integers that divide n are 1 and n n is composite if n > 1 and is not prime n is composite n = b for some integers, b with 1 < < n and 1 < b < n n = 1 is neither prime nor composite 10

Fundamental theorem of arithmetic: Every non-zero integer n can be expressed as n = ±p e 1 1 pe r r, where p 1,..., p r are distinct primes and e 1,..., e r are positive integers. Moreover, this expression is unique, up to a reordering of the primes 11

Proof (existence): Assume n positive Induction on n n = 1 n > 1. Induction hypothesis: every number smaller than n can be expressed as a product of primes If n is prime, then we re done Otherwise, n = b, where 1 < < n and 1 < b < n By induction, both and b can be expressed as a product of primes n can also be expressed as a product of primes Proof (uniqueness): that s the hard part... 12

Theorem 2: Let p be a prime. For all, b Z, if p b, then p or p b Proof: Suppose p b. Want to show: p or p b If p, we are done So assume p. Want to show p b As the only divisors of p are ±1 and ±p, the only common divisors of p and are ±1 So we have gcd(p, ) = 1 By Theorem 1 (with c := p), we have p b Generalization: if p is prime and p 1 k, then p for some = 1,..., k Proof: easy induction on k 13

Finishing proof of Fundamental Theorem (uniqueness) Suppose p 1 p r = q 1 q s, where the p s and q j s are primes ( ) Want to show that (p 1,..., p r ) is a re-ordering of (q 1,..., q s ) Induction on r: r = 0 r > 0: Since p 1 prime, we have p 1 q j for some j Since q j prime, we have p 1 = q j Cancel p 1 from LHS of ( ) and q j from RHS of ( ), and apply induction hypothesis 14