CSE20: Discrete Mathematics

Similar documents
Arithmetic Algorithms, Part 1

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

INTEGERS. In this section we aim to show the following: Goal. Every natural number can be written uniquely as a product of primes.

Greatest Common Divisor MATH Greatest Common Divisor. Benjamin V.C. Collins, James A. Swenson MATH 2730

Discrete Mathematics GCD, LCM, RSA Algorithm

Notes. Number Theory: Applications. Notes. Number Theory: Applications. Notes. Hash Functions I

Number Theory Proof Portfolio

Number Theory and Group Theoryfor Public-Key Cryptography

CSC 474 Information Systems Security

Applied Cryptography and Computer Security CSE 664 Spring 2017

Senior Math Circles Cryptography and Number Theory Week 2

ENEE 457: Computer Systems Security. Lecture 5 Public Key Crypto I: Number Theory Essentials

1 Overview and revision

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

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

8 Primes and Modular Arithmetic

Introduction to Public-Key Cryptosystems:

Elementary Algebra Chinese Remainder Theorem Euclidean Algorithm

Number Theory: Applications. Number Theory Applications. Hash Functions II. Hash Functions III. Pseudorandom Numbers

OWO Lecture: Modular Arithmetic with Algorithmic Applications

Modular Arithmetic and Elementary Algebra

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

Introduction to Number Theory 1. c Eli Biham - December 13, Introduction to Number Theory 1

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:

Ch 4.2 Divisibility Properties

CS250: Discrete Math for Computer Science

A SURVEY OF PRIMALITY TESTS

Lecture 4: Number theory

18 Divisibility. and 0 r < d. Lemma Let n,d Z with d 0. If n = qd+r = q d+r with 0 r,r < d, then q = q and r = r.

Outline. Number Theory and Modular Arithmetic. p-1. Definition: Modular equivalence a b [mod n] (a mod n) = (b mod n) n (a-b)

2 Elementary number theory

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

Introduction to Number Theory

Introduction to Number Theory

Algorithms (II) Yu Yu. Shanghai Jiaotong University

CS 290G (Fall 2014) Introduction to Cryptography Oct 21st, Lecture 5: RSA OWFs

Homework 3, solutions

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

MONOALPHABETIC CIPHERS AND THEIR MATHEMATICS. CIS 400/628 Spring 2005 Introduction to Cryptography

Linear Congruences. The equation ax = b for a, b R is uniquely solvable if a 0: x = b/a. Want to extend to the linear congruence:

Number Theory. Modular Arithmetic

download instant at

Basic elements of number theory

CSE 311 Lecture 13: Primes and GCD. Emina Torlak and Kevin Zatloukal

CSE 311: Foundations of Computing. Lecture 12: Two s Complement, Primes, GCD

Basic elements of number theory

CHAPTER 6. Prime Numbers. Definition and Fundamental Results

ALG 4.0 Number Theory Algorithms:

cse 311: foundations of computing Spring 2015 Lecture 12: Primes, GCD, applications

Lecture 7 Number Theory Euiseong Seo

Basic Algorithms in Number Theory

Numbers. Çetin Kaya Koç Winter / 18

NOTES ON SIMPLE NUMBER THEORY

Topics in Cryptography. Lecture 5: Basic Number Theory

NOTES ON INTEGERS. 1. Integers

Chapter 8 Public-key Cryptography and Digital Signatures

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

Number Theory & Modern Cryptography

Theory of RSA. Hiroshi Toyoizumi 1. December 8,

CS483 Design and Analysis of Algorithms

CISC-102 Fall 2017 Week 6

Elementary Number Theory Review. Franz Luef

Congruence of Integers

Addition. Ch1 - Algorithms with numbers. Multiplication. al-khwārizmī. al-khwārizmī. Division 53+35=88. Cost? (n number of bits) 13x11=143. Cost?

Contribution of Problems

Math 299 Supplement: Modular Arithmetic Nov 8, 2013

