Numbers (8A) Young Won Lim 5/24/17

Size: px
Start display at page:

Download "Numbers (8A) Young Won Lim 5/24/17"

Transcription

1 Numbers (8A

2 Copyright (c 2017 Young W. Lim. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". Please send corrections (or suggestions to youngwlim@hotmail.com. This document was produced by using OpenOffice and Octave.

3 GCD A 24-by-60 rectangle is covered with ten 12-by-12 square tiles, where 12 is the GCD of 24 and = mod 12 = 0 60 = mod 12 = 0 More generally, an a-by-b rectangle can be covered with square tiles of side-length d only if d is a common divisor of a and b d a d b d : common divisor the largest d : gcd (greatest common divisor Numbers (8A 3

4 LCM What is the LCM of 4 and 6? Multiples of 4 are: 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76,... and the multiples of 6 are: 6, 12, 18, 24, 30, 36, 42, 48, 54, 60, 66, 72,... Common multiples of 4 and 6 are simply the numbers that are in both lists: 12, 24, 36, 48, 60, 72,... So, from this list of the first few common multiples of the numbers 4 and 6, their least common multiple is Numbers (8A 4

5 GCD * LCM a = p 1 a 1 p2 a 2 pn a n Prime Factorization b = p 1 b 1 p2 b 2 pn b n gcd(a,b = p 1 min(a 1, b 1 p 2 min(a 2, b 2 p n min(a n,b n lcm(a,b = p 1 Max(a 1, b 1 p 2 Max (a 2, b 2 p n Max(a n, b n gcd(a, b lcm(a,b = p 1 a 1 +b 1 p2 a 2 +b 2 pn a n +b n = a b Numbers (8A 5

6 Finding common unit length Euclid's method for finding the greatest common divisor (GCD of two starting lengths BA and DC, both defined to be multiples of a common "unit" length. The length DC being shorter, it is used to "measure" BA, but only once because remainder EA is less than DC. EA now measures (twice the shorter length DC, with remainder FC shorter than EA. Then FC measures (three times length EA. Because there is no remainder, the process ends with FC being the GCD. On the right Nicomachus' example with numbers 49 and 21 resulting in their GCD of 7 (derived from Heath 1908:300. Numbers (8A 6

7 Euclid Algorithm Steps remainder remainder zero divisor divisor divisor gcd Numbers (8A 7

8 Euclid Algorithm 1071 = = gcd (1071,462 = 3 7 = = = = Numbers (8A 8

9 Common Divisor 1071 = = = common divisor d d 1071 and d mod d = 0 d mod d = 0 d Numbers (8A 9

10 Common Divisor Properties common divisor d? d 1071 and d mod d = 0 and 462 mod d = = remainder ( mod d = 0 2 (462 mod d mod d = mod d = mod d = mod d = mod d = mod d = 0 d 462 and d Numbers (8A 10

11 Reducing GCD Problems 1071 = d 1071 and d 462 gcd (1071, = d 462 and d 147 gcd (462, = d 147 and d 21 gcd (147, Numbers (8A 11

12 Linear Combination of gcd(1071, 462= = = = = ( = = = gcd(1071, 462 = 21 = gcd (a,b = sa + t b Numbers (8A 12

13 Linear Combination of gcd(252, 198= = = = = = = = 2 18 ( (198 3 ( = ( = = 18 gcd (a,b = sa + t b Numbers (8A 13

14 Bezout s Identity a, b Z + x, y Z x a + y b = gcd (a,b Bezout s coefficients (not unique Bezout s identities Generally, a linear combination of a & b must be unique and its coefficients x & y need not be integers. Numbers (8A 14

15 Pairs of Bézout Coefficients Examples 42 = = = 6 ( = 6 ( = 6 x a + y b = gcd (a,b x 12 + y 42 = gcd (12, 42 (x, y not unique Numbers (8A 15

16 Pairs of Bézout Coefficients not unique /6=7-3 < 7 4 < 7 12/6=2 1 < 2-1 < 2 Numbers (8A 16

17 Pairs of Bézout Coefficients 2 minimal pairs x a + y b = gcd (a,b 42/6=7 12/6=2 Among these pairs of Bézout coefficients, exactly two of them satisfy -3 < 7 4 < 7 1 < 2-1 < 2 The Extended Euclidean Algorithm always produces one of these two minimal pairs. Numbers (8A 17

18 Pairs of Bézout Coefficients all pairs x a + y b = gcd (a,b all pairs can be represented in the form 42/6=7 12/6= k 1 + 2k The Extended Euclidean Algorithm always produces one of these two minimal pairs. Numbers (8A 18

19 Extended Euclid Algorithm Given a & b, the extended Euclid algorithm produce the same coefficients. Uniquely, one is chosen among many possible Bézout s coefficients Numbers (8A 19

20 Congruence Etymology Middle English, from Latin congruentia ( agreement, from congruēns, present active participle of congruō ( meet together, agree. Noun: congruence (plural congruences The quality of agreeing or corresponding; being suitable and appropriate. (mathematics, number theory A relation between two numbers indicating they give the same remainder when divided by some given number. (mathematics, geometry The quality of being isometric roughly, the same measure and shape. (algebra More generally: any equivalence relation defined on an algebraic structure which is preserved by operations defined by the structure. Numbers (8A 20

21 Congruence in Geometry congruent congruent similar Numbers (8A 21

22 Congruent modulo n a b (mod n a is congruent to b modulo n n (a b n divides (a-b (a b mod n = 0 (a mod n = (b mod n the same remainder A remainder is positive (0,.. n-1 Numbers (8A 22

23 Congruence Relation Numbers (8A 23

24 Properties of a Congruence Relation Numbers (8A 24

25 Remainders Numbers (8A 25

26 Linear Congruence Problems a x b (mod n find x =? A linear congruence a x = b find x =? A linear equation A remainder is positive (0,.. n-1 Numbers (8A 26

27 Modular Multiplicative Inverse A linear congruence a x b (mod n āa x āb (mod n x ā b (mod n A linear equation a x = b a 1 a x = a 1 b x = a 1 b āa 1 (mod n a 1 a = 1 A remainder is positive (0,.. n-1 Numbers (8A 27

28 Relatively Prime Numbers gcd (a,n = 1 Relatively prime numbers a & n s a + t n = 1 s a + t n 1 (mod n t n mod n = 0 s a 1 (mod n āa 1 (mod n the inverse of a exists : s linear combination of gcd(a, n=1 Numbers (8A 28

29 Chinese Remainder Theorem x 2 (mod 3 and x 3 (mod 5 and x 2 (mod 7 Sunzi's original formulation: x 2 (mod 3 3 (mod 5 2 (mod 7 with the solution x = k where k Z Numbers (8A 29

30 Chinese Remainder Theorem x a 1 x a 2 (mod m 1 and (mod m 2 and m 1, m 2, m n pairwise relatively coprime x a n (mod m n x b (mod m 1 m 2 m n has a unique solution Numbers (8A 30

31 m i, m, and M i x 2 (mod 3 x 3 (mod 5 x 2 (mod 7 m 1 = 3 m 2 = 5 m 3 = 7 m = = 105 = m/m 1 = /3 = 35 = m/m 2 = 3 5 7/5 = 21 = m/m 3 = 3 5 7/7 = 15 x a 1 (mod m 1 x a 2 (mod m 2 x a 3 (mod m 3 m = m 1 m 2 m 3 = m/m 1 = m 2 m 3 = m/m 2 = m 1 m 3 = m/m 3 = m 1 m 2 mod m 2 = mod m 3 = 0 mod m 1 = mod m 3 = 0 mod m 1 = mod m 2 = 0 M i mod m j = M j mod m i = 0 for i j Numbers (8A 31

32 Inverse of M i m 1, m 2, m 3 : pairwise relatively coprime gcd (, m 1 = 1 = 1 (mod m 1 y 1 : the inverse of m 2 m 3 gcd (, m 2 = 1 = 1 (mod m 2 y 2 : the inverse of m 1 m 3 gcd (, m 3 = 1 = 1 (mod m 3 y 3 : the inverse of m 1 m 2 = 1 (mod m 1 = 0 (mod m 1 = 0 (mod m 1 = 0 (mod m 2 = 1 (mod m 2 = 0 (mod m 2 = 0 (mod m 3 = 0 (mod m 3 = 1 (mod m 3 m 2 m 3 m 1 m 3 m 1 m 2 Numbers (8A 32

33 Sum of a i M i y i a 1 a 2 a 3 = 1 (mod m 1 = 0 (mod m 1 = 0 (mod m 1 = 0 (mod m 2 = 1 (mod m 2 = 0 (mod m 2 = 0 (mod m 3 = 0 (mod m 3 = 1 (mod m 3 a 1 = a 1 (mod m 1 a 2 = 0 (mod m 1 a 3 = 0 (mod m 1 a 1 = 0 (mod m 2 a 2 = a 2 (mod m 2 a 3 = 0 (mod m 2 a 1 = 0 (mod m 3 a 2 = 0 (mod m 3 a 3 = a 3 (mod m 3 a 1 + a 2 + a 3 = a 1 = a 1 (mod m 1 a 1 + a 2 + a 3 = a 2 = a 2 (mod m 2 a 1 + a 2 + a 3 = a 3 = a 3 (mod m 3 Numbers (8A 33

34 X = Sum of a i M i y i x a 1 (mod m 1 x a 2 (mod m 2 x a 3 (mod m 3 a 1 + a 2 + a 3 = a 1 = a 1 (mod m 1 a 1 + a 2 + a 3 = a 2 = a 2 (mod m 2 a 1 + a 2 + a 3 = a 3 = a 3 (mod m 3 x = a 1 + a 2 + a 3 Numbers (8A 34

35 Chinese Remainder Examples (1 x 2 (mod 3 x 3 (mod 5 x 2 (mod 7 m 1 = 3 m 2 = 5 m 3 = = 105 = m = m/m 1 = /3 = 35 = m/m 2 = 3 5 7/5 = 21 = m/m 3 = 3 5 7/7 = 15 m 2 m 3 m 1 m 3 m 1 m 2 = 2 (mod m 1 = 0 (mod m 1 = 0 (mod m 1 = 0 (mod m 2 = 1 (mod m 2 = 0 (mod m 2 = 0 (mod m 3 = 0 (mod m 3 = 1 (mod m 3 m 2 m 3 m 1 m 3 m 1 m 2 = 35 2 = 2 2 = 1 (mod 3 = 21 1 = 1 1 = 1 (mod 5 = 15 1 = 1 1 = 1 (mod 7 y 1 ( =2 : the inverse of ( =35 y 2 ( =1 : the inverse of ( =21 y 3 ( =1 : the inverse of ( =15 = 1 (mod m 1 = 0 (mod m 1 = 0 (mod m 1 = 0 (mod m 2 = 1 (mod m 2 = 0 (mod m 2 = 0 (mod m 3 = 0 (mod m 3 = 1 (mod m 3 Numbers (8A 35

36 Chinese Remainder Examples (2 a 1 a 2 a 3 = 1 (mod m 1 = 0 (mod m 1 = 0 (mod m 1 = 0 (mod m 2 = 1 (mod m 2 = 0 (mod m 2 = 0 (mod m 3 = 0 (mod m 3 = 1 (mod m 3 x = a 1 + a 2 + a 3 x = a 1 = a 1 (mod m 1 x = a 2 = a 2 (mod m 2 x = a 3 = a 3 (mod m 3 m 1 = 3 m 2 = 5 m 3 = 7 = 3 5 7/3 = 5 7 = 35 = /5 = 3 7 = 21 = 3 5 7/7 = 3 5 = 15 x = = 233 x = 233 = 23 (mod 105 m = = 105 Numbers (8A 36

37 Chinese Remainder Summary x a 1 (mod m 1 x a 2 (mod m 2 x a 3 (mod m 3 m = m 1 m 2 m 3 = m/m 1 = m 2 m 3 = m/m 2 = m 1 m 3 = m/m 3 = m 1 m 2 m 1, m 2, m 3 : pairwise relatively coprime gcd (, m 1 = 1 gcd (, m 2 = 1 gcd (, m 3 = 1 = 1 (mod m 1 = 1 (mod m 2 = 1 (mod m 3 y 1 : the inverse of y 2 : the inverse of y 3 : the inverse of x = a 1 + a 2 + a 3 Numbers (8A 37

38 Chinese Remainder Theorem Numbers (8A 38

39 Upper and Lower Bounds Numbers (8A 39

40 References [1] [2]

Numbers (8A) Young Won Lim 5/22/17

Numbers (8A) Young Won Lim 5/22/17 Numbers (8A Copyright (c 2017 Young W. Lim. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version

More information

Numbers (8A) Young Won Lim 6/21/17

Numbers (8A) Young Won Lim 6/21/17 Numbers (8A Copyright (c 2017 Young W. Lim. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version

More information

Number Theory - Divisibility Number Theory - Congruences. Number Theory. June 23, Number Theory

Number Theory - Divisibility Number Theory - Congruences. Number Theory. June 23, Number Theory - Divisibility - Congruences June 23, 2014 Primes - Divisibility - Congruences Definition A positive integer p is prime if p 2 and its only positive factors are itself and 1. Otherwise, if p 2, then p

More information

Calculators will not be permitted on the exam. The numbers on the exam will be suitable for calculating by hand.

Calculators will not be permitted on the exam. The numbers on the exam will be suitable for calculating by hand. Midterm #2: practice MATH 311 Intro to Number Theory midterm: Thursday, Oct 20 Please print your name: Calculators will not be permitted on the exam. The numbers on the exam will be suitable for calculating

More information

Solutions for the Practice Questions

Solutions for the Practice Questions Solutions for the Practice Questions Question 1. Find all solutions to the congruence 13x 12 (mod 35). Also, answer the following questions about the solutions to the above congruence. Are there solutions

More information

Math 412: Number Theory Lecture 6: congruence system and

Math 412: Number Theory Lecture 6: congruence system and Math 412: Number Theory Lecture 6: congruence system and classes Gexin Yu gyu@wm.edu College of William and Mary Chinese Remainder Theorem Chinese Remainder Theorem: let m 1, m 2,..., m k be pairwise coprimes.

More information

Modular Arithmetic. claserken. July 2016

Modular Arithmetic. claserken. July 2016 Modular Arithmetic claserken July 2016 Contents 1 Introduction 2 2 Modular Arithmetic 2 2.1 Modular Arithmetic Terminology.................. 2 2.2 Properties of Modular Arithmetic.................. 2 2.3

More information

b) Find all positive integers smaller than 200 which leave remainder 1, 3, 4 upon division by 3, 5, 7 respectively.

b) Find all positive integers smaller than 200 which leave remainder 1, 3, 4 upon division by 3, 5, 7 respectively. Solutions to Exam 1 Problem 1. a) State Fermat s Little Theorem and Euler s Theorem. b) Let m, n be relatively prime positive integers. Prove that m φ(n) + n φ(m) 1 (mod mn). Solution: a) Fermat s Little

More information

Calculators will not be permitted on the exam. The numbers on the exam will be suitable for calculating by hand.

Calculators will not be permitted on the exam. The numbers on the exam will be suitable for calculating by hand. Midterm #: practice MATH Intro to Number Theory midterm: Thursday, Nov 7 Please print your name: Calculators will not be permitted on the exam. The numbers on the exam will be suitable for calculating

More information

Data security (Cryptography) exercise book

Data security (Cryptography) exercise book University of Debrecen Faculty of Informatics Data security (Cryptography) exercise book 1 Contents 1 RSA 4 1.1 RSA in general.................................. 4 1.2 RSA background.................................

More information

The congruence relation has many similarities to equality. The following theorem says that congruence, like equality, is an equivalence relation.

The congruence relation has many similarities to equality. The following theorem says that congruence, like equality, is an equivalence relation. Congruences A congruence is a statement about divisibility. It is a notation that simplifies reasoning about divisibility. It suggests proofs by its analogy to equations. Congruences are familiar to us

More information

6. Find an inverse of a modulo m for each of these pairs of relatively prime integers using the method

6. Find an inverse of a modulo m for each of these pairs of relatively prime integers using the method Exercises Exercises 1. Show that 15 is an inverse of 7 modulo 26. 2. Show that 937 is an inverse of 13 modulo 2436. 3. By inspection (as discussed prior to Example 1), find an inverse of 4 modulo 9. 4.

More information

Carmen s Core Concepts (Math 135)

Carmen s Core Concepts (Math 135) Carmen s Core Concepts (Math 135) Carmen Bruni University of Waterloo Week 7 1 Congruence Definition 2 Congruence is an Equivalence Relation (CER) 3 Properties of Congruence (PC) 4 Example 5 Congruences

More information

Number Theory/Cryptography (part 1 of CSC 282)

Number Theory/Cryptography (part 1 of CSC 282) Number Theory/Cryptography (part 1 of CSC 282) http://www.cs.rochester.edu/~stefanko/teaching/11cs282 1 Schedule The homework is due Sep 8 Graded homework will be available at noon Sep 9, noon. EXAM #1

More information

Math 255 Spring 2017 Solving x 2 a (mod n)

Math 255 Spring 2017 Solving x 2 a (mod n) Math 255 Spring 2017 Solving x 2 a (mod n) Contents 1 Lifting 1 2 Solving x 2 a (mod p k ) for p odd 3 3 Solving x 2 a (mod 2 k ) 5 4 Solving x 2 a (mod n) for general n 9 1 Lifting Definition 1.1. Let

More information

NUMBER THEORY AMIN WITNO

NUMBER THEORY AMIN WITNO NUMBER THEORY AMIN WITNO.. w w w. w i t n o. c o m Number Theory Outlines and Problem Sets Amin Witno Preface These notes are mere outlines for the course Math 313 given at Philadelphia

More information

ALGEBRA: Chapter I: QUESTION BANK

ALGEBRA: Chapter I: QUESTION BANK 1 ALGEBRA: Chapter I: QUESTION BANK Elements of Number Theory Congruence One mark questions: 1 Define divisibility 2 If a b then prove that a kb k Z 3 If a b b c then PT a/c 4 If a b are two non zero integers

More information

CMPSCI 250: Introduction to Computation. Lecture #14: The Chinese Remainder Theorem David Mix Barrington 4 October 2013

CMPSCI 250: Introduction to Computation. Lecture #14: The Chinese Remainder Theorem David Mix Barrington 4 October 2013 CMPSCI 250: Introduction to Computation Lecture #14: The Chinese Remainder Theorem David Mix Barrington 4 October 2013 The Chinese Remainder Theorem Infinitely Many Primes Reviewing Inverses and the Inverse

More information

Exam 1 7 = = 49 2 ( ) = = 7 ( ) =

Exam 1 7 = = 49 2 ( ) = = 7 ( ) = Exam 1 Problem 1. a) Define gcd(a, b). Using Euclid s algorithm comute gcd(889, 168). Then find x, y Z such that gcd(889, 168) = x 889 + y 168 (check your answer!). b) Let a be an integer. Prove that gcd(3a

More information

Linear Congruences. The solutions to a linear congruence ax b (mod m) are all integers x that satisfy the congruence.

Linear Congruences. The solutions to a linear congruence ax b (mod m) are all integers x that satisfy the congruence. Section 4.4 Linear Congruences Definition: A congruence of the form ax b (mod m), where m is a positive integer, a and b are integers, and x is a variable, is called a linear congruence. The solutions

More information

CMPSCI 250: Introduction to Computation. Lecture #14: The Chinese Remainder Theorem David Mix Barrington 24 February 2012

CMPSCI 250: Introduction to Computation. Lecture #14: The Chinese Remainder Theorem David Mix Barrington 24 February 2012 CMPSCI 250: Introduction to Computation Lecture #14: The Chinese Remainder Theorem David Mix Barrington 24 February 2012 The Chinese Remainder Theorem Infinitely Many Primes Reviewing Inverses and the

More information

Solutions to Exam 1. Problem 1. a) State Fermat s Little Theorem and Euler s Theorem. b) Let m, n be relatively prime positive integers.

Solutions to Exam 1. Problem 1. a) State Fermat s Little Theorem and Euler s Theorem. b) Let m, n be relatively prime positive integers. Solutions to Exam 1 Problem 1. a) State Fermat s Little Theorem and Euler s Theorem. b) Let m, n be relatively rime ositive integers. Prove that m φ(n) + n φ(m) 1 (mod mn). c) Find the remainder of 1 008

More information

Discrete Math Class 4 ( )

Discrete Math Class 4 ( ) Discrete Math 37110 - Class 4 (2016-10-06) 41 Division vs congruences Instructor: László Babai Notes taken by Jacob Burroughs Revised by instructor DO 41 If m ab and gcd(a, m) = 1, then m b DO 42 If gcd(a,

More information

Fermat s little theorem. RSA.

Fermat s little theorem. RSA. .. Computing large numbers modulo n (a) In modulo arithmetic, you can always reduce a large number to its remainder a a rem n (mod n). (b) Addition, subtraction, and multiplication preserve congruence:

More information

Introduction. and Z r1 Z rn. This lecture aims to provide techniques. CRT during the decription process in RSA is explained.

Introduction. and Z r1 Z rn. This lecture aims to provide techniques. CRT during the decription process in RSA is explained. THE CHINESE REMAINDER THEOREM INTRODUCED IN A GENERAL KONTEXT Introduction The rst Chinese problem in indeterminate analysis is encountered in a book written by the Chinese mathematician Sun Tzi. The problem

More information

Introduction to Modular Arithmetic

Introduction to Modular Arithmetic 1 Integers modulo n 1.1 Preliminaries Introduction to Modular Arithmetic Definition 1.1.1 (Equivalence relation). Let R be a relation on the set A. Recall that a relation R is a subset of the cartesian

More information

Solutions for the 2nd Practice Midterm

Solutions for the 2nd Practice Midterm Solutions for the 2nd Practice Midterm 1. (a) Use the Euclidean Algorithm to find the greatest common divisor of 44 and 17. The Euclidean Algorithm yields: 44 = 2 17 + 10 17 = 1 10 + 7 10 = 1 7 + 3 7 =

More information

Collection of rules, techniques and theorems for solving polynomial congruences 11 April 2012 at 22:02

Collection of rules, techniques and theorems for solving polynomial congruences 11 April 2012 at 22:02 Collection of rules, techniques and theorems for solving polynomial congruences 11 April 2012 at 22:02 Public Polynomial congruences come up constantly, even when one is dealing with much deeper problems

More information

Distribution of Primes

Distribution of Primes Distribution of Primes Definition. For positive real numbers x, let π(x) be the number of prime numbers less than or equal to x. For example, π(1) = 0, π(10) = 4 and π(100) = 25. To use some ciphers, we

More information

Applications of Fermat s Little Theorem and Congruences

Applications of Fermat s Little Theorem and Congruences Applications of Fermat s Little Theorem and Congruences Definition: Let m be a positive integer. Then integers a and b are congruent modulo m, denoted by a b mod m, if m (a b). Example: 3 1 mod 2, 6 4

More information

Example Enemy agents are trying to invent a new type of cipher. They decide on the following encryption scheme: Plaintext converts to Ciphertext

Example Enemy agents are trying to invent a new type of cipher. They decide on the following encryption scheme: Plaintext converts to Ciphertext Cryptography Codes Lecture 4: The Times Cipher, Factors, Zero Divisors, and Multiplicative Inverses Spring 2014 Morgan Schreffler Office: POT 902 http://www.ms.uky.edu/~mschreffler New Cipher Times Enemy

More information

Modular Arithmetic. Kieran Cooney - February 18, 2016

Modular Arithmetic. Kieran Cooney - February 18, 2016 Modular Arithmetic Kieran Cooney - kieran.cooney@hotmail.com February 18, 2016 Sums and products in modular arithmetic Almost all of elementary number theory follows from one very basic theorem: Theorem.

More information

Modular Arithmetic: refresher.

Modular Arithmetic: refresher. Lecture 7. Outline. 1. Modular Arithmetic. Clock Math!!! 2. Inverses for Modular Arithmetic: Greatest Common Divisor. Division!!! 3. Euclid s GCD Algorithm. A little tricky here! Clock Math If it is 1:00

More information

The Chinese Remainder Theorem

The Chinese Remainder Theorem The Chinese Remainder Theorem 8-3-2014 The Chinese Remainder Theorem gives solutions to systems of congruences with relatively prime moduli The solution to a system of congruences with relatively prime

More information

Cryptography, Number Theory, and RSA

Cryptography, Number Theory, and RSA Cryptography, Number Theory, and RSA Joan Boyar, IMADA, University of Southern Denmark November 2015 Outline Symmetric key cryptography Public key cryptography Introduction to number theory RSA Modular

More information

SOLUTIONS TO PROBLEM SET 5. Section 9.1

SOLUTIONS TO PROBLEM SET 5. Section 9.1 SOLUTIONS TO PROBLEM SET 5 Section 9.1 Exercise 2. Recall that for (a, m) = 1 we have ord m a divides φ(m). a) We have φ(11) = 10 thus ord 11 3 {1, 2, 5, 10}. We check 3 1 3 (mod 11), 3 2 9 (mod 11), 3

More information

Assignment 2. Due: Monday Oct. 15, :59pm

Assignment 2. Due: Monday Oct. 15, :59pm Introduction To Discrete Math Due: Monday Oct. 15, 2012. 11:59pm Assignment 2 Instructor: Mohamed Omar Math 6a For all problems on assignments, you are allowed to use the textbook, class notes, and other

More information

University of British Columbia. Math 312, Midterm, 6th of June 2017

University of British Columbia. Math 312, Midterm, 6th of June 2017 University of British Columbia Math 312, Midterm, 6th of June 2017 Name (please be legible) Signature Student number Duration: 90 minutes INSTRUCTIONS This test has 7 problems for a total of 100 points.

More information

SOLUTIONS FOR PROBLEM SET 4

SOLUTIONS FOR PROBLEM SET 4 SOLUTIONS FOR PROBLEM SET 4 A. A certain integer a gives a remainder of 1 when divided by 2. What can you say about the remainder that a gives when divided by 8? SOLUTION. Let r be the remainder that a

More information

Solutions to Problem Set 6 - Fall 2008 Due Tuesday, Oct. 21 at 1:00

Solutions to Problem Set 6 - Fall 2008 Due Tuesday, Oct. 21 at 1:00 18.781 Solutions to Problem Set 6 - Fall 008 Due Tuesday, Oct. 1 at 1:00 1. (Niven.8.7) If p 3 is prime, how many solutions are there to x p 1 1 (mod p)? How many solutions are there to x p 1 (mod p)?

More information

Math 127: Equivalence Relations

Math 127: Equivalence Relations Math 127: Equivalence Relations Mary Radcliffe 1 Equivalence Relations Relations can take many forms in mathematics. In these notes, we focus especially on equivalence relations, but there are many other

More information

Solutions for the Practice Final

Solutions for the Practice Final Solutions for the Practice Final 1. Ian and Nai play the game of todo, where at each stage one of them flips a coin and then rolls a die. The person who played gets as many points as the number rolled

More information

Multiples and Divisibility

Multiples and Divisibility Multiples and Divisibility A multiple of a number is a product of that number and an integer. Divisibility: A number b is said to be divisible by another number a if b is a multiple of a. 45 is divisible

More information

Number Theory. Konkreetne Matemaatika

Number Theory. Konkreetne Matemaatika ITT9131 Number Theory Konkreetne Matemaatika Chapter Four Divisibility Primes Prime examples Factorial Factors Relative primality `MOD': the Congruence Relation Independent Residues Additional Applications

More information

Public Key Cryptography Great Ideas in Theoretical Computer Science Saarland University, Summer 2014

Public Key Cryptography Great Ideas in Theoretical Computer Science Saarland University, Summer 2014 7 Public Key Cryptography Great Ideas in Theoretical Computer Science Saarland University, Summer 2014 Cryptography studies techniques for secure communication in the presence of third parties. A typical

More information

Overview. The Big Picture... CSC 580 Cryptography and Computer Security. January 25, Math Basics for Cryptography

Overview. The Big Picture... CSC 580 Cryptography and Computer Security. January 25, Math Basics for Cryptography CSC 580 Cryptography and Computer Security Math Basics for Cryptography January 25, 2018 Overview Today: Math basics (Sections 2.1-2.3) To do before Tuesday: Complete HW1 problems Read Sections 3.1, 3.2

More information

Practice Midterm 2 Solutions

Practice Midterm 2 Solutions Practice Midterm 2 Solutions May 30, 2013 (1) We want to show that for any odd integer a coprime to 7, a 3 is congruent to 1 or 1 mod 7. In fact, we don t need the assumption that a is odd. By Fermat s

More information

Mathematics Explorers Club Fall 2012 Number Theory and Cryptography

Mathematics Explorers Club Fall 2012 Number Theory and Cryptography Mathematics Explorers Club Fall 2012 Number Theory and Cryptography Chapter 0: Introduction Number Theory enjoys a very long history in short, number theory is a study of integers. Mathematicians over

More information

Math 1111 Math Exam Study Guide

Math 1111 Math Exam Study Guide Math 1111 Math Exam Study Guide The math exam will cover the mathematical concepts and techniques we ve explored this semester. The exam will not involve any codebreaking, although some questions on the

More information

MATH 135 Algebra, Solutions to Assignment 7

MATH 135 Algebra, Solutions to Assignment 7 MATH 135 Algebra, Solutions to Assignment 7 1: (a Find the smallest non-negative integer x such that x 41 (mod 9. Solution: The smallest such x is the remainder when 41 is divided by 9. We have 41 = 9

More information

Lecture 8. Outline. 1. Modular Arithmetic. Clock Math!!! 2. Inverses for Modular Arithmetic: Greatest Common Divisor. 3. Euclid s GCD Algorithm

Lecture 8. Outline. 1. Modular Arithmetic. Clock Math!!! 2. Inverses for Modular Arithmetic: Greatest Common Divisor. 3. Euclid s GCD Algorithm Lecture 8. Outline. 1. Modular Arithmetic. Clock Math!!! 2. Inverses for Modular Arithmetic: Greatest Common Divisor. 3. Euclid s GCD Algorithm Clock Math If it is 1:00 now. What time is it in 5 hours?

More information

Grade 6 Math Circles March 1-2, Introduction to Number Theory

Grade 6 Math Circles March 1-2, Introduction to Number Theory Faculty of Mathematics Waterloo, Ontario N2L 3G1 Centre for Education in Mathematics and Computing Grade 6 Math Circles March 1-2, 2016 Introduction to Number Theory Being able to do mental math quickly

More information

Math 1111 Math Exam Study Guide

Math 1111 Math Exam Study Guide Math 1111 Math Exam Study Guide The math exam will cover the mathematical concepts and techniques we ve explored this semester. The exam will not involve any codebreaking, although some questions on the

More information

MATH 324 Elementary Number Theory Solutions to Practice Problems for Final Examination Monday August 8, 2005

MATH 324 Elementary Number Theory Solutions to Practice Problems for Final Examination Monday August 8, 2005 MATH 324 Elementary Number Theory Solutions to Practice Problems for Final Examination Monday August 8, 2005 Deartment of Mathematical and Statistical Sciences University of Alberta Question 1. Find integers

More information

Discrete Mathematics & Mathematical Reasoning Multiplicative Inverses and Some Cryptography

Discrete Mathematics & Mathematical Reasoning Multiplicative Inverses and Some Cryptography Discrete Mathematics & Mathematical Reasoning Multiplicative Inverses and Some Cryptography Colin Stirling Informatics Some slides based on ones by Myrto Arapinis Colin Stirling (Informatics) Discrete

More information

Discrete Square Root. Çetin Kaya Koç Winter / 11

Discrete Square Root. Çetin Kaya Koç  Winter / 11 Discrete Square Root Çetin Kaya Koç koc@cs.ucsb.edu Çetin Kaya Koç http://koclab.cs.ucsb.edu Winter 2017 1 / 11 Discrete Square Root Problem The discrete square root problem is defined as the computation

More information

MODULAR ARITHMETIC II: CONGRUENCES AND DIVISION

MODULAR ARITHMETIC II: CONGRUENCES AND DIVISION MODULAR ARITHMETIC II: CONGRUENCES AND DIVISION MATH CIRCLE (BEGINNERS) 02/05/2012 Modular arithmetic. Two whole numbers a and b are said to be congruent modulo n, often written a b (mod n), if they give

More information

Sheet 1: Introduction to prime numbers.

Sheet 1: Introduction to prime numbers. Option A Hand in at least one question from at least three sheets Sheet 1: Introduction to prime numbers. [provisional date for handing in: class 2.] 1. Use Sieve of Eratosthenes to find all prime numbers

More information

Class 8: Factors and Multiples (Lecture Notes)

Class 8: Factors and Multiples (Lecture Notes) Class 8: Factors and Multiples (Lecture Notes) If a number a divides another number b exactly, then we say that a is a factor of b and b is a multiple of a. Factor: A factor of a number is an exact divisor

More information

p 1 MAX(a,b) + MIN(a,b) = a+b n m means that m is a an integer multiple of n. Greatest Common Divisor: We say that n divides m.

p 1 MAX(a,b) + MIN(a,b) = a+b n m means that m is a an integer multiple of n. Greatest Common Divisor: We say that n divides m. Great Theoretical Ideas In Computer Science Steven Rudich CS - Spring Lecture Feb, Carnegie Mellon University Modular Arithmetic and the RSA Cryptosystem p- p MAX(a,b) + MIN(a,b) = a+b n m means that m

More information

LECTURE 3: CONGRUENCES. 1. Basic properties of congruences We begin by introducing some definitions and elementary properties.

LECTURE 3: CONGRUENCES. 1. Basic properties of congruences We begin by introducing some definitions and elementary properties. LECTURE 3: CONGRUENCES 1. Basic properties of congruences We begin by introducing some definitions and elementary properties. Definition 1.1. Suppose that a, b Z and m N. We say that a is congruent to

More information

1.6 Congruence Modulo m

1.6 Congruence Modulo m 1.6 Congruence Modulo m 47 5. Let a, b 2 N and p be a prime. Prove for all natural numbers n 1, if p n (ab) and p - a, then p n b. 6. In the proof of Theorem 1.5.6 it was stated that if n is a prime number

More information

SESAME Modular Arithmetic. MurphyKate Montee. March 2018 IN,Z, We think numbers should satisfy certain rules, which we call axioms:

SESAME Modular Arithmetic. MurphyKate Montee. March 2018 IN,Z, We think numbers should satisfy certain rules, which we call axioms: SESAME Modular Arithmetic MurphyKate Montee March 08 What is a Number? Examples of Number Systems: We think numbers should satisfy certain rules which we call axioms: Commutivity Associativity 3 Existence

More information

Two congruences involving 4-cores

Two congruences involving 4-cores Two congruences involving 4-cores ABSTRACT. The goal of this paper is to prove two new congruences involving 4- cores using elementary techniques; namely, if a 4 (n) denotes the number of 4-cores of n,

More information

Foundations of Cryptography

Foundations of Cryptography Foundations of Cryptography Ville Junnila viljun@utu.fi Department of Mathematics and Statistics University of Turku 2015 Ville Junnila viljun@utu.fi Lecture 10 1 of 17 The order of a number (mod n) Definition

More information

Implementation / Programming: Random Number Generation

Implementation / Programming: Random Number Generation Introduction to Modeling and Simulation Implementation / Programming: Random Number Generation OSMAN BALCI Professor Department of Computer Science Virginia Polytechnic Institute and State University (Virginia

More information

Number-Theoretic Algorithms

Number-Theoretic Algorithms Number-Theoretic Algorithms Hengfeng Wei hfwei@nju.edu.cn March 31 April 6, 2017 Hengfeng Wei (hfwei@nju.edu.cn) Number-Theoretic Algorithms March 31 April 6, 2017 1 / 36 Number-Theoretic Algorithms 1

More information

1 = 3 2 = 3 ( ) = = = 33( ) 98 = = =

1 = 3 2 = 3 ( ) = = = 33( ) 98 = = = Math 115 Discrete Math Final Exam December 13, 2000 Your name It is important that you show your work. 1. Use the Euclidean algorithm to solve the decanting problem for decanters of sizes 199 and 98. In

More information

Algorithmic Number Theory and Cryptography (CS 303)

Algorithmic Number Theory and Cryptography (CS 303) Algorithmic Number Theory and Cryptography (CS 303) Modular Arithmetic Jeremy R. Johnson 1 Introduction Objective: To become familiar with modular arithmetic and some key algorithmic constructions that

More information

6.2 Modular Arithmetic

6.2 Modular Arithmetic 6.2 Modular Arithmetic Every reader is familiar with arithmetic from the time they are three or four years old. It is the study of numbers and various ways in which we can combine them, such as through

More information

CHAPTER 2. Modular Arithmetic

CHAPTER 2. Modular Arithmetic CHAPTER 2 Modular Arithmetic In studying the integers we have seen that is useful to write a = qb + r. Often we can solve problems by considering only the remainder, r. This throws away some of the information,

More information

The covering congruences of Paul Erdős. Carl Pomerance Dartmouth College

The covering congruences of Paul Erdős. Carl Pomerance Dartmouth College The covering congruences of Paul Erdős Carl Pomerance Dartmouth College Conjecture (Erdős, 1950): For each number B, one can cover Z with finitely many congruences to distinct moduli all > B. Erdős (1995):

More information

CS1800 Discrete Structures Fall 2016 Profs. Aslam, Gold, Ossowski, Pavlu, & Sprague 7 November, CS1800 Discrete Structures Midterm Version C

CS1800 Discrete Structures Fall 2016 Profs. Aslam, Gold, Ossowski, Pavlu, & Sprague 7 November, CS1800 Discrete Structures Midterm Version C CS1800 Discrete Structures Fall 2016 Profs. Aslam, Gold, Ossowski, Pavlu, & Sprague 7 November, 2016 CS1800 Discrete Structures Midterm Version C Instructions: 1. The exam is closed book and closed notes.

More information

Section 5.4. Greatest Common Factor and Least Common Multiple. Solution. Greatest Common Factor and Least Common Multiple

Section 5.4. Greatest Common Factor and Least Common Multiple. Solution. Greatest Common Factor and Least Common Multiple Greatest Common Factor and Least Common Multiple Section 5.4 Greatest Common Factor and Least Common Multiple Find the greatest common factor by several methods. Find the least common multiple by several

More information

Modular arithmetic Math 2320

Modular arithmetic Math 2320 Modular arithmetic Math 220 Fix an integer m 2, called the modulus. For any other integer a, we can use the division algorithm to write a = qm + r. The reduction of a modulo m is the remainder r resulting

More information

Wilson s Theorem and Fermat s Theorem

Wilson s Theorem and Fermat s Theorem Wilson s Theorem and Fermat s Theorem 7-27-2006 Wilson s theorem says that p is prime if and only if (p 1)! = 1 (mod p). Fermat s theorem says that if p is prime and p a, then a p 1 = 1 (mod p). Wilson

More information

Mark Kozek. December 7, 2010

Mark Kozek. December 7, 2010 : in : Whittier College December 7, 2010 About. : in Hungarian mathematician, 1913-1996. Interested in combinatorics, graph theory, number theory, classical analysis, approximation theory, set theory,

More information

Constructions of Coverings of the Integers: Exploring an Erdős Problem

Constructions of Coverings of the Integers: Exploring an Erdős Problem Constructions of Coverings of the Integers: Exploring an Erdős Problem Kelly Bickel, Michael Firrisa, Juan Ortiz, and Kristen Pueschel August 20, 2008 Abstract In this paper, we study necessary conditions

More information

Number Theory for Cryptography

Number Theory for Cryptography Number Theory for Cryptography 密碼學與應用 海洋大學資訊工程系 丁培毅 Congruence Modulo Operation: Question: What is 12 mod 9? Answer: 12 mod 9 3 or 12 3 (mod 9) 12 is congruent to 3 modulo 9 Definition: Let a, r, m (where

More information

EE 418 Network Security and Cryptography Lecture #3

EE 418 Network Security and Cryptography Lecture #3 EE 418 Network Security and Cryptography Lecture #3 October 6, 2016 Classical cryptosystems. Lecture notes prepared by Professor Radha Poovendran. Tamara Bonaci Department of Electrical Engineering University

More information

Grade 6 Math Circles. Divisibility

Grade 6 Math Circles. Divisibility Faculty of Mathematics Waterloo, Ontario N2L 3G1 Introduction Grade 6 Math Circles November 12/13, 2013 Divisibility A factor is a whole number that divides exactly into another number without a remainder.

More information

Primitive Roots. Chapter Orders and Primitive Roots

Primitive Roots. Chapter Orders and Primitive Roots Chapter 5 Primitive Roots The name primitive root applies to a number a whose powers can be used to represent a reduced residue system modulo n. Primitive roots are therefore generators in that sense,

More information

Lecture 32. Handout or Document Camera or Class Exercise. Which of the following is equal to [53] [5] 1 in Z 7? (Do not use a calculator.

Lecture 32. Handout or Document Camera or Class Exercise. Which of the following is equal to [53] [5] 1 in Z 7? (Do not use a calculator. Lecture 32 Instructor s Comments: This is a make up lecture. You can choose to cover many extra problems if you wish or head towards cryptography. I will probably include the square and multiply algorithm

More information

Public Key Encryption

Public Key Encryption Math 210 Jerry L. Kazdan Public Key Encryption The essence of this procedure is that as far as we currently know, it is difficult to factor a number that is the product of two primes each having many,

More information

Multiple : The product of a given whole number and another whole number. For example, some multiples of 3 are 3, 6, 9, and 12.

Multiple : The product of a given whole number and another whole number. For example, some multiples of 3 are 3, 6, 9, and 12. 1.1 Factor (divisor): One of two or more whole numbers that are multiplied to get a product. For example, 1, 2, 3, 4, 6, and 12 are factors of 12 1 x 12 = 12 2 x 6 = 12 3 x 4 = 12 Factors are also called

More information

Cryptography Math 1580 Silverman First Hour Exam Mon Oct 2, 2017

Cryptography Math 1580 Silverman First Hour Exam Mon Oct 2, 2017 Name: Cryptography Math 1580 Silverman First Hour Exam Mon Oct 2, 2017 INSTRUCTIONS Read Carefully Time: 50 minutes There are 5 problems. Write your name legibly at the top of this page. No calculators

More information

LUCAS-SIERPIŃSKI AND LUCAS-RIESEL NUMBERS

LUCAS-SIERPIŃSKI AND LUCAS-RIESEL NUMBERS LUCAS-SIERPIŃSKI AND LUCAS-RIESEL NUMBERS DANIEL BACZKOWSKI, OLAOLU FASORANTI, AND CARRIE E. FINCH Abstract. In this paper, we show that there are infinitely many Sierpiński numbers in the sequence of

More information

Goldbach conjecture (1742, june, the 7 th )

Goldbach conjecture (1742, june, the 7 th ) Goldbach conjecture (1742, june, the 7 th ) We note P the prime numbers set. P = {p 1 = 2, p 2 = 3, p 3 = 5, p 4 = 7, p 5 = 11,...} remark : 1 P Statement : Each even number greater than 2 is the sum of

More information

Congruence. Solving linear congruences. A linear congruence is an expression in the form. ax b (modm)

Congruence. Solving linear congruences. A linear congruence is an expression in the form. ax b (modm) Congruence Solving linear congruences A linear congruence is an expression in the form ax b (modm) a, b integers, m a positive integer, x an integer variable. x is a solution if it makes the congruence

More information

The Chinese Remainder Theorem

The Chinese Remainder Theorem The Chinese Remainder Theorem Theorem. Let m and n be two relatively prime positive integers. Let a and b be any two integers. Then the two congruences x a (mod m) x b (mod n) have common solutions. Any

More information

MST125. Essential mathematics 2. Number theory

MST125. Essential mathematics 2. Number theory MST125 Essential mathematics 2 Number theory This publication forms part of the Open University module MST125 Essential mathematics 2. Details of this and other Open University modules can be obtained

More information

Goldbach Conjecture (7 th june 1742)

Goldbach Conjecture (7 th june 1742) Goldbach Conjecture (7 th june 1742) We note P the odd prime numbers set. P = {p 1 = 3, p 2 = 5, p 3 = 7, p 4 = 11,...} n 2N\{0, 2, 4}, p P, p n/2, q P, q n/2, n = p + q We call n s Goldbach decomposition

More information

Outline Introduction Big Problems that Brun s Sieve Attacks Conclusions. Brun s Sieve. Joe Fields. November 8, 2007

Outline Introduction Big Problems that Brun s Sieve Attacks Conclusions. Brun s Sieve. Joe Fields. November 8, 2007 Big Problems that Attacks November 8, 2007 Big Problems that Attacks The Sieve of Eratosthenes The Chinese Remainder Theorem picture Big Problems that Attacks Big Problems that Attacks Eratosthene s Sieve

More information

The Chinese Remainder Theorem

The Chinese Remainder Theorem The Chinese Remainder Theorem Theorem. Let n 1,..., n r be r positive integers relatively prime in pairs. (That is, gcd(n i, n j ) = 1 whenever 1 i < j r.) Let a 1,..., a r be any r integers. Then the

More information

DUBLIN CITY UNIVERSITY

DUBLIN CITY UNIVERSITY DUBLIN CITY UNIVERSITY SEMESTER ONE EXAMINATIONS 2013 MODULE: (Title & Code) CA642 Cryptography and Number Theory COURSE: M.Sc. in Security and Forensic Computing YEAR: 1 EXAMINERS: (Including Telephone

More information

MATH 13150: Freshman Seminar Unit 15

MATH 13150: Freshman Seminar Unit 15 MATH 1310: Freshman Seminar Unit 1 1. Powers in mod m arithmetic In this chapter, we ll learn an analogous result to Fermat s theorem. Fermat s theorem told us that if p is prime and p does not divide

More information

Degree project NUMBER OF PERIODIC POINTS OF CONGRUENTIAL MONOMIAL DYNAMICAL SYSTEMS

Degree project NUMBER OF PERIODIC POINTS OF CONGRUENTIAL MONOMIAL DYNAMICAL SYSTEMS Degree project NUMBER OF PERIODIC POINTS OF CONGRUENTIAL MONOMIAL DYNAMICAL SYSTEMS Author: MD.HASIRUL ISLAM NAZIR BASHIR Supervisor: MARCUS NILSSON Date: 2012-06-15 Subject: Mathematics and Modeling Level:

More information

Chapter 4 Number Theory

Chapter 4 Number Theory Chapter 4 Number Theory Throughout the study of numbers, students Á should identify classes of numbers and examine their properties. For example, integers that are divisible by 2 are called even numbers

More information

Classical Cryptography

Classical Cryptography Classical Cryptography CS 6750 Lecture 1 September 10, 2009 Riccardo Pucella Goals of Classical Cryptography Alice wants to send message X to Bob Oscar is on the wire, listening to all communications Alice

More information

It is important that you show your work. The total value of this test is 220 points.

It is important that you show your work. The total value of this test is 220 points. June 27, 2001 Your name It is important that you show your work. The total value of this test is 220 points. 1. (10 points) Use the Euclidean algorithm to solve the decanting problem for decanters of sizes

More information