Discrete Structures Lecture Solving Congruences. mathematician of the eighteenth century). Also, the equation gggggg(aa, bb) =

Size: px
Start display at page:

Download "Discrete Structures Lecture Solving Congruences. mathematician of the eighteenth century). Also, the equation gggggg(aa, bb) ="

Transcription

1 First Introduction Our goal is to solve equations having the form aaaa bb (mmmmmm mm). However, first we must discuss the last part of the previous section titled gcds as Linear Combinations THEOREM 6 DEFINITION 6 BÉZOUT S THEOREM If aa and bb are positive integers, then there exist integers ss and tt such that gggggg(aa, bb) = ssss + tttt. If aa and bb are positive integers, then ss and tt such that gggggg(aa, bb) = ssss + tttt are called BBézzzzzzzz cccccccccccccccccccccccc of aa and bb (after Étienne Bézout, a French mathematician of the eighteenth century). Also, the equation gggggg(aa, bb) = ssss + tttt is called BBézzzzzzzz ss iiiiiiiiiiiiiiii. EXAMPLE 17 Express gggggg(252,198) = 18 as a linear combination of 252 and 198. Solution: To show that gggggg(252,198) = 18, the Euclidean algorithm uses these divisions. 252 = = = = 2 18 Using the next-to-last division (the third division), we can express gggggg(252,198) = 18 as a linear combination of 54 and 36. The second division tells us that 18 = = Substituting this expression for 36 into the previous equation, we can express 18 as a linear combination of 54 and 198. The first division tells us that 18 = 54 1 ( ) = = Substituting this expression for 54 into the previous equation, we can express 18 as a linear combination of 252 and = = 4 ( ) = completing the solution 1

2 Second Introduction Solving linear congruences, which have the form aaaa bb (mmmmmm mm), is an essential task in the study of number theory and its applications. To solve linear congruences, we employ inverses modulo mm. We explain how to work backwards through steps of the Euclidean algorithm to find inverses modulo mm. Once we have found an inverse of aa modulo mm, we solve the congruence aaaa bb (mmmmmm mm) by multiplying both sides of the congruence by this inverse. Linear Congruences A congruence of the form aaaa bb (mmmmmm mm), Where mm is a positive integer, aa and bb are integers, and xx is a variable, is called a linear congruence. How can we solve the linear congruence aaaa bb (mmmmmm mm), that is, how can we find all integers xx that satisfy this congruence? One method that we will describe uses an integer aa such that aaaa 1 (mmmmmm mm), if such an integer exists. Such an integer aa is said to be an inverse of aa modulo mm. Theorem 1 guarantees that an inverse of aa modulo mm exists whenever aa and mm are relatively prime. THEOREM 1 If aa and mm are relatively prime integers and mm > 1, then an inverse of aa modulo mm exists. Furthermore, this inverse is unique modulo mm. (That is, there is a unique positive integer aa less than mm that is an inverse of aa modulo mm and every other inverse of aa modulo mm is congruent to aa modulo mm.) EXAMPLE 1 Find an inverse of 3 modulo 7 by first finding Bézout coefficients of 3 and 7. (Note that we have already shown that 5 is an inverse of 3 modulo 7 by inspection.) Solution: Because gggggg(3,7) = 1, Theorem 1 tells us that an inverse of 3 modulo 7 exists. The Euclidean algorithm ends quickly when used to find the greatest common divisor of 3 and 7. From this equation we see that 7 = = 1 This shows that 2 and 1 are Bézout coefficients of 3 and 7. We see that 2 is an inverse of 3 modulo 7. Note that every integer congruent to 2 modulo 7 is also an inverse of 3, such as 5, 9, 12, and so on. 2

3 EXAMPLE 2 Find an inverse of 101 modulo Solution: For completeness, we present all steps used to compute an inverse of 101 modulo (Only the last step goes beyond methods developed in section 4.3 and illustrated in Example 17 in that section.) First, we use the Euclidean algorithm to show that gggggg(101,4620) = 1. Then we will reverse the steps to find Bézout coefficients aa and bb such that 101aa bb = 1. It will then follow that aa is an inverse of 101 modulo The steps used by the Euclidean algorithm to find gggggg(101,4620) are a b q r 4620 = = = = = = = Because the last nonzero remainder is 1, we know that gggggg(101,4620) = 1. We can now find the Bézout coefficients for 101 and 4620 by working backwards through these steps, expressing gggggg(101,4620) = 1 in terms of each successive pair of remainders. In each step we eliminate the remainder by expressing it as a linear combination of the divisor and the dividend. We obtain 1 = = 3 1 (23 3 7) = = ( ) = = ( ) = = ( ) = = ( ) = = 11 That = 1 tells us that 35 and 1601 are Bézout coefficients of 4620 and 101, and is an inverse of 101 modulo Once we have an inverse aa of aa modulo mm, we can solve the congruence aaaa bb(mmmmmm mm) by multiplying both sides of the linear congruence by aa, as Example 3 illustrates. 3