Exercises Exercises. 2. Determine whether each of these integers is prime. a) 21. b) 29. c) 71. d) 97. e) 111. f) 143. a) 19. b) 27. c) 93.

An Algorithm for Prime Factorization

Elementary Number Theory MARUCO. Summer, 2018

2 Arithmetic. 2.1 Greatest common divisors. This chapter is about properties of the integers Z = {..., 2, 1, 0, 1, 2,...}.

MATH FINAL EXAM REVIEW HINTS

Chapter 14: Divisibility and factorization

4 Number Theory and Cryptography

CPSC 467b: Cryptography and Computer Security

Public Key Encryption

CSE 20 DISCRETE MATH. Winter

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

Lecture 3.1: Public Key Cryptography I

Number Theory Solutions Packet

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

Rings and modular arithmetic

MATH 145 Algebra, Solutions to Assignment 4

CISC-102 Winter 2016 Lecture 11 Greatest Common Divisor

4. Number Theory (Part 2)

Number theory (Chapter 4)

MATH 215 Final. M4. For all a, b in Z, a b = b a.

Basic Algorithms in Number Theory

Chapter V. Theory of the Integers. Mathematics is the queen of the sciences and number theory is the queen of mathematics. Carl Friedrich Gauss

ICS141: Discrete Mathematics for Computer Science I

CPSC 467: Cryptography and Computer Security

NUMBER SYSTEMS. Number theory is the study of the integers. We denote the set of integers by Z:

Cryptosystem. Traditional Cryptosystems: The two parties agree on a secret (one to one) function f. To send a message M, thesendersendsthemessage

3 The fundamentals: Algorithms, the integers, and matrices

PRACTICE PROBLEMS: SET 1

1. Factorization Divisibility in Z.

Math.3336: Discrete Mathematics. Primes and Greatest Common Divisors

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

Congruences and Residue Class Rings

Remainders. We learned how to multiply and divide in elementary

Transcription:

Spring 2018

Today Greatest Common Divisor (GCD) Euclid s algorithm Proof of Correctness Reading: Chapter 4.3

Primes and GCD Universe: U = N = {0, 1, 2,...} a divides b (written a b) iff k.b = ak Set of divisors: D(a) = {d : (d a)} p 2 is prime if D(p) = {1, p} Common divisors of a and b: D(a) D(b) gcd(a, b) = max{d(a) D(b)}

Primes and GCD Universe: U = N = {0, 1, 2,...} a divides b (written a b) iff k.b = ak Set of divisors: D(a) = {d : (d a)} p 2 is prime if D(p) = {1, p} Common divisors of a and b: D(a) D(b) gcd(a, b) = max{d(a) D(b)} Question: D(30) D(42) = (A) {1, 3, 5}; (B) {1, 6, 7}; (C) {1, 3}; (D) {1, 3, 6};

Prime factorization Let (p i ) i 1 = (2, 3, 5, 7, 11, 13,...) the sequence of primes Every positive integer n is a product of primes: n = i k pe i i Prime factorization is essentially unique

Prime factorization Let (p i ) i 1 = (2, 3, 5, 7, 11, 13,...) the sequence of primes Every positive integer n is a product of primes: n = i k pe i i Prime factorization is essentially unique If n = i k pe i i (A) {p e i i then D(n) is the set : i = 1,..., k}; (B) { i k pc i i : i.c i e i }; (C) { i k pc i i : i.c i < e i }; (D) { i m pe i : m k};

Prime factorization Let (p i ) i 1 = (2, 3, 5, 7, 11, 13,...) the sequence of primes Every positive integer n is a product of primes: n = i k pe i i Prime factorization is essentially unique If n = i k pe i i (A) {p e i i then D(n) is the set : i = 1,..., k}; (B) { i k pc i i : i.c i e i }; (C) { i k pc i i : i.c i < e i }; (D) { i m pe i : m k}; The common divisors of n = i k pe i i and m = i k pf i i are D(n) D(m) = { i k p c i i : i.c i min(e i, f i )}

