 Because of our previous video, we've now shown that there's a one-to-one correspondence with cyclic codes and ideals of a cyclic group ring. And so using the natural quotient map, we can map Z2X onto the group ring Z2ZN, because of course we saw earlier that Z2ZN, this is just Z2X where we then mod out by the polynomial X to the N minus one, okay? So this is where our codes are gonna live. We're gonna look at ideals of our group ring. But the group ring is a quotient of a polynomial ring. This polynomial ring Z2X is a Euclidean domain because Z2 is a field. In particular, it's a principal ideal domain. And so every ideal of Z2X is principal. Does that have some consequence on the quotient Z2ZN, the group ring? Absolutely, we see that from this correspondence, the ideals of the group ring Z2ZN are principal ideals which correspond to the ideal, excuse me, they correspond as ideals of the form M of X. So it's principal, it's generated by a polynomial, but we can do one better than that. The kernel of this map, of course, is the principal ideal generated by X to the N minus one. These principal ideals, the ideals of Z2ZN here, they're gonna be principal, yes, and they're going to be, these polynomials M of X have to be the divisors of X to the N minus one. So how these things factor is gonna matter, right? So we look at the factorization of X to the N minus one using binary coefficients. And when we look at those irreducible polynomials, we choose one and that then generates an ideal, that then generates a cyclic code. And so given a cyclic code, it has this unique generator. We call that the minimum, excuse me, the minimal generator polynomial of the cyclic code. Now, why can I say it's unique? Because a principal ideal, it's generators only unique up to association, but in Z2X, the only unit is one. I mean, literally the only unit is one. And so it doesn't have any associates, MX. It is, in fact, unique in that situation. So let me give you an example of how we could then construct a code. So to find a cyclic code, we have to pick an ideal of Z2N, which comes down to picking an irreducible factor. It doesn't even have to be irreducible factor, but we just have to pick a polynomial factor of X to the N minus one for a fixed N. And how you choose that factor, of course, make a difference, right? Because if you choose the factor to be too big or too small, maybe you don't have enough code words, maybe they're too close together. We want them to be sparse. There's some more they'll talk about in the next lecture, of course. But for the sake of example, suppose we are gonna look at the polynomial X to the seven minus one, and we look at this as a binary polynomial. I will leave it as an exercise to the viewer to verify that this is in fact, it's prime factorization over Z2X. Now, the first factor should be pretty obvious because it's X to the seven minus one. We do have the factorization of X minus one times X to the six times X to the fifth plus X to the fourth plus X cubed plus X squared plus X plus one. All right, that one's pretty easy because this works over the rational numbers as well. Nothing special on Z2 there. But I would then leave it up to you, the viewer here to verify the product of those two irreducible cubic polynomials, one plus X cubed and one plus X squared plus X cubed. Their product does in fact equal that. So you can multiply this out and verify it. Clearly, one plus X is irreducible because it is linear. Why are these two cubic polynomials irreducible? That's easy to check as well because it'll be irreducible if and only if it doesn't have a root. Z2 has only two numbers at all, zero and one. And a quick check shows for both of them that neither zero or one are root. So this is in fact an irreducible factorization of X to the seven minus one. So if we wanna create a cyclic code, we have to pick a generator polynomial. And so for the sake of this example, I'm gonna choose my generator polynomial G of X to be one plus X plus X cubed, just because I want, I just picked that one, right? Let me show you then what type of code that gives us, okay? So because we're looking at X to the seven minus one, the encoded messages are going to be seven bits long. Now, because this polynomial is degree three, what that tells you is if I take a four bit message and you time to buy this polynomial because it's degree is three, that'll then create seven bit messages. So that's what we're coming up to here. So using G here, I then have a seven comma seven minus three that is a seven four block code. That is this polynomial code will be a seven four code, okay? Then, and then G of course is gonna be, it's gonna be our encoding map, right? So if we take polynomials in, so we're starting off with four bits, so that means we're gonna look at P three, so we can send over from P three to P seven by multiplying by this polynomial G X, okay? Now, the kernel of the map of multiplying by G X is gonna be this polynomial H of X, where H of X is you take the polynomial X to the seven minus one and you just take away G of X. So just get rid of G and you take everything else. So H is going to be one plus X times one plus X square plus X cubed, which if you multiply that out, you're gonna end up with, whoops, one plus X plus X squared plus X to the fourth like so. So this is gonna be H and this is gonna be G. Notice of course that since H is just X to the seventh minus one over G of X, if you take H of X and you times that by G of X, this is going to give you X to the seven minus one, but in the group ring Z two, Z seven, this is the same thing. Excuse me, Z two, no, yeah, Z two, Z seven, this is the same thing as just zero, right? Cause that's how we mod these things out. H times G is gonna equal zero in that situation cause that this element belongs to the ideal. It generates the ideal. That's what zero means in this situation. And I should have written a P six here earlier. Sorry about that because since G is a cubic polynomial, we start off with three bits. You're gonna add three more to it, the degree here. So you end up with P six. Sorry about that. We reduce mod seven. So that means our polynomials are gonna be a degree at most six. So using the standard basis for P three, which is gonna just gonna be one X, X squared, X cubed and using the standard basis for P six, which is just gonna be one X, X squared, X cubed, X to the fourth, X to the fifth, X to the sixth, et cetera. We can then represent the matrix, that is we can represent multiplication by G using the following matrix right here. Okay? So that is if you multiply one, if you multiply, excuse me, if you multiply one by G, you're gonna end up with this thing right here, right? So you end up with one X, X cubed, like so. If you multiply X by this thing, you're gonna get X, X squared, X to the fourth. It just, it cycles up, of course. If you take X squared and times it by G, you're gonna get X squared, X cubed, X to the fifth. And then lastly, a few times X to the third by G, you'll get X cubed, X to the fourth and X to the sixth, like so. All right, so putting this into coordinates, we get exactly the following generated matrix. So this polynomial, we can identify with this matrix. Multiplication of vectors by this matrix does the exact same thing as multiplication of polynomials by that matrix G, that polynomial G does the exact same thing. Then when we get H, can I get them both on the same screen? Ah-ha. So then the polynomial H, one plus X plus X squared plus X to the fourth is gonna coincide with this matrix right here. And I want you to notice a few things here. Like when we talk about G, I'm gonna slide that thing back up. When you had G, if you looked at the first column, since this first column is supposed to be one times G, you should just see its coefficients. The constant term, the linear term, the quadratic term, the cubic term, the quartic, the quintic, and the hextic, sextic, something like that. Terms right there. So basically the first column is just the coefficients of G. But then the next column is just you cycle down a row. Then you cycle down a row. Then you cycle down a row. And that's how you form G. It's you just take the coefficients of little G and you just cycle through. You're gonna get something very, very similar for H here when you put it into coordinates. I want you to look at the first row right here, right? I want you to take the coefficients of H but list them backwards, okay? So notice you have one, one, one, zero, one, zero, zero. Okay? So when we take our polynomial H, list it backwards, those are the coefficients in the first row. Then the second row is you're just gonna cycle that through, push it to the left. And then you're gonna cycle that again, push it to the left. And that's how you form this matrix H. And I do want you to verify, pause the video if you need to, that the matrix H times the matrix G is equal to the zero matrix. So this, so the image of G is in fact equal to the kernel of H. So the kernel of H is equal to the image of G. And this is our code C, like so. So once you've just picked, just pick a divisor of X to the N minus one, that forms a cyclic code. All cyclic codes are formed in that manner. And we can then construct its generator matrix just by looking at our generator polynomial. And the columns will just be the columns going up to down and they then cycle through, going downward. But then what's also called H, this, the canonical matrix H here, we can also form using the polynomial H right here, for which in this case you read it right to left and then you're gonna cycle down, cycle to the left as you work through on these things. That's how you build cyclic codes. And so I'm then gonna put this theorem on the screen as we end lecture 31 here. That if we have a factorization of X to the N minus one into H and G, right? So let's say the coefficients of H are H naught, H one X, plus H two X squared all the way up to HK X to the K. And G has as its coefficients, it's decomposition G of X equals G zero plus G one X plus G two X squared all the way up to G in minus K times X to the N minus K. Now of course the sum of these exponents does have to add up to the N. So if one of them is K, the other one's N minus K of course. Then the cyclic code generated by G of X has the following generator matrix, which will be N times N minus K. And we're gonna call that G. And then you're gonna have the, then you'll have the K by N parity check matrix H. I call the canonical earlier. This isn't necessarily gonna be the canonical parity check matrix because it doesn't necessarily have the form A augmented identity, but that's okay. This one's pretty awesome too. This is going to be our, this is gonna be a cyclic code we can generate from these polynomials. And the pattern always happens the way I described it here. The first column is just the coefficients of, it's just the coefficients of G in ascending order. I used to start with, you start with the G zero, the G one, then G two all the way up till the end. And you get zeros for this places you don't have anymore. And then each subsequent column, you're gonna shift down. You're gonna shift down all the way through. And you eventually should end with the largest coefficient then on the bottom. That's how you form G. But then with H starting with the top row, you're gonna put this in descending order. So the very, very largest coefficient shows up first, although there is a bunch of zeros. So I actually like to think of it more as going from the right. You have the constant term right here. Then you'll have H one and H two all the way up to HK. That gives you the first row. So again, with G, the first column is the polynomial G and then there's a cyclic shift downward. But with H, the first row is the polynomial H and then you're gonna see this shift downward. Every time you go down a row, it's gonna shift to the left, shift to the left, shift to the left, shift to the left until eventually HK is over here. With the G columns, of course, every time you go down, that is every time you go to the right, it's gonna go down one. And so you have this cyclic behavior and you're gonna get the properties that H times G does equals zero. So this does give you a linear code. And this linear code in fact will be cyclic. And then these two matrices, the generator and parity check matrices are developed from the polynomials G and H so effortlessly. So even if you don't wanna do the group ring stuff, you can turn this code into a matrix just like we did in math 4220, but it'll have this cyclic property because we utilize the algebraic structure of a group ring. And that's pretty awesome. Group rings are the coolest. And that brings us to the end of lecture 31. I appreciate you for watching. If you learned anything about polynomial codes, our group rings in this video, please like these videos, subscribe to the channel to see more videos like this in the future. And if you have any questions whatsoever, when you watch these videos, please post them in the comments. I'll be glad to answer them as soon as I can. Bye everyone.