CSE 321 Discrete Structures

Slides:



Advertisements
Similar presentations
CS 202 Epp section ?? Aaron Bloomfield
Advertisements

CSE331: Introduction to Networks and Security Lecture 19 Fall 2002.
Chapter 8 – Introduction to Number Theory. Prime Numbers prime numbers only have divisors of 1 and self –they cannot be written as a product of other.
The Integers and Division. Outline Division: Factors, multiples Exercise 2.3 Primes: The Fundamental Theorem of Arithmetic. The Division Algorithm Greatest.
CSE115/ENGR160 Discrete Mathematics 03/15/12
Sets, Combinatorics, Probability, and Number Theory Mathematical Structures for Computer Science Chapter 3 Copyright © 2006 W.H. Freeman & Co.MSCS Slides.
22C:19 Discrete Structures Integers and Modular Arithmetic
CSE 311 Foundations of Computing I Lecture 13 Number Theory Autumn 2012 CSE
Chapter 8 More Number Theory. Prime Numbers Prime numbers only have divisors of 1 and itself They cannot be written as a product of other numbers Prime.
Chapter Primes and Greatest Common Divisors ‒Primes ‒Greatest common divisors and least common multiples 1.
The Fundamental Theorem of Arithmetic (2/12) Definition (which we all already know). A number greater than 1 is called prime if its only divisors are 1.
22C:19 Discrete Math Integers and Modular Arithmetic Fall 2010 Sukumar Ghosh.
Notation Intro. Number Theory Online Cryptography Course Dan Boneh
CSC2110 Discrete Mathematics Tutorial 5 GCD and Modular Arithmetic
CSE115/ENGR160 Discrete Mathematics 03/15/11
6/20/2015 5:05 AMNumerical Algorithms1 x x1x
CSE 321 Discrete Structures Winter 2008 Lecture 8 Number Theory: Modular Arithmetic.
1 Integers and Division CS/APMA 202 Rosen section 2.4 Aaron Bloomfield.
CSE 321 Discrete Structures Winter 2008 Lecture 10 Number Theory: Primality.
CSE 311 Foundations of Computing I Lecture 12 Primes, GCD, Modular Inverse Spring

The Fundamentals: Algorithms, Integers, and Matrices CSC-2259 Discrete Structures Konstantin Busch - LSU1.
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 3 (Part 2): The Fundamentals: Algorithms, the.
MATH 224 – Discrete Mathematics
Discrete Mathematics CS 2610 March 17, Number Theory Elementary number theory, concerned with numbers, usually integers and their properties or.
Cyclic Groups (9/25) Definition. A group G is called cyclic if there exists an element a in G such that G =  a . That is, every element of G can be written.
Chapter 2 (Part 1): The Fundamentals: Algorithms, the Integers & Matrices The Integers and Division (Section 2.4)
CSE 311: Foundations of Computing Fall 2014 Lecture 12: Primes, GCD.
22C:19 Discrete Structures Integers and Modular Arithmetic Fall 2014 Sukumar Ghosh.
MA/CSSE 473 Day 08 Extended Euclid's Algorithm Modular Division Fermat's little theorem.
CSE 311 Foundations of Computing I Lecture 14 Euclid’s Algorithm Mathematical Induction Autumn 2012 CSE
Ref: Pfleeger96, Ch.31 Properties of Arithmetic Reference: Pfleeger, Charles P., Security in Computing, 2nd Edition, Prentice Hall, 1996.
Foundations of Computing I CSE 311 Fall Review: Division Theorem Let a be an integer and d a positive integer. Then there are unique integers q.
15-499Page :Algorithms and Applications Cryptography II – Number theory (groups and fields)
CSE 311: Foundations of Computing Fall 2013 Lecture 12: Primes, GCD, modular inverse.
Dan Boneh Intro. Number Theory Arithmetic algorithms Online Cryptography Course Dan Boneh.
CSE 311: Foundations of Computing Fall 2013 Lecture 11: Modular arithmetic and applications.
MA/CSSE 473 Day 09 Modular Division Revisited Fermat's Little Theorem Primality Testing.
1 Discrete Structures – CNS2300 Text Discrete Mathematics and Its Applications Kenneth H. Rosen (5 th Edition) Chapter 2 The Fundamentals: Algorithms,
The Fundamentals: Algorithms, Integers, and Matrices CSC-2259 Discrete Structures Konstantin Busch - LSU1.
CSE 311 Foundations of Computing I Lecture 12 Modular Arithmetic and Applications Autumn 2012 CSE
CSE 311 Foundations of Computing I Lecture 11 Modular Exponentiation and Primes Autumn 2011 CSE 3111.
MA/CSSE 473 Day 07 Extended Euclid's Algorithm Modular Division Fermat's little theorem intro.
A Prime Example CS Lecture 20 A positive integer p  2 is prime if the only positive integers that divide p are 1 and p itself. Positive integers.
Number-Theoretic Algorithms
CS 210 Discrete Mathematics The Integers and Division (Section 3.4)
Introduction to Number Theory
CSE565: Computer Security Lecture 7 Number Theory Concepts
CSE15 Discrete Mathematics 03/20/17
CS 2210:0001Discrete Structures Modular Arithmetic and Cryptography
Numerical Algorithms x x-1 Numerical Algorithms
Chapter 5: Number Theory
Introduction to Number Theory
CSE 311 Foundations of Computing I
Number Theory (Chapter 7)
CSE 311 Foundations of Computing I
CSE 311 Foundations of Computing I
Cryptography and Network Security
Discrete Math for CS CMPSC 360 LECTURE 12 Last time: Stable matching
刘振 上海交通大学 计算机科学与工程系 电信群楼3-509
CSE 311 Foundations of Computing I
Tuesday, 27 April Number-Theoretic Algorithms Chapter 31
CSE 321 Discrete Structures
CSE 321 Discrete Structures
CSE 321 Discrete Structures
Number Theory.
CSE 321 Discrete Structures
CSE 311 Foundations of Computing I
Presentation transcript:

