notations for modular arithmetic (sketch)

Upload: vlorbik

Post on 30-May-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/14/2019 notations for modular arithmetic (sketch)

    1/3

    NOTATIONS FOR MODULAR ARITHMETIC

    VLORBIK

    Equivalence (mod n) is of course not the same thing as equality: 13 = 7 for example,but 13 3 7. Equivalence does share some properties with equality, and herein lies muchof its usefulness.

    We will refer to the following remarkable facts as The Fundamental Theorem ofModular Arithmetic:Addition and multiplication both work using modular equivalences.

    This is obviously somewhat informal; what does work mean here? One way to state thismore formally is that if

    a n x and b n y

    it follows that

    a + b n x + y and ab n xy .

    Dont worry if youre confused by this formal statement; it should become clearer afterweve worked through some examples.

    0.1. Example: mod 10. Lets consider the example of mod 10. First of all, its easy tosee that every natural number is equivalent mod 10 to exactly one number from the set

    Z10 = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} .

    These are all the possible remainders when we divide a natural number by ten. (The symbolZ10 is standard for this set; the Z comes from zahlen, which is German for numbers.The official name of this set is the integers modulo ten; its usually called simply zeemod ten or zee ten. ) Note that Z10 consists of the ten natural numbers less than 10.

    In fact its even easy to determine which number in Z10 a given number is equivalent to:

    31, 415, 265, 358, 979 10 9 ,

    for example, and you dont need a calculator to see this. Just think about what happenswhen you divide by ten. The remainder is always the last digit.

    Another way to state the fundamental theorem for mod 10 numbers is that for any twonatural numbers, (i.) the last digit of the sum is equivalent mod ten to the sum of the last

    digits, and (ii.) the last digit of the product is equivalent mod ten to the product of thelast digits.But this is well-known! In fact, the familiar algorithms for calculating sums and products

    illustrate this principle quite nicely. Consider the example of the two numbers a = 3141

  • 8/14/2019 notations for modular arithmetic (sketch)

    2/3

    2 VLORBIK

    and b = 159. The fundamental theorem (part (i.) asserts that the last digit of the sumdepends only on the last digits of a and b. 314

    + 159473

    4+ 9

    13

    The last digit is 3 in each case; in fact we know these last digits must match by the verynature of the procedure for calculating the sum!By the same token, we have 314 159 = 49926, whereas 4 9 = 36. Again, the last

    digits match; again, the familiar multiplication algortithm shows why this must be so.In terms of equivalences, we are asserting that because

    314 10 4 and 159 10 9 ,

    we must have

    314 + 159 10 4 + 9 and314 159 10 4 9 ,

    which is a special case of the fundamental theorem.We can think of mod ten arithmetic as the arithmetic of last digits. The numbers in

    Z10 can be added and multiplied mod ten to produce answers in Z10; just throw awayall but the last digit. Well denote this addition by 10. Thus for example,

    410 9 = 3 .

    Likewise, 10 will denote multiplication mod ten in Z10:

    410 9 = 6

    (just keep the last digit of the ordinary product).

    0.2. Example: mod 2. .Arithmetic mod two is based on the set of remainders on division by two, namely

    Z2 = {0, 1} .

    Addition and multiplication are performed within this set by using remainders mod two:

    02 0 = 0 02 1 = 1 12 0 = 1 12 1 = 0

    (these equations correspond to the well-known facts of ordinary arithmetic: even pluseven is even, even plus odd is odd, odd plus even is odd, and odd plus odd is even), and

    02 0 = 0 02 1 = 0 12 0 = 0 12 1 = 1 .

    We can display the same data in Z2 addition and multiplication tables:

    2 0 10 0 11 1 0

    2 0 10 0 01 0 1

    These tables represent a complete arithmetic mod two. This could also be thought ofas the arithmetic of even or odd. Inded, we could just as well have written our tableswith E for even and O for odd as follows.

  • 8/14/2019 notations for modular arithmetic (sketch)

    3/3

    NOTATIONS FOR MODULAR ARITHMETIC 3

    2 E OE E OO O E

    2 E OE E EO E O

    The number notation will be much more convienient for moduli other than two, how-ever, so well continue to use the number notation for mod two calculations as well.

    0.3. Example: mod 3. .It will come as no surprise that

    Z3 = {0, 1, 2}

    (zee three) represents the set of integers modulo three: all the possible remainders whena natural number is divided by three. Furthermore, we can introduce mod three arithmeticusing symbols 3 and 3.

    3 0 1 20 0 1 21 1 2 0

    2 2 0 1

    3 0 1 20 0 0 01 0 1 2

    2 0 2 1