Transcript for:
Introduction to Modular Arithmetic Concepts

every day we all are doing a model operation without even knowing that we are doing this mod 12 operation shocking no worries let's dive into the topic of today the modular arithmetic part one to know this as usual let's start the session with the outcomes upon the completion of the session the learner will be able to outcome number one we will understand the modular arithmetic operation with examples outcome number two we will understand about congruence and outcome number three we will identify valid and invalid congruence let's dive into the topic of the day modular arithmetic what is this modular arithmetic actually this modular arithmetic is a system of arithmetic for integers we know integers and modular arithmetic is a system of arithmetic for integers when it is going to work on integers obviously we are going to wrap around after reaching a certain value called modulus so we are going to work on a system of arithmetic for integers and what we are going to do we are going to wrap around after reaching a certain value this value is called as a modulite i'll explain this point when we see an example and why we are dealing this modular arithmetic because this modular arithmetic is the central mathematical concept in cryptography the widely used cryptographic algorithms are mainly depending on these modular arithmetic let's understand about this modulus with this example here is a clock we have 24 hours a day do we have 24 numbers representing 24 hearts in our clock definitely no but still we are able to understand that the 24 hour timings with just 12 numbers isn't it let's say if the time is 15 hours it means it is 3 pm right if the time is 20 hours it means it is 8 pm isn't it all right if the time is 23 hours then obviously it is 11 pm isn't it actually what we are doing is a mod 12 operation we wrap around every 12 hours so what we are doing here is a wrap around operation on these integers so here we have only 12 integers represented on the clock and this is a system of arithmetic for integers and what we are doing we are wrapping around after reaching a certain value here in the wall clock example we are wrapping around every 12 hours right so 12 is the modulus here so the modulus value as far as a wall clock is concerned is 12 and when we say 13 hours what we are doing so 1 2 3 4 5 6 7 8 9 10 11 12 and this is 13 right and that's why we are able to find that it is 1 1pm when i say it's 13 hours what we are doing we are just doing a mod 12 operation on 13 so 13 mod 12 when 13 is divided by 12 we get the remainder one i hope things are clear for you now before seeing some examples in order to understand things clearly about modular arithmetic let's see what is congruence actually in cryptography congruence is used which is represented with this symbol instead of equality why equality is not preferred in congruence let's see some examples 15 is congruent to 3 more 12. since we are dealing with mod 12 let's see the wall clock example so the modulus value is 12 as far as the wall clock is concerned isn't it so here also we have mod 12 so when i say 15 what does it mean we did 15 mod 12 right so 15 more 12 is what the remainder is three so what we are doing actually is we are taking this number 15 and we are doing a mod 12 operation so remember this 15 is here and this 12 is the divisor so we are dividing 15 by 12 when it is done 12 1 times 12 and the remainder is 3 so 3 is the answer right that's what we said 15 hours means what it's 3 pm isn't it so 15 is congruent to 3 mod 12. i hope it is understandable let's see one more example 23 is congruent to 11 more 12. how did we get this because we are taking the number 23 and we are dividing 23 by 12 so 12 1 times 12 and the remainder is what 11 so that's the answer for this second equation so remember 23 is congruent to 11 or 12. in other words 23 hearts means 11 pm right let's stop dealing with mod 12 let's take some other numbers let's take 33 is congruent to three more 10 is it valid yes it is valid because 33 when it is divided by 10 10 3 times 30 and the remainder is 3 so this is also a valid concurrence isn't it because always remember when we have this number this is divided by this number and whatever we get as the remainder is this number so this is a colloquial way of explanation but still please understand things in this way for now then 10 is congruent to -2 mod 12. how did we get this let's say 10 is here right we are going to divide 10 by 12 10 it is divided by 12 how many times 12 takes 10 12 0 times 0 and the remainder is what 10 so here we can have 10 also so 10 is congruent to 10 mod 12 is the valid congruence in other words 10 mod 12 can be written as -2 right i hope you can remember this whenever you have a negative number mod then what i told you i asked you to simply add these two numbers isn't it i hope you can recollect this so minus 2 plus 1 is 10 so 10 or minus 2 both are perfect so in this case 10 is congruent to 10 more 12 is also perfect because we are getting the remainder as what 10 or 10 is congruent to minus 2 mod 12 is also perfectly a valid confluence so if we say a is congruent to b mod m what do we mean by this it means a when it is divided by m we get the remainder b right so a when it is divided by m we get the remainder b and we are not worried about this quotient right it may be any times and this can also be written as a is equal to k m plus b why because this a is the product of m and k by adding the remainder b right so a is equal to m into k plus b 15 is equal to 12 into 1 plus 3 right or 23 is equal to 12 into 1 plus 11 it means 12 into 1 is 12 plus 11 which is 23 that's what we got here now a very important question why we are preferring congruence instead of equality let me tell you that see here it need not be the case that it should be always 33 it can be 23 also so 23 is congruent to 3 more 10 right why because 23 when it is divided by 10 we get still 3 as the remainder it can be 23 33 43 53 it can vary but the remainder is still the same isn't it let's take one more example here this is 15 is congruent to 3 mod 1 right is there a necessity that it should be always 15 here no it can be other numbers as well so what could be the other number let's take 27 here 27 congruent to 3 more 12 27 is divided by 12 12 2 times 24 and the remainder is 3 still this is a valid congruence if this 15 is replaced with 27 here in this case we have 10 or even minus 2 both are same according to mathematics minus 2 is a different number 10 is a different number but under modulo 12 minus 2 and 10 are the same and that's why we are going for congruence instead of equality before we complete let's see some valid and invalid congruences the first confluence is 38 is congruent to 2 more 12. 38 when it is divided by 12 12 3 times 36 and the remainder is 2 right is it valid yes it is a valid congruence let's see the second congruence 38 is congruent to 14 mod 12. see here here also we have 38 here also we are going to perform the same module operation but can you see here here i am using 2 but here i am using 14 is it a valid congruence just pause this video for a while and think about this right answer it is a valid congruence you know why because when 38 is divided by 12 12 2 times it is 24 and the remainder is 14. see we are changing the quotient right so here the quotient value is 3 so 12 3's are 36 and the remainder is 2 here we are changing the quotient as 2 12 2s are 24 and the remainder is 14. so this is also a valid concurrence then 5 is congruent to 0 mod 5 that is 5 when it is divided by 5 we get 0 as the remainder so this is also a valid congruence then comes 10 is congruent to 2 6 10 when it is divided by 6 we get 4 as the remainder right so this is not 2 this is 4 right so this is an invalid congruence then 13 is congruent to 3 mod 13 13 when it is divided by 13 we get 0 as the remainder but here we have 3 it is an invalid congruence then comes the next one 2 is congruent to minus 3 mod 5. please pause this video for a while and think about the right answer it is a valid confidence because 2 when it is divided by 5 we get the remainder 2 itself right so it is like 2 mod 5 2 means it can also be written as minus 3 right just add these two minus 3 plus 5 it is plus 2 it is positive 2 right so it can be either positive 2 or minus 3. so this is also a valid congruence and finally minus 8 is congruent to 7 mod 5. i'll give one more congruence minus 3 is congruent to minus 8 mod 5. these two are testing exercise for you i request you to work it out and tell me whether these two are valid or invalid congruences in the comment section and that's it guys i hope now you understood the modular arithmetic with examples we understood about congruence we also identified some valid and invalid congruences i hope you guys enjoyed this presentation and thank you for watching [Music] [Applause] [Music]