Greatest Common Divisor (GCD) The greatest common divisor of n = i k pe i i and m = i k pf i i is D(n) D(m) = i k p min(e i,f i ) i

Greatest Common Divisor (GCD) The greatest common divisor of n = i k pe i i and m = i k pf i i is D(n) D(m) = i k p min(e i,f i ) i Question: What is the GCD of 30 and 42? (A) 2; (B) 3; (C) 6; (D) {1, 2, 3, 6}

Zeros and Ones

Zeros and Ones What are the divisors of 1? (A) D(1) = 1; (B) D(1) = {1}; (C) D(1) = N; (D) D(1) =

Zeros and Ones What are the divisors of 1? (A) D(1) = 1; (B) D(1) = {1}; (C) D(1) = N; (D) D(1) = What are the divisors of 0? (A) D(0) = 0; (B) D(0) = {0}; (C) D(0) = N; (D) D(0) =

Zeros and Ones What are the divisors of 1? (A) D(1) = 1; (B) D(1) = {1}; (C) D(1) = N; (D) D(1) = What are the divisors of 0? (A) D(0) = 0; (B) D(0) = {0}; (C) D(0) = N; (D) D(0) = What is the GCD of 7 and 0? gcd(7, 0) equals... (A) 7; (A) 0; (A) 1; (A) ;

Zeros and Ones What are the divisors of 1? (A) D(1) = 1; (B) D(1) = {1}; (C) D(1) = N; (D) D(1) = What are the divisors of 0? (A) D(0) = 0; (B) D(0) = {0}; (C) D(0) = N; (D) D(0) = What is the GCD of 7 and 0? gcd(7, 0) equals... (A) 7; (A) 0; (A) 1; (A) ; Special case: gcd(0, 0) = 0

Let s make it harder Can you compute it (by hand) in 60 seconds? gcd(12, 52) =??? (A) Working on it... (B) Yes, computed! (C) No way!... but I can write a program to compute it.

Let s make it harder Can you compute it (by hand) in 60 seconds? gcd(12, 52) =??? gcd(123, 345) =??? (A) Working on it... (B) Yes, computed! (C) No way!... but I can write a program to compute it.

Let s make it harder Can you compute it (by hand) in 60 seconds? gcd(12, 52) =??? gcd(123, 345) =??? gcd(6432, 4366) =??? (A) Working on it... (B) Yes, computed! (C) No way!... but I can write a program to compute it.

Let s make it harder Can you compute it (by hand) in 60 seconds? gcd(12, 52) =??? gcd(123, 345) =??? gcd(6432, 4366) =??? gcd(635432, 463366) =??? (A) Working on it... (B) Yes, computed! (C) No way!... but I can write a program to compute it.

Euclid s algorithm def euclid(a,b): # a,b: nonnegative integers if (b == 0): return a else: return (euclid(b, mod(a,b)))

Euclid s algorithm def euclid(a,b): # a,b: nonnegative integers if (b == 0): return a else: return (euclid(b, mod(a,b))) gcd(635432, 463366) = gcd(463366, 635432 463366) = gcd(463366, 172066) = gcd(172066, 463366 2 172066) = gcd(172066, 120334) = gcd(120344, 172066 120334) = gcd(120344, 51732) = gcd(51732, 120344 2 51732) = gcd(51732, 16880) = gcd(16880, 51732 3 16880) = gcd(16880, 1092) = gcd(1092, 16880 15 1092) = gcd(1092, 500) = gcd(500, 92) = gcd(92, 40) = gcd(40, 12) = gcd(12, 4) = gcd(4, 0) = 4.

