MATH 13150: Freshman Seminar Unit 15

Similar documents
Solutions for the Practice Questions

Solutions for the Practice Final

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

Modular Arithmetic. Kieran Cooney - February 18, 2016

Modular arithmetic Math 2320

NUMBER THEORY AMIN WITNO

SOLUTIONS TO PROBLEM SET 5. Section 9.1

Wilson s Theorem and Fermat s Theorem

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.

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

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

Primitive Roots. Chapter Orders and Primitive Roots

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

Math 127: Equivalence Relations

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

Solutions for the 2nd Practice Midterm

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

MAT Modular arithmetic and number theory. Modular arithmetic

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

Final exam. Question Points Score. Total: 150

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

L29&30 - RSA Cryptography

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

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

Number Theory. Konkreetne Matemaatika

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

Practice Midterm 2 Solutions

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

Applications of Fermat s Little Theorem and Congruences

Public Key Encryption

Algorithmic Number Theory and Cryptography (CS 303)

Three of these grids share a property that the other three do not. Can you find such a property? + mod

1.6 Congruence Modulo m

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

x 8 (mod 15) x 8 3 (mod 5) eli 2 2y 6 (mod 10) y 3 (mod 5) 6x 9 (mod 11) y 3 (mod 11) So y = 3z + 3u + 3w (mod 990) z = (990/9) (990/9) 1

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

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.

Modular Arithmetic. claserken. July 2016

Introduction to Modular Arithmetic

Distribution of Primes

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

CHAPTER 2. Modular Arithmetic

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

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

Data security (Cryptography) exercise book

MATH 13150: Freshman Seminar Unit 4

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

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 3: CONGRUENCES. 1. Basic properties of congruences We begin by introducing some definitions and elementary properties.

Solutions to Exercises Chapter 6: Latin squares and SDRs

Number Theory/Cryptography (part 1 of CSC 282)

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

Latin Squares for Elementary and Middle Grades

Algorithmic Number Theory and Cryptography (CS 303)

Classwork Example 1: Exploring Subtraction with the Integer Game

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

Grade 6/7/8 Math Circles April 1/2, Modular Arithmetic

A Quick Introduction to Modular Arithmetic

Discrete Math Class 4 ( )

MA 111, Topic 2: Cryptography

Classical Cryptography

N umber theory provides a rich source of intriguing

DUBLIN CITY UNIVERSITY

An elementary study of Goldbach Conjecture

Electrical Circuits Question Paper 6

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

Shuffling with ordered cards

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

6.2 Modular Arithmetic

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

Mathematics Explorers Club Fall 2012 Number Theory and Cryptography

1111: Linear Algebra I

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

SOLUTIONS FOR PROBLEM SET 4

ORDER AND CHAOS. Carl Pomerance, Dartmouth College Hanover, New Hampshire, USA

NIM Games: Handout 1

Sheet 1: Introduction to prime numbers.

Foundations of Cryptography

The Chinese Remainder Theorem

UNIVERSITY OF MANITOBA DATE: December 7, FINAL EXAMINATION TITLE PAGE TIME: 3 hours EXAMINER: M. Davidson

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

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

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

Lesson 27: Sine and Cosine of Complementary and Special Angles

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

For each person in your group, designate one of the following colors: Red, Blue, and Black. Next to the color, write your name in that color:

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

THE NUMBER OF PERMUTATIONS WHICH FORM ARITHMETIC PROGRESSIONS MODULO m

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

Is 1 a Square Modulo p? Is 2?

Number-Theoretic Algorithms

Group Theory and SAGE: A Primer Robert A. Beezer University of Puget Sound c 2008 CC-A-SA License

FOM 11 Ch. 1 Practice Test Name: Inductive and Deductive Reasoning

Math 319 Problem Set #7 Solution 18 April 2002

Grade 6 Math Circles. Divisibility

Discrete Mathematics & Mathematical Reasoning Multiplicative Inverses and Some Cryptography

1 Introduction. 2 An Easy Start. KenKen. Charlotte Teachers Institute, 2015

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

17. Symmetries. Thus, the example above corresponds to the matrix: We shall now look at how permutations relate to trees.

PROPERTIES OF MERSENNE NUMBERS AND PRIMES

