Modular Math - Walton High
Transcription
Modular Math - Walton High
Modular Math Jack Liu and Mark Duane Mrs. Miller Multivariable Calculus Spring Intro to Modular Math • • • Sometimes called clock math Euler pioneered the modern approach Consists of looking at a number and its remainder when divided by other numbers Notations • • • Only one is commonly used ( A ≡ B mod(n) ) Can also be denoted with a base, I.e. base 2, base 8, base 7 If two numbers have the same remainder it becomes (A = B mod(n)) Modular, an Explanation X ≡ A (mod B) X/B, the remainder is A. So: X-A=multiple of B Simple isn't it :) Examples 1. Is 4 congruent to 7 mod 6? 2. Is 4 congruent to 7 mod 3? 3. Write that 2 is true. The Math • To prove modularity A-B or B-A has to be a multiple of n Properties (for all numbers) • Properties if A, B, and n are integers • • Examples Find the remainder when 2012 is added to 3020, mod 4 • both numbers are evenly divisible by 4, so the remainder of the addition is 0. Find the remainder of 3116 + 1059 mod 7 Find the remainder when 6515*65105 mod 5 • since both are evenly divisible by 5 the remainder is 0 Find the remainder of 897*8416 mod 6 Your Turn Compute if 6 is congruent to 9 mod 2. Compute if 4 is congruent to 30 mod 2 In what base is 10 congruent to 13? Residue Systems A residue system is a set that contains one of each number that has a different remainder of n For Example, mod 4, some residue systems are: * {1,2,3,4} * {13,14,15,16} * {27,32,37,42} What is NOT a residue system? *{1,5,6,7} 1 and 5 are congruent mod 4 Examples of residue Systems Is _______ a residue system? • {24, 31, 99, 58, 67, 21} base 10 • {201, 3002, 60008, 90000, 7004} mod 5 Write a residue system for mod 13 and no a simple {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12} will not count, nor anything simple based off that... Uses, Chinese Remainder Theorem The Chinese Remainder theorem is used to find the minimum number that fulfills a set of requirements. The common example is, a woman who tells a policeman that she lost her basket of eggs, and that if she took three at a time out of it, she was left with 2, if she took five at a time out of it she was left with 3, and if she took seven at a time out of it she was left with 2. She then asks the policeman what is the minimum number of eggs she must have had. The answer is 23 Chinese Remainder Continued For example, consider the problem of finding an integer x such that A brute-force approach converts these congruences into sets and writes the elements out to the product of 3×4×5 = 60 (the solutions modulo 60 for each congruence): x ∈ {2, 5, 8, 11, 14, 17, 20, 23, 26, 29, 32, 35, 38, 41, 44, …} x ∈ {3, 7, 11, 15, 19, 23, 27, 31, 35, 39, 43, 47, 51, 55, 59, …} x ∈ {1, 6, 11, 16, 21, 26, 31, 36, 41, 46, 51, 56, …} To find an x that satisfies all three congruences, intersect the three sets to get: x ∈ {11, …} Which can be expressed as Uses, Computers All computers understand two states, on and off The states are denoted as 1 and 0 respectively With these two states we get Binary, counting in ones and zeroes Ex, 3 in binary is 11, 2 is 10 and so on Newer Computers can process greater numbers most can also handle Octal, base 8, and some can handle Hexadecimal, Base 16 Uses, Computer, Hexidecimal 0–9 represent values zero to nine, as they normally do A, B, C, D, E, F to represent values ten to fifteen. A=10 B=11 C=12 D=13 E=14 F=15 For example, the hexadecimal number 2AF3 is equal, in decimal, to (2 × 163) + (10 × 162) + (15 × 161) + (3 × 160), or 10,995. Representing numbers in different bases This is used in computing when reducing base 10 to a form computers can read, most often an on and an off, 1, 0. Called Binary, to compute, ex 26, 11010 from decimal to binary, successive division so you divide 26 by 2, the remainder becomes the LSB, the least significant bit. You repeat the process over and over until you can not divide anymore from binary to decimal, weighted multiplication each bit is a power of two more than the previous so the LSB is 2^0, and then 2^1, 2^2, etc. Uses, Calendar days. Marginally useful • • • • there are two algorithms that use Mod 7 to calculate the day of the week. One is designed for computers, the other is designed for mental calculations the computer algorithm is called the Zeller's Congruence the mental algorithim is the Doomsday Rule,no relation to the end of the World... the Doomsday Rule, this is somewhat useful Determine the "anchor day" for the century. Use the anchor day for the century to calculate the doomsday for the year. 3. Choose the closest date out of the ones that always fall on the doomsday (e.g. 4/4, 6/6, 8/8), and count the number of days (mod 7) between that date and the date in question to arrive at the day of the week. Some selected year's doomsday's: 2004 Sunday 2009 Saturday 2005 Monday 2010 Sunday 2006 Tuesday 2011 Monday 2007 Wednesday 2012 Wednesday 2008 Friday 2013 Thursday 1. 2. Examples Find the day of the week on 8/11 when the doomsday is Wednesday Find the day of the week on 2/11 when the doomsday is Friday Uses, The Musical Scale Mod 12 is used in the Music World. In the chromatic scale (one that plays every note between octaves), there are twelve notes per octave. The layout of a piano is very convenient for demonstrating this.