Euclid s algorithm def euclid(a,b): # a,b: nonnegative integers if (b == 0): return a else: return (euclid(b, mod(a,b))) gcd(635432, 463366) = gcd(463366, 635432 463366) = gcd(463366, 172066) = gcd(172066, 463366 2 172066) = gcd(172066, 120334) = gcd(120344, 172066 120334) = gcd(120344, 51732) = gcd(51732, 120344 2 51732) = gcd(51732, 16880) = gcd(16880, 51732 3 16880) = gcd(16880, 1092) = gcd(1092, 16880 15 1092) = gcd(1092, 500) = gcd(500, 92) = gcd(92, 40) = gcd(40, 12) = gcd(12, 4) = gcd(4, 0) = 4. Let s prove it!

Divisors and GCD Question: If (a, b) and (c, d) have the same divisors, then they have the same GCD. (D(a, b) = D(c, d)) = (gcd(a, b) = gcd(c, d)) (A) Yes; (B) No; (C) Maybe

Divisors and GCD Question: If (a, b) and (c, d) have the same divisors, then they have the same GCD. (D(a, b) = D(c, d)) = (gcd(a, b) = gcd(c, d)) (A) Yes; (B) No; (C) Maybe Question: If (a, b) and (c, d) have the same GCD, then then have the same divisors/ (gcd(a, b) = gcd(c, d)) = (D(a, b) = D(c, d)) (A) Yes; (B) No; (C) Maybe

Idea: Common divisors Claim: a, b and (a mod b), b have the same common divisors.

Idea: Common divisors Claim: a, b and (a mod b), b have the same common divisors. Proof: We show D(a) D(b) = D(a mod b)) D(b) by proving set inclusion in both directions.

Idea: Common divisors Claim: a, b and (a mod b), b have the same common divisors. Proof: We show D(a) D(b) = D(a mod b)) D(b) by proving set inclusion in both directions. Assume d D(a) D(b). WTP: d D(a mod b) a = dx b = dy r = a mod b satisfies a = qb + r Therefore, r = a qb = dx qdy = d(x qy) and d D(r).

Idea: Common divisors Claim: a, b and (a mod b), b have the same common divisors. Proof: We show D(a) D(b) = D(a mod b)) D(b) by proving set inclusion in both directions. Assume d D(a) D(b). WTP: d D(a mod b) a = dx b = dy r = a mod b satisfies a = qb + r Therefore, r = a qb = dx qdy = d(x qy) and d D(r). Assume d D(b) D(a mod b). WTP: d D(a) r = a mod b = dx b = dy Therefore, a = qb + r = qdy + dx = d(qy + x) and d D(a)

Back to our program def euclid(a,b): # a,b: nonnegative integers if (b == 0): return a else: return (euclid(b, mod(a,b))) Idea: If b = 0, then D(a) D(b) = D(a) N = D(a), and gcd(a, b) = a.

Back to our program def euclid(a,b): # a,b: nonnegative integers if (b == 0): return a else: return (euclid(b, mod(a,b))) Idea: If b = 0, then D(a) D(b) = D(a) N = D(a), and gcd(a, b) = a. Otherwise, D(a) D(b) = D(b) D(a mod b) So, gcd(a, b) = gcd(b, a mod b), and if euclid(b,mod(a,b)) is correct, then euclid(a,b) is also correct.

Proof by induction def euclid(a,b): # a,b: nonnegative integers if (b == 0): return a else: return (euclid(b, mod(a,b))) Claim: For all a, b, euclid(a,b) = gcd(a, b) Proof: By (strong) induction on what?

Proof by induction def euclid(a,b): # a,b: nonnegative integers if (b == 0): return a else: return (euclid(b, mod(a,b))) Claim: For all a, b, euclid(a,b) = gcd(a, b) Proof: By (strong) induction on what? (A) a; (B) b; (C) a + b; (D) Don t know

Proof by induction def euclid(a,b): # a,b: nonnegative integers if (b == 0): return a else: return (euclid(b, mod(a,b))) Claim: For all a, b, euclid(a,b) = gcd(a, b) Proof: By (strong) induction on what? (A) a; (B) b; (C) a + b; (D) Don t know Claim: For all a b, euclid(a,b) = gcd(a, b)