Transcription:

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 a, then there is a number k so that a k 1 mod p. In fact, k = p 1 works. In this result, we ll see that if m is any number and gcd(a,m) = 1, then there is a number k so that a k 1 (mod m). In fact, we can take k = φ(m), where φ(m) is the Euler function from Unit 10. We ll use the result a φ(m) 1 (mod m) when gcd(a,m) = 1 to compute a n (mod m) for very large numbers of n. 1.1. Some examples. Let s start by looking at some tables of powers. Here is a table of powers mod 9. In the table, the entry 7 in the 4-row, -column, means that 4 7 (mod 9). Mod 9 table of powers, I n 1 2 3 4 6 7 8 9 10 11 12 2 n 2 4 8 7 1 2 4 8 7 1 3 n 3 0 0 0 0 0 0 0 0 0 0 0 4 n 4 7 1 4 7 1 4 7 1 4 7 1 n 7 8 4 2 1 7 8 4 2 1 6 n 6 0 0 0 0 0 0 0 0 0 0 0 7 n 7 4 1 7 4 1 7 4 1 7 4 1 8 n 8 1 8 1 8 1 8 1 8 1 8 1 Let s make some observations about the table: 1. Once a 1 appears in a column, the pattern leading up to the 1 repeats over and over. For example, 4 3 1 (mod 9), and the first three powers are 4, 7, 1. The pattern 4, 7, 1, 4, 7, 1, 4, 7, 1,... repeats over and over. 2. The rows 1 n, 2 n, 4 n, n, 7 n, and 8 n are quite different from the rows 3 n and 6 n. If you think for a moment, you ll realize that 1, 2, 4,, 7, 8 are the numbers a so that a and 9 are relatively prime, while 3 and 6 are not relatively prime to 9. Guided by this, let s look at a table of Mod 9 powers without including the 3-row and 6-row: Mod 9 table of powers, II n 1 2 3 4 6 7 8 9 10 11 12 2 n 2 4 8 7 1 2 4 8 7 1 4 n 4 7 1 4 7 1 4 7 1 4 7 1 n 7 8 4 2 1 7 8 4 2 1 7 n 7 4 1 7 4 1 7 4 1 7 4 1 8 n 8 1 8 1 8 1 8 1 8 1 8 1 Now we can observe that every entry in the 6-column is 1, which means: 1

2 a 6 1 (mod 9) provided that gcd(a, 9) = 1. Now let s look at a table of mod 10 powers. Guided by the example of mod 9 powers, we ll only look at a k (mod 10) when gcd(a, 10) = 1. The mod 10 numbers that are relatively prime to 10 are 1, 3, 7, 9, so we ll only look at a k (mod 10) for these values of a. n 1 2 3 4 6 7 8 9 10 11 12 Mod 10 table of powers 3 n 3 9 7 1 3 9 7 1 3 9 7 1 7 n 7 9 3 1 7 9 3 1 7 9 3 1 9 n 9 1 9 1 9 1 9 1 9 1 9 1 In this case, we see that a 4 1 (mod 10) whenever a is relatively prime to 10, which is another way of saying that the 4-column of the table has all entries equal to 1. 1.2. Euler s theorem and applications. In this section, we ll discuss Euler s theorem and see how to use it to compute powers. As in Unit 10, φ(m) is the Euler φ-function, which counts numbers from 1 to m that are relatively prime to m. Theorem 1.1. Let m be a number. Then if a is a number relatively prime to m, a φ(m) 1 (mod m). Let s consider a few examples. First, we ll take m = 9. Then since 9 = 3 2, φ(9) = 9 2 = 6, using the formula for computing φ(9) from Unit 10, section 1.3. So if we 3 let m = 9 in Euler s theorem, the statement translates as: a 6 1 (mod 9) whenever a and 9 are relatively prime. This is exactly what we saw from the Mod 9 table of powers, so Euler s theorem agrees with what we already knew in this case. Now, let s try this with m = 10 and see if it agrees with what we know. Since 10 = 2, φ(10) = 10 1 2 4 = 4. So when m = 10, Euler s theorem says: a 4 1 (mod 10) when a and 10 are relatively prime. This agrees with the mod 10 table of powers. Finally, let s consider the case where m = p is a prime number. Then φ(p) = p p 1 = p 1, so Euler s theorem asserts that: p a p 1 1 (mod p) whenever a and p are relatively prime, which is the same as saying that p does not divide a. This means that Euler s theorem agrees with Fermat s theorem when m is prime. This is nice, but for you, the main point is to be able to compute using Euler s theorem. EXAMPLE: Compute 7 322 (mod 20). To do this, we use Euler s theorem. The first step is to compute φ(20). Since 20 = 2 2, φ(20) = 20 1 2 4 = 8. So since 7 and 20 are relatively prime, it follows that: 7 8 1 (mod 20).