4 EXAMPLE 3 What are the solutions of the linear congruence 3xx 4 (mmmmmm 7)? Solution: By Example 1 we know that 2 is an inverse of 3 modulo 7. Multiplying both sides of the congruence by 2 shows that 2 3xx 2 4 (mmmmmm 7) Because 6 1 (mmmmmm 7) and 8 6 (mmmmmm 7), it follows that if xx is a solution, then xx 8 6 (mmmmmm 7). We need to determine whether every xx with xx 6 (mmmmmm 7) is a solution. Assume that xx 6 (mmmmmm 7). Then, by Theorem 5 of Section 4.1, it follows that 3xx 3 6 = 18 4( mmmmmm 7) which shows that all such xx satisfy the congruence. We conclude that the solutions to the congruence are integers xx such that xx 6 (mmmmmm 7), namely, 6, 13, 20,, and 1, 8, 15,. The Chinese Remainder Theorem EXAMPLE 4 In the first century, the Chinese mathematician Sun-Tsu asked: There are certain things whose number is unknown. When divided by 3, the remainder is 2; when divided by 5, the remainder is 3; and when divided by 7, the remainder is 2. What will be the number of things? This puzzle can be translated into the following question: What are the solutions of the systems of congruences xx 2 (mmmmmm 3), xx 3 (mmmmmm 5), xx 2 (mmmmmm 7)? We will solve this system, and with it Sun-Tsu s puzzle, later in this section. THEOREM 2 THE CHINESE REMAINDER THEOREM Let mm 1, mm 2,, mm nn be pairwise relatively prime positive integers greater than one and aa 1, aa 2,, aa nn arbitrary integers. Then the system xx aa 1 (mmmmmm mm 1 ), xx aa 2 (mmmmmm mm 2 ), xx aa nn (mmmmmm mm nn ) has a unique solution modulo mm = mm 1 mm 2 mm nn. (That is, there is a solution xx with 0 xx < mm, and all other solutions are congruent modulo mm to this solution.) 4

5 Proof: To establish this theorem, we need to show that a solution exists and that it is unique modulo mm. We will show that a solution exists by describing a way to construct this solution. To construct a simultaneous solution, first let MM kk = mm/mm kk for kk = 1,2,, nn. That is, MM kk is the product of the moduli except for mm kk. Because mm ii and mm kk have no common factors greater than 1 when ii kk, it follows that gggggg(mm kk, MM kk ) = 1. Consequently, by Theorem 1, we know that there is an integer yy kk, an inverse of MM kk modulo mm kk, such that MM kk yy kk 1 (mmmmmm mm kk ) To construct a simultaneous solution, form the sum xx = aa 1 MM 1 yy 1 + aa 2 MM 2 yy aa nn MM nn yy nn Will now show that xx is a simultaneous solution. First, note that because MM jj 0( mmmmmm mm kk ) whenever jj kk, all terms except the kkth term in this sum are congruent to 0 modulo mm kk. Because MM kk yy kk 1 (mmmmmm mm kk ) we see that xx aa kk MM kk yy kk aa kk (mmmmmm mm kk ), for kk = 1,2,, nn. We have shown that xx is a simultaneous solution to the nn congruences. EXAMPLE 5 To solve the system of congruences in Example 4, first let mm = = 105, MM 1 = mm = 35, MM 3 2 = mm = 21, and MM 5 3 = mm = 15. We see that 2 is an 7 inverse of MM 1 = 35 modulo 3, because ( mmmmmm 3); 1 is an inverse of MM 2 = 21 modulo 5, because ( mmmmmm 5); and 1 is an inverse of MM 3 = 15 modulo 7, because 15 1( mmoooo 7). The solutions to this system are those xx such that xx aa 1 MM 1 yy 1 + aa 2 MM 2 yy 2 + aa 3 MM 3 yy 3 = = ( mmmmmm 105), It follows that 23 is the smallest positive integer that is a simultaneous solution. We conclude that 23 is the smallest positive integer that leaves a remainder of 2 when divided by 3, a remainder of 3 when divided by 5, and a remainder of 2 when divided by 7. 5

6 EXAMPLE 6 Use the method of back substitution to find all integers xx such that xx 1 (mmmmmm 5), xx 2( mmmmmm 6), and xx 3( mmmmmm 7). Solution: By Theorem 4 in Section 4.1, the first congruence can be rewritten as an equality, xx = 5tt + 1 where tt is an integer. Substituting this expression for xx into the second congruence tells us that 5tt + 1 2(mmmmmm 6), which can be easily solved to show that tt 5(mmmmmm 6) (as the reader should verify). Using Theorem 4 in Section 4.1 again, we see that tt = 6uu + 5 where uu is an integer. Substituting this expression for tt into the equation xx = 5tt + 1 tells us that xx = 5(6uu + 5) + 1 = 30uu We insert this into the third equation to obtain 30uu (mmmmmm 7) Solving this congruence tells us that uu = 6(mmmmmm 7) (as the reader should verify). Theorem 4 in Section 4.1 tells us that uu = 7vv + 6 where vv is an integer. Substituting this expression for uu into the equation xx = 30uu + 26 tells us that xx = 30(7vv + 6) + 26 = 210uu Translating this back into a congruence, we find the solution to the simultaneous congruences, xx 206(mmmmmm 210). Computer Arithmetic with Large Integers Read for yourself. Fermat s Little Theorem THEOREM 3 FERMAT S LITTLE THEOREM If pp is prime and aa is an integer not divisible by pp, then aa pp 1 1(mmmmmm pp). Furthermore, for every integer aa we have aa pp aa(mmmmmm pp). 6

7 EXAMPLE 9 Find mod 11. Solution: We can use Fermat s little theorem to evaluate mod 11 rather than using the fast modular exponentiation algorithm. By Fermat s little theorem we know that 7 10 = 1(mod 11), so (7 10 ) kk = 1(mod 11)222 = We now see that = = (7 10 ) (1) (mmmmmm 11). It follows that mod 11 = 5. Primitive Roots and Discrete Logarithms. Read for yourself. 7

4.4 Solving Congruences using Inverses

4.4 Solving Congruences using Inverses 4.4 Solving Congruences using Inverses Solving linear congruences is analogous to solving linear equations in calculus. Our first goal is to solve the linear congruence ax b pmod mq for x. Unfortunately

More information

Math 3336 Section 4.3 Primes and Greatest Common Divisors. Prime Numbers and their Properties Conjectures and Open Problems About Primes

