 Hello, I am Carline Arceo from the Institute of Mathematics of the University of the Philippines, Dilliman. Thank you for joining me for a discussion of modular systems of numbers. When we talk about mathematics invariably, what first comes to mind are numbers. And when we think about numbers, the primary, the most basic function we have for them is counting. In our discussion today, we will be dealing with whole numbers. So for modular systems of numbers, we first think about the adjective modular. What comes to mind when we talk about a module? A module is each of a set of standardized parts or independent units that can be used to construct a more complex structure. Other sources on online dictionaries would also define it as one of a set of separate parts that can be joined together to form a larger, complete whole. It can also be referred to as a separable, self-contained component of a system. What are familiar modular systems or structures to us? Think about a modular cabinet. It's a premade unit that can stand alone. And then when you bring it on site, you just attach it to the wall of the house or of the building. What is a modular building? A modular building is said to be composed of modules produced off-site, which are put together on-site, reflecting the identical design intent and specifications of a site-built facility, still without compromise and resulting in a complete construction in half the time. A modular design, in general, subdivides a system into smaller parts called the modules that can be independently created and then used in different systems. I think it's a definition of modular design that we can use when we take on the concept of modular systems of numbers. So what is a modular system of numbers? A modular system of numbers would, in parallel, use only a small set of whole numbers. A fixed number is assigned as the modulus. And if we set that modulus to be, say, the whole number k, then the corresponding subset of whole numbers is zero, one, two, three, up to k minus one. That is, we stop at the whole number right before the modulus k. This system is called the mod k system. Now, how are these numbers in the subset related to the modulus? They are the possible remainders when one divides by the module. Indeed, when one divides by the number k, then the only possible remainders would be all the whole numbers smaller than k. So that would be the set zero, one, two, up to k minus one. Now, I'm sure some examples of modular systems of numbers are already familiar to you. For example, if you look at the face of a clock, that's already a modular system from one to 12. The months of the year, you go from the first month to the 12th month, and then you go back to one. Both zodiacs, meaning the western zodiac and the Chinese zodiac, all count by 12. And when you get to the 12th sign, you go back to the first one. You also know how to count by mod seven. What is mod seven in our everyday system? It's exactly the days of the week. Sunday, Monday, all the way up to Saturday, and then back to Sunday again. And no matter how we want to jump to Friday, sorry, we still have to go through Monday, Tuesday, all the way up to Thursday again, then Friday, Saturday, back to Sunday. There's a small modular system you're very familiar with. Those of us stuck in traffic would be familiar with a mod three system, represented by the traffic lights. We go from red to green to yellow, as if we were counting zero, one, two, zero, one, two. And those of us who practice or are enthusiasts of music would know very well that our musical notes start with do, re, mi, then all the way up to la, ti, back to do. So that is another modular system that many, if not all of us, are actually familiar with. How many of you know how to play the game flames? You're familiar with flames, right, where we associate a certain number with f, l, a, m, e, and s. So that if you hit the number one, if you get the number one, then this would represent f, and then you'd look for a meaning for f. If you'd get the number two, then it would be l, and so on, so that when you get to the number six, you assign the letter s, or the relation that s represents, and when you go to seven, eight, nine, then correspondingly, you'd go back to f, l, and a. And then when you accidentally bite your tongue, what do you usually do? Don't you look to your left or to your right? You look at a seatmate and immediately ask for a number. Why do you ask for that number? Because that number, you will match with a letter in the alphabet, and then you will match it to a certain person with that name, whose name starts with that letter, and then think, oh, he or she is thinking of me. And if you do that assignment of a number to a letter, how many letters are there? There are 26 letters that we use so that you are actually already doing modular counting according to the modulus 26. So you see those are at least five examples of modular systems that you're already familiar with. So how do we count again, whether it's modular five, six, seven, or 26? It's actually a wrapping or a turning around or a going back to the start once the modulus is reached. So how do we perform modular arithmetic with these numbers? It's a usual arithmetic, usual addition, usual multiplication, but with the added step of getting the remainder upon dividing by the modulus. Remember, the module is made up of the remainders 0, 1, 2 up to k minus 1, which one gets when you divide by the modulus k. And take note, that small module 0, 1, 2 up to k minus 1 can actually cover the entire set of whole numbers. So you can think of the set 0, 1, 2, k minus 1 as the module through which one can complete the whole numbers. How is this done? Let's talk about mod 5. The mod 5 system is composed of the numbers 0, 1, 2, 3, and 4. 0, 1, 2, 3, and 4 are the possible remainders when you divide by 5. And this set completes the set of whole numbers as follows. 0 will represent all whole numbers which yield the remainder of 0 upon division by 5. So what are those numbers? 0 would represent 5, 10, 15, 20, and so on, all the multiples of 5. How about the number 1? 1, therefore, is going to represent all whole numbers which will yield the remainder of 1 upon division by 5. So that would be the whole numbers 6, 11, 16, 21, and so on. How about the number 2? Then similarly, these would be the numbers which yield remainder 2 upon division by 5. So we'll start with 7, 12, 17, and so on. 3 will represent in the same manner, 8, 13, 18, and so on. 4 will represent the set 9, 14, 19, 24, and so on. And then we don't go to 5, right? We go back to 0 and the multiples of 5, which again give you a remainder of 0 upon division by 5. So that's how the set 0 up to 4. That's very small, 5 symbols only. That's how that small set actually completes the set of whole numbers. And how do we do the arithmetic on them? It's a closed set so that if you do addition and multiplication, the result should still belong to that set. So if I'm going to add, let's say, 3 and 4, 3 plus 4 usually is 7. But remember, in modular arithmetic, we need an additional step. And that step is dividing by the modulus and getting the remainder. So 3 plus 4 is 7. But 7 does not belong to 0, 1, 2, 3, 4. 7 must therefore be in final form 1 of 0, 1, 2, 3, and 4. And we get that by dividing 7 by 5 and getting the remainder. So 7 divided by 5 gives a remainder of 2. So the simple addition 3 plus 4, which usually gives us 7, in mod 5 would give us 2. 3 plus 4 is 7, which is equivalent to 2 in mod 5. If we do a multiplication, let's say 3 times 3. 3 times 3 usually is 9. But 9 does not belong to the mod 5 system. 9 is represented by which number? You remember? 9 is represented by 4. Because in mod 5, when you divide 9 by 5, you get 4. So 3 plus 4 is 2 in mod 5. 3 times 3 is 4 in mod 5. That's how we perform modular arithmetic. You do the same for mod 6 or mod 10 or mod 12. Let's take as an example mod 12. Our day is divided into 24 hours of which we have the first 12 in the morning in the AM and the next 12 in the PM. If we schedule shifts or, for example, take medicine, we have to know how to count our hours. Let's say your shift starts at 8 AM and you're going to work for 8 straight hours before the next shift comes on. What time will the next shift come on? This is modular counting mod 12. Because when you count 8 plus 8 hours, we don't say 16, right? We don't say the next person will come on at 16 PM. But instead, when we count 8 hours, it's 8, 9, 10, 11, 12, and then back to 1 when we start the PM. So we know that the next shift will start at 4 PM. That is already an example, an immediate example, of knowing how to count in mod 12. If you're supposed to take your medicine every 6 hours and you take your first dose at 8 AM, in 6 hours, you don't say the next time I'm going to drink my medicine is 14 PM, right? In mod 12, 14 is equivalent to what? 2. 2 PM in this case. So scheduling shifts and taking our medicines, this is another example where we show that we are familiar with counting in mod 12. Now I will revert back to mod 26. Again, we use mod 26 in a very simple representation of our English alphabet. Because the application I would like to discuss today is in encoding or cryptography. Cryptography literally means hidden writing, the purpose of which is secure communication. For our discussion today, let's just assign numbers to letters of the alphabet. So the most natural assignment would be 1 for the letter A, 2 for the letter B, 3 for the letter C, and so on, until 25 for the letter Y, and then for the letter Z, not 26. But remember, for our modular system, we go to 0 once you divide by 26. So Z is represented by the whole number 0 instead of 26. How do we apply the coding? We start with an encoding formula. An encoding formula is most simply represented by some linear function, let's say Y equals F of X. Of course, eventually, to be able to decode a message, you have to isolate X in that formula, just as if you were getting the inverse of the function or the formula. So think of Y equals, let's say, 3X plus 21. 3X plus 21. And I will choose a letter, for starters, letter A. We attribute to letter A, the representative 1. So if we let X take the value 1 and put it into the formula 3X plus 21, it gives us the Y value 24. And then we assign again, we go to the letter corresponding to 24, which is the letter X. What does that mean for us? That means every time we want to write something using the letter A, we will replace the letter A with the letter X. Maybe another example will help. How about the letter C? The letter C is the third letter in the alphabet. Therefore, if we assign X to be 3 for the letter C and put it into the formula 3X plus 21, that will yield 3 times 3 plus 21 or 30. But 30 in Mod 26 is 30 divided by 26. The remainder is 4. So the Y value corresponding to the letter C is 4. And that would correspond to the letter D. So every time we want to write the word using the letter C, it will now be replaced with the letter D. So you can do the same for all the other letters. So for example, if you want to write the word race in code using the encoding formula Y equals 3X plus 21, you will end up writing in secret R-A-C-E using the letters W, X, D, and J. Of course, for proper communication, the receiver has to know how to decode the secret message. If the message is encoded using Y equals 3X plus 21, then we just do our usual algebra to isolate X. And using Mod 26, you can check this as well, the decoding formula you will arrive at should be X equals 9Y plus 19. So if you receive a message in code, for example, I used R-A-C-E earlier, which was W, X, D, J, or according to our partnering or the correspondence with the numbers, this would be 23, 24, 4, and 10. If you take these four numbers and plug them in as Y values, you should retrieve, if your algebra is correct, you should retrieve 18, 1, 3, and 5, and the corresponding letters would be R, A, C, and E. So you get back correctly the message race. So how are we so far? I hope everything is clear. You might be ready for an example. I'll give you, decode the letters D, N, N, and E, just a four-letter word, D, N, N, E. Maybe you'd want to pause this video for three to five minutes and try solving it first. So how was it? Were you able to decode D, N, and E? What was the feeling after you decoded it? Let's see if your answer is correct. The answer, the decoded word, D, N, N, E, should come out to be the word cool, C-O-O-L. And I hope that was your reaction once you were able to decode properly. Isn't it cool to be able to encode and decode? Now for more sophisticated codes, do you need a modular system bigger than mod 26? Do you think that to be able to make more things happen, more complicated stuff, security and such, that you need symbols more than 26? No. On the contrary, you need a much smaller mod system. You have any guess what that modular system is? The more complicated the system or the intended representation, here's how the logic goes. The simpler should be your choice and number of symbols so that they are just repeated in what we will call strings. That modular system will contain only, I hope you guessed right, two symbols. It's a binary or Boolean system which involves only 0 and 1. Therefore, for very complicated encoding or cryptography, don't be surprised, all you'll need are the two symbols 0 or 1 or the mod 2 system. It actually provides the clearest logic because 0 or 1, you just have a binary choice, just two decisions to make, open or closed, on or off, true or false, in color, black or white, right? For example, you see very often black and white codes. The product codes you see in the grocery, those columns which are black and white, those are strings actually of 0s and 1s. In two dimensions, you have the quick response codes. You also have strings of 0s and 1s to make possible your personal identification numbers. When you send messages, when you send photographs in real time, this is all made possible by strings of 0s and 1s. And the reason you are able to download this video and watch it in high resolution is, you guessed right, due to strings of 0s and 1s. In other words, the reason you are able to download this video and watch it in high resolution is due to a modular system. Thank you for listening.