Modular Arithmetic. Marizza Bailey. December 14, 2015

Similar documents
36 Modular Arithmetic

CHAPTER 8. Copyright Cengage Learning. All rights reserved.

Chapter 3: Theory of Modular Arithmetic 1. Chapter 3: Theory of Modular Arithmetic

Modular Arithmetic. is just the set of remainders we can get when we divide integers by n

Algorithmic number theory Cryptographic hardness assumptions. Table of contents

1 Elementary number theory

Introduction to Sets and Logic (MATH 1190)

Ch 3.4 The Integers and Division

9.5 Equivalence Relations

Euclid's Algorithm. MA/CSSE 473 Day 06. Student Questions Odd Pie Fight Euclid's algorithm (if there is time) extended Euclid's algorithm

Module 2 Congruence Arithmetic pages 39 54

ELEMENTARY NUMBER THEORY AND METHODS OF PROOF

ELEMENTARY NUMBER THEORY AND METHODS OF PROOF

1 Elementary number theory

Lecture Notes, CSE 232, Fall 2014 Semester

Senior Math Circles Cryptography and Number Theory Week 1

Cryptography Worksheet

Congruence Arithmetic

Know the Well-ordering principle: Any set of positive integers which has at least one element contains a smallest element.

Introduction to Modular Arithmetic

MITOCW watch?v=kvtlwgctwn4

(1) Modular arithmetic

Introduction to Cryptography and Security Mechanisms. Abdul Hameed

Chapter 4. Number Theory. 4.1 Factors and multiples

Excerpt from "Art of Problem Solving Volume 1: the Basics" 2014 AoPS Inc.

INF2270 Spring Philipp Häfliger. Lecture 4: Signed Binaries and Arithmetic

Accuplacer Arithmetic Study Guide

The Chinese remainder theorem

Number System. Introduction. Natural Numbers (N) Whole Numbers (W) Integers (Z) Prime Numbers (P) Face Value. Place Value

CPSC 467b: Cryptography and Computer Security

Number Theory Open, Round 1 Test #101

Mathematics. Jaehyun Park. CS 97SI Stanford University. June 29, 2015

Encryption à la Mod Name

Lecture 2 Algorithms with numbers

SCHOOL OF ENGINEERING & BUILT ENVIRONMENT. Mathematics. Numbers & Number Systems

Midterm Exam. CS381-Cryptography. October 30, 2014

r=1 The Binomial Theorem. 4 MA095/98G Revision

The School District of Palm Beach County Fourth Grade Mathematics Scope st Trimester

Applied Cryptography and Network Security

CSE 215: Foundations of Computer Science Recitation Exercises Set #4 Stony Brook University. Name: ID#: Section #: Score: / 4

CS669 Network Security

CSE 20 DISCRETE MATH. Fall

MA/CSSE 473 Day 05. Integer Primality Testing and Factoring Modular Arithmetic intro Euclid s Algorithm

Section A Arithmetic ( 5) Exercise A

Topic 2: Decimals. Topic 1 Integers. Topic 2 Decimals. Topic 3 Fractions. Topic 4 Ratios. Topic 5 Percentages. Topic 6 Algebra

2.4 Multiplication and Division of Integers

Divisibility Rules and Their Explanations

RSA (material drawn from Avi Kak Lecture 12, Lecture Notes on "Computer and Network Security" Used in asymmetric crypto.

Primality Testing! 1

Lecture 8: Addition, Multiplication & Division

What Is A Relation? Example. is a relation from A to B.

EE 486 Winter The role of arithmetic. EE 486 : lecture 1, the integers. SIA Roadmap - 2. SIA Roadmap - 1

Basic operators, Arithmetic, Relational, Bitwise, Logical, Assignment, Conditional operators. JAVA Standard Edition

Learning Log Title: CHAPTER 3: ARITHMETIC PROPERTIES. Date: Lesson: Chapter 3: Arithmetic Properties

Properties. Comparing and Ordering Rational Numbers Using a Number Line

(I m not printing out these notes! Take your own.)

Rational Number is a number that can be written as a quotient of two integers. DECIMALS are special fractions whose denominators are powers of 10.

Equations and Problem Solving with Fractions. Variable. Expression. Equation. A variable is a letter used to represent a number.

1. Represent each of these relations on {1, 2, 3} with a matrix (with the elements of this set listed in increasing order).

Introduction to Cryptography and Security Mechanisms: Unit 5. Public-Key Encryption

GO - OPERATORS. This tutorial will explain the arithmetic, relational, logical, bitwise, assignment and other operators one by one.

UCT Algorithm Circle: Number Theory

Activity Guide - Public Key Cryptography

CSE 20 DISCRETE MATH. Winter

! Addition! Multiplication! Bigger Example - RSA cryptography

Rational Numbers CHAPTER Introduction

CS 97SI: INTRODUCTION TO PROGRAMMING CONTESTS. Jaehyun Park

Information Science 1

Math 302 Introduction to Proofs via Number Theory. Robert Jewett (with small modifications by B. Ćurgus)

Channel Coding and Cryptography Part II: Introduction to Cryptography

Introduction to Programming in C Department of Computer Science and Engineering\ Lecture No. #02 Introduction: GCD

Unit 2: Accentuate the Negative Name:

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #23 Loops: Precedence of Operators

50 MATHCOUNTS LECTURES (6) OPERATIONS WITH DECIMALS

CPS 104 Computer Organization and Programming

Unit 7 Number System and Bases. 7.1 Number System. 7.2 Binary Numbers. 7.3 Adding and Subtracting Binary Numbers. 7.4 Multiplying Binary Numbers

Will introduce various operators supported by C language Identify supported operations Present some of terms characterizing operators

Fractions. Dividing the numerator and denominator by the highest common element (or number) in them, we get the fraction in its lowest form.

Lecture 7 Number Theory Euiseong Seo

Math 126 Number Theory

Learning the Language - V

Math Introduction to Advanced Mathematics

8/27/2016. ECE 120: Introduction to Computing. Graphical Illustration of Modular Arithmetic. Representations Must be Unambiguous

Subtraction Understand Subtraction on a Number Line Using a number line let s demonstrate the subtraction process using the problem 7 5.

Creating a new data type

Math 7 Notes Unit Three: Applying Rational Numbers

x= suppose we want to calculate these large values 1) x= ) x= ) x=3 100 * ) x= ) 7) x=100!

