13150 Unit 11

Embed Size (px)

Citation preview

  • 8/12/2019 13150 Unit 11

    1/10

    MATH 13150: Freshman Seminar

    Unit 11

    1. Modular arithmetic

    In this chapter, we discuss a new number system, where the only numbers are 0, 1, 2, 3and 4. The idea is to add and multiply them the way we would on a clock with only 5hours, instead of 12. This will produce unexpected equalities. In the last few sectionsof the chapter, we discuss variants where we use another number in place of 5.

    1.1. 4+ 2 = 1, or how to convince your parents that your math prof is crazy.We want to introduce a new number system where the only numbers are

    0 1 2 3 4

    We call these numbers the mod 5 numbers. This number system will be based onordinary addition and multiplication. However, it has to be different!! The reasonfor this is because we cannot now write 1 + 4 = 5, because 5 is not a number in ournumber system. You should not take this to mean that 1 + 4 is not equal to 5, butrather that the statement 1 + 4 = 5 does not make sense because 5 is not a numberin our number system.

    ADDITION RULE: To add two mod 5 numbers a and b, we add them together asordinary numbers. If the result is less than 5, we just use the ordinary addition. If

    the result is more than 5, we divide 5 into the result, and take the remainder. Thatremainder is a+b (mod 5), the sum ofa and b in mod 5 arithmetic.

    For example, to add together 1 and 3 mod 5, we add together 1 + 3 = 4. Since 4 isless than 5, the sum of 1 and 3 in mod 5 arithmetic is 4. We express this by writing:

    1 + 3 4 (mod 5).

    Note that instead of using = to denote equality as in usual arithmetic, we use to denote equality in mod 5 arithmetic. The symbol helps us remember that weare working in mod 5 arithmetic.Things get more interesting when we add 3 and 4 mod 5. Certainly 3 + 4 = 7, butsince 7 is at least as big as 5, we should divide 5 into 7 and take the remainder, which

    is 2. Then according to the rule:3 + 4 2 (mod 5),

    so if we add 3 and 4 together, we get 2 in mod 5 arithmetic.Similarly,

    1 + 4 0 (mod 5), 2 + 4 1 (mod 5), 4 + 4 3 (mod 5).

    To restate, if usual a+b is 4 or less, than a+b (mod 5) is the usual addition, but ifthe usual a+b is 5 or more, we subtract 5 so that we get an actual mod 5 number.This is exactly like what you do when you determine what time it is when it is sixhours after 8 pm. You would add 6 to 8 to get 14, and then since there are only 14

    1

  • 8/12/2019 13150 Unit 11

    2/10

    2

    hours on the clock, you would subtract 12 to get the correct time 2 oclock. This iswhy we can think of modular arithmetic as clock arithmetic.

    We can make an addition table that records the result of adding any two numbers:

    MOD 5 ADDITION TABLE+ 0 1 2 3 40 0 1 2 3 41 1 2 3 4 02 2 3 4 0 13 3 4 0 1 24 4 0 1 2 3

    For example, in the 3-row and 4-column, we find 2, and this means that 3 + 4 2(mod 5), which we verified above.

    Of course, we would like to make sure that usual properties of addition work. Forexample, is

    4 + 3 3 + 4 (mod 5)?

    A quick glance at the table verifies that this is true. In fact,

    FACT: For any two mod 5 numbers aand b, a+b b+a (mod 5).

    You can verify that this fact is true by trying out all cases using the table. Thetruth of this fact is the same as the observation that the table is symmetric aboutthe diagonal line with entries 0, 2, 4, 1, 3. A better way of thinking about it is just toobserve that 4+3 = 7 = 3+4 in usual arithmetic, and so they are still equal when wetake the remainder after dividing by 5. This argument explains the fact in general.

    A similar argument shows thatFACT: For any three mod 5 numbers a, b and c, (a+b) +c a+ (b+c) (mod 5).

    For example, we can verify that

    (3 + 4) + 1 3 + (4 + 1) (mod 5).

    Indeed, from the table 3+4 2 (mod 5), so (3+4)+1 2 + 1 3 (mod 5).On theother hand, from the table, 4 + 1 0 (mod 5), so 3 + (4 + 1) 3 + 0 3 (mod 5).These two facts are useful, because they mean that the common facts we use inaddition are true in modular arithmetic. In essence, everything we are familiar with

    for usual addition works for modular arithmetic as long as it makes sense. In otherwords, unless we add two numbers and get a number that is 5 or larger, everythingworks like before. If we do get a number that is 5 or larger, we just subtract 5, andproceed.

    1.2. Subtraction and negative numbers. In this section, we want to learn toevaluate expressions like:

    4 1 (mod 5) and 2 3 (mod 5)

    For subtraction it is useful to use negative numbers, just as in ordinary arithmetic,where a b= a+ b.

  • 8/12/2019 13150 Unit 11

    3/10

  • 8/12/2019 13150 Unit 11

    4/10

    4

    1.3. Multiplication and powers. The real fun in modular arithmetic will comefrom multiplication. We will multiply using the same idea as from addition, that is,

    MULTIPLICATION RULE FOR MODULAR ARITHMETHIC: To multiply twomod 5 numbers a and b, compute the remainder of when we divide a b by 5. Theresult is written as a b (mod 5).

    For example, 4 4 = 16 in usual arithmetic, and 16 has remainder 1 when divided by5. From this, we get

    4 4 1 (mod 5)

    Similarly, 3 3 4 (mod 5), since 3 3 = 9 in usual arithmetic, and 5 divides 9 oncewith remainder 4.We can build a multiplication table for mod 5 arithmetic:

    MOD 5 MULTIPLICATION TABLE 0 1 2 3 40 0 0 0 0 01 0 1 2 3 42 0 2 4 1 33 0 3 1 4 24 0 4 3 2 1

    For example, since there is a 1 in the 2-row and 3-column, 2 3 1 (mod 5).Note that there are some common features with usual arithmetic:

    1. a

    b

    b

    a (mod 5) so changing the order in multiplication doesnt change theanswer2. a 0 0 (mod 5), so any mod 5 number multiplied by 0 is 03. a 1 a (mod 5), so any mod 5 number multiplied by 1 is itself.

    These properties are easy to see from the table. The first property is the same as thefact that the table does not change when we reflect through the diagonal line with0, 1, 4, 4, 1. The second property is the same as the fact that the zero row containsall zeroes. The third property is the same as the fact that the entries in the one roware just the number of the corresponding column.In addition, there are some additional properties, which are valid whenever a, b andc are mod 5 numbers.

    4. (a b) c a (b c) (mod 5)5. a (b+c) a b+a c (mod 5)

    PROBLEM 1: Verify properties 4. and 5. whena = 2, b = 3, and c = 4 in mod 5arithmetic.

    SOLUTION: Start with property 4. We compute:

    (2 3) 4 1 4 (mod 5) since 2 3 1 (mod 5). But 1 4 4 (mod 5), so (2 3) 4 4(mod 5). On the other hand, 2 (3 4) 2 2 (mod 5) since 3 4 2 (mod 5). But22 4 (mod 5), so 2(34) 4 (mod 5). We have verified property 4. by computingeach side and getting the same answer.

  • 8/12/2019 13150 Unit 11

    5/10

    5

    Now lets verify property 5. We compute:2 (3+4) 2 2 4 (mod 5), where at the first step, we used 3+4 2 (mod 5), and

    at the second step, we used 22 4 (mod 5). On the other hand, 2 3+24 1+3 4(mod 5). In the first step, we used 2 3 1 (mod 5), and in the second step, we used2 4 3 (mod 5).

    These properties 1, 2, 3, 4, and 5 are very useful, because they mean that manip-ulations you are used to using from ordinary multiplication still work in modulararithmetic.We can also compute powers in modular arithmetic. Ifn is a usual number and a ismod 5 number, then

    an a a a a (mod 5), where the dots indicate that we take the product ofnfactors ofa.

    For example, 23 2 2 2 8 3 (mod 5). Meanwhile, 35 243 3 (mod 5). Justin case you dont know that 35 = 243 in usual arithmetic, lets see a calculator-freeway to compute 35 (mod 5).

    35 32 32 3 (4 4) 3 1 3 3 (mod 5). We used the facts that 32 3 3 4(mod 5) and 42 4 4 1 (mod 5).

    In other words, you can simplify computations in modular arithmetic by groupingthem in the right way. Well come back to this later (a lot!!!).

    1.4. What about mod 2, or mod 3, or mod 30? In the earlier sections of thischapter, we did mod 5 arithmetic. What is special about 5? Why cant we doarithmetic mod 2, mod 3, mod 6, or mod 323.The answer is that we can. Weve just been using mod 5 arithmetic as an exampleto investigate. This hopefully gave you some familiarity with the idea.

    RULES FOR ARITHMETIC mod n1. The numbers in mod n arithmetic are 0 , 1, 2, 3, . . . , n 1

    2. Ifa and b are two mod n numbers, we compute the remainder c when we dividea+b byn, and say a+b c (mod n).3. If b is a mod n number, then b n b (mod n) unless b 0 (mod n), and0 0 (mod n).4. Ifaand bare mod n numbers, then a b a+ b (mod n). The mod n numbera b has the property that a b+b a (mod n).5. Ifa and b are two mod n numbers, we compute the remainder d when we dividea bbyn, and say a b d (mod n).

    For example, if we want to arithmetic mod 6, then the mod 6 numbers are 0, 1, 2, 3, 4, 5.We can make mod 6 addition and multiplication tables:

  • 8/12/2019 13150 Unit 11

    6/10

    6

    MOD 6 ADDITION TABLE

    + 0 1 2 3 4 50 0 1 2 3 4 5

    1 1 2 3 4 5 02 2 3 4 5 0 13 3 4 5 0 1 24 4 5 0 1 2 35 5 0 1 2 3 4

    MOD 6 MULTIPLICATION TABLE

    0 1 2 3 4 50 0 0 0 0 0 01 0 1 2 3 4 52 0 2 4 0 2 43 0 3 0 3 0 34 0 4 2 0 4 25 0 5 4 3 2 1

    For example, 3 + 5 2 (mod 6), since 3 + 5 = 8 in usual arithmetic, and 6 divides 8once with remainder 2. This result can be read off from the addition table since theentry in the 3-row and 5-column is 2. Similarly, 3 5 3 (mod 6), since 3 5 = 15 inusual arithmetic, and 6 divides 15 twice with remainder 3. This result can be readoff from the multiplication table since the entry in the 3-row and 5-column is 3.Note that 3 2 0 (mod 6), so a product of two nonzero mod 6 numbers can be 0.This didnt happen mod 5.The following rules are always true for addition and multiplication. These rules are

    familiar and you have used them all the time in ordinary arithmetic. You can usethem for modular arithmetic also.

    ADDITION RULES:1. a+b b+a (mod n), for any mod n numbers aand b.2. (a+b) + c a+ (b+c) (mod n) for any mod n numbers a, b and c.3. a+ 0 a (mod n) for any mod n number a.MULTIPLICATION RULES:1. a b b a (mod n) for any mod n numbers aand b2. a 0 0 (mod n) for any mod n number a.3. a 1 a (mod n) for any mod n number a

    4. (a

    b)

    c

    a

    (b

    c) (mod n) for any mod n numbers a, band c5. a (b+c) a b+a c (mod n) for any mod n numbers a, b, and c.

    Well explain why they are true in the next section. The important thing is that youremember that these facts work just the same in modular arithmetic as in ordinaryarithmetic.

    Lets look at a few additional examples.

    ARITHMETIC mod 2The mod 2 numbers are 0 and 1. The addition and multiplication tables are:

  • 8/12/2019 13150 Unit 11

    7/10

    7

    MOD 2 ADDITION TABLE+ 0 10 0 1

    1 1 0

    MOD 2 MULTIPLICATION TABLE 0 10 0 01 0 1

    For example, 1 + 1 0 (mod 2), since 2 divides 2 with remainder 0.

    ARITHMETIC mod 3The mod 3 numbers are 0, 1,and 2. The addition and multiplication tables are:

    MOD 3 ADDITION TABLE

    + 0 1 20 0 1 2

    1 1 2 02 2 0 1

    MOD 3 MULTIPLICATION TABLE

    0 1 20 0 0 01 0 1 22 0 2 1

    If you are asked to do a computation mod n, you compute the same way we did inthe examples of mod 5 and mod 6 arithmetic.

    PROBLEM: Do the following modular arithmetic calculations.

    1. 14 + 20 (mod 27)2. 12 7 (mod 33)3. 21 25 (mod 31)4. 25 22 (mod 31)5. 7 10 (mod 35).SOLUTION: For the first calculation, note that 14+20 = 34 in usual arithmetic. Since27 divides 34 with remainder 7, 14 + 20 7 (mod 27). For the second calculation,note that 12 7 = 84 in usual arithmetic. Since 33 divides 84 twice with remainder18, 12 7 18 (mod 33). For the third calculation, since 25 6 (mod 31), 21 25 21 + 6 27 (mod 31). For the fourth calculation, 22 9 (mod 31), so25 22 25 + 9 3 (mod 31). For the last calculation, 7 10 = 70 in usual

    arithmetic, and since 35 divides 70 with remainder 0, 7 10 0 (mod 35).

    1.5. Mathematical explorations, or we just took a trip to the moon. Letsstop for a moment and think about what weve just done. Weve created a newnumber system called mod n arithmetic for each number n. Weve explained howto add and multiply in mod n arithmetic. Then weve done some computations inmod n arithmetic, and seen for example, that 14 + 20 7 (mod 27). While modn arithmetic may seem strange, these computations, and the computations you willhave the unbridled joy of doing in the homework, will make you familiar with mod narithmetic.

  • 8/12/2019 13150 Unit 11

    8/10

    8

    You can think of this as analogous to taking a trip to a new city. When you arrivein a new city, life is a little difficult at first. You dont know where anything is, and

    youre always getting lost. However, when you look around for awhile and investigatethings for awhile, you get a better idea of how to find things. In other words, youhave begun to be familiar with the city, or to understand the city.This is analogous to what scientists do when they are studying a problem. Imaginethat you are a chemist and you want to know what happens when you mix twochemicals, like cesium chloride and water. Cesium chloride is a powder you can findin most high school chemistry labs. If you drop a little cesium chloride in a testtubefilled with water, youll see a mild explosion. If you drop a lot of cesium chloride in atesttube filled with water, you may blow up the lab. A chemist interprets this resultby saying that cesium reacts strongly with water. This tells the chemist somethingabout the atomic structure of cesium, and enables chemists to group cesium with otheratoms with similar properties. When the chemist mixes two chemicals together, thisis analogous to what you do when you walk around in a new place. The chemist isgathering information about the chemicals, and you are gathering information aboutthe new place.This is even harder for astronomers, who may be interested in the moon, or a planetlike Jupiter. In principle, an astronomer can travel to the moon and look around(while wearing a space suit) and gather rocks and analyze them. In practice, going tothe moon is a long ordeal, so an astronaut or a robot goes and collects materials andbrings them back for the astronomer to study. This is analogous to the astronomertaking a walk around the moon to get some idea of how things work, which is like

    when you walk around a city and find out where things are located. If the astronomerwants to study Jupiter, things are even harder. If an astronaut went to Jupiter, itwould take years to get there, and the astronaut would not find anything to standon, because Jupiter is composed of highly pressurized gas, and in any event, theastronomer would have been crushed by then because of the high pressure in Jupitersatmosphere. So instead, astronomers study Jupiter by taking pictures and analyzingorbits of its moons, and studying properties of light that comes from Jupiter. Whilethis is indirect, the astronomer is still learning things about Jupiter by taking a lookat it, which is again analogous to walking around a new city to get the lay of theland.Life is considerably easier for mathematicians, in the sense that we dont have to put

    up with funny laboratory smells or risk blowing ourselves up, nor do we have to buildexpensive precision machinery to measure something happending on Jupiter. Themath version of a new world is a new number system. Our version of exploration isto investigate the new number system and try to understand how it works.If you approach modular arithmetic with some spirit of investigation, youll have abetter sense of what is happening.

    EXERCISES:

    (1) Do the following modular arithmetic calculations:(a) 35 + 17 (mod 50)

  • 8/12/2019 13150 Unit 11

    9/10

    9

    (b) 11 13 (mod 36)(c) 11 13 (mod 36)

    (d) 13 10 (mod 36)(e) 12 10 (mod 50)(f) 39 + 11 (mod 50)(g) 10 10 (mod 11)(h) 12 10 (mod 30)(i) 13 5 (mod 60)(j) 54 (mod 11)

    (2) Make an addition and multiplication table for mod 7 arithmetic.(3) Make an addition and multiplication table for mod 8 arithmetic.(4) In this Unit and in the last few problems, youve seen the multiplication tables

    for mod n arithmetic when n = 2, 3, 5, 6, 7, 8. Look at the mod 5 table. Ofcourse, in the zero row and zero column all entries are 0. In every other rowand column, every mod n number occurs exactly once. For which values ofnfrom 2, 3, 5, 6, 7, 8 does every row and column besides the zero row and columncontain every mod n number exactly once?

    For which of these values ofnis it the case that 0 only occurs in the zero rowor the zero column? For which of these values ofnis the case that no numberoccurs more than once in any particular row or column? Make a guess aboutwhich numbers nhave these two properties (i.e., only zeroes in multiplicationtable are in row 0 or column 0, and no number occurs more than once in anyrow or column).

    (5) (a) Is there a mod 7 number x so that 3 x 5 (mod 7)? What is it?(b) Is there a mod 7 number x so that 2 x 6 (mod 7)? How is it related

    to the fraction 6

    2?

    (c) Is there a mod 8 number x so that 3 x 1 (mod 8)?(d) Is there a mod 8 number x so that 6 x 3 (mod 8)?(e) How many mod 8 numbers x are there so that 6 x 2 (mod 8)?

    (6) (a) Compute 30 + 40 (mod 60).(b) Suppose you look at your watch and it is 6:30. 40 minutes later, you look

    at your watch again. How many minutes after 7:00 is it?(c) Compare your answers from Parts (a) and (b).

    (7) (a) Compute 7 35 (mod 60).(b) Suppose at 5 minutes after the start of each hour, a security guard drives

    by a particular ATM (so the security guard comes by at 1:05, 2:05, 3:05,4:05, etc). Suppose also an anally retentive thief robs a customer at theATM at 12:35, and robs another customer every 35 minutes after that, soat 12:35, 1:10, 1:45, etc. When does the security guard drive by exactlywhen the thief is robbing a customer? How many customers has the thiefrobbed by then?

    (c) How are Part (a) and Part (b) related?

  • 8/12/2019 13150 Unit 11

    10/10

    10

    (8) Find two mod 10 numbers x so that 2 x 2 (mod 10) (hint: x= 1 is one ofthe numbers).

    (9) Compute 21 1 7 + 7 17 (mod 27) (hint: you can do this in a second withouta calculator by rewriting the expression using the distribute law).

    (10) (a) Compute 26 (mod 7).(b) Compute 260 (mod 7) (hint: 260 (26)10 (mod 7) using the laws of ex-

    ponents, and this should make the calculation easier).(c) Compute 262 (mod 7) (hint: use laws of exponents so that you can use

    your last calculation).