Math 3336 Section 4.3 Primes and Greatest Common Divisors. Prime Numbers and their Properties Conjectures and Open Problems About Primes Math 3336 Section 4.3 Primes and Greatest Common Divisors Prime Numbers and their Properties Conjectures and Open Problems About Primes Greatest Common Divisors and Least Common Multiples The Euclidian

More information

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

COMP239: Mathematics for Computer Science II. Prof. Chadi Assi EV7.635 COMP239: Mathematics for Computer Science II Prof. Chadi Assi assi@ciise.concordia.ca EV7.635 The Euclidean Algorithm The Euclidean Algorithm Finding the GCD of two numbers using prime factorization is

More information

Notes on Systems of Linear Congruences

Notes on Systems of Linear Congruences MATH 324 Summer 2012 Elementary Number Theory Notes on Systems of Linear Congruences In this note we will discuss systems of linear congruences where the moduli are all different. Definition. Given the

More information

Wilson s Theorem and Fermat s Little Theorem

Wilson s Theorem and Fermat s Little Theorem Wilson s Theorem and Fermat s Little Theorem Wilson stheorem THEOREM 1 (Wilson s Theorem): (p 1)! 1 (mod p) if and only if p is prime. EXAMPLE: We have (2 1)!+1 = 2 (3 1)!+1 = 3 (4 1)!+1 = 7 (5 1)!+1 =

More information

Number Theory Proof Portfolio

Number Theory Proof Portfolio Number Theory Proof Portfolio Jordan Rock May 12, 2015 This portfolio is a collection of Number Theory proofs and problems done by Jordan Rock in the Spring of 2014. The problems are organized first by

More information

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

Know the Well-ordering principle: Any set of positive integers which has at least one element contains a smallest element. The first exam will be on Monday, June 8, 202. The syllabus will be sections. and.2 in Lax, and the number theory handout found on the class web site, plus the handout on the method of successive squaring

More information

4 Number Theory and Cryptography

4 Number Theory and Cryptography 4 Number Theory and Cryptography 4.1 Divisibility and Modular Arithmetic This section introduces the basics of number theory number theory is the part of mathematics involving integers and their properties.

More information

Algebra. Modular arithmetic can be handled mathematically by introducing a congruence relation on the integers described in the above example.

Algebra. Modular arithmetic can be handled mathematically by introducing a congruence relation on the integers described in the above example. Coding Theory Massoud Malek Algebra Congruence Relation The definition of a congruence depends on the type of algebraic structure under consideration Particular definitions of congruence can be made for

More information

3 The fundamentals: Algorithms, the integers, and matrices

3 The fundamentals: Algorithms, the integers, and matrices 3 The fundamentals: Algorithms, the integers, and matrices 3.4 The integers and division This section introduces the basics of number theory number theory is the part of mathematics involving integers

More information

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

Number Theory. CSS322: Security and Cryptography. Sirindhorn International Institute of Technology Thammasat University CSS322. Number Theory. CSS322: Security and Cryptography Sirindhorn International Institute of Technology Thammasat University Prepared by Steven Gordon on 29 December 2011 CSS322Y11S2L06, Steve/Courses/2011/S2/CSS322/Lectures/number.tex,

More information

1 Overview and revision

1 Overview and revision MTH6128 Number Theory Notes 1 Spring 2018 1 Overview and revision In this section we will meet some of the concerns of Number Theory, and have a brief revision of some of the relevant material from Introduction

More information

Basic elements of number theory

Basic elements of number theory Cryptography Basic elements of number theory Marius Zimand 1 Divisibility, prime numbers By default all the variables, such as a, b, k, etc., denote integer numbers. Divisibility a 0 divides b if b = a

More information

Basic elements of number theory

Basic elements of number theory Cryptography Basic elements of number theory Marius Zimand By default all the variables, such as a, b, k, etc., denote integer numbers. Divisibility a 0 divides b if b = a k for some integer k. Notation

More information

MATH 3240Q Introduction to Number Theory Homework 4

MATH 3240Q Introduction to Number Theory Homework 4 If the Sun refused to shine I don t mind I don t mind If the mountains fell in the sea Let it be it ain t me Now if six turned out to be nine Oh I don t mind I don t mind Jimi Hendrix If Six Was Nine from

More information

Chinese Remainder Algorithms. Çetin Kaya Koç Spring / 22

Chinese Remainder Algorithms.   Çetin Kaya Koç Spring / 22 Chinese Remainder Algorithms http://koclab.org Çetin Kaya Koç Spring 2018 1 / 22 The Chinese Remainder Theorem Some cryptographic algorithms work with two (such as RSA) or more moduli (such as secret-sharing)

More information

MTH 346: The Chinese Remainder Theorem

MTH 346: The Chinese Remainder Theorem MTH 346: The Chinese Remainder Theorem March 3, 2014 1 Introduction In this lab we are studying the Chinese Remainder Theorem. We are going to study how to solve two congruences, find what conditions are

More information

Mathematics of Cryptography

Mathematics of Cryptography Modulo arithmetic Fermat's Little Theorem If p is prime and 0 < a < p, then a p 1 = 1 mod p Ex: 3 (5 1) = 81 = 1 mod 5 36 (29 1) = 37711171281396032013366321198900157303750656 = 1 mod 29 (see http://gauss.ececs.uc.edu/courses/c472/java/fermat/fermat.html)

More information

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

2.3 In modular arithmetic, all arithmetic operations are performed modulo some integer. CHAPTER 2 INTRODUCTION TO NUMBER THEORY ANSWERS TO QUESTIONS 2.1 A nonzero b is a divisor of a if a = mb for some m, where a, b, and m are integers. That is, b is a divisor of a if there is no remainder

