Discrete Math for CS CMPSC 360 LECTURE 12 Last time: Stable matching

Slides:



Advertisements
Similar presentations
Number Theory Algorithms and Cryptography Algorithms Prepared by John Reif, Ph.D. Analysis of Algorithms.
Advertisements

Euclidean Algorithm Applied Symbolic Computation CS 567 Jeremy Johnson.
1 Lect. 12: Number Theory. Contents Prime and Relative Prime Numbers Modular Arithmetic Fermat’s and Euler’s Theorem Extended Euclid’s Algorithm.
Computer Science CSC 474Dr. Peng Ning1 CSC 474 Information Systems Security Topic 2.3 Basic Number Theory.
WS Algorithmentheorie 03 – Randomized Algorithms (Primality Testing) Prof. Dr. Th. Ottmann.
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.
February 19, 2015Applied Discrete Mathematics Week 4: Number Theory 1 The Growth of Functions Question: If f(x) is O(x 2 ), is it also O(x 3 )? Yes. x.
Notation Intro. Number Theory Online Cryptography Course Dan Boneh
CSC2110 Discrete Mathematics Tutorial 5 GCD and Modular Arithmetic
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2002 Tuesday, 26 November Number-Theoretic Algorithms Chapter 31.
Chapter II. THE INTEGERS
6/20/2015 5:05 AMNumerical Algorithms1 x x1x
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2001 Lecture 7 Tuesday, 11/6/01 Number-Theoretic Algorithms Chapter.
WHOLE NUMBERS; INTEGERS Whole numbers: Z 0,+ = the natural numbers  {0}. Integers:
CSE 321 Discrete Structures Winter 2008 Lecture 10 Number Theory: Primality.
CSE 311 Foundations of Computing I Lecture 12 Primes, GCD, Modular Inverse Spring
Fall 2002CMSC Discrete Structures1 Let us get into… Number Theory.
9/2/2015Discrete Structures1 Let us get into… Number Theory.
Mathematics of Cryptography Part I: Modular Arithmetic
COMP 170 L2 Page 1 L05: Inverses and GCDs l Objective: n When does have an inverse? n How to compute the inverse? n Need: Greatest common dividers (GCDs)
MATH 224 – Discrete Mathematics
Module :MA3036NI Cryptography and Number Theory Lecture Week 7
Mathematics of Cryptography Modular Arithmetic, Congruence,
CPSC 3730 Cryptography and Network Security
1 Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown Chapter 4 – Finite Fields.
Information Security and Management 4. Finite Fields 8
CS 312: Algorithm Analysis Lecture #4: Primality Testing, GCD This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.Creative.
Chapter 4 – Finite Fields
Greatest Common Divisor Jordi Cortadella Department of Computer Science.
CS 312: Algorithm Analysis Lecture #4: Primality Testing, GCD This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.Creative.
CSE 311: Foundations of Computing Fall 2014 Lecture 12: Primes, GCD.
Lecture 6.1: Misc. Topics: Number Theory CS 250, Discrete Structures, Fall 2011 Nitesh Saxena.
CS Modular Division and RSA1 RSA Public Key Encryption To do RSA we need fast Modular Exponentiation and Primality generation which we have shown.
MA/CSSE 473 Day 08 Extended Euclid's Algorithm Modular Division Fermat's little theorem.
Cryptography and Network Security Chapter 4. Introduction  will now introduce finite fields  of increasing importance in cryptography AES, Elliptic.
Ref: Pfleeger96, Ch.31 Properties of Arithmetic Reference: Pfleeger, Charles P., Security in Computing, 2nd Edition, Prentice Hall, 1996.
CSE 311: Foundations of Computing Fall 2013 Lecture 12: Primes, GCD, modular inverse.
Discrete Mathematics
CSE 311: Foundations of Computing Fall 2013 Lecture 11: Modular arithmetic and applications.
CS 312: Algorithm Analysis Lecture #4: Primality Testing, GCD This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.Creative.
1 Discrete Structures – CNS2300 Text Discrete Mathematics and Its Applications Kenneth H. Rosen (5 th Edition) Chapter 2 The Fundamentals: Algorithms,
Ch04-Number Theory and Cryptography 1. Introduction to Number Theory Number theory is about integers and their properties. We will start with the basic.
CS480 Cryptography and Information Security Huiping Guo Department of Computer Science California State University, Los Angeles 3. Mathematics of Cryptography.
Number Theory Lecture 1 Text book: Discrete Mathematics and its Applications, 7 th Edition.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Number Theory. Introduction to Number Theory Number theory is about integers and their properties. We will start with the basic principles of divisibility,
Number-Theoretic Algorithms
CS 210 Discrete Mathematics The Integers and Division (Section 3.4)
Divisibility and Primes
Mathematical Background for Cryptography: Modular arithmetic and gcd
Lecture 3.2: Public Key Cryptography II
Integers and Division Section 3.4.
Numerical Algorithms x x-1 Numerical Algorithms
CMSC Discrete Structures
CSE 311 Foundations of Computing I
CSE 311 Foundations of Computing I
MATH301- DISCRETE MATHEMATICS Copyright © Nahid Sultana Dr. Nahid Sultana Chapter 4: Number Theory and Cryptography.
GCD and Optimization Problem
Applied Discrete Mathematics Week 3: Algorithms
Numerical Algorithms x x-1
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
Applied Discrete Mathematics Week 4: Number Theory
Discrete Math for CS CMPSC 360 LECTURE 4 Last time and recitations:
Discrete Math for CS CMPSC 360 LECTURE 13 Last time:
CSE 321 Discrete Structures
Discrete Math for CS CMPSC 360 LECTURE 14 Last time:
Copyright © Zeph Grunschlag,
Applied Discrete Mathematics Week 10: Introduction to Counting
Number Theory.
Presentation transcript:

Discrete Math for CS CMPSC 360 LECTURE 12 Last time: Stable matching Modular arithmetic Today: Exponentiation Multiplicative Inverses Extended Euclid’s algorithm CMPSC 360 11/29/2018

Modular exponentiation Naive algorithm to compute 𝑥 𝑦 mod 𝑚. mod-exp-naive(𝒙,𝒚,𝒎) Input: integer 𝒙, natural number 𝒚, positive integer 𝒎. if 𝒚=𝟎 then return 1 else 𝒛= mod-exp-naive(𝒙,𝒚−𝟏,𝒎) return (𝒛⋅𝒙 mod 𝒎) 11/29/2018

I-clicker problem (frequency: BC) If 𝑦 has 𝑏 bits, how many multiplications mod 𝑚 are performed when we compute 𝑥 𝑦 mod 𝑚 by the naive algorithm? Find the largest correct bound: At least √𝑏. At least 𝑏. At least 2𝑏. At least 𝑏 2 . At least 2 𝑏−1 . 11/29/2018

Modular exponentiation Uses repeated squaring to compute 𝑥 𝑦 mod 𝑚. mod-exp(𝒙,𝒚,𝒎) Input: integer 𝒙, natural number 𝒚, positive integer 𝒎. if 𝒚=𝟎 then return 1 else 𝒛= mod-exp(𝒙,𝒚 div 𝟐,𝒎) if 𝒚 mod 2 =𝟎 then return (𝒛⋅𝒛 mod 𝒎) else return (𝒛⋅𝒛⋅𝒙 mod 𝒎) 11/29/2018

I-clicker problem (frequency: BC) If 𝑦 has 𝑏 bits, how many multiplications mod 𝑚 are performed when we compute 𝑥 𝑦 mod 𝑚 by repeated squaring? Find the smallest correct bound: At most √𝑏. At most 𝑏. At most 2𝑏. At most 𝑏 2 . At most 2 𝑏−1 . 11/29/2018

Definitions If 𝑥⋅𝑦≡1 (mod 𝑚) then 𝑦 is a multiplicative inverse of 𝑥 modulo 𝑚. The greatest common divisor of natural numbers 𝑥 and 𝑦, denoted gcd(𝑥,𝑦), is the largest natural number that divides both. If gcd(𝑥,𝑦)=1 then 𝑥 and 𝑦 are relatively prime (also called coprime). 11/29/2018