CSE 321 Discrete Structures Winter 2008 Lecture 9 Number Theory: Modular Arithmetic

Announcements Readings Today: Wednesday: Friday: Modular Exponentiation 3.5, 3.6 (5th Edition: 2.5) Wednesday: Primality 3.6 (5th Edition: 2.5) Friday: Applications of Number Theory 3.7 (5th Edition: 2.6)

Highlights from Lecture 8 Modular Arithmetic a mod n: remainder when divided by n 0  a mod n  n-1 a  b (mod n) means a mod n = b mod n a+nb = (a + b) mod n a n b = (a  b) mod n Finite domain arithmetic Well behaved, especially if n is prime Applications to computing

Hashing Map values from a large domain, 0…M-1 in a much smaller domain, 0…n-1 Index lookup Test for equality Hash(x) = x mod p Often want the hash function to depend on all of the bits of the data Collision management

Pseudo Random number generation Linear Congruential method xn+1 = (a xn + c) mod m m = 10, a = 3, c = 2, x0 = 0

Data Permutations Caesar cipher, a = 1, b = 2, . . . Shift cipher HELLO WORLD Shift cipher f(x) = (x + k) mod n f-1(x) = (x – k) mod n Affine cipher f(x) = (ax + b) mod n f-1(x) = (a-1(x-b) ) mod n a b c d e f g 1 2 3 4 5 6 7

Modular Exponentiation 1 2 3 4 5 6 a a1 a2 a3 a4 a5 a6 1 2 3 4 5 6

Fermat’s Little Theorem If p is prime, 0 < a  p-1, ap-1  1 (mod p) Group theory Index of x, smallest i > 0 such that xi = 1 The index of x divides the order of the group

Exponentiation Compute 7836581453 Compute 7836581453 mod 104729 104,729 is the 10,000th prime

Fast exponentiation int FastExp(int x, int n){ long v = (long) x; int m = 1; for (int i = 1; i <= n; i++){ v = (v * v) % modulus; m = m + m; Console.WriteLine("i : " + i + ", m : " + m + ", v : " + v ); } return (int)v;

Program Trace i : 1, m : 2, v : 82915 i : 2, m : 4, v : 95592

Fast exponentiation algorithm What if the exponent is not a power of two? 81453 = 216 + 213 + 212 + 211 + 210 + 29 + 25 + 23 + 22 + 20 The fast multiplication algorithm computes an mod p in time O(log n)

Discrete Log Problem Given integers a, b in [1,…, p-1], find k such that ak mod p = b

Primality An integer p is prime if its only divisors are 1 and p An integer that is greater than 1, and not prime is called composite Fundamental theorem of arithmetic: Every positive integer greater than one has a unique prime factorization

Factorization If n is composite, it has a factor of size at most sqrt(n)

Euclid’s theorem There are an infinite number of primes. Proof by contradiction: Suppose there are a finite number of primes: p1, p2, . . . pn