180 likes | 325 Views
This lecture delves into the concepts of congruence and modulus arithmetic, essential topics in discrete structures. We explore how integers are congruent mod k, perform modulus addition and multiplication, and examine their practical applications such as error checking and encryption. The course illustrates how congruence helps in areas like bitwise operations and time calculation, solidifying understanding of natural and integer numbers. Additionally, we will cover RSA key generation, focusing on the significance of prime numbers and their role in secure communication.
E N D
Congruence and Sets Dali - “The Persistence of Memory” Discrete Structures (CS 173) Madhusudan Parthasarathy, University of Illinois
Review of Last Class • Counting, natural numbers, and integers • Representation of numbers: unary, Roman, decimal, binary • Divisibility: a| b iff b =ma for some integer m • Prime numbers and composite numbers • GCD and LCM is the largest integer that divides both and is the smallest integer that both and divide • Euclidean algorithm for computing gcd • p and q are relatively prime if they have no common prime factors. i.e., gcd(p.q) = 1
Goals of this lecture • Introduce the concept of congruence mod k • Be able to perform modulus arithmetic • Rationals • Reals
Applications of congruence • bitwise operations • error checking • computing 2D coordinates in images • encryption • telling time • etc.
Congruence mod k • Two integers are congruent mod k if they differ by an integer multiple of k • Definition: If is any positive integer, two integers and are congruent mod k iff divides
Examples of congruent mod k overhead
Modulus addition proof Claim: For any integers with , if and then Definition: overhead
Modulus multiplication proof Claim: For any integers with , if and then Definition: overhead
Equivalence classes with modulus The equivalence class of integer (written ) is the set of all integers congruent to In (mod 7), In (mod 5), In ,
Modulus arithmetic overhead
RSA Key Generation • Creating the public and private keys for encryption/decryption • Choose two prime numbers and • Choose an integer such that and is relatively prime with • Solve for (e.g., with extended Euclidean algorithm) • Using the keys • Public key: • Private key: • Encryption • Turn message into an integer • Coded message • Decryption • Original message
Thank you • Next week: sets and relations