Proof by induction def euclid(a,b): # a,b: nonnegative integers if (b == 0): return a else: return (euclid(b, mod(a,b))) Claim: For all a, b, euclid(a,b) = gcd(a, b) Proof: By (strong) induction on what? (A) a; (B) b; (C) a + b; (D) Don t know Claim: For all a b, euclid(a,b) = gcd(a, b) Proof: By (strong) induction on what? (A) a; (B) b; (C) a + b; (D) Don t know

Proof details def euclid(a,b): # a,b: nonnegative integers if (b == 0) then a else return (euclid(b, mod(a,b))) Claim: For all a b, euclid(a,b) = gcd(a, b) Proof: By strong induction on b.

Proof details def euclid(a,b): # a,b: nonnegative integers if (b == 0) then a else return (euclid(b, mod(a,b))) Claim: For all a b, euclid(a,b) = gcd(a, b) Proof: By strong induction on b. Base case: b = 0. euclid(a,b) = a and gcd(a, 0) = a.

Proof details def euclid(a,b): # a,b: nonnegative integers if (b == 0) then a else return (euclid(b, mod(a,b))) Claim: For all a b, euclid(a,b) = gcd(a, b) Proof: By strong induction on b. Base case: b = 0. euclid(a,b) = a and gcd(a, 0) = a. Inductive step: Assume b > 0 and euclid(a,r) = gcd(a, r) for all r < b euclid(a,b) = euclid(b,r) where r = (a mod b) < b By induction hypothesis euclid(b,r) = gcd(b, r) But we proved that gcd(b, r) = gcd(a, b) So, euclid(a,b)= gcd(a, b)

Completing the proof def euclid(a,b): # a,b: nonnegative integers if (b == 0) then a else return (euclid(b, mod(a,b))) Lemma: For all a b, euclid(a,b) = gcd(a, b) Proved!

Completing the proof def euclid(a,b): # a,b: nonnegative integers if (b == 0) then a else return (euclid(b, mod(a,b))) Lemma: For all a b, euclid(a,b) = gcd(a, b) Proved! Theorem: For all a, b, euclid(a,b) = gcd(a, b) Proof: If a b, then euclid(a,b) = gcd(a, b) by the lemma If a < b, then b 1 and a mod b = a. So, euclid(a,b) = euclid(b,a) = gcd(b, a) = gcd(a, b)

Application: breaking weak RSA keys Mining Your Ps and Qs: Widespread weak keys in network devices, Heninger et al., 2012. RSA cryptosystem: Public Key K = P Q, product of two large secret random primes Many devices use bad pseudorandom generators, so P, Q are not very random Different devices end up using the same P or Q Collect all RSA public keys from the internet, and compute their GCD if K 1 = PQ, K 2 = PQ, then gcd(k 1, K 2 ) = P.

Bezout s Identity def euclid(a,b): # a,b: nonnegative integers if (b == 0): return a else: return (euclid(b, mod(a,b))) Theorem: For any positive integers a, b, there exists integers x, y such that gcd(a, b) = xa + yb.

Bezout s Identity def euclid(a,b): # a,b: nonnegative integers if (b == 0): return a else: return (euclid(b, mod(a,b))) Theorem: For any positive integers a, b, there exists integers x, y such that gcd(a, b) = xa + yb. Can you prove the theorem? (A) Yes; (B) No; (C) Maybe.

Bezout s Identity def euclid(a,b): # a,b: nonnegative integers if (b == 0): return a else: return (euclid(b, mod(a,b))) Theorem: For any positive integers a, b, there exists integers x, y such that gcd(a, b) = xa + yb. Can you prove the theorem? (A) Yes; (B) No; (C) Maybe. What proof method would you use?