Now divide 8 into 322, it goes in 40 times with remainder 2, so 322 = 40 8 + 2. It follows that: 7 322 7 8 40+2 (7 8 ) 40 7 2 1 40 7 2 (mod 20), using rules of expondents and Euler s theorem. But But 1 40 7 2 7 2 49 9 (mod 20), so putting this together, we conclude that 7 322 9 (mod 20). Remark 1.2. Another way of writing out the solution is to say that since 322 2 (mod 8), it follows that 7 322 7 2 (mod 20). In other words, the 40 in 322 = 40 8 + 2 is not essential, because it just comes in as a power of 1: 1 40 1 (mod 20). GENERAL RULE: If k r (mod φ(m)), then a k a r (mod m). We can justify this rule, following what we did in the last problem. If k r (mod φ(m)), then k = s φ(m) + r for some number s. But then: a k a s φ(m)+r a s φ(m) a r (mod m), so a k (a φ(m) ) s a r 1 s a r a r (mod m), since a φ(m) 1 (mod m). PROBLEM: Compute 12 268 (mod 3). To solve this, we first check that 12 and 3 are relatively prime, so we can use Euler s theorem. Then we compute φ(3) = 3 4 6 = 24. Now divide 24 into 268, and we 7 find 268 4 (mod 24), since 264 = 11 24 + 4. From this, we can deduce using the GENERAL RULE from the last remark that: 12 268 12 4 (mod 3). It remains to compute 12 4 (mod 3). You can either do that using a calculator, or compute 12 2 144 4 (mod 3), so 12 4 12 2 12 2 4 4 16 (mod 3), so 12 268 16 (mod 3) solves the problem. PROBLEM: Compute 7 1688 (mod 180). To solve this problem, first check that 7 and 180 are relatively prime, which is easy since 180 = 2 2 3 2. Thus, φ(180) = 180 1 2 2 3 4 = 48. Now divide 48 into 1688, to find 1688 = 48 3 + 8, so 1688 8 (mod 48). Using the GENERAL RULE from Remark 1.2, we find: 7 1688 7 8 (mod 180). It s no fun trying to compute 7 8 (mod 180) without a calculator, but with a calculator you can see easily that: 7 8 764801 121 (mod 180). From this, we conclude that 7 1688 121 (mod 180), which solves the problem. PROBLEM: Compute 13 732 (mod 77). Since 77 = 7 11, 77 and 13 are relatively prime, and φ(77) = 60. A quick computation gives 732 12 (mod 60), so 13 732 13 12 (mod 77), so we just need to compute 13 12 (mod 77), which we can do using successive squares. This gives: 3

4 13 2 169 1 (mod 77), so 13 4 13 2 13 2 1 1 22 6 (mod 77) 13 8 13 4 13 4 6 6 36 (mod 77). Then 13 12 13 8+4 13 8 13 4 36 6 216 62 1 (mod 77), i.e., 13 12 1 (mod 77), which solves the problem. PROBLEM: Compute 1 7 (mod 3). This is a trick question. Since gcd(1, 3) =, 1 and 3 are not relatively prime, so we just have to try computing successive squares, as in the beginning of Unit 14. We get: 1 2 22 1 (mod 3). 1 4 1 2 1 2 1 1 1 2 1 (mod 3), which gives: 1 7 1 4+2+1 1 4 1 2 1 1 1 1 1 (mod 3), so 1 7 1 (mod 3) is the solution. 1.3. Justification for Euler s theorem. Euler s theorem is true for essentially the same reason that Fermat s theorem is true. To see this, let s try to justify Euler s theorem in a mod 18 example. Since 18 = 2 3 2, φ(18) = 6, and the numbers from 1 to 18 relatively prime to 18 are 1,, 7, 11, 13, 17. We ll show that 7 6 1 (mod 18), as Euler s theorem predicts, without computing powers. We compute the 7-row for multiplication mod 18 with numbers relatively prime to 18: 7 1 7 (mod 18) 7 17 (mod 18) 7 7 13 (mod 18) 7 11 (mod 18) 7 13 1 (mod 18) 7 17 11 (mod 18) It follows that: EQUATION (*): (7 1) (7 ) (7 7) (7 11) (7 13) (7 17) 7 17 13 1 11 (mod 18) By factoring out the first 7 in each factor in parentheses, the left-hand side of this EQUATION (*) can be written as: 7 6 1 7 11 13 17 7 6 C (mod 18), where C = 1 7 11 13 17. The right-hand side of EQUATION (*) is C (mod 18), since it has the same factors as C, but in different order. This means we can rewrite EQUATION (*) as: EQUATION (**): 7 6 C C (mod 18). Note that C = 1 7 11 13 17 is relatively prime to 18 since it has no factors divisible by 2 or 3. Thus, (**) to get: 7 6 C 1 C C 1 C 1 C 1 (mod 18), so (mod 18) exists, so we can divide by C in EQUATION

7 6 1 1 (mod 18) and finally, 7 6 1 (mod 18). EXERCISES: (1) Do the following computations in mod 22 arithmetic. Does the last step verify Euler s theorem? (a) Compute 2 (mod 22) (b) Compute 4 (mod 22) (c) Compute 8 (mod 22) (d) Compute 10 (mod 22) (2) Do the following computations in modular arithmetic. (a) Compute 7 8 (mod 30) (b) Compute 11 24 (mod 70). (c) Compute 2 24 (mod 70). (d) Compute 37 80 (mod 300). (e) Compute 20 (mod 2). (f) Compute 72 (mod 91). (3) Do the following computations in modular arithmetic. (a) Compute 7 13 (mod 30). (b) Compute 3 387 (mod 221). (c) Compute 367 (mod 2). (d) Compute 7 1021 (mod 6). (e) Compute 7 63 (mod 44). (4) Explain why 6 1 (mod 18) following the method used to show that 7 6 1 (mod 18) in Section 1.3 of this unit.