Grade 7 & 8 Math Circles October 12, 2011 Modular Arithmetic

Similar documents
Grade 6/7/8 Math Circles April 1/2, Modular Arithmetic

Grade 6 Math Circles March 8-9, Modular Arithmetic

Grade 7/8 Math Circles February 9-10, Modular Arithmetic

MODULAR ARITHMETIC II: CONGRUENCES AND DIVISION

Groups, Modular Arithmetic and Geometry

Grade 6 Math Circles. Divisibility

Cryptography Lecture 1: Remainders and Modular Arithmetic Spring 2014 Morgan Schreffler Office: POT 902

Distribution of Primes

Lecture 8. Outline. 1. Modular Arithmetic. Clock Math!!! 2. Inverses for Modular Arithmetic: Greatest Common Divisor. 3. Euclid s GCD Algorithm

A Quick Introduction to Modular Arithmetic

Introduction To Modular Arithmetic

Grade 6 Math Circles March 1-2, Introduction to Number Theory

Mathematics Explorers Club Fall 2012 Number Theory and Cryptography

Number Theory and Public Key Cryptography Kathryn Sommers

Example Enemy agents are trying to invent a new type of cipher. They decide on the following encryption scheme: Plaintext converts to Ciphertext

Solutions for the Practice Final

Example Enemy agents are trying to invent a new type of cipher. They decide on the following encryption scheme: Plaintext converts to Ciphertext

Modular Arithmetic and Doomsday

The congruence relation has many similarities to equality. The following theorem says that congruence, like equality, is an equivalence relation.

Math Runes. Abstract. Introduction. Figure 1: Viking runes

Public Key Cryptography

Math 1111 Math Exam Study Guide

Modular arithmetic Math 2320

Math 1111 Math Exam Study Guide

Introduction to Modular Arithmetic

Overview. The Big Picture... CSC 580 Cryptography and Computer Security. January 25, Math Basics for Cryptography

Modular Arithmetic. claserken. July 2016

The Chinese Remainder Theorem

Multiples and Divisibility

How to Become a Mathemagician: Mental Calculations and Math Magic

#27: Number Theory, Part II: Modular Arithmetic and Cryptography May 1, 2009

1 Introduction to Cryptology

Number Theory and Security in the Digital Age

Diffie-Hellman key-exchange protocol

Classical Cryptography

Grade 7/8 Math Circles Winter March 24/25 Cryptography

Assignment 2. Due: Monday Oct. 15, :59pm

Linear Congruences. The solutions to a linear congruence ax b (mod m) are all integers x that satisfy the congruence.

Data security (Cryptography) exercise book

Modular Arithmetic: refresher.

1 = 3 2 = 3 ( ) = = = 33( ) 98 = = =

Number Theory - Divisibility Number Theory - Congruences. Number Theory. June 23, Number Theory

CMPSCI 250: Introduction to Computation. Lecture #14: The Chinese Remainder Theorem David Mix Barrington 4 October 2013

Collection of rules, techniques and theorems for solving polynomial congruences 11 April 2012 at 22:02

MA 111, Topic 2: Cryptography

MATH 135 Algebra, Solutions to Assignment 7

Number Theory: Modulus Math

4) If your birthday fell on a Sunday this year, what day will it fall on next year? 5) If it is autumn now, what season will it be in 100 seasons?

MA/CSSE 473 Day 9. The algorithm (modified) N 1

Essentials. Week by. Week. Investigations. Math Trivia

Solutions to Problem Set 6 - Fall 2008 Due Tuesday, Oct. 21 at 1:00

Error Detection and Correction

6.2 Modular Arithmetic

Keeping secrets secret

Application: Public Key Cryptography. Public Key Cryptography