Bezout s Identity def euclid(a,b): # a,b: nonnegative integers if (b == 0): return a else: return (euclid(b, mod(a,b))) Theorem: For any positive integers a, b, there exists integers x, y such that gcd(a, b) = xa + yb. Can you prove the theorem? (A) Yes; (B) No; (C) Maybe. What proof method would you use? Can you modify the algorithm to return (x, y)?

Extended Euclid Algorithm def bezout(a,b): # a,b: nonnegative integers if (b == 0): return (1,0) else: (q,r) = divmod(a,b) # a = qb+r (x,y) = bezout(b,r) # xb+yr = gcd(b,r) = gcd(a,b) return (???,???) Question: What shall we return? (A) (x + qy, x) (B) (y, x qy) (C) (x qy, x) (D) (y, x + qy)

Correctness? How can we check if the program is correct? (A) Prove by induction that bezout returns valid (x, y) (B) Run the program on some test inputs (C) First run some tests, then prove correctness

Correctness? How can we check if the program is correct? (A) Prove by induction that bezout returns valid (x, y) (B) Run the program on some test inputs (C) First run some tests, then prove correctness How can you test the program? How can you generate tests without already having a correct program?

Testing the algorithm def euclid(a,b): # a,b: nonnegative integers if (b == 0): return a else: (q,r) = divmod(a,b) # a = qb+r return (euclid(b,r)) def bezout(a,b): # a,b: nonnegative integers if (b == 0): return (1,0) else: (q,r) = divmod(a,b) # a = qb+r (x,y) = bezout(b,r) # xb+yr = gcd(b,r) = gcd(a,b) return (y,x-q*y) def test(a,b): (x,y) = bezout(a,b) return (x*a+y*b == euclid(a,b))

Proving correctness def euclid(a,b): # a,b: nonnegative integers if (b == 0): return a else: (q,r) = divmod(a,b) # a = qb+r return (euclid(b,r)) def bezout(a,b): # a,b: nonnegative integers if (b == 0): return (1,0) else: (q,r) = divmod(a,b) # a = qb+r (x,y) = bezout(b,r) # xb+yr = gcd(b,r) = gcd(a,b) return (y,x-q*y) Claim: For every positive integers a, b, bezout(a,b) computes integers x, y such that x*a+y*b == euclid(a,b) Proof: By induction on b... left as exercise

Application to modular arithmetic Let m > 1 be a positive integer We have seen how to compute a + b (mod m), a b (mod m), a b (mod m) Can you also compute a/b (mod m)? More simply, can you compute a 1 (mod m)? Question: Can you compute a 1 (mod 1)5 for any of the following numbers (A) a=2; (B) a=5; (C) a=7; (D) a=12;

Modular invertion using Bezout s identity Proof: Want to compute a 1 (mod m) Compute (x, y) such that xa + ym = gcd(a, m) = d If d = 1, then xa = d ym = 1 (mod m), so x = a 1 (mod m) If d > 1, then a has no inverse modulo m Assume for contradiction that d = gcd(a, m) > 1 and c.a c = 1 (mod m) Then, k.ac = 1 + km Since d divides both a and m, it must also divide 1 = ac km. This is only possible if d = 1, contradiction!

Finite Fields If p is a prime, then (Z p, +, ) is a field Axioms:

Finite Fields If p is a prime, then (Z p, +, ) is a field Axioms: Associativity of +: a, b, c.(a + b) + c = a + (b + c) Commutativity of +: a, b.(a + b) = (b + a) Neutral element: 0. a.a + 0 = 0 + a = a Additive Inverses: a. b.a + b = 0. (b = a) Associativity of :... Commutativity of :... Neutral element: 1. a.a 1 = a

Finite Fields If p is a prime, then (Z p, +, ) is a field Axioms: Associativity of +: a, b, c.(a + b) + c = a + (b + c) Commutativity of +: a, b.(a + b) = (b + a) Neutral element: 0. a.a + 0 = 0 + a = a Additive Inverses: a. b.a + b = 0. (b = a) Associativity of :... Commutativity of :... Neutral element: 1. a.a 1 = a Multiplicative Inverses: a.(a 0) b.a b = b a = 1. (b = a 1 ) Distributivity: a, b, c.a (b + c) = a b + a c.

