CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.

Slides:



Advertisements
Similar presentations
Prof. Shachar Lovett Clicker frequency: CA CSE 20 Discrete math Prof. Shachar Lovett
Advertisements

Finite Fields Rong-Jaye Chen. p2. Finite fields 1. Irreducible polynomial f(x)  K[x], f(x) has no proper divisors in K[x] Eg. f(x)=1+x+x 2 is irreducible.
Chapter 4 Finite Fields. Introduction of increasing importance in cryptography –AES, Elliptic Curve, IDEA, Public Key concern operations on “numbers”
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
Section 4.1: Primes, Factorization, and the Euclidean Algorithm Practice HW (not to hand in) From Barr Text p. 160 # 6, 7, 8, 11, 12, 13.
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
6/20/2015 5:05 AMNumerical Algorithms1 x x1x
Congruence of Integers
Chapter 2 Parity checks Simple codes Modular arithmetic.
Lecture 3.2: Public Key Cryptography II CS 436/636/736 Spring 2012 Nitesh Saxena.
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
Great Theoretical Ideas in Computer Science.
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
1.3 – AXIOMS FOR THE REAL NUMBERS. Goals  SWBAT apply basic properties of real numbers  SWBAT simplify algebraic expressions.
4.1 Factors and Divisibility
Peter Lam Discrete Math CS.  Sometimes Referred to Clock Arithmetic  Remainder is Used as Part of Value ◦ i.e Clocks  24 Hours in a Day However, Time.
Equivalence Relations MSU CSE 260. Outline Introduction Equivalence Relations –Definition, Examples Equivalence Classes –Definition Equivalence Classes.
Great Theoretical Ideas in Computer Science.
CPSC 3730 Cryptography and Network Security
By: Hector L Contreras SSGT / USMC
Mathematics Review Exponents Logarithms Series Modular arithmetic Proofs.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Math 3121 Abstract Algebra I Lecture 9 Finish Section 10 Section 11.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Foundations of Discrete Mathematics Chapter 4 By Dr. Dalia M. Gil, Ph.D.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Great Theoretical Ideas in Computer Science for Some.
Modular Arithmetic and the RSA Cryptosystem Great Theoretical Ideas In Computer Science John LaffertyCS Fall 2005 Lecture 9Sept 27, 2005Carnegie.
Copyright © Cengage Learning. All rights reserved. CHAPTER 8 RELATIONS.
8.5 Equivalence Relations
Chapter 13 Mathematic Structures 13.1 Modular Arithmetic Definition 1 (modulo). Let a be an integer and m be a positive integer. We denoted by a mod m.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
MAT 2720 Discrete Mathematics Section 3.3 Relations
Chap. 7 Relations: The Second Time Around
Great Theoretical Ideas in Computer Science.
1 Discrete Structures – CNS2300 Text Discrete Mathematics and Its Applications Kenneth H. Rosen (5 th Edition) Chapter 2 The Fundamentals: Algorithms,
Chapter 4 With Question/Answer Animations 1. Chapter Motivation Number theory is the part of mathematics devoted to the study of the integers and their.
Great Theoretical Ideas in Computer Science.
Modular Arithmetic and the RSA Cryptosystem Great Theoretical Ideas In Computer Science Steven RudichCS Spring 2005 Lecture 8Feb 3, 2005Carnegie.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Number-Theoretic Algorithms
The Relation Induced by a Partition
Discrete Math II Howon Kim
Mathematical Background for Cryptography: Modular arithmetic and gcd
Modular Arithmetic and the RSA Cryptosystem
Number Theory and Modular Arithmetic
Numerical Algorithms x x-1
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
Equivalence Relations
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
1.3 – AXIOMS FOR THE REAL NUMBERS
Miniconference on the Mathematics of Computation
Rayat Shikshan Sanstha’s S.M.Joshi College, Hadapsar -28
Clements MAΘ October 30th, 2014
Lecture 3 Strings and Things (Section 1.1)
Chapter 8 (Part 2): Relations
Presentation transcript:

CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett

Today’s Topics: 1. Modular arithmetics 2

1. Modular Arithmetic 3

Modular arithmetics 4

