Chinese Remainder Theorem. How many people What is x? Divided into 4s: remainder 3 x ≡ 3 (mod 4) Divided into 5s: remainder 4 x ≡ 4 (mod 5) Chinese Remainder.

Slides:



Advertisements
Similar presentations
Mod arithmetic.
Advertisements

The Euler Phi-Function Is Multiplicative (3/3)
1 Lect. 12: Number Theory. Contents Prime and Relative Prime Numbers Modular Arithmetic Fermat’s and Euler’s Theorem Extended Euclid’s Algorithm.
COMP 170 L2 Page 1 L06: The RSA Algorithm l Objective: n Present the RSA Cryptosystem n Prove its correctness n Discuss related issues.
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.
1 Section 2.4 The Integers and Division. 2 Number Theory Branch of mathematics that includes (among other things): –divisibility –greatest common divisor.
22C:19 Discrete Structures Integers and Modular Arithmetic
22C:19 Discrete Math Integers and Modular Arithmetic Fall 2010 Sukumar Ghosh.
Congruence class arithmetic. Definitions: a ≡ b mod m iff a mod m = b mod m. a  [b] iff a ≡ b mod m.
Congruence of Integers
1 CSE20 Lecture 6 4/19/11 CK Cheng UC San Diego. Residual Numbers (NT-1 and Shaum’s Chapter 11) Introduction Definition Operations Range of numbers Conversion.
Congruence Classes Z n = {[0] n, [1] n, [2] n, …, [n - 1] n } = the set of congruence classes modulo n.
DTTF/NB479: Dszquphsbqiz Day 9 Announcements: Homework 2 due now Homework 2 due now Computer quiz Thursday on chapter 2 Computer quiz Thursday on chapter.
Announcements: Homework 2 due now Homework 2 due now Quiz this Friday on concepts from chapter 2 Quiz this Friday on concepts from chapter 2 Practical.
CS555Spring 2012/Topic 61 Cryptography CS 555 Topic 6: Number Theory Basics.
BY MISS FARAH ADIBAH ADNAN IMK
9/2/2015Discrete Structures1 Let us get into… Number Theory.
Mathematics of Cryptography Part I: Modular Arithmetic
Prelude to Public-Key Cryptography Rocky K. C. Chang, February
Prep Math Competition, Lec. 1Peter Burkhardt1 Number Theory Lecture 1 Divisibility and Modular Arithmetic (Congruences)
M ODULAR A RITHMETIC Lesson 4.6. This section, we are grouping numbers, based on their reminders. 18 ÷ 4 = 4 r ÷ 4 = 5 r ÷ 4 = 19 r. 2 These.
Chapter 4 Numeration and Mathematical Systems © 2008 Pearson Addison-Wesley. All rights reserved.
Copyright © Curt Hill Divisibility and Modular Arithmetic A Topic in Number Theory.
Cryptography Inverses and GCD Piotr Faliszewski. GCD(a,b) gcd(a, 0) = a gcd(a, b) = gcd(b, a mod b) a = b*q + r Here: q =  a / b  r = a mod b (a –
Chinese Remainder Theorem Dec 29 Picture from ………………………
22C:19 Discrete Structures Integers and Modular Arithmetic Fall 2014 Sukumar Ghosh.
Discrete Mathematics Section 3.7 Applications of Number Theory 大葉大學 資訊工程系 黃鈴玲.
1 Section Congruences In short, a congruence relation is an equivalence relation on the carrier of an algebra such that the operations of the algebra.
Module #9 – Number Theory 1/5/ Algorithms, The Integers and Matrices.
Congruences (2/17) If m (the modulus) is positive and if a and b are integers, then we say a is congruent to b mod m, writing a  b (mod m), provided that.
Factor A factor of an integer is any integer that divides the given integer with no remainder.
Lesson 11-2 Remainder & Factor Theorems Objectives Students will: Use synthetic division and the remainder theorem to find P(r) Determine whether a given.
Discrete Mathematics 4. NUMBER THEORY Lecture 7 Dr.-Ing. Erwin Sitompul
Chinese Remainder Theorem Ying Ding Junru Chen. Chinese Remainder Theorem Sun Zi suanjing ( 孫子算經 The Mathematical Classic by Sun Zi) Shushu Jiuzhang (
9.1 Primes and Related Congruence Equations 23 Sep 2013.
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.
Discrete Mathematics
Lecture 2-3 Basic Number Theory and Algebra. In modern cryptographic systems, the messages are represented by numerical values prior to being encrypted.
Divisibility and Modular Arithmetic
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.
CS480 Cryptography and Information Security
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.
Number-Theoretic Algorithms
4-2 Triangle Congruence by SSS and SAS
Chapter Applications of Number Theory Some Useful Results
Garis-garis Besar Perkuliahan
Congruence class arithmetic
Introduction to Cryptography
Prelude to Public-Key Cryptography
Modular Arithmetic Lesson 4.6.
Advanced Algorithms Analysis and Design
Integers and Division Section 3.4.
RSA Preliminaries.
6*. An Introduction to Number Theory
MATH301- DISCRETE MATHEMATICS Copyright © Nahid Sultana Dr. Nahid Sultana Chapter 4: Number Theory and Cryptography.
Applied Discrete Mathematics Week 3: Algorithms
Applied Discrete Mathematics Week 4: Number Theory
Discrete Math for CS CMPSC 360 LECTURE 12 Last time: Stable matching
Week #5 – 23/25/27 September 2002 Prof. Marie desJardins
Modular Arithmetic and Change of Base
Assignment #1 Solutions
CMSC 203, Section 0401 Discrete Structures Fall 2004 Matt Gaston
Section 10.3 Modular Arithmetic
Applied Discrete Mathematics Week 10: Introduction to Counting
Clements MAΘ October 30th, 2014
Discrete Mathematics Chapter 4 Number Theory. Discrete Mathematics Chapter 4 Number Theory.
Algebra 5 Congruence Classes.
Lecture 2-3 Basic Number Theory and Algebra
Section 9.3 Modular Arithmetic.
Presentation transcript:

Chinese Remainder Theorem

How many people What is x? Divided into 4s: remainder 3 x ≡ 3 (mod 4) Divided into 5s: remainder 4 x ≡ 4 (mod 5) Chinese Remainder Theorem

x ≡ a 1 (mod m 1 ) x ≡ a 2 (mod m 2 ) x ≡ a k (mod m k ) Theorem: If m 1,m 2,…,m k are relatively prime and a 1,a 2,…,a k are integers, then have a unique solution modulo m, where m = m 1 m 2 …m k. (That is, there is a solution x with and all other solutions are congruent modulo m to this solution.)

(1)Compute m = m 1 m 2 … m n. (2)Determine M 1 = m/m 1 ; M 2 = m/m 2 ; … ; M n = m/m n (3) Find the inverse of M 1 mod m 1, M 2 mod m 2, …, M n mod m n which are y 1, y 2,…, y n, (4) Compute x = a 1 M 1 y 1 + a 2 M 2 y 2 +…+ a n M n y n (5) Solve x ≡ y (mod m) Steps of solution:

Example : Solve the system of congruences x≡ 2 (mod 3), x≡ 3 (mod 5), x≡ 2 (mod 7) Solution: (1) m= 3 · 5 · 7=105 (2) M 1 = m/m 1 =105/3=35, M 2 = 21; M 3 = 15 (3) y 1 = 2 is an inverse of 35 mod 3 because 35 ≡ 2 (mod 3) y 2 = 1 is an inverse of 21 mod 5 because 21 ≡ 1 (mod 5) y 3 = 1 is an inverse of 15 mod 7 because 15 ≡ 1 (mod 7) (4) x= a 1 M 1 y 1 + a 2 M 2 y 2 + a 3 M 3 y 3 = 2 · 35 · · 21 · · 15 · 1=233 (5) 233 ≡ 23 (mod 105)

x≡ 2 (mod 3), x≡ 3 (mod 5), x≡ 2 (mod 7) m a232 M y 1 1.y 2 1.y 3 y ≡ 23 (mod 105)

We conclude that 23 is the smallest positive integer that: 23 mod 3 = 2 23 mod 5 = 3 23 mod 7 = 2

Find all the solution to the system of congruences x≡ 2 (mod 3), x≡ 1 (mod 4), x≡ 3 (mod 5)

x≡ 2 (mod 3), x≡ 1 (mod 4), x≡ 3 (mod 5) m34560 a213 M y 1 3.y 2 2.y 3 y ≡ 53 (mod 60)

Home Work Find all the solution to the system of congruences x≡ 1 (mod 2), x≡ 2 (mod 3), x≡ 3 (mod 5), x≡ 4 (mod 11)