Lecture 32. Handout or Document Camera or Class Exercise. Which of the following is equal to [53] [5] 1 in Z 7? (Do not use a calculator.

Cryptography, Number Theory, and RSA

Workbook. Janet Beissinger and Vera Pless

Math 319 Problem Set #7 Solution 18 April 2002

Practice Midterm 2 Solutions

Math 127: Equivalence Relations

The number theory behind cryptography

Fermat s little theorem. RSA.

Drill Time: Remainders from Long Division

MCAS/DCCAS Mathematics Correlation Chart Grade 4

CMPSCI 250: Introduction to Computation. Lecture #14: The Chinese Remainder Theorem David Mix Barrington 24 February 2012

Fall. Spring. Possible Summer Topics

CHAPTER 2. Modular Arithmetic

SHUFFLING INTO MATH JANE FELLING. Box Cars and One-Eyed Jacks RSA ILLINOIS. Day Presenting: Tuesday Room: Marsalis 2 Time: 10:45-11:45

Mathematics in your head the secrets of mental math

Public Key Cryptography Great Ideas in Theoretical Computer Science Saarland University, Summer 2014

Grade 6 Math Circles November 15 th /16 th. Arithmetic Tricks

DUBLIN CITY UNIVERSITY

SOLUTIONS TO PROBLEM SET 5. Section 9.1

Latin Squares for Elementary and Middle Grades

b) Find all positive integers smaller than 200 which leave remainder 1, 3, 4 upon division by 3, 5, 7 respectively.

CIE 2016 Math Comp Math Fun Answer Key. Name: ID: Grade: 7 Room: Start Time: Finish Time:

XSEED Summative Assessment Test 2. Maths, Test 2. XSEED Education Maths Grade 4 1

Foundations of Cryptography

Grade 7 and 8 Math Circles March 19th/20th/21st. Cryptography

MAT Modular arithmetic and number theory. Modular arithmetic

Long Division. Trial Divisor. ~The Cover-up Method~

Diophantine Equations and Modulo 11.

Modular Arithmetic. Kieran Cooney - February 18, 2016

Place Value (Multiply) March 21, Simplify each expression then write in standard numerical form. 400 thousands thousands = thousands =

An Overview of Mathematics 4

WITH MATH INTERMEDIATE/MIDDLE (IM) GRADE 6

Divisibility Rules I: Base 10 Number System

Grade 7/8 Math Circles Winter March 3/4 Jeopardy and Gauss Prep - Solutions

Section 1.6 Factors. To successfully complete this section,

Chapter 10 Error Detection and Correction 10.1

Synergy Round. Warming Up. Where in the World? Scrabble With Numbers. Earning a Gold Star

1 Introduction. 2 An Easy Start. KenKen. Charlotte Teachers Institute, 2015

LUCAS-SIERPIŃSKI AND LUCAS-RIESEL NUMBERS

Multiplication & Division

In this chapter, I give you a review of basic math, and I do mean basic. I bet you know a lot

Sheet 1: Introduction to prime numbers.

Solutions for the 2nd Practice Midterm

MAT199: Math Alive Cryptography Part 2

THE CHINESE REMAINDER CLOCK TUTORIAL

Transcription:

1 University of Waterloo Faculty of Mathematics Centre for Education in Mathematics and Computing Grade 7 & 8 Math Circles October 12, 2011 Modular Arithmetic To begin: Before learning about modular arithmetic (or mods for short), let us first talk about remainders. Question 1: What is the remainder when 51 is divided by 6? Question 2: What are all possible remainders when a number is divided by 6? By 4? By 9? In General: For any number n, all possible remainders when n is the divisor are 0, 1,..., n 1. We can sort our dividends into groups of like remainders for certain divisors (or moduli, the plural of modulus), you have actually seen this before: Example 1 Sort the numbers 1 through 10 into even numbers and odd numbers. Odd Even Notice that the numbers have remainder 0 when divided by 2, and the numbers have remainder 1 when divided by 2. We can do this with any modulus.

2 Example 2 Sort the numbers 1 through 10 depending on their remainder when divided by 3. Remainder: What we have just done is broken up our numbers into their congruence classes for the modulus 3 (i.e. a group of integers who all have the same remainder when divided by 3). There is one congruence class for each possible remainder of 3. Why are remainders so important to us? Modular Arithmetic Modular arithmetic uses remainders to state possibly big numbers in a compact way. It is useful when events repeat, which is where you ve seen it before... Modular arithmetic is also sometimes called Clock Arithmetic On a clock face, the numbers ascend from 1 to 12. However, when 1:00 PM rolls around, we typically don t say 13 O clock, we simply wrap back around to 1:00 again. Similarly 24-hour clocks wrap back around from 23:00 to 0:00. Mods use this wrapping concept too, except we always start (and wrap back to) 0 when working with mods. Looking back at Question 1: When 51 is divided by 6, the remainder is 3. This means that 51 belongs in the congruence class of 3 for the modulus 6. A shorthand for this is: 51 3 (mod 6) This is read as 51 is congruent to 3 mod 6, and interpreted as The remainder when 51 is divided by 6 is 3. NOTE: Congruent ( ) does not mean equal, it means that both numbers have the same remainder when divided by the modulus. This also means that 51 45 39 33... 15 9 3 (mod 6)

