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

Size: px
Start display at page:

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

Transcription

1 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 by hand. Problem. For unknown reasons, the high priest of number theory has banned usage of the Euclidean algorithm. With the help of the Chinese remainder theorem, determine the modular inverse of 49 modulo 666. Note that 666 = 9 7. We rst compute 49 modulo each of ; 9; 7. That's super easy: 49 (mod ), 49 5 (mod 9) and 49 (mod 7). By the Chinese remainder theorem, 49 97[(9 7) mod +7[( 7) mod [( 9) mod (mod666): Problem. Compute 7 (mod 90) in the following three dierent ways: (a) Directly, using binary exponentiation. (b) With the help of Euler's theorem. (c) With the help of the Chinese remainder theorem (as well as Euler's theorem). (a) Modulo 90, we have 7 = 49, 7 4 = 49 6, 7 8 6, 7 6 6, 7, Therefore, 7 = (mod 90). (b) Since 90 = 5, we nd (90) = 90 5 = 4 so that Euler's theorem tells us that 7 4 (mod 90). Since 5 (mod 4), we have = (mod 90).

2 (c) Notice that 90 = 5, where ; 9; 5 are pairwise coprime. Computing 7 modulo each of ; 9; 5 is much easier (note that (9) = 9 = 6 so that, by Euler's theorem 7 6 (mod 9); on the other hand, 7 4 (mod 5)): 7 (mod ); 7 7 ( ) (mod 9); 7 7 (mod 5): By the Chinese remainder theorem, [(9 5) mod + 5 [( 5) mod [( 9) mod (mod 90): Comment. While this might seem like the most involved approach (it certainly requires the most expertise), observe that the actual computations are much simpler than in the other cases (because we are operating modulo very small numbers). Problem. Note that = 7 9. (a) Modulo, what do we learn from Euler's theorem? (b) Using the Chinese remainder theorem, show that x 44 (mod ) for all x coprime to. (c) Compare the two results! Bonus: Can you come up with a strengthening of Euler's theorem? (a) Since () = 7 9 = 88, we learn that x 88 (mod ) for all x that are coprime to. (b) By the Chinese remainder theorem, the congruence x 44 (mod ) is true for all x coprime to (or, equivalently, all x coprime to both 7 and 9) if and only if the two congruences x 44 (mod 7) and x 44 (mod 9) are true for all such x. By Fermat's little theorem, we have x 6 (mod 7) and hence x 44 (x 6 ) 9 (mod 7). Likewise, x 8 (mod 9) implies that x 44 (x 8 ) 8 (mod 9). (c) If x 44 (mod ), then x 88 = (x 44 ) (mod ). This means that Euler's theorem is weaker than the congruence we obtained using the Chinese remainder theorem. This leads us to the following strengthening of Euler's theorem. If the prime factorization of n is n = p k p r k r, then x f(n) (mod n), where f(n) = lcm('(p k ); '(p k ); :::; '(p r k r )): Advanced comment. This f(n) is almost the minimal value (n) such that x (n) (mod n). The only improvement that can be made is that, in the above, '( m ) may be replaced with '(m ) if m >. This is known as Carmichael's theorem.

3 Problem 4. Let a; b be positive integers. (a) Suppose that x a (mod n) and x b (mod n). Show that x gcd(a;b) (mod n). (b) Use the previous result to nd all solutions to x 0 (mod 07). (c) On the other hand, there are 6 solutions to x 0 (mod 06). What is dierent in this case? (a) By Bezout's identity, we nd integers r; s such that ra + sb = gcd(a; b). Hence, x gcd(a;b) = x ra+sb = (x a ) r (x b ) s r s (mod n): (b) Note that a solution x is necessarily coprime to 07. (Why?!) By Fermat's little theorem, x 06 (mod 07). Since gcd(06; 0) =, we conclude that x (mod 07). Since 07 is a prime, this congruence has only the solutions x (mod 07). (We established this in Problem of Homework 4. Make sure that you recall the argument and why it is crucial that 07 is a prime.) (c) Again, a solution x is necessarily coprime to 06. By Euler's theorem, x 576 (mod 06). Since gcd(576; 0) =, we conclude that x (mod 06). However, 06 is not a prime and so this congruence actually has more solutions than just x (mod 06). Comment. In fact, it has the 6 solutions ; 7; 4; 449; 559; 575; 88; 007; 009; 5; 44; 457; 567; 58; 889; 05 modulo 06. Clearly, each of these also solves x 0 (mod 06). Problem 9 below makes it transparent where these extra solutions are coming from. In short, by the Chinese remainder theorem, the congruence modulo 06 = 5 7 breaks into congruences modulo 5, and 7; in each of these three cases, we get at least the two solutions, which we can combine in = 8 dierent ways to get 8 solutions modulo 06. That we actually have 6 = 4 solutions modulo 06 is due to the fact that x (mod 5 ) actually has 4 instead of just solutions (namely, x ; 5 (mod 5 )). Problem 5. (a) You wonder whether ; 660; 9 is a prime. A (comparatively) quick computation shows that (mod 6609). What do you conclude? (b) You wonder whether 9; 96; 80 is a prime. A quick computation shows that (mod 99680). What do you conclude? (a) This proves that 6609 is not a prime. Because, if it was a prime, then 6608 (mod 6609) by Fermat's little theorem. [Indeed, 6609 = 69 5; but nding that factorization is a more dicult task! (b) We still don't know whether is a prime or not. There is two possibilities: either is a prime, or is a pseudoprime to base (people also say that is a Fermat liar in that case). [Actually, is a prime.

4 Problem 6. (a) Using Fermat's little theorem and base, show that 4 is not a prime. (b) Is 4 a pseudoprime to the base? These computations are tedious to do by hand. Do make sure though that the idea and the procedure are clear. (a) / (mod 4) so that, by Fermat's little theorem, 4 cannot be a prime. Of course, computing that (mod 4) requires some work. In the absence of knowing the prime factorization of 4, we resort to direct binary exponentiation (see comment below) and 40 = (00000) = Here are the intermediate values we get modulo 4: 9, 4 8, 8 8, 6 45, 9 (so that, now, the values repeat), 64 8, 8 8, Useful observation. Note that we could have saved some work by exploiting (mod 4), which implies 0 (mod 4). Since 40 0 (mod 0), we nd that 40 0 = 8 56 (mod 4). (b) We need to compute 40 (mod 4). We proceed using binary exponentiation as in the previous part. The values we get modulo 4 are: = 4, 4 = 6, 8 = 56, 6 = 64, = 4, so that, again, values repeat. In the end, we nd that 40 (mod 4). This means that 4 is a pseudoprime to the base (because we already know that 4 is not an actual prime). Useful observation. Again, we can save a lot of work by exploiting (mod 4), which implies 0 (mod 4). As before, we conclude that 40 0 = 8 (mod 4). Comment. If we know the factorization of 4 then we can cut down on our work a little bit by using the Chinese remainder theorem and Euler's theorem (but realize that if we have to ask questions like whether 4 is a prime, then we wouldn't know this factorization and wouldn't be able to apply these theorems). Problem 7. (a) Among the numbers ; ; :::; 06, how many are coprime to 06? (b) Carefully state Euler's theorem. (c) If the prime factorization of n is n = p k p r k r, what does (n) evaluate to? (d) Carefully state Wilson's theorem. (a) This just asks for (06). (b) If n > and gcd(a; n) =, then a (n) (mod n). k (c) If the prime factorization of n is n = p k p r r, then (n) = n p pr. (d) If p is a prime, then (p )! (mod p). Problem 8. (a) What does it mean for n to be a pseudoprime to base a? (b) What does it mean for n to be an absolute pseudoprime? (c) Outline the Fermat primality test. What makes this a heuristic test? 4

5 (a) It means that n is composite but satises a n a (mod n). In other words, it behaves like a prime would by Fermat's little theorem. Sometimes the condition a n a (mod n) is replaced with a n (mod n). That makes no dierence unless gcd(a; n) =/ (in which case we learned about a divisor of n). (b) These are numbers which are pseudoprime to any base a >. (c) Fermat primality test: Input: number n and parameter k indicating the number of tests to run Output: not prime or possibly prime Algorithm: Repeat k times: Pick a random number a from f; ; :::; n g. If a n / (mod n), then stop and output not prime. Output possibly prime. The test is heuristic because it is not designed to decide with absolute certainty whether a number is a prime. More specically, if it claims that a number is composite, then we actually do have certainty that the number is indeed composite (but don't know its factors). But the test is unable to prove that a number is prime; if we choose the number of iterations k large enough, then we have strong reason to believe that n is a prime (if we do not deal with an absolute pseudoprime [which are very rare then there is only a probability of k that we mistakenly label a composite number as probably prime). Problem 9. (a) Using the Chinese remainder theorem, determine all solutions to x (mod 05). (b) Can you predict how many solutions the congruence x (mod 0) is going to have? (a) Note that 05 = 5 7. By the Chinese remainder theorem, x is a solution to x (mod 05) if and only if x is a solution to the three congruences x (mod ); x (mod 5); x (mod 7): Since ; 5; 7 are primes each of these only has the obvious solutions x. (Again, we established this in Problem of Homework 4.) Using the Chinese remainder theorem, these combine in = 8 dierent ways to a solution modulo 05. For instance, one the 8 possibilities is x (mod ); x (mod 5); x (mod 7) () x 5 7 [(5 7) mod + 7 [( 7) mod 5 5 [( 5) mod 7 = (mod 05): Corresponding to it is the negative case x (mod ), x (mod 5), x (mod 7) which is equivalent to x 4 (mod 05). Likewise, we determine all 8 solutions as follows: x (mod ); x (mod 5); x (mod 7) () x (mod 05) x (mod ); x (mod 5); x (mod 7) () x 9 (mod 05) x (mod ); x (mod 5); x (mod 7) () x 4 (mod 05) x (mod ); x (mod 5); x (mod 7) () x 4 (mod 05) x (mod ); x (mod 5); x (mod 7) () x 4 (mod 05) x (mod ); x (mod 5); x (mod 7) () x 4 (mod 05) x (mod ); x (mod 5); x (mod 7) () x 9 (mod 05) x (mod ); x (mod 5); x (mod 7) () x (mod 05) 5

6 Note that, because each case has a negative, we only need to compute 4 of these 8 cases. In summary, x (mod 05) has exactly the 8 solutions x ; 9; 4; 4 modulo 05. (b) Since 0 = 5 7, we can again use the Chinese remainder theorem and argue as in the previous case. There is just one dierence: the congruence x (mod ) only has solution (because (mod )). Hence, we nd that the congruence x (mod 0) has = 8 solutions. A variation. On the other hand, x (mod 5 7 9) will have = 6 solutions. Problem 0. (a) Which number is represented by the continued fraction [; ; ; ; ;? (b) Determine all convergents of [; ; ; ; ;. (c) Which number is represented by the innite continued fraction [; ; ; ; ; ; ; ; :::? (d) Compare, numerically, the rst six convergents (computed above) to the value of the innite continued fraction. (a) [; ; ; ; ; = = 4 0 Comment. Of course, we can simplify this continued fraction directly. But that is a bit time consuming and prone to errors. A better is way is to compute the convergents recursively as we do in the next part. (b) The convergents are C 0 =, C = [; = + =, C = [; ; = + We can continue like that but the computations will get more involved. Instead, we should proceed recursively. Recall from class that the convergents C n = pn of [a q 0 ; a ; a ; ::: are characterized by n + = 4. p k = a k p k + p k with p = 0; p = and q k = a k q k + q k with q = ; q = 0 : The corresponding calculations of p n and q n are as follows: (c) Write x = [; ; ; ; ; ; ; ; :::. Then, x = + n a n p n q n C n ::: = +. + x The equation x = + simplies to x = x. Further (note that, clearly x =/ so that x + =/ 0) + x + x simplies to (x )(x + ) = x or x x = 0, which has the solutions x = p = p. Since + p.66 and p 4 p 0.66, we conclude that [; ; ; ; ; ; ; ; ::: = +. (d) C 0 =, C = =.5, C = 4., C = 8 =.75, C 4 = 5.64, C 5 =

7 These values quickly approach + p.66 in the expected alternating fashion. Problem. (a) Express the numbers 5 7 and as a simple continued fraction. 9 (b) Is this the unique simple continued fraction representing 5 9? Explain! (a) The simplest way to obtain the continued fraction for 5 is via the Euclidian algorithm: 9 5 = ; 9 = ; 59 = 6 + ; 6 = + 5; = 5 + ; 5 = Hence, 5 = [; ; ; ; ; 5. 9 To determine a simple continued fraction for 7 using the Euclidian algorithm applied to , we rst write = + = + = 05 + ; 05 = 9 + 6; = 6 + 5; 6 = 5 + ; 5 = 5 + 0: 05. We then proceed Combined, 7 = [ ; ; 9; ; ; 5. (b) No, a nite continued fraction can always be expressed in two ways because of the simple relation [a 0 ; a ; a ; :::; a n = [a 0 ; a ; a ; :::; a n ;, assuming a n >. In this case, we also have 5 = [; ; ; ; ; 4;. 9 It is also a very good idea to review the problems from Homework 5 as well as the previous practice problems. 7

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

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

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

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

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

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

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

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

Numbers (8A) Young Won Lim 5/24/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

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

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

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

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

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

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

An interesting class of problems of a computational nature ask for the standard residue of a power of a number, e.g.,

An interesting class of problems of a computational nature ask for the standard residue of a power of a number, e.g., Binary exponentiation An interesting class of problems of a computational nature ask for the standard residue of a power of a number, e.g., What are the last two digits of the number 2 284? In the absence

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

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 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 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

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

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

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

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

MA/CSSE 473 Day 9. The algorithm (modified) N 1

MA/CSSE 473 Day 9. The algorithm (modified) N 1 MA/CSSE 473 Day 9 Primality Testing Encryption Intro The algorithm (modified) To test N for primality Pick positive integers a 1, a 2,, a k < N at random For each a i, check for a N 1 i 1 (mod N) Use the

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

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

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

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

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

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

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

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

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

Cryptography. 2. decoding is extremely difficult (for protection against eavesdroppers);

Cryptography. 2. decoding is extremely difficult (for protection against eavesdroppers); 18.310 lecture notes September 2, 2013 Cryptography Lecturer: Michel Goemans 1 Public Key Cryptosystems In these notes, we will be concerned with constructing secret codes. A sender would like to encrypt

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

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

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

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 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

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

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

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

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

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

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

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

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

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 7: POLYNOMIAL CONGRUENCES TO PRIME POWER MODULI

LECTURE 7: POLYNOMIAL CONGRUENCES TO PRIME POWER MODULI LECTURE 7: POLYNOMIAL CONGRUENCES TO PRIME POWER MODULI 1. Hensel Lemma for nonsingular solutions Although there is no analogue of Lagrange s Theorem for prime power moduli, there is an algorithm for determining

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

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

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

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

Final exam. Question Points Score. Total: 150

Final exam. Question Points Score. Total: 150 MATH 11200/20 Final exam DECEMBER 9, 2016 ALAN CHANG Please present your solutions clearly and in an organized way Answer the questions in the space provided on the question sheets If you run out of room

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

CMath 55 PROFESSOR KENNETH A. RIBET. Final Examination May 11, :30AM 2:30PM, 100 Lewis Hall

CMath 55 PROFESSOR KENNETH A. RIBET. Final Examination May 11, :30AM 2:30PM, 100 Lewis Hall CMath 55 PROFESSOR KENNETH A. RIBET Final Examination May 11, 015 11:30AM :30PM, 100 Lewis Hall Please put away all books, calculators, cell phones and other devices. You may consult a single two-sided

More information

ON THE EQUATION a x x (mod b) Jam Germain

ON THE EQUATION a x x (mod b) Jam Germain ON THE EQUATION a (mod b) Jam Germain Abstract. Recently Jimenez and Yebra [3] constructed, for any given a and b, solutions to the title equation. Moreover they showed how these can be lifted to higher

More information

Q(173)Q(177)Q(188)Q(193)Q(203)

Q(173)Q(177)Q(188)Q(193)Q(203) MATH 313: SOLUTIONS HW3 Problem 1 (a) 30941 We use the Miller-Rabin test to check if it prime. We know that the smallest number which is a strong pseudoprime both base 2 and base 3 is 1373653; hence, if

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

Problem Set 6 Solutions Math 158, Fall 2016

Problem Set 6 Solutions Math 158, Fall 2016 All exercise numbers from the textbook refer to the second edition. 1. (a) Textbook exercise 3.3 (this shows, as we mentioned in class, that RSA decryption always works when the modulus is a product of

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

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

MAT199: Math Alive Cryptography Part 2

MAT199: Math Alive Cryptography Part 2 MAT199: Math Alive Cryptography Part 2 1 Public key cryptography: The RSA algorithm After seeing several examples of classical cryptography, where the encoding procedure has to be kept secret (because

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

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

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

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

PT. Primarity Tests Given an natural number n, we want to determine if n is a prime number.

PT. Primarity Tests Given an natural number n, we want to determine if n is a prime number. PT. Primarity Tests Given an natural number n, we want to determine if n is a prime number. (PT.1) If a number m of the form m = 2 n 1, where n N, is a Mersenne number. If a Mersenne number m is also a

More information

MAT Modular arithmetic and number theory. Modular arithmetic

MAT Modular arithmetic and number theory. Modular arithmetic Modular arithmetic 1 Modular arithmetic may seem like a new and strange concept at first The aim of these notes is to describe it in several different ways, in the hope that you will find at least one

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

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

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

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

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

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

EE 418: Network Security and Cryptography

EE 418: Network Security and Cryptography EE 418: Network Security and Cryptography Homework 3 Solutions Assigned: Wednesday, November 2, 2016, Due: Thursday, November 10, 2016 Instructor: Tamara Bonaci Department of Electrical Engineering University

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

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

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

MT 430 Intro to Number Theory MIDTERM 2 PRACTICE

MT 430 Intro to Number Theory MIDTERM 2 PRACTICE MT 40 Intro to Number Theory MIDTERM 2 PRACTICE Material covered Midterm 2 is comrehensive but will focus on the material of all the lectures from February 9 u to Aril 4 Please review the following toics

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

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

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

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

An elementary study of Goldbach Conjecture

An elementary study of Goldbach Conjecture An elementary study of Goldbach Conjecture Denise Chemla 26/5/2012 Goldbach Conjecture (7 th, june 1742) states that every even natural integer greater than 4 is the sum of two odd prime numbers. If we

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

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

MAT 302: ALGEBRAIC CRYPTOGRAPHY. Department of Mathematical and Computational Sciences University of Toronto, Mississauga.

MAT 302: ALGEBRAIC CRYPTOGRAPHY. Department of Mathematical and Computational Sciences University of Toronto, Mississauga. MAT 302: ALGEBRAIC CRYPTOGRAPHY Department of Mathematical and Computational Sciences University of Toronto, Mississauga February 27, 2013 Mid-term Exam INSTRUCTIONS: The duration of the exam is 100 minutes.

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

PROPERTIES OF MERSENNE NUMBERS AND PRIMES

PROPERTIES OF MERSENNE NUMBERS AND PRIMES PROPERTIES OF MERSEE UMBERS AD PRIMES If one looks at the sequence of numbers- = 3, 7, 31, 127, 2047, 8291, 131071, 524287 one notices that its elements are, with the exception of 2047, prime numbers defined

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

ON MODULI FOR WHICH THE FIBONACCI SEQUENCE CONTAINS A COMPLETE SYSTEM OF RESIDUES S. A. BURR Belt Telephone Laboratories, Inc., Whippany, New Jersey

ON MODULI FOR WHICH THE FIBONACCI SEQUENCE CONTAINS A COMPLETE SYSTEM OF RESIDUES S. A. BURR Belt Telephone Laboratories, Inc., Whippany, New Jersey ON MODULI FOR WHICH THE FIBONACCI SEQUENCE CONTAINS A COMPLETE SYSTEM OF RESIDUES S. A. BURR Belt Telephone Laboratories, Inc., Whippany, New Jersey Shah [1] and Bruckner [2] have considered the problem

More information

Final Exam, Math 6105

Final Exam, Math 6105 Final Exam, Math 6105 SWIM, June 29, 2006 Your name Throughout this test you must show your work. 1. Base 5 arithmetic (a) Construct the addition and multiplication table for the base five digits. (b)

More information

Application: Public Key Cryptography. Public Key Cryptography

Application: Public Key Cryptography. Public Key Cryptography Application: Public Key Cryptography Suppose I wanted people to send me secret messages by snail mail Method 0. I send a padlock, that only I have the key to, to everyone who might want to send me a message.

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

Xor. Isomorphisms. CS70: Lecture 9. Outline. Is public key crypto possible? Cryptography... Public key crypography.

Xor. Isomorphisms. CS70: Lecture 9. Outline. Is public key crypto possible? Cryptography... Public key crypography. CS70: Lecture 9. Outline. 1. Public Key Cryptography 2. RSA system 2.1 Efficiency: Repeated Squaring. 2.2 Correctness: Fermat s Theorem. 2.3 Construction. 3. Warnings. Cryptography... m = D(E(m,s),s) Alice

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

by Michael Filaseta University of South Carolina

by Michael Filaseta University of South Carolina by Michael Filaseta University of South Carolina Background: A covering of the integers is a system of congruences x a j (mod m j, j =, 2,..., r, with a j and m j integral and with m j, such that every

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

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