 Today we're going to look at a very interesting group. It's the integers mod in. Don't run away. I'm going to make it very simple I'm going to oversimplify it. You're going to actually be bored when you see how simple this is the integers Integers mod in under certain circumstances the integers mod in and the addition We're going to show that that is indeed a group what I want to start you off with it's just a very Basic reminder of your days at school, and that's how to do division and I'm going to start off very easy I'm going to say 4 divided by 4 and What I'm really interested in here is what the remainder is If I do that what is 4 divided by 4 well 4 goes into 4 exactly once and 1 times 4 is 4 and there's remainder of 0 why Because you write it like this 1 times 4 plus 0. That's our remainder. That's 4 plus 0 is 4 What if I were to divide 5 by 4 well That's still going to be 1 times 4, but I have a remainder of 1 because 1 times 4 is 4 plus 1 equals 5 So here I had a remainder of 0 here I have a remainder of 1 but about 6 divided by 4 well that's going to have a remainder of 2 7 divided by 4 is going to have a remainder of 3 8 divided by 4 is going to jump to 0 again So it seems that there's going to be this little repetition. So that's very easy What about these those these fractions 3 divided by 4? Well, what we do there is we say it's 0 times 4 plus a remainder of 3 0 times 4 so 3 divided by 4 is 0 with a remainder of 3 So 0 plus 3 and that indeed is the 3 that I'm looking for so the remainder here is 3 2 divided by 4 we know it's a half, but it's actually 0 times 4 with a remainder of 2 0 plus 2 that's 2 so our remainder here is 2 1 over 4 we have a remainder of 1 0 divided by 4 is 0 times 4 plus a remainder of 0 That equals 0 so a remainder here 0 so it seems we do have the 0 1 2 3 0 1 2 3 0 1 2 3 it seems like these are these are the only four Reminders I'm going to have when I divide by 4 now. Let's just get to the difficult one So that was very basic. What about the negative one? What would be the remainder there? Well, if I look at it it seems to be that the remainder has got to be 3 because I'm going 3 2 1 0 3 2 1 0 It better be a 3 on this side and indeed it is because what we have here we overshoot to the left-hand side So it's minus 1 times 4 that gives me minus 4, but I need to get to minus 1 so I better add 3 So if I divide negative 1 by 4 minus 1 divided by 4 the remainder is 3 because it goes into 4 goes into negative 1 minus 1 time and there's a remainder of 3 minus 2 We would know it is negative a half, but it's actually negative 1 times 4 It goes into that a negative one time So I'm overshooting to negative 4, but to get back to negative 2 I have to add another 2 that's going to give me my negative 3 that I'm looking for that's going to Make my negative 2 that I'm looking for negative 3 divided by 4 Well, that's still negative 1 times 4 plus my remainder is now 1 to get to negative 3 So my remainder here is going to be 2 my remainder here is going to be 1 and Negative 4 divided by 4 as you imagine my remainder there is 0 So that is very simply how to look at the remainder Remember here that it is 0 times for these and Yeah, I overshoot to the left-hand side and I have to add because my remainders must always be positive So that's the first part Let's clean the board and move on to the second part in our journey into the integers mod n So the board is clean what I've left on the board for you is the Remainders remember that I would get to the 3 here because it would be 4 Times a negative it would be 4 times negative 3 that's negative 12 And I had to add a positive 3 to get to negative 9 The next thing I want to talk about is relations. Remember relations if you don't I'll link to it in the top corner There you can click on that to watch the video on remainders on relations I should say so I'm going to have a few things I'm going to have a set s and I'm going to let that set equals the set of all integers I'm going to choose an n and that's going to be an element of the integers Minus zero I don't want zero because I'm trying to divide by and I can't divide by zero So I'm going to choose an n there to divide all my integers and then I'm going to have this relation r members sometimes related like that and my Relation is going to be the following n divides a minus b for all a comma b elements of The integers or elements of my set s Now what does this in divides mean? It means you Divide by in and there's a remainder of zero then it does divide. So if I have four Divides 12 that is indeed correct before because 12 divided by 4 is 3 with a remainder of zero So 4 does indeed Divide 12 4 does not divide 11 So you can't write that and a minus b is just something like I have 12 minus 8 and That is 4 Divide 4 which is just 4 divide before and that's just one with the remainder the remainder is important Our remainder here is zero So that would be my a and that would be my b that's what it means So in so in divides a minus b for all that that this this room this means I Should actually write this as well a minus b For all a for all a so let's just let's just correct it Let's just make that very clear that it's a minus b that we have there So a divides aim in divides a minus b there's your example there So this is my relation that I'm interested in Now remember that we had three properties and if those three properties held for my relation It is going to be a very special kind of relation. Remember that the first one was the reflexive property Let's quickly look at that reflexive and that would state the following if this is reflexive what we would have is that n divides a minus a for all a elements of My set s or in this instance the integers and is that true? Well a minus a for all a is zero and n does indeed Divide zero because zero divided by one is zero zero divided by two remember my n is any integer except zero So zero divided by a million is still zero with the remainder of zero So it does divide zero so we do have that our relation here that we set up Our relation that we set up does divide a minus a for all a elements of s So it is reflexive is it symmetric is it symmetric the symmetric property is going to say that n divides a minus b Implies that n also divides b minus a Is that true and it's actually got to be true both ways Well is that so remember though that a minus b that's just equal to minus B minus a that's exactly the same thing and it's not a proof But think of it if four divides eight it's also going to divide negative eight The remainder is going to be zero in both in both instances But let's say that as far as if you do want to get to approve. Let's say that a minus b equals let's say Some are and that are can be written as in times p if in does divide that it is a multiple of in Can you see that if in divides are so if I could write this in divides are and are is can then be written as in Divides p. So if a four divides eight it is going to divide two times Four so let's do that before divides eight eight can be written as four by four times two and You can see that so eight in this instance is going to be my are and This is going to be my NP there and are equals NP and if I can if I can write If anything is a multiple of four, of course, it is going to divide for is going to divide any multiple of four Four times three four times four four times five four times six four times zero four times negative two It is always going to divide it is always going to divide that and if this this is equal to negative is equal to the negative of B minus a or let's put it this way. Let's write it in a different way That what we wanted to say here if we if we do this then this is going to be negative are So this is going to be in times negative p So for instance, that was before divides four times negative two So we have that it divides both of them the p and the negative p because both of them will be multiples of four in that instance So that does go both ways. There is this symmetric property involved here So we do have that this is it is reflexive. It is symmetric. Let's look to see if it's transitive Now think about it this way if four divides if four divides eight and four divides Four four is definitely going to divide eight plus four and this eight might have been Twelve minus four and that might have been eight minus four so I Have or let's say Well, that's not the proper example, but I really want to show you let's do it this way if n divides a minus b It implies that and let's do and in divides B minus c that implies that n divides a Minus c Now, let's think about it this way. That's the example that I have here. So let's make let's do those Let's make that 12 minus minus eight and eight minus four So that's my a and my b. That's my b and that's my c So what about if I add those two together? Of course, you see that these are going to cancel and 12 minus four is going to give me eight and four and D Does divide eight so you can see so you can see where this is going that if I have those two and I add them This means this occurs because what I have there is a minus b plus b minus c those two cancel And it's a minus and it's a minus c We can also look at it in a different way Well, let me clean the board and I'll show you So let me show you that with a clean board now What I'm saying is n divides p times n and n divides q times n If it does do this if it does do this This is just a minus b and this one is b minus c I can write them both as that because remember if it does divide it is a multiple of n now if I add These two up together with each other. So that's going to be p n plus q n I'm going to take an n out and that is p plus q So that was my And that was q so imagine this a minus b as p b minus c is q It is going to be a multiple of in I am going to have this multiple of in so if I add those I take n out And indeed in is going to divide those two So we do have the transitive property as well And if we do have a relation that has the reflex of property the symmetric property and the transitive property It is going to divide our set here. It is going to divide our set And we are going to have this this is called an equivalence relation remember Equivalence relation and we're going to have these equivalence classes equivalence classes and If I do have these equivalence classes, they are going to have an intersection, which is the empty set and Now just look at this very beautifully here if I look at the integers mod 4 Because I'm dividing by 4. I do seem to have these equivalence classes. Let's write them out That was my relation I've done exactly that let me show you that this is indeed an equivalence class The first one is going to be zero my first equivalence class Remember that's how some text books write it some have a line underneath and let's see everything that has a remainder of zero We start there say with Minus 12 minus 8 minus 4 0 4 8 12 Etc. And all of those have a remainder of zero Let's have a look at the ones that have a remainder of one and we see them We see them here minus 7. Let's do minus 10 as well. So minus Should that be minus 10 3? 0 3 2 1 minus 7 plus 4 minus 11 minus 11 minus 7 minus 3 1 5 9 13 And if you see if I look at those two they have nothing the intersection would be the empty set Let's look at those with the remainder of 12 With the remainder of 2 I should say a remainder of 2 there is my negative 6 there So we can make it negative 10 minus 6 minus 2 2 6 10 14 and so on and 3 with a remainder of 3 there we go Let's do minus 9 so minus 9 and with another 3 is going to be minus 5 Minus 1 we're gonna have a 3 we're gonna have a 7 we're gonna have an 11 we're gonna have a 15 Etc. So they are my equivalence classes They are going to be equivalence classes because I've shown that this relation It has a reflexive property a symmetric property and a trans transitive property Because look at this if I say 8 minus 4 that gives me 4 and 4 doesn't be divide 4 So my relation holds 9 divide by 5 is 4 14 minus 6 is 8 and 4 does divide 8 11 minus 7 is 4 and 4 divides 4 so any and these any a minus b that I do here It's going to have a remainder of 0. So this Relation is going to hold for all of those for all of those for all of those for all of those So I do have that this does give me Equivalence classes and there you can see the equivalence class and no matter what two values you select in any of these equivalence classes If I subtract two of them, it is going to be divisible by 4 and now these It's the set that I'm interested in when it comes to the integers mod 4 for instance in this So anytime I choose a different integer in just not zero I'm going to get the following the integers that I am going to get the following. So for n equals 4 My new set. Let's call this my set a that is going to be 0 1 The equivalence classes. So in this instance, I'm going to have three up to three So I'm going to have four equivalence classes because n was 4 I'm going to have four equivalence classes and that is these things This is my new set and I'm going to do arithmetic on these four elements And if I do if my if my binary operation say for instance is addition I'm going to look at is the addition. This is my set that only has four elements In this case, if I were divided by 12, I would have 12 elements But let's just stick to these four. Do they form a group under addition? So I've got a set with four elements I want to know are they a group under addition? Let's have a look So the board is clean. Let's carry on. I've got my equivalence classes here 0 1 2 3 such that that relation holds remember I can subtract any two of these And it will be divisible by 4 So I've got my new set S. It only has four elements My binary operation is addition So my group I'm claiming is this group S under the binary operation of addition That is my group. Let's see if this is indeed a group The way that we are going to define addition that's up to us And this is the way that we're going to define addition If I take any one of these, let's call these S sub 1, S sub 2, S sub 3 and S sub 4 Any one of these two And I'm going to define the addition of any two of these Say S i plus S j And i can be equal to j or it cannot be equal to j So I can say S 1 plus S 1, which will be 0 plus 0 I'm going to define that by taking a representative element Of S inside of that And I'm going to take a representative value inside of this So say for instance I have 0 plus 1 How am I going to define that? I'm going to take any one in this equivalence class So maybe I'll take 4 And I'm going to add to that any one in 1 Let's take 1 That is going to equal 5 And 5 is in what equivalence class So our 5 is in equivalence class 1 So I'm going to say 0 plus 1 is 1 I'm only talking about addition of these 4 elements But the way I define addition is by taking a representative element In that equivalence class And adding it to a representative in any other one And let's just do that And we're going to do that through what's called the Cayley's tables So I'm going to have here 0 I'm going to have 1 I'm going to have 2 And I'm going to have 3 And to that I'm going to add 1 I'm going to add 2 3 And 4 Let's have that And let's do this And let's do that So all I'm going to do What have I done? That was very funny 1, 2, and 3 Anyway, there we go It's been a busy day So let's do 0 plus 0 And just keep it easy for yourself 0 plus 0 is 0 And 4 divides into that With the remainder of 0 So this is going to remain I'm not going to put the square brackets around So that remains in 0 Any 2 that I add there 4 plus 8 is 12 And 12 stays in that equivalence class If I take a representative of 1 And add it to 0 So let's take 1 plus 0 There's 1 1 is still in that class So it stays in 1 And you can very quickly see If I add 0 to any of these Or if I add Any of these to 0 That remains in that same class So what we can very quickly see It seems though While it is That 0 is our identity element So we already know That we do have an identity element here Because 0 plus anyone So this one Plus any of the others Or any of the others Plus 0 gives me the identity element Let's take 1 plus 1 So if I take any element in 1 And I add it to 1 So let's just stick to 1 1 plus 1 is 2 And that's in the equivalence class 2 So 1 plus 1 Is going to give me a 2 there Let's do 2 plus 1 So I'm going to take 1 from 2 Let's take 2 Plus 1 is 3 And I seem to end up in equivalence class 3 So I end up in equivalence class So 3 Let's take 3 plus 1 So let's take here 3 Just to keep it simple Plus 1 is 4 And that's in equivalence class 0 So that's in equivalence class 0 Let's take a 1 plus a 2 So let's here be Let's take We're doing 1 plus a 2 So let's take 5 and 6 Well that's 11 And 11 is in class 3 11 is in class 3 Let's take a 2 and a 2 2 and 2 is 4 I jump back to 0 And let's take 3 plus 2 3 plus 2 is 5 I'm just taking Or 7 and 6 is 13 Or 6 and negative 1 is 5 Whatever I do I'll end up in equivalence class 1 Let's take 1 plus 3 1 plus 3 is 4 4 is in equivalence class 0 A 2 plus a 3 So let's take a Anyone here Let's take negative 2 And 3 That gives us 1 And 1 is in equivalence class 1 And let's take a 3 and a 3 again So let's take 3 and 7 is 10 And that's in equivalence class 2 So what do I see here? I see that By the way that I've defined addition On these 4 elements I find the following It is closed under addition Closed under addition No matter what to Closed under addition No, binary operation of addition No matter what to I add What 2 of these I add to each other I still remain inside of one of these So it is closed Now is it associative? You can check on that I'm not going to do a proof of that But check on it Just take some elements And you are definitely going to see That I have if I have si plus sj plus sk And that represents any 3 of these And that is going to equal exactly si plus sj plus sk If I do that So the associative property Is indeed going to hold We've already seen that there is an identity element And that is the 0, 1 Is there an inverse for each and every one An inverse means if I add anyone To anyone I get back to the identity element 0 So 0 is its own inverse Because if I add 0 to 0 I get back to the identity element Let's see if I add anything to 1 If I get to the identity element And it seems there is 3 So 3 is the inverse of 1 2 is its own inverse And the inverse of 3 is 1 So every element has its inverse inside of the set Lo and behold I have a group That the integers mod n In this instance it was 4 Under addition does form a group And for those elements under addition I want you to try multiplication So if we were to change this to multiplication Let's do that quickly And we change that to multiplication Is the integers mod 4 Or mod anything then in the end Under multiplication does that form a group 0 times 0 is the 0 That's going to stay in the 0 1 times 0 is 0 That stays in 0 2 times 0 So let's just take 2 times 4 is 8 That stays in 0 You can take any element in 3 Let's take minus 1 and 4 That gives me minus 4 Which is still in 0 And the same goes for here So what I'm very quickly going to see when you go through that Is that you're not going to find an identity element That multiplying by any one of them Maintains itself in that class So just go through that See that you can do it on your own And see which of these properties hold But you are going to see That under multiplication these are not a group Under addition integers mod n form a beautiful group