 Welcome back to our lecture series math 4230 abstract Algebra 2 for students at Southern Utah University. As usual, I'll be your professor today, Dr. Hansh missile nine. In lecture 31, we are going to talk about the idea of a polynomial code. We'll define exactly what a polynomial code is in the next video. In this video, we're going to find the related notion of a cyclic code. So imagine we have an N by N linear code. We say that that code is cyclic. If you take a arbitrary code word, so let's say we have the code word a 1, a 2, a 3, all the way up to a N. Of course, these code words we can identify as vectors in the vector space Z2N. So we have N bits of those N bits of course are encoding M bits of information, but there's some check bits that have been inserted, right? Of course. So we say that a code is cyclic if every cyclical permutation of a code word is still a code word. So in particular, if you take the code word a 1, a 2, up to a N, if the cyclic permutation a N, a 1, a 2, a 3, up to a N minus 1, notice what we did here is we took the very last one, we moved it to the front and bumped everyone down. So basically, everyone moves down. A 1 goes to a 2, a 2 goes to a 3. I should be more specific here. A 1 goes to the 2 spot, a 2 goes to the 3 spot, a 3 goes to the 4 spot all the way down. So a N takes over the, a N minus 1 takes over the Nth position and then a N will come to the front and take over the first position. So that's what we mean by a cyclic permutation of a code word. So the code, we say the linear code is cyclic if every code word is cyclically permutable into another code word. Every cyclic permutation of a code word is still a code word. In other words, the cyclic group ZN naturally acts on the set Z2N by this cyclic permutation, right? We can identify ZN very naturally as a subgroup of SN where we're thinking of ZN here is generated by the permutation 1, 2, 3 all the way up to N, like so. And so this N cycle clearly belongs to ZN. The cyclic subgroup generated by that will be isomorphic to ZN. We're making that identification right now, that permutation action. And so we say that a linear code is a cyclic code if it is in fact a ZN set, that is the group ZN acts on the set here. So notice what we've done here is we've reviewed these ideas of algebraic coding theory. These aren't just arbitrary messages. There's algebraic structure to it. We introduced the idea of in math 4230 to be precise. We introduced the idea of a group code and a linear code by adding a group structure to these sets because after all, Z2N has a group structure. But there's not just a group structure with respect to addition. There's not just a vector space structure with regard to skill and multiplication. There's also very naturally a group action on Z2N. So in particular, if you take the whole set Z2N, ZN acts on Z2N by this permutation action. And so if a code is of course a linear code, so it's a subspace, but if it's a subspace for which this cyclic permutation action is closed upon, that is we have a ZN subset, then we call that a cyclic code. So we're looking for those vector spaces of Z2N, which already gives it some algebraic structure. We're looking for vector spaces that have this additional group action to it as well. Because the more algebraic structure you put on these codes, it seems the stronger they become. So consider the following 6 by 3 matrices. We'll call them G1 and G2. G2 is a little invisible right now. We'll scroll down in just a moment. But G3 is this 6 by 3 matrix. This is our generating code. So in particular, since this is a 6 by 3 matrix, what's going to happen is you can times this by a 3 vector. So you have A2, A3 right there, arbitrary 3 vector. And as there are six rows here, it'll turn three vectors into six vectors. And so because our matrix is 6 by 3, our generating matrix is 6 by 3, that tells us this will produce a 6, 3 linear code. And the basic situation is the following. If you take this matrix and you times it by 0, you're going to get 0. Every matrix times 0 gives you 0. If you take, and we don't have to go through all of these here, but if you take like 0, 0, 1 as your vector, you're just going to grab the third column of the matrix. So you're going to get 0, 0, 1 dash to 0, 0, 1. I'm just adding the dashes so that it's easier to read these codes here. Of course, if you times it by 0, 1, 0, you're going to grab the second column here. So 0, 1, 0, 0, 1, 0. If we do this one, I'll give you the first column. This, if you times it by 0, 1, 1, that'll be the sum of the last two columns. So you get 0, 1, 1, 0, 1, 1. You'll notice, of course, that the scheme is much more, much more simple than that. This encoding process is just you take your word and then you repeat it twice. So this is just the double, double the message. You send it twice. 1, 0, 0. We send it as 1, 0, 0, dash 1, 0, 0. 1, 1, 0. You'll be able to be concoated as 1, 1, 0, 1, 1, 0. Okay? So that's what this code is doing. But I want you to be aware that this code is, in fact, a cyclic code. So notice what happens here. If you take the 0 vector, now, because every bit is the exact same, every cyclic permutation of the 0 vector gives you back the 0 vector. This element is fixed by all cyclic permutations. Okay. This is also true for the vector 1, 1, 1, 1. The all 1s vector, all 0 vectors, these will be fixed by all permutations in particular, the cyclic permutations, like so. Now consider this one right here. 001 dashes 001. If we were to permute it cyclically, that is, everyone goes to the right by one step, right? What that's going to do is that's going to turn you into the vector 1, 0, 0, 1, 0, 0, right? Because looking at this vector here, there's just a two 1s. Let's keep track of where they are. This one's going to go to the front, like we see right here. And then this one's going to go to the other side of the dash, which we see here. So this vector, when you permute it once, you get this one. Now, if you permute it again, that's going to produce this vector right here, because this one will go over, this one will go over. That's exactly that vector right there. And then this vector, if we cyclically permuted once, this one goes over, this one goes over, and we get back to where we started here. So there is this three cycle here, I'm going to do this in yellow. We get this one, this one, and this one. These three vectors are an orbit of that cyclic permutation. Now let's consider, notice these were of course, all the vectors of weight two. They had two ones in them. What if we look at the vectors of weight four here, we get 011 dashes 011. Let's pay attention to the zeros this time, where they go. These zeros will go to the left. So this should be in the middle now. Oh, that's exactly this vector right here. You end up with 101101. If we permute the zeros again, this zero go to the right, this zero goes to the right. That produces exactly this one right here. One zero, excuse me, one, one zero, one, one zero. And then of course, if you permute this one more time, you'll go back to where we started with this right here. So these green vectors I've now highlighted represent a cyclic orbit of the Z in action on the Z six action on this set. Then of course, like I said, the zero vector is by itself. The all ones vector is also by itself. And so we see here that in fact, all all eight of these vectors are in fact, cyclically permuted into each other. This does in fact give us a cyclic code. Let's come down to look at a second matrix, look at this one here, G two. This time, your matrix looks like the first column is 111100. Then the next column is 011110. And then lastly, 001111. Do I say the right number ones there? But you'll notice that, you know, when you look at the matrix, you do see some like cyclic behavior, right? Look, you look at these zeros, you kind of cyclically permuted the columns there. So you got a zero here, zero here, do it one more time, you get that. So I mean, like, hey, you look at the matrix, I've cyclically permuted the columns, does that produce a cyclic code? Well, clearly, like I said, the all zeros, the all one vectors, if it's even present, the zero vector definitely will be but the all one vector isn't present in this code. If you look at the all zero vector, it's always fixed. So no big deal there. Let's look at this word right here, this code word, it has a weight of two, it can only cyclically permute into another vector of weight two. Where are they on the list here? Well, if we move the ones over, so you're going to get, if you move the ones over, this one moves to the right, and this one moves over here, so we should have 101000. Okay, so you want a 101, here's a 101, but that's not all zeros. And then you scan, scan, scan, scan, scan. There's no other one who has a 101 in it in the first three bits. So it turns out that this vector right here, cannot be cyclically permuted into another one, it's it's cyclic permutation is not included. So this first code we looked at was in fact, cyclic, this one here is not a cyclic code. Even though like I said, there is some type of like cyclic permutation happening on the columns here, but the resultant code isn't going to work. Okay, now when you look at these codes, I do want you to note sort of the following situation here. When you look at these codes from before, what was the minimum weight of these words? This first one, our minimum weight was two. So that's going to be the minimum distance of this code. Now since two factors of decomposes has one plus one, we see that this code is a one error, one error detection, no level of correction. So it's a very, very simple cyclic code, but it is cyclic with one level of error detection. This one right here, G two, if we look at the minimum, the minimum weight, this one also had a minimum weight of one. So that tells us we're going to have one level of detection, no level of correction on this code. But again, the first one's cyclic, the second one's not. So even though the the minimum distance turned out to be the same, so the level of detection and correction appears to be the same, you can have a code that is cyclic and one that's not. Does that cyclic component add us an extra level here? And the answer is going to be yes. And so while these codes do have very, very low level of detection correction here, let me kind of emphasize why you might be interested in a cyclic code in the first place. Because when you have errors, it's not like it happens randomly. It happens chaotically, which is not the same thing. Chaos wall may be difficult to predict. It's not truly random. There is a reason behind it. Like if we have two, two communication devices that are trying to connect with one another, and this one sends a message to the other one. Well, if there's an error, there's some type of noise in that happens, maybe some type of like electrical burst in the system affected the transmission, that burst happened at a moment. And so the bits that were sent during the burst are the ones that are likely going to be affected. And so I guess what I'm trying to say here is that if a message has errors, the errors are typically going to be clustered together. It's not like they are truly randomly distributed out equally, equally likely. The distribution of errors is probably not equally likely as we predicted before, they're probably close together. And so if you found one error, those elements next to it have a much higher probability of being erroneous as opposed to ones that are farther away from it. And so one of the advantage of a cyclic permutation is that if you have like a transposition that is like a two, two bits next to each other got switched around, or if there's a cluster of errors together, the cyclic code has a better opportunity of detecting that and correcting that as opposed to just an arbitrary linear code, which is having the assumption that all errors are all bits are equally likely to be erroneous, as opposed to the cyclic one that's like, oh, the errors come in clusters likely. And so there is a strength to be in a cyclic code that we will talk about of course later on in this lecture series.