 Welcome back, we are talking about arithmetic in this set of residue classes modulo any given integer n, actually a natural number n. And we saw that this arithmetic means that we can add 2 classes that will give us a class, we can multiply 2 classes that will again give us a class residue class modulo n. In the last lecture towards the end, I made some noise about these operations being well-defined. So, why it is so much important? Let us go and see what we have done in the end that whenever we have a congruence modulo n, addition, subtraction and product is going to preserve the congruence. And therefore, I said that we have addition as well as subtraction and multiplication on the set of residue classes. And indeed in the last lecture I asked and answered this question that this addition and multiplication is a well-defined operation. So, what does one mean by this? So, let us go through these 2 operations one by one and to really understand the concept of well-definedness properly, we will also see an example of an operation where the well-definedness does not hold. So, let us go to the very first property, we have we are asking whether this addition is it well-defined? Answer is that yes it is, but how do we check this? So, what it means is that if you have the class of A to be equal to class of C and the class of B is equal to class of D. If these 2 hold then we must have that the class of A plus B is the same as the class of C plus B because you know I told you that I may look at the class of A as given by the element A and the class of B as given by the element B. We are defining the summation of these 2 classes and we are picking up one single element from the class as we saw in the last lecture that the class really has infinitely many elements. So, we have infinitely many choices and if we are taking 2 classes then we have doubly infinitely many choices which is again just an infinite number of choices. And then we say that the sum of these 2 classes is the class of A plus B. So, here we are making a choice, we are choosing the element A from the class A and we are choosing the element B take the sum and then take the corresponding class. So, to make sure that this is well defined or that it does not depend on the choices that we have made, we have to ensure that if someone else chooses a different element in the class. So, if class A is class C then the other person may actually choose the element to be C and if class B is class D then the other element may other person may choose the element D and then the summation for the other person will be the class of C plus D. For me it is A plus B and its class for the other person it may be the class of C plus D and to have the mathematics well defined to have no confusion at all these 2 classes the class of A plus B and the class of C plus D should be the same. Only then we say that the addition makes sense, only then do we say that the addition is well defined it does not depend on the person does not depend on the place we are taking addition the date time etc. So how do we ensure that this holds so first of all because class A is class C we have that A is congruent to C mod n this is something which is given to us and we have that B is congruent to D mod n. But then we have seen that whenever A is congruent to C mod n B is congruent to D mod n we get A plus B is congruent to C plus D mod n that is all that we needed to check because A plus C mod n and C plus D mod n are same and that means that these 2 classes happen to be the same class. So the addition is well defined let us go over to the next slide to check whether the multiplication is well defined. So indeed multiplication is also well defined and for that we need to check the same thing. So if the class of A is the class of C the class of B is the class of D then we must have class AB to be equal to the class CD this is what we should have to have the product to be well defined because once again someone may say that C is my element in the first class which is the class of A and D is my element in the class of B and then for that person the multiplication will be the multiplication of C and D and then taking its class and to have these 2 multiplications to give you the same class we should have that AB and CD give you the same class but this is again a simple checking. So since A is congruent to C mod n and B is congruent to D mod n we do have that AB is congruent to CD mod n. This was also one of the initial problems which I had given you and I had also invited you to think about and since we have the AB and CD congruent to each other mod n we have that these 2 classes are indeed the same. So we have that the addition is well defined we have that the product is well defined once you have product you can take powers. So we can talk about power of an element in the set of residue classes. So we have the we will start with one residue class and we define the power of that class. So our definition is as follows we start so left hand side we have a residue class and we are taking a power of that which should again be a residue class because we want to have the arithmetic within the set of residue classes to have an arithmetic does not mean that you are allowed to go out. So here we want to give the definition of the power of the residue class A and we say that this our definition is that this is same as the class of A power B is this well defined. So of course here we have to check something very simple we need to check that if the class A is the class C then we must have the class of A power B to be equal to the class of C power B this is all that we need to check and is this true so this is clearly true. So since A is congruent to C mod n I will consider this congruence A B many times take the product of left hand side elements which are all A A A the product taken B times so I get A power B and the element on the right side of the congruence is C C C B times taking the product will give you C power B. So we get A power B is congruent to C power B mod n and this is all that we wanted because once we have A power B congruent to C power B mod n we get that these two classes are the same. So just like from multiplication we went to power similarly from addition we can go to taking multiples but that is a very basic case of the multiplication. So let me just write it here for you similarly K times the class of A is the class of K. So these were the three or if you consider the last operation we had four operations which are well defined on the set of residue classes. Now I want to give you an example of a operation which is not well defined. So here the operation is given we want to define power of a residue class by another residue class. We want to define power of the class A by the class B so look at that the B in the slides has the square brackets given in red to tell you that we are looking at the power of a residue class by another residue class this is what we are doing and we have no choice but to define it in this way because this is the most natural way to define it. Or let us say that our example is that if we define it in this way the class of A power class of B to be equal to class of A power B then this operation or this definition that we are giving is not well defined it does not make sense. So why does it not make sense? Let us look at why this does not hold. So what I am saying is that if you have a class of some element A to be equal to the class of an element C and the class of B is the class of D then it is not necessary that the class of A power B is equal to the class of C power D. This is really the problem. So to say that it is not necessary that this happens we need to just give an example where this does not happen. So we consider the example where n is 3 let us say let us take A equal to 2 and I will take B equal to 1. Now modulo 3 the class of 1 is the class of 4 because 1 is congruent to 4 modulo 3 and now if I want to take the power of this we want to know whether these 2 are the same. This is class of 2 power 1 which is class of 2 and this on the other hand is class of 2 power 4. 2 power 4 is 2 into 2 into 2 into 2 which is 4 square which is 16 and since your n is 3 class of 16 is class of 1. But class of 2 is not equal to the class of 1 modulo 3 these are not same. So we get that these 2 are also not same. The class of 2 power class 1 and the class of 2 power class 4 these by the definition that we have made here are not the same. So indeed we will have to think about and ensure that the operations that we define. So what we have done here is that we have defined operations where our elements where some sets remember the classes the residue classes modulo n are themselves sets and we want to talk about what it means to sum 2 sets modulo n and we said that the sum of 2 sets is given to be yet another set where the set is obtained by choosing 2 elements from these 2 sets taking their sum in the integers and then looking at the corresponding class. This is how we had defined similarly we defined for the product. Thankfully these 2 operations are well defined and therefore we have a nice arithmetic on the set of residue classes modulo n. So we have done a bit of theory until now it is time to get our hands dirty and do some problems. So I am going to give some examples I will give you a minute or two to think about them and we will solve them together after that. So very first problem it is a simple problem compute 13 square modulo 5. So we are working in the arithmetic of congruence classes residue classes modulo 5. 13 will give its own class I want you to compute the class which is the square of the class of 13 your minute starts now. So since your time is up let us compute these things together. So we have first of all 13 is congruent to 3 modulo 5. Therefore if I wanted to compute the square of 13 this would be same as computing the square of 3. Of course many of you would know what is the square of 13 right away but if you do not know B at E is because we are doing the arithmetic modulo 5 and therefore it is enough to compute the square of 3 which is 9. So you may say that the square of 13 modulo 5 is 9 that would also be okay but since we are looking at the residue classes we will look at elements which are between 0 and 5. So we are going to look at only the 5 elements 0, 1, 2, 3, 4 and among these 5 elements 9 is congruent to 4 mod 5. So our answer is quite easy. So let us go and do some more problems. Second problem is slightly difficult it says compute 15 into 59 modulo 75. So now earlier we had the arithmetic modulo 5 we had only 5 numbers 0, 1, 2, 3, 4 and we wanted to take square of one of those and again get the answer to be equal to one of those. Here we have 75 elements. So here we have to be slightly careful about taking this product. Do not use calculator, calculator is not going to be needed for this competition. So your minute starts again at this moment okay. So let us do this problem together. There are two things that I would do to solve this problem. 15 into 59 is actually 3 into 5 into 59 because 15 is nothing but 3 into 5. So the product 15 into 59 is same as 3 into 5 into 59 and further we note that 59 is congruent to a smaller number modulo 75. If you add 16 to 59 that is adding 1 first and then adding 15. So you will be adding 15 to 60 you will get 75. So as much as long as the arithmetic is happening modulo 75 we can replace 59 by minus 16 that makes our problem much simpler. So I will first of all write 15 as 3 into 5 and then I replace minus then I will replace the 59 by minus 16. Now this is simpler because this is 3 into minus 80 75 16 into 5 is 80 and we have to keep that minus sign but 80 is same as 5 mod 75. So this is nothing but 3 into minus 5 which gives you minus 15 mod 75. So answer is minus 15 or 60. So the answer that we obtain in this case is that 15 into 59 modulo 75 is 60. So this was a slightly involved computation but because we had 59 we could replace it by minus 16 and then do out the calculation by also observing that 15 is product of two smaller elements. So there are two things that we can do here which is that once you have one number into another number you can write one of the numbers as product of smaller numbers and do the product in steps or if you have a number which is bigger than n by 2 here 59 was bigger than 75 by 2. So we could replace it by a negative of a smaller number. These are the two things which we can do when we are doing arithmetic modulo on natural number n. This is why this arithmetic is simpler compared to the usual arithmetic which we do inside n q r which is the real numbers or complex numbers. Let us go on and do one more thing after doing summation product. The very next natural thing is division. So I want you to tell me what is 25 divided by 16 modulo 79. Observe that I am asking you to divide by 16 mod 79. The GCD the greatest common divisor of 16 and 79 is 1. In fact 16 is 2 power 4. So the only prime that will divide 16 is 2 and 2 does not divide 79. So there is no prime which will divide both of them and therefore the GCD has to be 1. Of course you may also say that 79 is itself a prime. So your minute starts now. So let us do this computation. We want to know what is 25 divided by 16 modulo 79. So we want to understand this but it will be useful to note the following thing. Just like we had replaced the earlier 59 by negative of 16 to have a simpler thing here we have a division which is a somewhat difficult operation and so we would like to replace this division by multiplication by another number. So what is that another number? Note that 16 into 5 is 80 and this is congruent to 1 mod 79. So 1 upon 16 is congruent to 5 mod 79. That makes our job quite simple because we then have 25 by 16. This is congruent to 25 into 5 modulo 79 and this is equal to 125 and then you just need to go modulo 79 and find once you remove 80 from this 125 you get 45 and to remove 79 you have to remove one more. So we get that this is equal to 46. So our answer is this 25 divided by 16 is 46 mod 79. Let us go and do one more problem compute 3 power 8 modulo 13. So your minute starts now. So let me do this problem as well. Let us compute all powers of 3. So we know that 3 square is congruent to 9 modulo 13. Therefore 3 power 4 is going to be congruent to 9 square modulo 13. 9 square is 81 and 81 is we need to remove multiples of 13. 13 into 6 is 78 and once we remove 78 we get that this is congruent to 3 modulo 13 and hence 3 power 8 which is the square of 3 power 4 is same as 3 square modulo 9 modulo 13. So our answer is that the class of 3 power 8 modulo 13 the residue class modulo 13 of the element 3 its 8th power is the residue class of 9. We will see some more interesting problems in the next lecture. What we have to do is to keep in mind that the moment we do addition, subtraction, multiplication or taking powers we have to remove the multiples of n and work with the smaller number. We are actually only working with elements 0, 1, 2, 3 up to n minus 1. Have this with you and see you next time. Thank you.