Number-Theoretic Algorithms
|
|
- Benedict Cain
- 6 years ago
- Views:
Transcription
1 Number-Theoretic Algorithms Hengfeng Wei March 31 April 6, 2017 Hengfeng Wei Number-Theoretic Algorithms March 31 April 6, / 36
2 Number-Theoretic Algorithms 1 Modular Arithmetic 2 Euclid s Algorithm 3 Pairwise Relatively Prime 4 Chinese Remainder Theorem
3 Modular Arithmetic Cancellation in modular arithmetic (TC ) ad bd (mod n) = a b (mod n) ad bd (mod n), d n = a b (mod n) (mod 4) 3 5 (mod 4) Hengfeng Wei (hfwei@nju.edu.cn) Number-Theoretic Algorithms March 31 April 6, / 36
4 Modular Arithmetic Changing the modulus (mod 4) 3 5 (mod 4) 3 5 (mod 2) ad bd (mod nd) a b (mod n) (d 0) (a mod n)d = ad mod nd (distributive law) ad bd (mod n) a b (mod n (d, n) ) Hengfeng Wei (hfwei@nju.edu.cn) Number-Theoretic Algorithms March 31 April 6, / 36
5 Modular Arithmetic Changing the modulus n = n 1 n 2 n k a b (mod n) = a b (mod n i ) a b (mod 100) = a b (mod 20) = a b (mod 5) Hengfeng Wei (hfwei@nju.edu.cn) Number-Theoretic Algorithms March 31 April 6, / 36
6 Modular Arithmetic Changing the modulus n = n 1 n 2 n k a b (mod n 1 ), a b (mod n 2 ) a b (mod lcm(n 1, n 2 )) a b (mod n 1 ), a b (mod n 2 ) a b (mod n 1 n 2 ), if n 1 n 2 1 i k, a b (mod n i ) a b (mod n), if n i n j Hengfeng Wei (hfwei@nju.edu.cn) Number-Theoretic Algorithms March 31 April 6, / 36
7 Number-Theoretic Algorithms 1 Modular Arithmetic 2 Euclid s Algorithm 3 Pairwise Relatively Prime 4 Chinese Remainder Theorem
8 Euclid s Algorithm Worst-case analysis of Euclid s algorithm (TC ) 1. If a > b 0, Euclid(a, b) makes 1 + log ϕ b recursive calls. Lamé s theorem: a > b 1, b < F k+1 = r < k. k = 2 + log ϕ b To prove b < F 3+logϕ b. F k = ϕk ˆϕ k 5 > ϕk 1 5 Hengfeng Wei (hfwei@nju.edu.cn) Number-Theoretic Algorithms March 31 April 6, / 36
9 Euclid s Algorithm Worst-case analysis of Euclid s algorithm (TC ) 2. Improve this bound to 1 + log ϕ ( b (a,b) ). (16, 12) a (a, b) = (a, b) ( (a, b), b (a, b) ) = (12, 4) = (4, 0) (4, 3) = (3, 1) = (1, 0) = 4 = 1 a Euclid(a, b) Euclid( (a, b), b (a, b) ) Hengfeng Wei (hfwei@nju.edu.cn) Number-Theoretic Algorithms March 31 April 6, / 36
10 Euclid s Algorithm Worst-case analysis of Euclid s algorithm (TC ) 2. Improve this bound to 1 + log ϕ ( b (a,b) ). a Euclid(a, b) Euclid( (a, b), b (a, b) ) Euclid(b, a mod b) Euclid(? b (a, b), a (a, b) mod b Euclid(b, a mod b) Euclid( (a, b), a mod b (a, b) ) a (a, b) mod b (a, b) = a mod b (a, b) b (a, b) ) Hengfeng Wei (hfwei@nju.edu.cn) Number-Theoretic Algorithms March 31 April 6, / 36
11 Euclid s Algorithm Worst-case analysis of Euclid s algorithm (TC ) 2. Improve this bound to 1 + log ϕ ( b (a,b) ). Lemma (Generalization of Lemma 31.10) If a > b 1, d = (a, b) and Euclid(a, b) performs k 1 recursive calls, then a df k+2 and b df k+1. Hengfeng Wei (hfwei@nju.edu.cn) Number-Theoretic Algorithms March 31 April 6, / 36
12 Euclid s Algorithm Average-case analysis of Euclid s algorithm T (m, 0) = 0; T (m, n) = 1 + T (n, m mod n) n 1 When m is chosen at random: T n = 1 T (k, n) n 0 k<n Assume that, for 0 k < n, (n mod k) is random : T n n (T 0 + T T n 1 ) = n = H n ln n + O(1) Reference The Art of Computer Programming, Vol 2: Seminumerical Algorithms (Section 4.5.3) by Donald E. Knuth, 3rd edition. Hengfeng Wei (hfwei@nju.edu.cn) Number-Theoretic Algorithms March 31 April 6, / 36
13 Number-Theoretic Algorithms 1 Modular Arithmetic 2 Euclid s Algorithm 3 Pairwise Relatively Prime 4 Chinese Remainder Theorem
14 Pairwise Relatively Prime Pairwise relatively prime (TC ) n 1, n 2, n 3, n 4 are pairwise relatively prime gcd(n 1 n 2, n 3 n 4 ) = gcd(n 1 n 3, n 2 n 4 ) = 1 Hengfeng Wei (hfwei@nju.edu.cn) Number-Theoretic Algorithms March 31 April 6, / 36
15 Pairwise Relatively Prime Pairwise relatively prime (TC ) n 1, n 2,..., n k are pairwise relatively prime a set of lg k pairs of numbers derived from the n i are relatively prime. ( ) k = Θ(k 2 ) (complete graph) 2 gcd( 1 L, 1 R ) = gcd( 2 L, 2 R ) = = gcd( lg k L, lg k R ) = 1 k = 2 : gcd(n 1, n 2 ) = 1 k = 3 : gcd(n 1, n 2 n 3 ) = gcd(n 2, n 3 ) = 1 Hengfeng Wei (hfwei@nju.edu.cn) Number-Theoretic Algorithms March 31 April 6, / 36
16 Pairwise Relatively Prime Pairwise relatively prime: divide-and-conquer n 1 n 2 n 3 n 4 n 5 n 6 n 7 n 1 n 2 n 3 n 4 n 5 n 6 n 7 n 1 n 2 n 3 n 4 n 5 n 6 n 7 n 1 n 2 n 3 n 4 n 5 n 6 { T (1) = 0 T (k) = T ( k 2 ) + T ( k 2 ) + 1 = T (k) = k 1 = Θ(k) T k = k 1 : (n i, n i+1 n i+2 n k ) 1 i < k Hengfeng Wei (hfwei@nju.edu.cn) Number-Theoretic Algorithms March 31 April 6, / 36
17 Pairwise Relatively Prime Pairwise relatively prime: smarter combination n 1 n 2 n 3 n 4 n 1 n 2 n 3 n 4 n 1 n 2 n 3 n 4 (n 1 n 2, n 3 n 4 ) = 1 (n 1, n 2 ) = 1, (n 3, n 4 ) = 1 { T (1) = 0 T (k) = T ( k 2 ) + 1 (n 1 n 2, n 3 n 4 ) = 1 (n 1 n 3, n 2 n 4 ) = 1 = T (k) = lg k Hengfeng Wei (hfwei@nju.edu.cn) Number-Theoretic Algorithms March 31 April 6, / 36
18 Pairwise Relatively Prime Pairwise relatively prime: the dividing pattern k = 7 : n 0, n 1, n 2,..., n 6 n 0 n 1 n 2 n 3 n 4 n 5 n 6 n 0 n 1 n 2 n 3 n 4 n 5 n 6 n 0 n 1 n 2 n 3 n 4 n 5 n 0 n 1 n 2 n 3 n 4 n 5 n 6 0 : : : : : : : 110 T (k) = lg k Hengfeng Wei (hfwei@nju.edu.cn) Number-Theoretic Algorithms March 31 April 6, / 36
19 Pairwise Relatively Prime Can we do even better? T (k) lg k Prove by (strong) mathematical induction. T (k) 1 + T ( k 2 ) 1 + lg k 2 = lg k Hengfeng Wei (hfwei@nju.edu.cn) Number-Theoretic Algorithms March 31 April 6, / 36
20 Pairwise Relatively Prime Biclique covering Covering a complete graph with few complete bipartite subgraphs. Hengfeng Wei (hfwei@nju.edu.cn) Number-Theoretic Algorithms March 31 April 6, / 36
21 Pairwise Relatively Prime Biclique covering: rethinking the first divide-and-conquer Reference for T (k) k 1 T (k) = k 1 edge-disjoint biclique partition On the Addressing Problem for Loop Switching by Graham and Pollak, Reference for weighted biclique partition Covering a Graph by Complete Bipartite Graphs by P. Erdős and L. Pyber, Hengfeng Wei (hfwei@nju.edu.cn) Number-Theoretic Algorithms March 31 April 6, / 36
22 Number-Theoretic Algorithms 1 Modular Arithmetic 2 Euclid s Algorithm 3 Pairwise Relatively Prime 4 Chinese Remainder Theorem
23 Chinese Remainder Theorem Chinese Remainder Theorem (CRT) Theorem (CRT) n 1,..., n k ; a 1,..., a k n i n j i j, n = n 1 n 2 n k!a (0 a < n) : a a i (mod n i ). Proof for uniqueness. a (a 1, a 2,..., a k ) a a (mod n i ) = n a a. Hengfeng Wei (hfwei@nju.edu.cn) Number-Theoretic Algorithms March 31 April 6, / 36
24 Chinese Remainder Theorem History of CRT Hengfeng Wei Number-Theoretic Algorithms March 31 April 6, / 36
25 Chinese Remainder Theorem History of CRT Hengfeng Wei Number-Theoretic Algorithms March 31 April 6, / 36
26 Chinese Remainder Theorem Proof of CRT (1) Nonconstructive proof. f : [0, n) [0, a i ) 1 i k f : a ( a mod n 1,..., a mod n k ) f is one-to-one. f is onto. a : f(a) = (a 1,..., a k ). Hengfeng Wei (hfwei@nju.edu.cn) Number-Theoretic Algorithms March 31 April 6, / 36
27 Chinese Remainder Theorem Proof of CRT (2) Constructive proof by induction. a a 1 (mod n 1 ) (1) a a 2 (mod n 2 ) (2) (1) = a = a 1 + n 1 y x = a 1 + n 1 n 1 1 (a 2 a 1 ) (mod n 1 n 2 ) Hengfeng Wei (hfwei@nju.edu.cn) Number-Theoretic Algorithms March 31 April 6, / 36
28 Chinese Remainder Theorem Proof of CRT (3) Constructive proof by induction. a a 1 (mod n 1 ) (3) a a 2 (mod n 2 ) (4) n 1 n 2 = n 1 n 1 + n 2 n 2 = 1 x = a 1 n 1 n 1 + a 2 n 2 n 2 (mod n 1 n 2 ) Hengfeng Wei (hfwei@nju.edu.cn) Number-Theoretic Algorithms March 31 April 6, / 36
29 Chinese Remainder Theorem Proof of CRT (4) Constructive proof. 1. x 1 (mod n i ), x 0 (mod n j ) (i j) x = M i (M 1 i mod n i ) = x = M i M 1 i (mod n) 2. x a i (mod n i ), x 0 (mod n j ) (i j) 3. a a i (mod n i ), 1 i k a = x = a i M i M 1 i (mod n) 1 i k a i M i M 1 i (mod n) Hengfeng Wei (hfwei@nju.edu.cn) Number-Theoretic Algorithms March 31 April 6, / 36
30 Chinese Remainder Theorem Proof of CRT (5) More efficient constructive proof. Reference The Residue Number System by Garner, Reference The Art of Computer Programming, Vol 2: Seminumerical Algorithms (Section 4.3.2) by Donald E. Knuth, 3rd edition. Hengfeng Wei Number-Theoretic Algorithms March 31 April 6, / 36
31 Chinese Remainder Theorem Operations over CRT a (a 1, a 2,..., a n ) a ± b (a 1 ± b 1, a 2 ± b 2,..., a n ± b n ) a b (a 1 b 1, a 2 b 2,..., a n b n ) TC Proof. a (a 1, a 2,..., a n ), (a, n) = 1 = a 1 (a 1 1, a 1 2,..., a 1 n ) a 1 a 1 i (mod n i ) = { a ai (mod n i ) (a, n) = 1 Hengfeng Wei (hfwei@nju.edu.cn) Number-Theoretic Algorithms March 31 April 6, / 36
32 Chinese Remainder Theorem The ϕ function Theorem (The ϕ function) ϕ(p) = p 1 ϕ(p k ) = p k p k 1 r ϕ(n) = n (1 1 r k ) (n = p i i ) p i=1 i i=1 We shall not prove this formula here. CLRS (Section 31.3) Let us prove this formula now. m n = ϕ(mn) = ϕ(m)ϕ(n) Hengfeng Wei (hfwei@nju.edu.cn) Number-Theoretic Algorithms March 31 April 6, / 36
33 Chinese Remainder Theorem The ϕ function Theorem (The ϕ function) m n = ϕ(mn) = ϕ(m)ϕ(n) Proof. U mn = {a mod mn, (a, mn) = 1} U m = {b mod m, (b, m) = 1} U n = {c mod n, (c, n) = 1} f : U mn U m U n f(a mod mn) = (a mod m, a mod n). Hengfeng Wei (hfwei@nju.edu.cn) Number-Theoretic Algorithms March 31 April 6, / 36
34 Chinese Remainder Theorem Secret sharing using the CRT Definition ((k, n)-threshold secret sharing scheme) (3, 3)-secret sharing: Reference How to Share a Secret by Maurice Mignotte, Hengfeng Wei (hfwei@nju.edu.cn) Number-Theoretic Algorithms March 31 April 6, / 36
35 Chinese Remainder Theorem Secret sharing using the CRT 1. Choose m i : m 1 < m 2 < < m n, m i m j, n k m i < m i i=n k+2 i=1 2. Choose the secret S: n k m i < S < m i i=n k+2 i=1 3. Compute the shares: s i = S mod m i Hengfeng Wei (hfwei@nju.edu.cn) Number-Theoretic Algorithms March 31 April 6, / 36
36 Chinese Remainder Theorem Solving simultaneous congruences (TC ) x 1 (mod 9) x 2 (mod 8) x 3 (mod 7) x 10 (mod 504) Hengfeng Wei (hfwei@nju.edu.cn) Number-Theoretic Algorithms March 31 April 6, / 36
37 Chinese Remainder Theorem Solving simultannous congruences CRT with large modulus 19x 556 (mod 1155) x 1 (mod 3) 19x 556 (mod 3) x 4 (mod 5) 19x 556 (mod 5) x 2 (mod 7) 19x 556 (mod 7) x 9 (mod 11) 19x 556 (mod 11) Hengfeng Wei (hfwei@nju.edu.cn) Number-Theoretic Algorithms March 31 April 6, / 36
38 Chinese Remainder Theorem Solving simultaneous congruences CRT with non-pairwisely co-prime moduli x 3 (mod 8) x 11 (mod 20) x 1 (mod 15) { x 3 (mod 2 3 ) { x 3 (mod 2 3 ) x 3 (mod 2 2 ) { x 3 (mod 2 2 ) x 1 (mod 5) { x 1 (mod 3) { x 1 (mod 3) x 1 (mod 5) { x 1 (mod 5) x 1 (mod 5) Hengfeng Wei (hfwei@nju.edu.cn) Number-Theoretic Algorithms March 31 April 6, / 36
39 Chinese Remainder Theorem Solving simultaneous congruences Theorem (CRT with non-pairwisely coprime moduli) a i a j (mod (n i, n j )) 0 a < lcm(n 1, n 2,..., n k ) Hengfeng Wei (hfwei@nju.edu.cn) Number-Theoretic Algorithms March 31 April 6, / 36
40 Chinese Remainder Theorem Simultaneous incongruences?a, 1 i k : a a i (mod n i ) NP-complete Hengfeng Wei (hfwei@nju.edu.cn) Number-Theoretic Algorithms March 31 April 6, / 36
41 Chinese Remainder Theorem Hengfeng Wei Number-Theoretic Algorithms March 31 April 6, / 36
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 informationNUMBER 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 informationNumber 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 informationIntroduction 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 informationWilson 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 informationMath 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 informationAlgorithmic 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 informationThe 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 information6. 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 informationThe 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 informationFermat 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 informationData 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 informationb) 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 informationCMPSCI 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 informationCMPSCI 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 informationNumber 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 informationIntroduction. 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 informationPrimitive 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 informationp 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 informationAlgorithmic Number Theory and Cryptography (CS 303)
Algorithmic Number Theory and Cryptography (CS 303) Modular Arithmetic and the RSA Public Key Cryptosystem Jeremy R. Johnson 1 Introduction Objective: To understand what a public key cryptosystem is and
More informationCalculators 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 informationSheet 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 informationL29&30 - RSA Cryptography
L29&30 - RSA Cryptography CSci/Math 2112 20&22 July 2015 1 / 13 Notation We write a mod n for the integer b such that 0 b < n and a b (mod n). 2 / 13 Calculating Large Powers Modulo n Example 1 What is
More informationMath 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 information1.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 informationThe 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 informationThe 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 informationSolutions 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 informationMAT 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 informationModular 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 informationDistribution 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 informationLECTURE 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 informationUniversity 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 informationApplications 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 informationFoundations 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 informationNumbers (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 informationCollection 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 informationNumbers (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 informationNumbers (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 informationNumber 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 informationby 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 informationSolutions 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 informationAssignment 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 informationSOLUTIONS 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 informationSolutions 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 informationDiscrete 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 informationMathematics 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 informationSolutions 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 informationCarmen 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 informationDiscrete 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 informationMark 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 informationDUBLIN 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 informationON 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 informationThe 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 informationExam 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 informationALGEBRA: 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 informationModular 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 informationLecture 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 informationConstructions 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 informationMath 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 informationSOLUTIONS 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 informationMATH 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 informationPublic 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 informationDegree 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 informationNumber Theory and Security in the Digital Age
Number Theory and Security in the Digital Age Lola Thompson Ross Program July 21, 2010 Lola Thompson (Ross Program) Number Theory and Security in the Digital Age July 21, 2010 1 / 37 Introduction I have
More informationDiffie-Hellman key-exchange protocol
Diffie-Hellman key-exchange protocol This protocol allows two users to choose a common secret key, for DES or AES, say, while communicating over an insecure channel (with eavesdroppers). The two users
More informationOverview. 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 informationMAT 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 informationPractice 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 informationShuffling with ordered cards
Shuffling with ordered cards Steve Butler (joint work with Ron Graham) Department of Mathematics University of California Los Angeles www.math.ucla.edu/~butler Combinatorics, Groups, Algorithms and Complexity
More informationZhanjiang , People s Republic of China
Math. Comp. 78(2009), no. 267, 1853 1866. COVERS OF THE INTEGERS WITH ODD MODULI AND THEIR APPLICATIONS TO THE FORMS x m 2 n AND x 2 F 3n /2 Ke-Jian Wu 1 and Zhi-Wei Sun 2, 1 Department of Mathematics,
More informationA4M33PAL, ZS , FEL ČVUT
Pseudorandom numbers John von Neumann: Any one who considers arithmetical methods of producing random digits is, of course, in a state of sin. For, as has been pointed out several times, there is no such
More informationA New RNS 4-moduli Set for the Implementation of FIR Filters. Gayathri Chalivendra
A New RNS 4-moduli Set for the Implementation of FIR Filters by Gayathri Chalivendra A Thesis Presented in Partial Fulfillment of the Requirements for the Degree Master of Science Approved April 2011 by
More informationMATH 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 informationLinear 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 information11 Chain and Antichain Partitions
November 14, 2017 11 Chain and Antichain Partitions William T. Trotter trotter@math.gatech.edu A Chain of Size 4 Definition A chain is a subset in which every pair is comparable. A Maximal Chain of Size
More informationON 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 informationCalculators 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 informationLECTURE 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 informationFinal 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 informationMODULAR 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 informationAn 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 informationCS70: Lecture 8. Outline.
CS70: Lecture 8. Outline. 1. Finish Up Extended Euclid. 2. Cryptography 3. Public Key Cryptography 4. RSA system 4.1 Efficiency: Repeated Squaring. 4.2 Correctness: Fermat s Theorem. 4.3 Construction.
More informationXor. 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 informationDiscrete Mathematics and Probability Theory Spring 2018 Ayazifar and Rao Midterm 2 Solutions
CS 70 Discrete Mathematics and Probability Theory Spring 2018 Ayazifar and Rao Midterm 2 Solutions PRINT Your Name: Oski Bear SIGN Your Name: OS K I PRINT Your Student ID: CIRCLE your exam room: Pimentel
More informationMA/CSSE 473 Day 13. Student Questions. Permutation Generation. HW 6 due Monday, HW 7 next Thursday, Tuesday s exam. Permutation generation
MA/CSSE 473 Day 13 Permutation Generation MA/CSSE 473 Day 13 HW 6 due Monday, HW 7 next Thursday, Student Questions Tuesday s exam Permutation generation 1 Exam 1 If you want additional practice problems
More informationDiscrete 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 informationMA/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 informationEE 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 informationArithmetic of Remainders (Congruences)
Arithmetic of Remainders (Congruences) Donald Rideout, Memorial University of Newfoundland 1 Divisibility is a fundamental concept of number theory and is one of the concepts that sets it apart from other
More informationAnimation Demos. Shows time complexities on best, worst and average case.
Animation Demos http://cg.scs.carleton.ca/~morin/misc/sortalg/ http://home.westman.wave.ca/~rhenry/sort/ Shows time complexities on best, worst and average case http://vision.bc.edu/~dmartin/teaching/sorting/animhtml/quick3.html
More informationPT. 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 informationREADING TO ACCOMPANY CSU-P MATH 319 NUMBER THEORY SPRING TERM, CONGRUENCES
READING TO ACCOMPANY CSU-P MATH 319 NUMBER THEORY SPRING TERM, 2014 JONATHAN A. PORITZ AFTER WISSAM RAJI 2. CONGRUENCES A congruence is nothing more than a statement about divisibility. The theory of congruences
More informationGoldbach 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 information12. Let Rm = {0,1,2,..., m 1} be a complete residue system modulo ra. Let a be an integer. When is a Rm = {0,1 a, 2 a,...
12. Let Rm = {0,1,2,..., m 1} be a complete residue system modulo ra. Let a be an integer. When is a Rm = {0,1 a, 2 a,..., a (ra - 1)} a complete residue system modulo m? Prove your conjecture. (Try m
More informationLecture 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 informationlecture notes September 2, Batcher s Algorithm
18.310 lecture notes September 2, 2013 Batcher s Algorithm Lecturer: Michel Goemans Perhaps the most restrictive version of the sorting problem requires not only no motion of the keys beyond compare-and-switches,
More informationCryptography, 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 informationPublic 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 informationLossy Compression of Permutations
204 IEEE International Symposium on Information Theory Lossy Compression of Permutations Da Wang EECS Dept., MIT Cambridge, MA, USA Email: dawang@mit.edu Arya Mazumdar ECE Dept., Univ. of Minnesota Twin
More information