Cryptology complementary. Finite fields the practical side (1)

Lesson 1: Arithmetic Review

COMPUTER SCIENCE TRIPOS

2.Simplification & Approximation

Applied Cryptography and Computer Security CSE 664 Spring 2018

1. Relations 2. Equivalence relations 3. Modular arithmetics. ! Think of relations as directed graphs! xry means there in an edge x!

Student Success Center Arithmetic Study Guide for the ACCUPLACER (CPT)

Section 1.1 Definitions and Properties

Connecting Statements. Today. First there was logic jumping forward.. ..and then proofs and then induction...

Prepared by Sa diyya Hendrickson. Package Summary

Algorithms (III) Yu Yu. Shanghai Jiaotong University

Think: 5 5 5, or 25. Think: Think: Evaluate Multiply. So, when s 2, the value of. 5(s 3) is 125. Then divide.

Embedded Systems Design Prof. Anupam Basu Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Transcription:

Modular Arithmetic Marizza Bailey December 14, 2015

Introduction to Modular Arithmetic If someone asks you what day it is 145 days from now, what would you answer? Would you count 145 days, or find a quicker way?

Maybe, you would note that there are 7 days in a week, and, therefore, in seven days it would be the same day as today. Then you would only have to find out how many groups of 7 fit into 145. This could be easily done by dividing 7 into 145. The answer, of course, would be 20, with 5 left over, or 145 = 7(20) + 5.. Then, it would only be necessary to count 5 days from today, and you would see that it would Saturday.

You may think this knowledge would only be useful to show off to friends, but you would be mistaken. Programmers use this information to write calendar programs, and time programs, as well as others. The mathematics that is involved in this problem is called modular arithmetic. Instead of looking at a number as a value in and of itself, it is though of as a member of a remainder class relative to a number.

For Example, if we wanted to compute 12 mod (5) we would see that 12 = 5(2) + 2, and therefore, 5 goes into 12 twice with remainder 2. Hence, 12 mod (5) = 2.

See if you can compute the following: 17 mod (3) 39 mod (4) 137 mod (6) 234 mod (10) 365 mod (7) 73 mod (52) 256 mod (12)

How many years would it take for August 6 to be a Monday?

Modular Congruence What does it mean that 7 2 mod (5)? First of all, it means that the difference of 7 and 2 is a multiple of 5, i.e., 7 = 5k + 2 for some integer, k. Is 7 actually equal to 2. What does equivalent mean? It means almost equal. An equivalence relation is a relation that is symmetric, reflexive and transitive.

Adding and Subtracting Suppose you want to add two numbers modulo m. Would you be able to just add their residues? We d like to believe that to be the case. Let s look at an Example. Example Suppose you want to add 7 and 23 modulo 6. 7 + 23 = 30 mod (6) = 0 and 7 mod (6) = 1 and 23 mod (6) = 5, so 1 + 5 = 0 mod (6).

Exercises Add the following and simplify: 73 + 89 mod (10) 93 + 47 mod (9) 403 397 mod (8) 1214 + 1591 mod (7) 134 + 453 217 mod (12) 2372 + 971 1549 mod (11)

Find the additive inverse of each number in the respective modulo class. 5 mod (9) 7 mod (12) 4 mod (8)

Find the value(s) for x that make the equation true. x + 6 = 2 mod (7) x + 117 = 73 mod (125)

Multiplication Lemma Let r 1 = a mod (n) and r 2 = b mod (n), then r 1 r 2 mod (n) = ab mod (n)

Multiplication in the integers and multiplication mod(n) is very different. You may not be able to divide by a number in mod(n). This is because division in any number set is multiplication by the multiplicative inverse.

Let me explain, if you see 2x = 5, and I ask you how to solve the equation, you would divide both sides by 2. Really, what you are doing is multiplying both sides by 1 2 because 2 1 2 = 1, which means that 1 2 2x = 1 2 5 x = 5 2

Therefore, to divide by a number, it has to have a multiplicative inverse. What is the multiplicative inverse of 2 mod (10)? Try it. I ll wait. What? You didn t find one? That s weird.

The reason for this is because 2(5) = 0 mod (10) which means 2 is a zero divisor in Z 10. That s right! xy = 0 no longer implies that x = 0 or y = 0.

In fact, all numbers which are not relatively prime to 10 will be zero divisors. For example, 2, 4, 5, 6, 8, 0 are not relatively prime to 10, and are, therefore, are zero divisors. Also, 1, 3, 7, 9 are relatively prime, and so are multiplicative invertible.

Exercises For each of the numbers below, find the multiplicative inverse in the indicated modulus. If it does not have a multiplicative inverse, then find the factor which makes it a zero divisor. 5 modulo 24 4 modulo 7 3 modulo 9 2 modulo 6 6 modulo 14