CSE 20 DISCRETE MATH. Winter

Similar documents
CSE 20 DISCRETE MATH. Winter

CSE 20 DISCRETE MATH. Fall

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

Introduction to Sets and Logic (MATH 1190)

2 Elementary number theory

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

Fall 2015 Lecture 14: Modular congruences. cse 311: foundations of computing

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

M381 Number Theory 2004 Page 1

Relations. Relations. Definition. Let A and B be sets.

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?

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

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

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

Chapter 3 Basic Number Theory

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

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

MATH 501 Discrete Mathematics. Lecture 6: Number theory. German University Cairo, Department of Media Engineering and Technology.

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

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

Homework #2 solutions Due: June 15, 2012

ELEMENTS OF NUMBER THEORY

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

Introduction to Cryptography CS 355 Lecture 3

Part V. Chapter 19. Congruence of integers

3.7 Non-linear Diophantine Equations

WORKSHEET MATH 215, FALL 15, WHYTE. We begin our course with the natural numbers:

Introduction to Cryptography. Lecture 6

MATH 115, SUMMER 2012 LECTURE 4 THURSDAY, JUNE 21ST

Math 109 HW 9 Solutions

Ch 4.2 Divisibility Properties

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?

Number Theory Proof Portfolio

4. Congruence Classes

MATH 361: NUMBER THEORY FOURTH LECTURE

Ma/CS 6a Class 2: Congruences

RED. Name: Instructor: Pace Nielsen Math 290 Section 1: Winter 2014 Final Exam

Definitions. Notations. Injective, Surjective and Bijective. Divides. Cartesian Product. Relations. Equivalence Relations

CHAPTER 3. Congruences. Congruence: definitions and properties

With Question/Answer Animations. Chapter 4

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

Primes. Rational, Gaussian, Industrial Strength, etc. Robert Campbell 11/29/2010 1

Relations. Binary Relation. Let A and B be sets. A (binary) relation from A to B is a subset of A B. Notation. Let R A B be a relation from A to B.

Writing Assignment 2 Student Sample Questions

D-MATH Algebra I HS18 Prof. Rahul Pandharipande. Solution 1. Arithmetic, Zorn s Lemma.

Discrete Structures Lecture Primes and Greatest Common Divisor

8 Primes and Modular Arithmetic

MTH 346: The Chinese Remainder Theorem

MATH FINAL EXAM REVIEW HINTS

An integer p is prime if p > 1 and p has exactly two positive divisors, 1 and p.

Topics in Cryptography. Lecture 5: Basic Number Theory

NOTES ON SIMPLE NUMBER THEORY

AN ALGEBRAIC PROOF OF RSA ENCRYPTION AND DECRYPTION

Number theory (Chapter 4)

Introduction to Cryptology. Lecture 19

Notes on Systems of Linear Congruences

7. Prime Numbers Part VI of PJE

The number of ways to choose r elements (without replacement) from an n-element set is. = r r!(n r)!.

MATH 215 Sets (S) Definition 1 A set is a collection of objects. The objects in a set X are called elements of X.

MATH 2200 Final Review

Chapter 1 : The language of mathematics.

CSE 20 DISCRETE MATH WINTER

Adam Blank Spring 2017 CSE 311. Foundations of Computing I. * All slides are a combined effort between previous instructors of the course

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

CSE 20 DISCRETE MATH. Winter

The next sequence of lectures in on the topic of Arithmetic Algorithms. We shall build up to an understanding of the RSA public-key cryptosystem.

Proof 1: Using only ch. 6 results. Since gcd(a, b) = 1, we have

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

Modular Arithmetic Instructor: Marizza Bailey Name:

CSE 20 DISCRETE MATH. Fall

Lecture Notes. Advanced Discrete Structures COT S

CS March 17, 2009

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

Math 319 Problem Set #2 Solution 14 February 2002

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

Numbers. Çetin Kaya Koç Winter / 18

CSE 20 DISCRETE MATH WINTER

Number Theory and Group Theoryfor Public-Key Cryptography

14 Equivalence Relations

CSE 20 DISCRETE MATH WINTER

Ma/CS 6a Class 2: Congruences

3.2 Solving linear congruences. v3

CISC-102 Fall 2017 Week 6

CHAPTER 6. Prime Numbers. Definition and Fundamental Results

Definition 6.1 (p.277) A positive integer n is prime when n > 1 and the only positive divisors are 1 and n. Alternatively

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

Signature: (In Ink) UNIVERSITY OF MANITOBA TEST 1 SOLUTIONS COURSE: MATH 2170 DATE & TIME: February 11, 2019, 16:30 17:15

Integers and Division

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

4.3 - Primes and Greatest Common Divisors

Congruence Classes. Number Theory Essentials. Modular Arithmetic Systems

CSE 20 DISCRETE MATH WINTER

Lecture 7 Number Theory Euiseong Seo

MATH 420 FINAL EXAM J. Beachy, 5/7/97

Lecture 5: Arithmetic Modulo m, Primes and Greatest Common Divisors Lecturer: Lale Özkahya

An Algorithm for Prime Factorization

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

Math 2070BC Term 2 Weeks 1 13 Lecture Notes

