 We are finally ready to define the titular topic of lecture 32 that of a BCH code So let's give that definition here So let's see be a polynomial cyclic code over Zn, right? We think of a cyclic code. These are gonna come from ideals of the group ring Z to N We do call it a polynomial code because we're thinking of our code words as polynomials inside of this group ring here and Suppose that D is equal to the number 2r plus 1 for some for some number r here, right? So we're gonna think of D is gonna be our minimal distance of the code and why does r matter here, right? Well, we've seen previously that if your if your distance is D if your D equals 2r plus 1 that means you can correct our many our many Errors so that that's the significance here that if D equals 2r plus 1 you have our level of correction of errors inside your code Okay, so we say that C is a BCH code of length in and distance D Where N of course is the size of this cyclic group That's gonna tell you how many entries are in each code So do you have a 5-bit message a 15-bit message? Etc that comes down from the length there. That's the end and then the distance is again the minimum distance there we've seen previously that cyclic codes are Uniquely determined by a single minimal generating polynomial which gives you the generate It's the it's the generator of the principle ideal that is the code Call that element g of x our generator polynomial Then we say that the code is BCH the cyclic code is BCH if the generator G of x is the minimal polynomial Of the I should say it's the least common multiple of the polynomials m1 x times m2 x Times m3 x all the way up to m2 x for which for the sake of this definition Mi x is the minimal polynomial of zeta i Where zeta is a primitive in through to unity over Z2 so these polynomials mi of x are in fact cyclic tonic polynomials So we could call this like phi of of such a thing But of course over finite fields primitive in through it's actually can split from each other And so there actually could be two cyclic tonic polynomials of degree five or degree 15 or something like that And so we'll just use mi here to help us keep track of these things So mi is the minimal polynomial of zeta i where zeta was a primitive in through to unity over Z2 And this is why we say it's the least common multiple because as we've seen The minimal polynomial for right here. So m1 of x. This is the minimal polynomial of zeta Okay, well this polynomial likely has other roots to it like maybe it has zeta squared or zeta to the fourth That means m2 would be the same as m1 and for would be the same thing as m1 So this list will likely have repeats inside of it. We don't want to take the product of all these things We just want to find the least common multiple All right, and that's then when we can we get g we call that a bch code Why bch? Where does the what is the what does the acronym come from? Well, this comes from the mathematicians that first established this coding scheme. Uh, so in 1960 uh, the mathematicians rc boss And um dv ray i'm gonna write it out first Uh chad hurry Uh developed what we now know as a bch code and in 1959, um working independently, uh the mathematician a um hawkinson, whoops, that's a q Hawkinson and I do apologize if those names were not pronounced correctly. Um Developed this idea now hawkinson actually developed it a little bit earlier But in the realm of publishing it can sometimes take a couple years to get a mathematical or scientific article peer reviewed and published And so these these two groups worked independently each other and happened around the same time period So we give credit to both. Um, so while hawkinson actually did beat The other two in this development by a year that's somewhat of an irrelevant detail It's very possible. They could have submitted this paper first I I we could probably look it up if we really cared But nonetheless credit is given to all three of these mathematicians and in proper mathematical tradition when giving accreditation Uh, I should say attribution to mathematicians Typically the names are listed in alphabetical order. Uh, there's not like this ranking of like Who's the top who's the first author the second author because when it comes to mathematical contributions Even a potentially small contribution if it completes a proof is just as valuable as any other ones And so the mathematical community we try to consider all authors equal and therefore Names are listed in alphabetical order. So hence we have b c h right here As the name of this type of code All right, uh, there of course are some deviations to that like the rsa Encryption particle protocol is not in alphabetical order. It should be a rs. But whatever it's just it's just been established at a point But for this one, we got to write bch It's going to be the product of all of these cyclic tonic polynomials. Okay, and so an important result when it comes to Uh, bch code is the following equivalencies So suppose that we have a cyclic code over z n then the following three statements are Equivalent to each other c is a bch code of distance d So that is the same thing as saying that every polynomial f of t inside of our code c Uh, that is it's a code word. It's a code polynomial f of t if and only if Zeta i is a root of f where i ranges from one to d one included inside of that And thirdly, this is equivalent to Um h which is the parity check matrix associated to c here is the associated Vandaman matrix where your first column is all ones your second columns are powers of zeta Then zeta, uh, then you square everything then you cube everything all the way up to z to the end power at the end like there So we have this vandaman matrix, uh, these these three things are all one of the same thing All right, uh, for which why is that? I'm not going to go through all the details of this proof right now I mostly want to focus this video on an actual construction of a bch code So I will leave the details to the viewer here, but I will give you the basic idea of what's going on here So from the definition, we just saw a moment ago, right? um You have a bch code if and only if g is the least common multiple of these cyclic tonic polynomials That's the definition of being a bch code Okay, and the fact that you are your minimum distances at least d where d is this Number right here to r plus one that means we have our polynomials from um one up to m one up to m two r so that guarantees a certain inclusion of cyclic tonic polynomials So if you have a bch code that means m one x is a divisor of g which means that When you take a when you take g of x g of zeta Um is in fact a root. Okay. We also have that since m two is a polynomial divisor of g Z zeta squared is a root m three is are going to be a divisor of g so that means zeta three and this is going to go up to Uh two r which two r is one less than d So we have all of the roots of g are going to range. Well, at least there could be more But we have roots where zeta one through zeta d minus one are all roots of g of x here now every every code Every cyclic code is determined by a principle ideal With a unique generator g so f belongs to the code if and only if f I should say g of t here divides f of t Okay, um, but since g has all of those roots f will have all those roots as well And since g of course is the least common multiple of this thing if f has all of those roots That means that g divides f and that f belongs to this So that we get that a implies b very very quickly and you could also reverse the direction I think pretty pretty quickly as well that If we have this assumption in particular, this is a property of g and g then would have to have all of those roots So g would be the least common multiple of all of these things um And yeah, so we get we get a and b are actually put to each other pretty quickly When it comes to this vandaman matrix right here Be aware that vandaman matrix multiplication is the same thing as polynomial evaluation for which When you look at this thing right here if we took the coefficients of our polynomial f and we put them in here So like the first we have a zero a one all the way up to a n minus one So if we take the coefficient vector associated to the polynomial Then multiplication by the vandaman matrix will give you the evaluation of the polynomial So you end up with f of zeta right here Then you get f of zeta squared all the way down to f of zeta to the two r Which of course is d minus one like so And so if this if if this is a parity check matrix then this product should be zero Which means each of these things is equal to zero For which then all of these are roots for all of the polynomials inside the code So that gives you that c implies b and you can also reverse the direction as well since this thing happens This product is equal to zero so that there and this since this happens for every code in the code word This gives us that this is a parity check matrix So again, I didn't provide all the details of this thing But very naturally we can see that these three things are all equivalent to each other All right, and so we can create linear codes in our usual manner using Parity check matrix h and an generator matrix g This is not the canonical parity check matrix, but nonetheless we can use this vandaman matrix using primitive roots of unity To produce a bch code if we wanted to All right for the most part we're going to probably stick with the polynomials And so in in this video, I want to give us an example of a bch code We're going to construct a bch code over z two using the 15 the 15 roots of the 15th roots of unity Okay, so in order to do that we have to first establish What is the factorization of x to the 15 minus 1 as a polynomial in z two x? Because we have to know what what the cyclotonic polynomials are And that does depend on the field All right, so let's look at z two x and factor x to the 15 minus 1 I claim that the Prime factorization is on the screen right now So we have x plus 1 times x square plus x plus 1 times x to the fourth plus x q plus x square plus x plus 1 Times x to the fourth plus x plus 1 times x to the fourth plus x q plus 1 Okay So one can verify that the product of these Five polynomials does in fact simplify to be x to the 15 minus 1 when you work mod 2 You can pause the video and check that right now if you want to I'm actually going to try to work it backwards and show you where this factorization came from Okay, because when we look at this list, I claim that If you take the polynomial x to the 4 plus x plus 1 the roots of this polynomial are primitive 15 throats of unity The roots of this polynomial are likewise primitive 15 throats of unit 15 throats of unity, but I'm going to focus on this one And so I'm going to take a random root of this polynomial I'm going to call it zeta and that's going to be a primitive 15th root of unity and that's going to be my starting point Therefore, I claim That m1 of x is going to be this polynomial x to the fourth plus x plus 1 And so in order to prove that the roots of this is the roots of this polynomial are primitive 15 throats of unity Then that's actually going to give us the factorization Because if this is in fact a divisor of this which we can check easy enough that it's a divisor Even if you don't want to do all the all of this extended foil on the screen right now You can at least do polynomial division take x to the 15th minus 1 and divided by x to the fourth plus x plus 1 You can verify this is a divisor and as such the roots of this polynomial have to be 15 throats of unity, but why are they primitive? Okay Well, one of the obvious ones is that if you take the polynomial m0 of x this equals to x plus 1 What's m0 here? m0 would be the minimum polynomial of zeta to the zero, which of course is just 1 So we need the primitive first root of unity Which is going to be x plus 1 clearly if you plug in 1 1 plus 1 is 0 mod 2 So 1 is a root of that thing. It's a linear polynomial. That's the only root So this does give us m0 right here. All right, so that's the first one to take care of Now look at the polynomial x cube minus 1 by the usual difference of cubes formula Even over the rational numbers This is going to factor over as x minus 1 times x squared plus x plus 1 But as we're working mod 2 This polynomial x minus 1 is the same thing as x plus 1 And so the roots of the polynomial x cubed minus 1 Which again when you're working mod 2 could be x cubed plus 1 But that's beside the point the roots of this polynomial are going to be third roots of unity This is the first root the first root of unity So then the other two third roots of unity because there should be three total Are going to be the roots of this polynomial Which this polynomial is in fact irreducible. You can check very quickly that zero and one are not roots so this is going to be Our third roots of unity And this is our first roots of unity now be aware here that if you take and this is going to have both third roots of unity The third roots of unity are actually going to be things of the form zeta to the fifth Because notice if you take zeta to the fifth cubed you're going to get zeta to the 15th Which is equal to 1 so the third roots of unity actually are going to be zeta to the fifth And zeta to the tenth so in particular x square plus x plus 1 This polynomial is going to be in five in our classification. Okay now we can also factor We can also factor x to the fifth minus one in the following way You can take the difference of fifth powers there for which you're going to get x minus one And then x to the fourth plus x cube plus x square plus x plus one like so again This translates into x plus one when you're working mod two So this is the first this this is the first cyclic tonic polynomial Which then as there are five fifth roots of unity for for primitive ones, right? They have to all be right here and you can check again. This polynomial is irreducible Why is it irreducible? Well zero doesn't work One doesn't work And so it doesn't have a root it could factor as a product of Irreducible quadratics, but as we discussed previously there's only one irreducible quadratic Over z2 and that is x squared plus x plus one So if it factored it would have to factor as x squared plus x plus one here squared for which is we're working mod two We can use freshman exponentiation. This becomes x to the fourth plus x square plus one Which is not the same thing as this polynomial. It's also not the same thing as these two polynomials as well so For similar reasons these These degree four polynomials are irreducible zero and one are not roots and this factorization is invalid for them So all four of these degree four polynomials are in fact irreducible And so they would have to be then the fifth. This has to be that the this would have to be the fifth cyclic tonic polynomial Because this polynomial It contained its roots have to be fifth roots of unity mod two And there's four primitive ones and that this is degree four minimal polynomial It's got to be that case now be aware that if I take zeta cubed and I raise that to the fifth power This gives you zeta to the 15th. Whoops 15, which is equal to one So the in fact the the fifth the fifth roots of unity are going to look like zeta cubed zeta to the sixth zeta to the ninth and zeta to the 12th like so And so this polynomial right here is my m three Okay, so this is the cyclic this is the cyclic tonic polynomial minimal polynomial for uh for the Root zeta cubed. All right, so then by process of elimination We've taken care of we've taken care of the first thirds and fifth roots of unity. So we're left with eight Uh eight 15th roots of unity. So the roots of these two polynomials have to be the 15th roots of unity All right. Um, and so as such if we choose one arbitrarily I'll say one of the roots of this polynomial is zeta that makes this m one And then What about this one right here? It's going to have some other roots, but how are the eight? How are the eighth? Uh primitive roots distributed, right? You have a zeta. We have a zeta squared We have a zeta to the fourth. We have a let's see We have we did five we did six Uh, so then we have a zeta seven. We have a zeta eight We have a zeta nine was already taken care of 10 was already taken care of so then 11 comes next We did 12. So there's a 13 and then there's a 14 All right, so here are eight Um primitive 15th roots of unity mod two Um, so how are how do we distribute these eight roots amongst these two polynomials? All right, because at this point, um, you if you if you took x to the 15 minus one you factor out these things right here We then get this polynomial. We get some degree eight polynomial. We potentially could factor right here All right, uh, but let me give you another way of how this thing is going to work out So notice, let's see By by a limit we proved previously if you have a polynomial Um, which has zeta as a root then as we're working mod two zeta squared is also a root of that polynomial Now as zeta does not belong to z two This is a different element We so we get zeta zeta squared But then zeta squared squared because two is the characteristic of our of our field right here You're also going to get zeta the fourth is a root and then you square they get zeta to the eighth is a root And then you cycle that back Zeta to the sixteenth since these are 15th roots of unity is going to give me back zeta All right, so this tells us that in fact the four roots of our polynomial So m one Which is equal to x to the fourth plus x plus one This has to factor as x minus zeta Times x minus zeta squared x minus zeta to the fourth Times x minus zeta to the eighth and this is the factorization of course over the splitting field f 16 For for these polynomials here This then tells us that the other polynomial x to the four plus x cube plus one It has to have as as its four roots zeta to the seven zeta to the 11 zeta to 13 And zeta to the 14 so we so in particular this polynomial is m seven I'm just going to write the smallest one in there So this is the cyclic atomic polynomial for zeta to the seventh like so All right, so that's how we get these factorizations here So now we know what the roots of each of these polynomials are supposed to be Uh, so this one just has its root one. This one had zeta five and zeta 10 This one had zeta six. Uh, excuse me zeta three zeta six zeta nine zeta 12 This one had zeta zeta squared zeta fourth zeta eight and this one had the other ones zeta seven zeta 11 zeta 13 and zeta 14 So we know exactly where all the roots belong in this polynomial here So this is gives us our factorization of x to the 15 minus one as a polynomial over z two All right, so in summary, um x plus one is m zero x square plus x plus one is m five x to the fourth through x to the zero is this would be m three x to the fourth plus x plus one is m one and x to the fourth plus x cube plus x one is m seven Now admittedly you could swap the roles of these two polynomials when we make much of a difference whatsoever Uh, but but what have you? Well, we we chose this one right here as our m one So now if we want to create a bch code of length 15 That is where it comes to the factorizations of x to the 15th minus one mod two If we want that to be distance five Okay, distance five means That we need to look we need to construct our polynomial g of x to be the lcm Of we're gonna take m one We're gonna take m two We're gonna take m three And we're gonna take m four That is we stop one short of our d five right here So five minus one is four So we're gonna take the least common multiple of these Of these four polynomials, but notice here that m one, which is this one It has zeta one as a root it also has zeta two as a root It also has zeta four as a root it also had zeta eight as a root, but I don't really care about eight So this one actually takes care of all of these so these three are actually all the same polynomial Um, okay, so we get we get m one. What about m three? m three was this one right here It had as it has zeta three as a root of course It also has zeta six zeta nine zeta 12 as a root as well So the for the bch code of distance five We have to look at the product of m one and m three Which is going to give us one plus x plus x to the fourth Plus one plus x plus x square plus x q plus x to the fourth And when you multiply those out again working one two This will simplify to be one plus x to the fourth plus x to the sixth Plus x to the seventh plus x to the eighth like so And so then this g generates a bch code A 15 seven block code, right? So our messages have our encoded messages have length 15 But then we can encode a seven bit messages using using these things right here Now remember how did we end up doing that? Well g of x is a degree eight polynomial and you get 15 minus eight is equal to seven So we can encode a seven bit messages by multiplying it by G of x right here. We've seen this previously. So this gives us a 15 seven bch code Its minimum distance is going to be at least five. It could be better than that, but it's at least five All right And so this tells us that well five can break down as two times two plus one So this code is going to give us two error correction And so I want to bring to the memory of my students that on a take-home test Back in the prequel math 42 20. You're asked to create a linear code A linear code whose Error correction was in fact two right and it was a hard question at the time We were able to work through it the bch code gives us a much simpler way of doing it Less guessing checking more methodical because it comes down to factorizations Of cyclotonic polynomials Now with g of x we can also compute h of x because it should be the property that g of x Times h of x is equal. Sorry. That's the wrong way I mean for the polynomials doesn't make a bunch of difference for the matrix it does So I want to be consistent there. So h of x times g of x should equal zero Where of course zero in this ring is the same thing as x to the 15 minus one So we can just take x to the 15 minus one and divide it by g, right? So g was m one times m three So we grab the other three factors m zero times m five times m seven Which is a reminder where these three polynomials Skipping all the details here you can multiply those out and this will simplify to be the polynomial one plus x to the fourth Plus x to the sixth plus x to the seventh this this polynomial then gives you the parity check matrix We we can just use a polynomial of course because if you have any code Maybe like if you if you receive the message f of x right here Then you can multiply by h and this should then equal zero if it's a code word If it's not a code word, you're gonna get something else your syndrome will be non zero and you know an error was Um an error was detected. We could ask for retransmission. Um, we're gonna of course end lecture 32 here We haven't yet talked about how One can error correct With a bch code. We know that it can at least this code can detect at least two correct two errors Detection's much easier because you just have to look at the syndrome. Um, if the syndrome's not zero You've detected an error But how do you correct them that takes a little bit more and i'm actually gonna leave that as a exercise to the viewer In particular, we're gonna see this on a we're gonna see this on a future Take-home exam at least for my students. That's what we're gonna see But that brings us to the end of this conversation about bch codes How we could use our finite fields to develop theory for More sophisticated linear codes than we did with just group theory alone So thanks for watching and our next videos We're gonna return to general field theory particularly we're going to go to gawa theory and define Finally what the gawa group of a field extension is So, uh, if you've learned anything about bch codes or polynomial codes or cyclic codes in these videos Please like these videos subscribe the channel to learn more about these in the future or to see more videos about gawa theory or what have you Um, and please post any comments below if you have any and i'll be glad to answer them as soon as I can. Bye everyone