More information

Computer Architecture 10. Residue Number Systems

Computer Architecture 10. Residue Number Systems Computer Architecture 10 Residue Number Systems Ma d e wi t h Op e n Of f i c e. o r g 1 A Puzzle What number has the reminders 2, 3 and 2 when divided by the numbers 7, 5 and 3? x mod 7 = 2 x mod 5 =

More information

Chinese Remainder Theorem

Chinese Remainder Theorem Chinese Remainder Theorem Çetin Kaya Koç koc@cs.ucsb.edu Çetin Kaya Koç http://koclab.org Winter 2017 1 / 16 The Chinese Remainder Theorem Some cryptographic algorithms work with two (such as RSA) or more

More information

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

a the relation arb is defined if and only if = 2 k, k DISCRETE MATHEMATICS Past Paper Questions in Number Theory 1. Prove that 3k + 2 and 5k + 3, k are relatively prime. (Total 6 marks) 2. (a) Given that the integers m and n are such that 3 (m 2 + n 2 ),

More information

Number Theory. Modular Arithmetic

Number Theory. Modular Arithmetic Number Theory The branch of mathematics that is important in IT security especially in cryptography. Deals only in integer numbers and the process can be done in a very fast manner. Modular Arithmetic

More information

Integers and Division

Integers and Division Integers and Division Notations Z: set of integers N : set of natural numbers R: set of real numbers Z + : set of positive integers Some elements of number theory are needed in: Data structures, Random

More information

Arithmetic and Algebra

Arithmetic and Algebra Arithmetic and Algebra Daniel Butnaru daniel.butnaru@uni-konstanz.de 15. Dezember 2006 Daniel Butnaru daniel.butnaru@uni-konstanz.de Arithmetic and Algebra 1/39 Outline 1 Introduction 2 Big Number Arithmetic

More information

M381 Number Theory 2004 Page 1

M381 Number Theory 2004 Page 1 M81 Number Theory 2004 Page 1 [[ Comments are written like this. Please send me (dave@wildd.freeserve.co.uk) details of any errors you find or suggestions for improvements. ]] Question 1 20 = 2 * 10 +

More information

2x 1 7. A linear congruence in modular arithmetic is an equation of the form. Why is the solution a set of integers rather than a unique integer?

2x 1 7. A linear congruence in modular arithmetic is an equation of the form. Why is the solution a set of integers rather than a unique integer? Chapter 3: Theory of Modular Arithmetic 25 SECTION C Solving Linear Congruences By the end of this section you will be able to solve congruence equations determine the number of solutions find the multiplicative

More information

The set of integers will be denoted by Z = {, -3, -2, -1, 0, 1, 2, 3, 4, }

The set of integers will be denoted by Z = {, -3, -2, -1, 0, 1, 2, 3, 4, } Integers and Division 1 The Integers and Division This area of discrete mathematics belongs to the area of Number Theory. Some applications of the concepts in this section include generating pseudorandom

More information

Numbers. Çetin Kaya Koç Winter / 18

Numbers. Çetin Kaya Koç   Winter / 18 Çetin Kaya Koç http://koclab.cs.ucsb.edu Winter 2016 1 / 18 Number Systems and Sets We represent the set of integers as Z = {..., 3, 2, 1,0,1,2,3,...} We denote the set of positive integers modulo n as

More information

[Part 2] Asymmetric-Key Encipherment. Chapter 9. Mathematics of Cryptography. Objectives. Contents. Objectives

[Part 2] Asymmetric-Key Encipherment. Chapter 9. Mathematics of Cryptography. Objectives. Contents. Objectives [Part 2] Asymmetric-Key Encipherment Mathematics of Cryptography Forouzan, B.A. Cryptography and Network Security (International Edition). United States: McGraw Hill, 2008. Objectives To introduce prime

More information

Lecture notes: Algorithms for integers, polynomials (Thorsten Theobald)

Lecture notes: Algorithms for integers, polynomials (Thorsten Theobald) Lecture notes: Algorithms for integers, polynomials (Thorsten Theobald) 1 Euclid s Algorithm Euclid s Algorithm for computing the greatest common divisor belongs to the oldest known computing procedures

More information

Chapter 3 Basic Number Theory

Chapter 3 Basic Number Theory Chapter 3 Basic Number Theory What is Number Theory? Well... What is Number Theory? Well... Number Theory The study of the natural numbers (Z + ), especially the relationship between different sorts of

More information

NUMBER THEORY AND CODES. Álvaro Pelayo WUSTL

NUMBER THEORY AND CODES. Álvaro Pelayo WUSTL NUMBER THEORY AND CODES Álvaro Pelayo WUSTL Talk Goal To develop codes of the sort can tell the world how to put messages in code (public key cryptography) only you can decode them Structure of Talk Part

More information

Math From Scratch Lesson 20: The Chinese Remainder Theorem

Math From Scratch Lesson 20: The Chinese Remainder Theorem Math From Scratch Lesson 20: The Chinese Remainder Theorem W. Blaine Dowler January 2, 2012 Contents 1 Relatively Prime Numbers 1 2 Congruence Classes 1 3 Algebraic Units 2 4 Chinese Remainder Theorem

More information

Introduction to Information Security

Introduction to Information Security Introduction to Information Security Lecture 5: Number Theory 007. 6. Prof. Byoungcheon Lee sultan (at) joongbu. ac. kr Information and Communications University Contents 1. Number Theory Divisibility

More information

Math 109 HW 9 Solutions