Math Circle Beginners Group February 28, 2016 Euclid and Prime Numbers Solutions

CSE 105 THEORY OF COMPUTATION

Transcription:

CSE 20 DISCRETE MATH Winter 2017 http://cseweb.ucsd.edu/classes/wi17/cse20-ab/

Today's learning goals Define and use the congruence modulo m equivalence relation Perform computations using modular arithmetic Explain how primality and modular arithmetic are related The final exam is Saturday March 18 8am-11am. Lecture A will take the exam in GH 242 Lecture B will take the exam in SOLIS 107 Practice questions for the final exam are now available on Piazza. Solutions will not be posted for these questions. However, the TAs will discuss them in the review session Thursday 03/16/2017 8:00p-10:50p PETER 108.

Equivalence relations Rosen p. 608 Two formulations A relation R on set S is an equivalence relation if it is reflexive, symmetric, and transitive. x R y iff x and y are "similar" Partition S into equivalence classes, each of which consists of "similar" elements: collection of disjoint, nonempty subsets that have S as their union x,y both in A i iff x and y are "similar"

*The* example Rosen p. 240 For a,b in Z and m in Z + we say a is congruent to b mod m iff m (a-b) i.e. and in this case, we write Claim: Congruence mod m is an equivalence relation Congruence classes: [a] m = {s (a,s) is in R} = {s a mod m = s mod m}

mod is mod? Theorem 3 p. 241 Let a and b be integers and m be a positive integer. Then iff a mod m = b mod m Proof:

Arithmetic modulo m Rosen p. 242-243 (a+b) mod m = ( (a mod m) + (b mod m) ) mod m ab mod m = ((a mod m) (b mod m)) mod m + 0 1 2 0 0 1 2 1 1 2 0 2 2 0 1. 0 1 2 0 0 0 0 1 0 1 2 2 0 2 1

Arithmetic modulo m Rosen p. 242-243 (a+b) mod m = ( (a mod m) + (b mod m) ) mod m ab mod m = ((a mod m) (b mod m)) mod m What is (1068+785) mod 3? A. 0 B. 1 C. 2 D. I need a calculator E. I don't have enough time!

Division? Find an example of two integers a,b that are not multiples of 6 but where ab mod 6 = 0 Zero divisors

Primes Rosen p. 257 An integer p greater than 1 is prime if its only positive factors are 1 and p.

Primes Rosen p. 257 An integer p greater than 1 is prime if its only positive factors are 1 and p. Fact: There are no zero divisors mod p. Why? Suppose ab mod p = 0. Then ab = kp so p (ab). Is it possible to have (ab) be a multiple of p at the same time as a and b both not multiples of p

Excursion: gcd Rosen p. 265 For two integers a,b (not both 0), the largest integer d such that d a and d b is called the greatest common divisor of a and b, gcd(a,b). A. gcd(a,b) < a B. gcd(a,b) could be negative. C. gcd (a,b) can never equal b. D. gcd (a,b) can equal 1. E. None of the above.

Excursion: gcd Rosen p. 265 For two integers a,b (not both 0), the largest integer d such that d a and d b is called the greatest common divisor of a and b, gcd(a,b). If p is prime and a is an integer, then A. gcd(a,p) depends on a B. gcd(a,p) equals 1 C. gcd (a,p) equals p D. gcd (a,p) equals ap E. None of the above.

Calculating gcd(a,b) Rosen p. 267 Euclidean Algorithm Remember HW 1?

Euclidean algorithm Rosen p. 267 1. Algorithm for calculating GCD 2. Theoretical consequence: Bézout's Theorem If a,b are positive ints then there are ints s,t such that gcd(a,b) = sa + tb

Back to primes Is it possible to have (ab) be a multiple of p at the same time as a and b both not multiples of p? For simplicity, assume 0 a,b p

Back to primes Is it possible to have (ab) be a multiple of p at the same time as a and b both not multiples of p? For simplicity, assume 0 a,b p Know ab = kp and gcd(a,p) = 1 By Bézout's Theorem, there are ints s,t with 1 = gcd(a,p) = sa + tp

Back to primes Is it possible to have (ab) be a multiple of p at the same time as a and b both not multiples of p? For simplicity, assume 0 a,b p Know ab = kp and gcd(a,p) = 1 By Bézout's Theorem, there are ints s,t with 1 = gcd(a,p) = sa + tp b = b (sa + tp) = s(ab)+(bt)p = s(kp) + (bt)p = (sk+bt)p

Primes Rosen p. 257 An integer p greater than 1 is prime if its only positive factors are 1 and p. Fact: There are no zero divisors mod p. Why? Suppose ab mod p = 0. Then ab = kp so p (ab). So p a and p b. That is, a mod p = 0 and b mod p=0. mod b there are no zero divisors

Arithmetic modulo p, arithmetic looks very familiar

Fundamental Theorem of Arithmetic Rosen p 336 Strong induction! P(n) "n can be written as the product of primes"

Infinitely many primes Rosen p. 260 Proof by contradiction!

Open questions Can we efficiently factor a large number into primes? Is every even number the sum of two primes Goldbach's conjecture Are there infinitely many "twin primes"?