Applications of Finite Fields in CS Error Correcting Codes Fast Integer Arithmetics Cryptography Hashing...

Chinese Remainder Theorem Let p, q be two different primes f : Z pq Z p Z q where f (x) = (x mod p, x mod q) Theorem: f is a bijection

Chinese Remainder Theorem Let p, q be two different primes f : Z pq Z p Z q where f (x) = (x mod p, x mod q) Theorem: f is a bijection Example: p = 7, q = 5 f (22) =?? (A) (1, 1); (B) (2, 2); (C) (1, 2); (D) (2, 1);

Chinese Remainder Theorem Let p, q be two different primes f : Z pq Z p Z q where f (x) = (x mod p, x mod q) Theorem: f is a bijection Example: p = 7, q = 5 f (22) =?? (A) (1, 1); (B) (2, 2); (C) (1, 2); (D) (2, 1); f 1 (5, 3) =??? (A) 12; (B) 19; (C) 26; (D) 33;

CRT proof How can you define f 1? gcd(p, q) = 1 Question: We prove that f is (A) Injective (one-to-one); (B) Surjective (onto); (C) Bijective (one-to-one correspondence);

CRT proof How can you define f 1? gcd(p, q) = 1 Inverse of p (mod q): x.xp = 1 (mod q) Question: We prove that f is (A) Injective (one-to-one); (B) Surjective (onto); (C) Bijective (one-to-one correspondence);

CRT proof How can you define f 1? gcd(p, q) = 1 Inverse of p (mod q): x.xp = 1 (mod q) Inverse of q (mod p): y.yq = 1 (mod p) Question: We prove that f is (A) Injective (one-to-one); (B) Surjective (onto); (C) Bijective (one-to-one correspondence);

CRT proof How can you define f 1? gcd(p, q) = 1 Inverse of p (mod q): x.xp = 1 (mod q) Inverse of q (mod p): y.yq = 1 (mod p) g(a, b) = xpb + yqa Question: We prove that f is (A) Injective (one-to-one); (B) Surjective (onto); (C) Bijective (one-to-one correspondence);

CRT proof How can you define f 1? gcd(p, q) = 1 Inverse of p (mod q): x.xp = 1 (mod q) Inverse of q (mod p): y.yq = 1 (mod p) g(a, b) = xpb + yqa g(a, b) (mod p) yqa 1 a a (mod p) Question: We prove that f is (A) Injective (one-to-one); (B) Surjective (onto); (C) Bijective (one-to-one correspondence);

CRT proof How can you define f 1? gcd(p, q) = 1 Inverse of p (mod q): x.xp = 1 (mod q) Inverse of q (mod p): y.yq = 1 (mod p) g(a, b) = xpb + yqa g(a, b) (mod p) yqa 1 a a (mod p) g(a, b) (mod q) xpb 1 b b (mod q) Question: We prove that f is (A) Injective (one-to-one); (B) Surjective (onto); (C) Bijective (one-to-one correspondence);

CRT proof How can you define f 1? gcd(p, q) = 1 Inverse of p (mod q): x.xp = 1 (mod q) Inverse of q (mod p): y.yq = 1 (mod p) g(a, b) = xpb + yqa g(a, b) (mod p) yqa 1 a a (mod p) g(a, b) (mod q) xpb 1 b b (mod q) (f g)(a, b) = (a, b) Question: We prove that f is (A) Injective (one-to-one); (B) Surjective (onto); (C) Bijective (one-to-one correspondence);

Review: Bijections on Finite sets Let A, B be finite sets of the same size A = B If f : A B is injective, then it is a bijection. If f : A B is surjective, then it is a bijection.

Course Evaluations CAPE course evaluations are open You should have received information to submit your evaluations on May 28 Evals are open till before final week Remember to submit your course evals!