Math 109 HW 9 Solutions Math 109 HW 9 Solutions Problems IV 18. Solve the linear diophantine equation 6m + 10n + 15p = 1 Solution: Let y = 10n + 15p. Since (10, 15) is 5, we must have that y = 5x for some integer x, and (as we

More information

Chapter 9 Mathematics of Cryptography Part III: Primes and Related Congruence Equations

Chapter 9 Mathematics of Cryptography Part III: Primes and Related Congruence Equations Chapter 9 Mathematics of Cryptography Part III: Primes and Related Congruence Equations Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 9.1 Chapter 9 Objectives

More information

2x 1 7. A linear congruence in modular arithmetic is an equation of the form. Why is the solution a set of integers rather than a unique integer?

2x 1 7. A linear congruence in modular arithmetic is an equation of the form. Why is the solution a set of integers rather than a unique integer? Chapter 3: Theory of Modular Arithmetic 25 SECTION C Solving Linear Congruences By the end of this section you will be able to solve congruence equations determine the number of solutions find the multiplicative

More information

Homework #2 solutions Due: June 15, 2012

Homework #2 solutions Due: June 15, 2012 All of the following exercises are based on the material in the handout on integers found on the class website. 1. Find d = gcd(475, 385) and express it as a linear combination of 475 and 385. That is

More information

Section Summary. Division Division Algorithm Modular Arithmetic

Section Summary. Division Division Algorithm Modular Arithmetic 1 Chapter Motivation Number theory is the part of mathematics devoted to the study of the integers and their properties. Key ideas in number theory include divisibility and the primality of integers. Representations

More information

Elementary Algebra Chinese Remainder Theorem Euclidean Algorithm

Elementary Algebra Chinese Remainder Theorem Euclidean Algorithm Elementary Algebra Chinese Remainder Theorem Euclidean Algorithm April 11, 2010 1 Algebra We start by discussing algebraic structures and their properties. This is presented in more depth than what we

More information

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

MATH 433 Applied Algebra Lecture 4: Modular arithmetic (continued). Linear congruences. MATH 433 Applied Algebra Lecture 4: Modular arithmetic (continued). Linear congruences. Congruences Let n be a postive integer. The integers a and b are called congruent modulo n if they have the same

More information

Number Theory and Cryptography

Number Theory and Cryptography . All rights reserved. Authorized only for instructor use in the classroom. No reproduction or further distribution permitted without the prior written consent of McGraw-Hill Education. Number Theory and

More information

Mathematics for Cryptography

Mathematics for Cryptography Mathematics for Cryptography Douglas R. Stinson David R. Cheriton School of Computer Science University of Waterloo Waterloo, Ontario, N2L 3G1, Canada March 15, 2016 1 Groups and Modular Arithmetic 1.1

More information

ELEMENTS OF NUMBER THEORY

ELEMENTS OF NUMBER THEORY ELEMENTS OF NUMBER THEORY Examination corner 1 one mark question in part A 1 - two mark question in part B 1 five mark OR 3mark+2 mark question in part C 1 two or four mark question in part E concepts

More information

NOTES ON SIMPLE NUMBER THEORY

NOTES ON SIMPLE NUMBER THEORY NOTES ON SIMPLE NUMBER THEORY DAMIEN PITMAN 1. Definitions & Theorems Definition: We say d divides m iff d is positive integer and m is an integer and there is an integer q such that m = dq. In this case,

More information

An Introduction to Proof-based Mathematics Harvard/MIT ESP: Summer HSSP Isabel Vogt

An Introduction to Proof-based Mathematics Harvard/MIT ESP: Summer HSSP Isabel Vogt An Introduction to Proof-based Mathematics Harvard/MIT ESP: Summer HSSP Isabel Vogt Class Objectives Field Axioms Finite Fields Field Extensions Class 5: Fields and Field Extensions 1 1. Axioms for a field

More information

A Readable Introduction to Real Mathematics

A Readable Introduction to Real Mathematics Solutions to selected problems in the book A Readable Introduction to Real Mathematics D. Rosenthal, D. Rosenthal, P. Rosenthal Chapter 7: The Euclidean Algorithm and Applications 1. Find the greatest

More information

Ch 4.2 Divisibility Properties

Ch 4.2 Divisibility Properties Ch 4.2 Divisibility Properties - Prime numbers and composite numbers - Procedure for determining whether or not a positive integer is a prime - GCF: procedure for finding gcf (Euclidean Algorithm) - Definition:

More information

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

Primes and Modular Arithmetic! CSCI 2824, Fall 2014!! Primes and Modular Arithmetic! CSCI 2824, Fall 2014!!! Scheme version of the algorithm! for finding the GCD (define (gcd a b)! (if!(= b 0)!!!!a!!!!(gcd b (remainder a b))))!! gcd (812, 17) = gcd(17, 13)

More information

With Question/Answer Animations. Chapter 4

With Question/Answer Animations. Chapter 4 With Question/Answer Animations Chapter 4 Chapter Motivation Number theory is the part of mathematics devoted to the study of the integers and their properties. Key ideas in number theory include divisibility

More information

Chapter 8. Introduction to Number Theory

Chapter 8. Introduction to Number Theory Chapter 8 Introduction to Number Theory CRYPTOGRAPHY AND NETWORK SECURITY 1 Index 1. Prime Numbers 2. Fermat`s and Euler`s Theorems 3. Testing for Primality 4. Discrete Logarithms 2 Prime Numbers 3 Prime

More information

This exam contains 5 pages (including this cover page) and 4 questions. The total number of points is 100. Grade Table

This exam contains 5 pages (including this cover page) and 4 questions. The total number of points is 100. Grade Table MAT115A-21 Summer Session 2 2018 Practice Final Solutions Name: Time Limit: 1 Hour 40 Minutes Instructor: Nathaniel Gallup This exam contains 5 pages (including this cover page) and 4 questions. The total

More information

Number Theory and Group Theoryfor Public-Key Cryptography

Number Theory and Group Theoryfor Public-Key Cryptography Number Theory and Group Theory for Public-Key Cryptography TDA352, DIT250 Wissam Aoudi Chalmers University of Technology November 21, 2017 Wissam Aoudi Number Theory and Group Theoryfor Public-Key Cryptography

More information

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

10 Problem 1. The following assertions may be true or false, depending on the choice of the integers a, b 0. a Math 4161 Dr. Franz Rothe December 9, 2013 13FALL\4161_fall13f.tex Name: Use the back pages for extra space Final 70 70 Problem 1. The following assertions may be true or false, depending on the choice

More information

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

11 Division Mod n, Linear Integer Equations, Random Numbers, The Fundamental Theorem of Arithmetic 11 Division Mod n, Linear Integer Equations, Random Numbers, The Fundamental Theorem of Arithmetic Bezout s Lemma Let's look at the values of 4x + 6y when x and y are integers. If x is -6 and y is 4 we

More information

Course 2BA1: Trinity 2006 Section 9: Introduction to Number Theory and Cryptography

Course 2BA1: Trinity 2006 Section 9: Introduction to Number Theory and Cryptography Course 2BA1: Trinity 2006 Section 9: Introduction to Number Theory and Cryptography David R. Wilkins Copyright c David R. Wilkins 2006 Contents 9 Introduction to Number Theory and Cryptography 1 9.1 Subgroups

More information

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

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

More information

CIS 6930/4930 Computer and Network Security. Topic 5.1 Basic Number Theory -- Foundation of Public Key Cryptography

CIS 6930/4930 Computer and Network Security. Topic 5.1 Basic Number Theory -- Foundation of Public Key Cryptography CIS 6930/4930 Computer and Network Security Topic 5.1 Basic Number Theory -- Foundation of Public Key Cryptography 1 Review of Modular Arithmetic 2 Remainders and Congruency For any integer a and any positive

More information

CSC 474 Information Systems Security

CSC 474 Information Systems Security CSC Information Systems Security Topic. Basic Number Theory CSC Dr. Peng Ning Basic Number Theory We are talking about integers! Divisor We say that b divides a if a = mb for some m, denoted b a. b is

More information

9 Modular Exponentiation and Square-Roots

9 Modular Exponentiation and Square-Roots 9 Modular Exponentiation and Square-Roots Modular arithmetic is used in cryptography. In particular, modular exponentiation is the cornerstone of what is called the RSA system. 9. Modular Exponentiation

More information

44.(ii) In this case we have that (12, 38) = 2 which does not divide 5 and so there are no solutions.

44.(ii) In this case we have that (12, 38) = 2 which does not divide 5 and so there are no solutions. Solutions to Assignment 3 5E More Properties of Congruence 40. We can factor 729 = 7 3 9 so it is enough to show that 3 728 (mod 7), 3 728 (mod 3) and 3 728 (mod 9). 3 728 =(3 3 ) 576 = (27) 576 ( ) 576

More information

MATH 2112/CSCI 2112, Discrete Structures I Winter 2007 Toby Kenney Homework Sheet 5 Hints & Model Solutions

MATH 2112/CSCI 2112, Discrete Structures I Winter 2007 Toby Kenney Homework Sheet 5 Hints & Model Solutions MATH 11/CSCI 11, Discrete Structures I Winter 007 Toby Kenney Homework Sheet 5 Hints & Model Solutions Sheet 4 5 Define the repeat of a positive integer as the number obtained by writing it twice in a

More information

The Chinese Remainder Theorem

The Chinese Remainder Theorem The Chinese Remainder Theorem R. C. Daileda February 19, 2018 1 The Chinese Remainder Theorem We begin with an example. Example 1. Consider the system of simultaneous congruences x 3 (mod 5), x 2 (mod

More information

Senior Math Circles Cryptography and Number Theory Week 2

Senior Math Circles Cryptography and Number Theory Week 2 Senior Math Circles Cryptography and Number Theory Week 2 Dale Brydon Feb. 9, 2014 1 Divisibility and Inverses At the end of last time, we saw that not all numbers have inverses mod n, but some do. We

More information

ICS141: Discrete Mathematics for Computer Science I

ICS141: Discrete Mathematics for Computer Science I ICS141: Discrete Mathematics for Computer Science I Dept. Information & Computer Sci., Jan Stelovsky based on slides by Dr. Baek and Dr. Still Originals by Dr. M. P. Frank and Dr. J.L. Gross Provided by

More information

Number Theory Math 420 Silverman Exam #1 February 27, 2018

Number Theory Math 420 Silverman Exam #1 February 27, 2018 Name: Number Theory Math 420 Silverman Exam #1 February 27, 2018 INSTRUCTIONS Read Carefully Time: 50 minutes There are 5 problems. Write your name neatly at the top of this page. Write your final answer

More information

Course MA2C02, Hilary Term 2013 Section 9: Introduction to Number Theory and Cryptography

Course MA2C02, Hilary Term 2013 Section 9: Introduction to Number Theory and Cryptography Course MA2C02, Hilary Term 2013 Section 9: Introduction to Number Theory and Cryptography David R. Wilkins Copyright c David R. Wilkins 2000 2013 Contents 9 Introduction to Number Theory 63 9.1 Subgroups

More information

PUTNAM TRAINING NUMBER THEORY. Exercises 1. Show that the sum of two consecutive primes is never twice a prime.

PUTNAM TRAINING NUMBER THEORY. Exercises 1. Show that the sum of two consecutive primes is never twice a prime. PUTNAM TRAINING NUMBER THEORY (Last updated: December 11, 2017) Remark. This is a list of exercises on Number Theory. Miguel A. Lerma Exercises 1. Show that the sum of two consecutive primes is never twice

More information

MATH 145 Algebra, Solutions to Assignment 4

MATH 145 Algebra, Solutions to Assignment 4 MATH 145 Algebra, Solutions to Assignment 4 1: a) Find the inverse of 178 in Z 365. Solution: We find s and t so that 178s + 365t = 1, and then 178 1 = s. The Euclidean Algorithm gives 365 = 178 + 9 178

More information

Discrete Structures Lecture Primes and Greatest Common Divisor

Discrete Structures Lecture Primes and Greatest Common Divisor DEFINITION 1 EXAMPLE 1.1 EXAMPLE 1.2 An integer p greater than 1 is called prime if the only positive factors of p are 1 and p. A positive integer that is greater than 1 and is not prime is called composite.

More information

The Chinese Remainder Theorem

The Chinese Remainder Theorem Sacred Heart University DigitalCommons@SHU Academic Festival Apr 20th, 9:30 AM - 10:45 AM The Chinese Remainder Theorem Nancirose Piazza Follow this and additional works at: http://digitalcommons.sacredheart.edu/acadfest

More information

Introduction to Number Theory

Introduction to Number Theory INTRODUCTION Definition: Natural Numbers, Integers Natural numbers: N={0,1,, }. Integers: Z={0,±1,±, }. Definition: Divisor If a Z can be writeen as a=bc where b, c Z, then we say a is divisible by b or,

More information

1. multiplication is commutative and associative;

1. multiplication is commutative and associative; Chapter 4 The Arithmetic of Z In this chapter, we start by introducing the concept of congruences; these are used in our proof (going back to Gauss 1 ) that every integer has a unique prime factorization.

More information

Classical RSA algorithm

Classical RSA algorithm Classical RSA algorithm We need to discuss some mathematics (number theory) first Modulo-NN arithmetic (modular arithmetic, clock arithmetic) 9 (mod 7) 4 3 5 (mod 7) congruent (I will also use = instead

More information

Proofs. Methods of Proof Divisibility Floor and Ceiling Contradiction & Contrapositive Euclidean Algorithm. Reading (Epp s textbook)

Proofs. Methods of Proof Divisibility Floor and Ceiling Contradiction & Contrapositive Euclidean Algorithm. Reading (Epp s textbook) Proofs Methods of Proof Divisibility Floor and Ceiling Contradiction & Contrapositive Euclidean Algorithm Reading (Epp s textbook) 4.3 4.8 1 Divisibility The notation d n is read d divides n. Symbolically,

More information

ORDERS OF UNITS IN MODULAR ARITHMETIC

ORDERS OF UNITS IN MODULAR ARITHMETIC ORDERS OF UNITS IN MODULAR ARITHMETIC KEITH CONRAD. Introduction If a mod m is a unit then a ϕ(m) mod m by Euler s theorem. Depending on a, it might happen that a n mod m for a positive integer n that

More information

Beautiful Mathematics

Beautiful Mathematics Beautiful Mathematics 1. Principle of Mathematical Induction The set of natural numbers is the set of positive integers {1, 2, 3,... } and is denoted by N. The Principle of Mathematical Induction is a

More information

Topics in Cryptography. Lecture 5: Basic Number Theory

Topics in Cryptography. Lecture 5: Basic Number Theory Topics in Cryptography Lecture 5: Basic Number Theory Benny Pinkas page 1 1 Classical symmetric ciphers Alice and Bob share a private key k. System is secure as long as k is secret. Major problem: generating

More information

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

CS 5319 Advanced Discrete Structure. Lecture 9: Introduction to Number Theory II CS 5319 Advanced Discrete Structure Lecture 9: Introduction to Number Theory II Divisibility Outline Greatest Common Divisor Fundamental Theorem of Arithmetic Modular Arithmetic Euler Phi Function RSA

More information

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

This is a recursive algorithm. The procedure is guaranteed to terminate, since the second argument decreases each time. 8 Modular Arithmetic We introduce an operator mod. Let d be a positive integer. For c a nonnegative integer, the value c mod d is the remainder when c is divided by d. For example, c mod d = 0 if and only

More information

Eureka Math. Algebra II Module 1 Student File_A. Student Workbook. This file contains Alg II-M1 Classwork Alg II-M1 Problem Sets

Eureka Math. Algebra II Module 1 Student File_A. Student Workbook. This file contains Alg II-M1 Classwork Alg II-M1 Problem Sets Eureka Math Algebra II Module 1 Student File_A Student Workbook This file contains Alg II- Classwork Alg II- Problem Sets Published by the non-profit GREAT MINDS. Copyright 2015 Great Minds. No part of

More information

12x + 18y = 50. 2x + v = 12. (x, v) = (6 + k, 2k), k Z.

12x + 18y = 50. 2x + v = 12. (x, v) = (6 + k, 2k), k Z. Math 3, Fall 010 Assignment 3 Solutions Exercise 1. Find all the integral solutions of the following linear diophantine equations. Be sure to justify your answers. (i) 3x + y = 7. (ii) 1x + 18y = 50. (iii)

More information

Finite Fields and Error-Correcting Codes

Finite Fields and Error-Correcting Codes Lecture Notes in Mathematics Finite Fields and Error-Correcting Codes Karl-Gustav Andersson (Lund University) (version 1.013-16 September 2015) Translated from Swedish by Sigmundur Gudmundsson Contents

More information

Solutions to Problem Set 3 - Fall 2008 Due Tuesday, Sep. 30 at 1:00

Solutions to Problem Set 3 - Fall 2008 Due Tuesday, Sep. 30 at 1:00 Solutions to 18.781 Problem Set 3 - Fall 2008 Due Tuesday, Sep. 30 at 1:00 1. (Niven 2.3.3) Solve the congruences x 1 (mod 4), x 0 (mod 3), x 5 (mod 7). First we note that 4, 3, and 7 are pairwise relatively

More information

THESIS. Presented in Partial Fulfillment of the Requirements for the Degree Master of Science in the Graduate School of The Ohio State University

THESIS. Presented in Partial Fulfillment of the Requirements for the Degree Master of Science in the Graduate School of The Ohio State University The Hasse-Minkowski Theorem in Two and Three Variables THESIS Presented in Partial Fulfillment of the Requirements for the Degree Master of Science in the Graduate School of The Ohio State University By

More information

Elementary Properties of the Integers

Elementary Properties of the Integers Elementary Properties of the Integers 1 1. Basis Representation Theorem (Thm 1-3) 2. Euclid s Division Lemma (Thm 2-1) 3. Greatest Common Divisor 4. Properties of Prime Numbers 5. Fundamental Theorem of

More information

Math 312/ AMS 351 (Fall 17) Sample Questions for Final

Math 312/ AMS 351 (Fall 17) Sample Questions for Final Math 312/ AMS 351 (Fall 17) Sample Questions for Final 1. Solve the system of equations 2x 1 mod 3 x 2 mod 7 x 7 mod 8 First note that the inverse of 2 is 2 mod 3. Thus, the first equation becomes (multiply

More information

Wednesday, February 21. Today we will begin Course Notes Chapter 5 (Number Theory).

Wednesday, February 21. Today we will begin Course Notes Chapter 5 (Number Theory). Wednesday, February 21 Today we will begin Course Notes Chapter 5 (Number Theory). 1 Return to Chapter 5 In discussing Methods of Proof (Chapter 3, Section 2) we introduced the divisibility relation from

More information

NUMBER THEORY. Anwitaman DATTA SCSE, NTU Singapore CX4024. CRYPTOGRAPHY & NETWORK SECURITY 2018, Anwitaman DATTA

NUMBER THEORY. Anwitaman DATTA SCSE, NTU Singapore CX4024. CRYPTOGRAPHY & NETWORK SECURITY 2018, Anwitaman DATTA NUMBER THEORY Anwitaman DATTA SCSE, NTU Singapore Acknowledgement: The following lecture slides are based on, and uses material from the text book Cryptography and Network Security (various eds) by William

More information

Lecture 7 Number Theory Euiseong Seo

Lecture 7 Number Theory Euiseong Seo Lecture 7 Number Theory Euiseong Seo (euiseong@skku.edu) 1 Number Theory God created the integers. All else is the work of man Leopold Kronecker Study of the property of the integers Specifically, integer

More information

4 Powers of an Element; Cyclic Groups

4 Powers of an Element; Cyclic Groups 4 Powers of an Element; Cyclic Groups Notation When considering an abstract group (G, ), we will often simplify notation as follows x y will be expressed as xy (x y) z will be expressed as xyz x (y z)

More information

LECTURE NOTES IN CRYPTOGRAPHY

LECTURE NOTES IN CRYPTOGRAPHY 1 LECTURE NOTES IN CRYPTOGRAPHY Thomas Johansson 2005/2006 c Thomas Johansson 2006 2 Chapter 1 Abstract algebra and Number theory Before we start the treatment of cryptography we need to review some basic

More information

ECEN 5022 Cryptography

ECEN 5022 Cryptography Elementary Algebra and Number Theory University of Colorado Spring 2008 Divisibility, Primes Definition. N denotes the set {1, 2, 3,...} of natural numbers and Z denotes the set of integers {..., 2, 1,

More information

Modular Arithmetic Instructor: Marizza Bailey Name:

Modular Arithmetic Instructor: Marizza Bailey Name: Modular Arithmetic Instructor: Marizza Bailey Name: 1. Introduction to Modular Arithmetic If someone asks you what day it is 145 days from now, what would you answer? Would you count 145 days, or find

More information

Lecture Notes. Advanced Discrete Structures COT S

Lecture Notes. Advanced Discrete Structures COT S Lecture Notes Advanced Discrete Structures COT 4115.001 S15 2015-01-13 Recap Divisibility Prime Number Theorem Euclid s Lemma Fundamental Theorem of Arithmetic Euclidean Algorithm Basic Notions - Section

More information

Chapter 4 Finite Fields

Chapter 4 Finite Fields Chapter 4 Finite Fields Introduction will now introduce finite fields of increasing importance in cryptography AES, Elliptic Curve, IDEA, Public Key concern operations on numbers what constitutes a number

More information

Lesson 1: Successive Differences in Polynomials

Lesson 1: Successive Differences in Polynomials Lesson 1 Lesson 1: Successive Differences in Polynomials Classwork Opening Exercise John noticed patterns in the arrangement of numbers in the table below. 2.4 3.4 4.4 5.4 6.4 5.76 11.56 19.36 29.16 40.96

More information

Number theory (Chapter 4)

Number theory (Chapter 4) EECS 203 Spring 2016 Lecture 10 Page 1 of 8 Number theory (Chapter 4) Review Questions: 1. Does 5 1? Does 1 5? 2. Does (129+63) mod 10 = (129 mod 10)+(63 mod 10)? 3. Does (129+63) mod 10 = ((129 mod 10)+(63

More information

EULER S THEOREM KEITH CONRAD

EULER S THEOREM KEITH CONRAD EULER S THEOREM KEITH CONRAD. Introduction Fermat s little theorem is an important property of integers to a prime modulus. Theorem. (Fermat). For prime p and any a Z such that a 0 mod p, a p mod p. If

More information