Residue classes  Remember that equivalence relations = partition of universe to equivalence classes  Even = [0 mod 2] = {…,-4,-2,0,0,2,4,…}  Odd = [1 mod 2] = {…,-3,-1,1,3,…}  Partition by value modulo 2 5

Residue classes  Similarly, there are 3 residue classes modulo 3  [0 mod 3] = {x: x=3a} = {…,-6,-3,0,3,6,…}  [1 mod 3] = {x: x=3a+1} = {…,-5,-2,1,4,7,…}  [2 mod 3] = {x: x=3a+2} = {…,-4,-1,2,5,8,…}  Similarly, modulo n defines n residue classes. For x  Z, we denote by [x mod n] its residue class. 6

Modular addition  We can add residue classes.  Fix n.  [x mod n]+[y mod n]=[x+y mod n]  This is well defined. What does that mean? A. For any x,y, the sum x+y is defined B. The definition of sum does not depend on choice of representatives C. There is a way to obtain all residue classes D. I don’t know 7

Modular addition  Residue classes mod mod 5 1 mod 5 2 mod 53 mod 5 4 mod 5

Modular addition  Residue classes mod 5  [x mod 5]+[1 mod 5]=[x+1 mod 5] 9 0 mod 5 1 mod 5 2 mod 53 mod 5 4 mod 5

Modular addition  [x mod n]+[y mod n]=[x+y mod n]  Theorem: this is well defined  This means:  if x,x’  Z are such that x mod n=x’ mod n;  and y,y’  Z are such that y mod n=y’ mod n.  Then (x+y) mod n = (x’+y’) mod n.  So, the definition of addition does not depend on the chosen representatives for each residue class 10

Modular addition  [x mod n]+[y mod n]=[x+y mod n]  Theorem: this is well defined  Proof (direct proof):  If x mod n=x’ mod n then x’=x+na for a  Z  If y mod n=y’ mod n then y’=y+nb for b  Z  Then (x’+y’)=(x+y)+n(a+b)  So [x’+y’ mod n]=[x+y mod n]  QED 11

Modular addition  [2 mod 5]+[4 mod 5]= A. 0 B. [2 mod 5] C. [1 mod 5] D. [1 mod 4] E. None/other/more than one 12

Modular multiplication  [x mod n]*[y mod n]=[x*y mod n]  Theorem: this is well defined  Proof (direct proof):  If x mod n=x’ mod n then x’=x+na for a  Z  If y mod n=y’ mod n then y’=y+nb for b  Z  Then (x’*y’)=(x*y)+n(ay+bx+nab)  So [x’*y’ mod n]=[x*y mod n]  QED 13

Modular multiplication  [2 mod 5]*[4 mod 5]= A. [1 mod 5] B. [2 mod 5] C. [3 mod 5] D. [4 mod 5] E. None/other/more than one 14

Modular multiplication  [2 mod 5]*[4 mod 7]= A. [1 mod 5] B. [2 mod 7] C. [3 mod 35] D. [8 mod 35] E. None/other/more than one 15

Modular multiplication  X={0,1,2,3,4}  Define: xRy if [2x mod 5]=[y mod 5]  Is R… A. Symmetric B. Reflexive C. Transitive D. More than one E. None 16

The ring Z n  Define Z n ={[0 mod n],[1 mod n],…,[n-1 mod n]}  The set of all residue classes modulo n  We defined addition and multiplication on Z n  You can check: they obey all the usual definitions of addition and multiplication (abbrv. [x]=[x mod n])  [x]+[y]=[y]+[x]; [x]*[y]=[y]*[x]  [x]*([y]+[z])=[x]*[y]+[x]*[z]  [x]+[0]=[x]; [x]*[1]=[x]  …  Sets which support addition and multiplication are called rings 17

The ring Z n  If n is not prime, weird stuff can happen  Example: [2 mod 6] * [3 mod 6] = A. [0 mod 6] B. [2 mod 6] C. [3 mod 6] D. [5 mod 6] E. None/other/more than one 18

The ring Z n  If n is not prime, weird stuff can happen  Example: [2 mod 6] * [3 mod 6] = [0 mod 6]  That is, we multiplied two nonzero elements, and got zero as a result  (these are called zero divisors) 19

Applications of modular arithmetic