3 Finding Congruences With smaller numbers it is simple to find their congruence under a certain modulus, as long as you know your multiplication/division tables. Example 3 a) What is 84 (mod 9)? b) What is 52 (mod 5)? c) What is -4 (mod 10)? To find congruences in larger numbers for a certain modulus, follow these steps: 1. Divide your number by your modulus, using either your calculator or the mental methods learned last week. 2. Take the whole number part of your answer and multiply it by your modulus. 3. Subtract this from your original number, what you get is your remainder and also your congruence. Example 4 What is 3,686,132 (mod 7)? Applications of Congruences Dates and Times Since the days of the week, and the hours of the day are repeated events, we can use modular arithmetic to find past or future dates and times. Examples: 1. Today is Wednesday, what day of the week will it be: a) 165 days from now? b) 365 days from now? c) 1000 days from now?

4 2. I celebrated my 21st birthday on Wednesday, July 27th, 2011. On what day of the week was I born? (Don t forget about leap years!) 3. One year on Venus lasts 225 Earth days. Rachel is 13 years and 83 days old. How many days until her next Venusian birthday? How old will she be turning (in Venusian years)? Omit leap years for simplicity. Cryptography: Shift Ciphers If we assign each letter of the alphabet a number from 0 to 25 (ex. A=0, B=1, C=2, etc...), a shift cipher can be used to encode and decode messages with a known shift number (which we ll call k). To encode our message, we encrypt each letter individually using the formula: coded = (original + k)(mod 26) If we are given an encoded message and a shift number, we can decrypt the letters using the formula: original = (coded + 26 - k)(mod 26) Why do we add 26? This step will ensure we will not have to work with negative dividends. Infact we can actually add any multiple of 26, as we are only concerned about remainders. Examples: 1. encode the message MODULAR ARITHMETIC using k = 20 2. What do you say when you see an empty parrot cage? Decode the answer FEBOWED using k = 16

5 Exercises: 1. (a) What day of the week were you born? (b) What day of the week will you turn 100? 2. 1 year on Jupiter is equal to approximately 12 Earth years. On what day of the week did you celebrate your 1 st Jovian (or Jupiterian) birthday? (If you haven t turned 1 on Jupiter yet, calculate on which day of the week your 1 st birthday will fall) 3. It is 8:00 AM in our 24 hour world. What time is it in a 3 hour world? 4. In Example 3 on Page 4, our final answer is not quite accurate. A day on Venus (i.e. How long it takes the planet to make one rotation on its axis) is 243 Earth days. Notice that a day on Venus is longer than its year. Given this new information, in how many Venusian days will Rachel celebrate her next birthday? 5. Given that one day on Jupiter lasts 10 earth hours, calculate how many Jovian days ago you celebrated your 1 st birthday (Exercise 2). 6. Find a partner to work with. Think of a secret message to send to them and encode it using a shift cipher with a shift number of your choice. Give your partner their coded message and the shift number. Decode your partner s message to you. 7. What did the acorn say when he grew up? The answer VTDBTIGN Has been first encoded with a shift number of 21, and then encoded a second time using a shift of 20. Find the original message. Is there are way to do this in only one step? 8. Using a standard 52 card deck I deal all the cards out to Leah, Matt, and myself. Were the cards dealt evenly? 9. Jon is facing East, he rotates 1260 clockwise. What direction is he now facing? 10. Philippa counted the loonies in her pocket. When she put them in groups of 4, she had 2 loonies left over. When she put them in groups of 5, she had one loonie left over. If Philippa has more than 10 loonies, what is the smallest possible number of loonies she could have?