 And the last thing we were seeing was this Galois field extension fields right. So, at least this field I think most of you should be familiar with I will denote it either g of 2 power m I think this is again another notation or f 2 power m. So, I am going to define it I can as I showed you in the previous classes I can think of this as 0 1 alpha alpha squared so on till alpha power what 2 power m minus 2 k and alpha power 2 power m minus 1 equals 1 and there is one more relationship right alpha power m equals right some function of what. So, you will get something like some a 0 alpha power no I am sorry I think let me write this carefully a 0 plus a 1 alpha plus so on till a m minus 1 alpha power m minus 1 what are these a's these comes these this relation comes from pi alpha which is what a degree m primitive polynomial. So, once you pick all that carefully you know you can always get f 2 power m in this form. So, that is the Galois field that is the finite field with 2 power m elements. So, to give you a brief motivation for where we will be finally going I want to start off by saying defining codes which are called BCH codes using these finite elements from this finite field. So, you will see the critical idea so you saw we saw methods for designing parity check matrices for minimum distance 3 and even 4 ok with binary entries itself we could happily define a parity check matrix with some simple constraints that you can easily enforce no two columns are the same right that is not too bad to enforce for minimum distance 3 for minimum distance 5 we had this problem we could not really easily design binary matrices where you can guarantee that 4 columns will never add to 0 or 3 columns would never add to 0 it is more complicated the number of conditions you have to check becomes more and more involved ok. So, the crucial idea in coming up with a general parity check matrix for any minimum distance you desire is the use of finite fields. So, you say I will come up with a parity check matrix whose entries are not from f 2, but from f 2 power m ok. So, you will take that liberty. So, I will say my parity check matrix will not have entries which are binary, but the entries of the parity check matrix will be from f 2 power m ok. So, that is the crucial trick and there is a very nice way of constructing a parity check matrix over f 2 power m which will easily guarantee a minimum distance for you ok. So, that is what we are going to see next and there are lot of issues there will from there we will come back and look at this field once again very closely and look at polynomials over these fields and all that. So, we will come back to this fields and study them closely once again, but before that I want to give you this construction for BCH codes which gives you any minimum distance you want ok. Well, any minimum distance as in reasonable extra ok. So, of course, of course the bounds cannot be violated right the bounds that you had before for minimum distance nk and d cannot be violated. So, within that you can do a lot of these lot of these things ok. So, that is the definition for BCH codes ok. So, if you want expansions B is Bose and C is Choudhury. So, you can see Indian names are there right at the beginning after that they went somewhere you will never see an Indian name in coding theory for a long time ok. Then this name I can never pronounce it correctly and I am sure I cannot write the spelling correctly something like this ok. So, it is named after all three of them who came up with this code ok. So, what is the goal here ok. So, I am going to I am going to come up with some parity check matrix just the which will achieve a target minimum distance B ok. I will use let us say let us say alpha belonging to F 2 power m is a primitive element ok. What does this mean when I say alpha belonging to F 2 power m is a primitive element I can construct F 2 power m in this form 0 1 alpha alpha square so on ok. I think I define that in last class. So, that is a primitive element using this using these elements of F 2 power m we will construct a parity check matrix which will guarantee a minimum distance D ok. That is what we will do let me make sure I get I get the whole thing right ok. So, what will we do we will construct a H to achieve D using elements from from F 2 power m ok. So, the first thing you should ask me is does it even make sense can I construct a parity check matrix from F 2 power m and get a binary code yeah. So, it is possible ok. So, like you said every element can be represented as a vector that is one way of thinking about it, but I will come back and justify that also a little bit ok. But another way of thinking about it is the 0 and 1 are contained in F 2 power m ok. So, even if I have ok. So, even if I have H being let us say and some r by n matrix ok and then with entries from F 2 power m even if I have a parity check matrix with entries from F 2 power m I can define a binary code in the following fashion ok. I can define C to be the code which contains of vectors from F 2 n what is F 2 n now it is the n dimensional binary vector space. So, any V will be what V will be only a binary vector ok such that H times V transpose equals 0 ok. Why does this definition make sense why can I multiply a vector from with binary entries on the right ok. So, remember this matrix H has entries from F 2 power m why is it why is it ok for me to multiply with V transpose on the right. So, F 2 power m has F 2 in it ok. So, I can think of the 0s and 1s in V as belonging to F 2 power m also nothing stops me from doing that and all these multiplications when I do H V transpose I will do over F 2 power m ok right is this clear. So, this multiplication is a little bit you have to think about it a little bit see remember each entry in H is from F 2 power m. So, you have to multiply that. So, when you do this multiplication for instance if you look at the first row ok. So, maybe H has a form like this ok. So, H 1 1 H 1 2 so on till H 1 n ok. So, H 2 1 so on till likewise ok if it has a form like this what am I saying that multiplication is if I do V 1 V 2 V n all these guys are bits right ok. How do I think of this multiplication what is the first entry here? It will be H 1 1 V 1 plus H 1 2 V 2 plus so on till H 1 n V n ok. So, that will be the first row ok it will be actually where will it belong? It will be in F 2 power m right each of these H's H 1 1 H 2 H 1 2 so on they are from F 2 power m the V 1 V 2 are all binary ok. So, it is either 0 or 1 right wherever there is one you will be adding the corresponding H I j's ok and that addition will happen only in F 2 power m. So, this will in general belong to F 2 power m ok. So, I am going to say I will only take those vectors here in my code which will give me 0's here all of this should be 0. If this belongs to C then this should be this 0 vector ok that perfectly make sense there is nothing that violates this. So, I can very well choose what I can choose my parity check matrix to have entries from F 2 power m ok ok is that clear ok. Can I choose entries from F 3 power m does that make sense ok you would not get a binary code right because 0 and 1 the binary 0 and 1 are not in F 3 power m ok it has 0 and 1, but what are those 2 what are those 0 and n 0 and 1 0 and 1 n F 3 ok that is a different 0 and 1 from the 0 and 1 you have in F 2 ok. So, you can do F 2 power m you are very safe ok all right is that clear ok. So, this seems to be very clear to you ok the next statement I am going to make will require some thinking ok. Now, suppose I say this matrix H has full rank ok remember all this F 2 power m is also a field. So, you can do Gaussian elimination in with H nothing stops you from doing that it is a field it is F this is a proper matrix with entries from a field. So, you can do Gaussian elimination in fact you can figure out rank also right that is fine suppose I say this H matrix has full rank ok ok what can I say about the dimension of the code can I say anything ok. So, you see the problem lies there ok how do you find dimension of a code if you define the parity check matrix over F 2 power m had this matrix been over F 2 based on its rank I can immediately conclude what the dimension of the code will be I can immediately figure out encoding and decoding everything, but because I put these entries from F 2 power m based on its rank I cannot say anything about the dimension of C ok because this is not a binary matrix anymore ok. So, that is something to be worried about ok. So, immediately just because it has full rank I cannot say the code has dimension n minus r I cannot say that ok right why because I am forcing this vector v to be in F 2 not in F 2 power m if I said this v can be in F 2 power m right you understand what I mean right if I say these entries v i are in 0 1 if I do not place this restriction yeah all my linear algebra will apply, but once I place this restriction the linear algebra in the known form does not apply you cannot use it directly ok. So, you will have to worry about dimension ok dimension is a problem we will come back to it ok we will come back to it there is an elegant theory which fixes this problem which tells you how to find dimension for this, but for now dimension is a problem, but we will not worry about dimension, but other than finding out things like dimension this works perfectly alright ok. So, let me give you an example of a simple situation where I will define a code with parity check matrix having entries over an extension field and we will try to figure out code words we will try to see if we can find the binary code words for such a code we will try to find that ok and then we will actually see the BCH construction which gives you good minimum distance ok. Let us see an example ok let me choose F 8 ok or maybe F 4 ok. So, F 4 is the easiest thing I can do ok 0 1 alpha alpha square alpha power 3 is 1 and then I will say alpha square is alpha plus 1 ok. So, that is the way of defining F 4 right is that clear ok. So, now I might want to define a parity check matrix ok I will just this is just an example I will just come up with something just like that without worrying too much about whether anything is reasonable or not I will say 1 alpha alpha squared ok. So, let us say that and then we will say what shall we say ok. So, I say alpha 1 0 ok just like that some arbitrary thing ok ok is that clear. So, so that is my parity check matrix ok if you have to come up with code words for this parity check matrix ok. So, what are my code words now remember I have to find length 3 binary vectors ok binary vectors which will multiply this matrix on the right and give me 0 ok. So, try to see if you can quickly find some binary vectors which will follow 1 vector which will always be there is what 0 0 0 ok. So, I know 0 0 0 will belong to the code C ok what is my code C code is set of all V in f 2 3 such that h times V transpose is 0 can we find anything else you convince there is no code word ok what is the best way of doing it just try all the code words there are only 8 possibilities right 8 vectors try all of them see how many of them are in here no code word 1 1 1 ok some people are saying 1 1 1 1 1 1 1 ok the first row is ok it will give you 0 what about the second row will give you alpha squared ok is everybody agreeing that there are no code words no binary code words for this ok. But if you allow your code words to have arbitrary coefficients yeah you can easily find ok this is got if you do Gaussian elimination you will see this is got rank 2 ok. So, you can find definitely how many code words ok you can find 4 4 code words including the 0 ok it is easy to find but none of them are binary ok. So, you see in this case see just happens to be the trivial all 0 ok. So, that was a quite a bad example ok let me give you another example same f 4 ok. So, in this case you will see you will have two different code words 0 0 0 1 1 1 ok. So, does not seem very easy right I mean it is not very easy to quickly figure out only thing you are doing is trying out all the possibilities ok suddenly if I move from f 4 to f 256 and give you a long thing it is it is going to be tough it is not does not seem very easy ok. But there is a way around not for all codes but for at least for bch codes there is a way around this ok. So, we will have to come back and look at that very closely ok. So, one thing I want to highlight is it is not as easy as the binary codes if you were to pick each coefficient each entry in this matrix to be binary then it is very simple just find the rank and you know 2 power n minus the row rank of h will give you the exact number of code words and you know even an encoder etc etc ok. So, the trick that you have to use to go from. So, it turns out you can take any parity check matrix that is like this which is non-binary and convert it into an equivalent binary parity check matrix it is possible ok. So, that is it is quite important ok. So, I am a little bit confused about this thing not having any let me just take a quick look at this make sure I am happy with this. So, that is fine. So, there is a trick that one can use right to go from a non-binary parity check matrix well not all I mean by a parity check matrix over f 2 power m to a parity check matrix over f 2 once you do that trick then you can use all your linear algebra and simply do the elimination ok. That trick basically involves what he suggested you have to replace each element with this vector form or that is all you need for instance let me do it in the general case and then we will come back to these examples and do it once again. So, it is not too difficult it is a very simple idea look at what is happening in the general case ok. So, a parity check matrix looks something like this h 1 2 h 1 h 1 1 h 1 2 so on till h 1 n then h 2 1 h 2 2 so on till h 2 n ok then I guess the last row would be h r 1 h r 2 h r n ok. So, how do you go from a parity check matrix like this with each of these guys from f 2 power m to a parity check matrix which has only binary entries remember the check should be valid ok you cannot just suddenly say my parity checks will be something else now ok the same parity check should be should be maintained ok. So, so what is happening let us look at the first row ok what is what is the check in for enforced by the first row first row tells you h 1 1 times v 1 plus h 1 2 times v 2 plus so on till h 1 n times v n equals 0 ok. So, this is one check in this is one equation in f 2 power m ok. So, this is an equation with ok this is one equation in in f 2 power m. So, you remember suppose if you have a equation with complex numbers on both sides what would you do how will you get how will you make it into real equations. You equate the real parts and equate the imaginary parts you do the same thing here ok. So, each of these entries is actually a vector in what look at this each of these guys is actually a vector in f 2 you have a vector notation. So, simply replace each of them by their vector notation you will equivalently get m equations in f 2 ok and both of them you can go back and forth if all those m equations are satisfied you can replace each of those vectors with this entry in f 2 power m and you can go back to an equation in f 2 power m. If this equation over f 2 power m is satisfied you know that each of those individual equations have to be satisfied right how are you doing addition in f 2 power m you take each vector and you add element wise. So, if the sum of two vectors became 0 then each element wise sum should also become 0 ok. So, it is very natural that one equation gives you m equations in f 2 ok. So, what you do is you replace h i j by vector by by its vector notation sorry about this vector notation ok to get m equations over f 2 ok. So, that is the simple trick you use ok. So, if you do that your r by n parity check matrix with entries from f 2 power m becomes what matrix m times r cross n ok n remains the same m n does not get multiplied by m ok right each entry is being replaced by a column vector ok imagine column vector ok. So, you should remember it is a column vector think of it as a m cross 1 column vector ok. So, each entry is getting replaced by a column vector. So, the number of rows will become m times r, but the number of columns will remain the same ok. So, that is what happens right each equation becomes m equations with binary coefficients. So, if you have r equations in f 2 power m you will get m times r equations with the same number of variables ok. So, now you see your rank argument has to be done with the binary version and not the version over f 2 power m ok. So, that is the important thing once you come to binary you can use all your Gaussian elimination and rank arguments to count the number of code words and everything will work out exactly as before ok. So, now if you use this in our examples you will see in one case you will get a different I mean in both those cases you will get two different results as a result of Gaussian elimination ok. So, let us go back to the first example what was it in our first example we had 1 alpha alpha squared and then alpha 1 0 right. So, this is the equation over f 4 ok in binary. So, if you convert to binary if you go to binary then what should you do you will get a 4 by 3 matrix right each entry is going to be replaced by its column vector notation ok. So, it is good to write down the vector and vector notation 0 1 alpha alpha squared. So, if you say your basis is alpha 1 ok. So, this is going to be 0 0 this is going to be 0 1 this is going to be 1 0 and this is going to be 1 ok. So, once you write it down in vector notation ok. So, you can replace everything very easily 0 1 1 0 1 1 you would get 1 0 0 1 0 0. So, this is a 4 by 3 matrix if you actually simplify this you will see it has rank 3 ok. So, obviously, then your code becomes only the all 0 ok you have a rank full rank matrix right multiplying the null space will be only the nothing more will be there ok. So, that is something you can use ok is that clear ok. So, the second example tells you that you have to be very careful when you do the rank you have to actually compute the rank just based on the number of equations you cannot conclude anything right that is the second example what was my second example you had 1 alpha alpha squared alpha 1 nothing alpha, alpha squared 1 ok. So, even here it looks like you will end up with the 4 by 3 binary matrix, but actually its rank happens to be 2 ok. So, that is why it works out in this fashion ok. So, let me rewrite this little bit clearly ok. So, if you go to binary ok. So, again do the same 0 1 1 0 1 1 1 0 1 1 0 1 ok. So, you see these two are linear combination of the first two ok you add the first two rows you will get this the second rows are repetition of the first row itself ok. So, these two are not are linearly dependent on first two rows ok. So, you in fact, get only a 2 by 3 binary matrix with linearly independent rows and that gives you a that gives you two code words right it will get two code words 2 power 1 2 code words and that makes sense ok. So, I could have also figured out that the last two in fact, this row itself is linearly dependent on the first row right if you take a look ok right in binary you may not be able to see, but what happens here if you multiply by alpha you get this. So, there was a so, so, so linear dependence in higher fields might be a little bit more subtle. In fact, there can be more more confusing cases than this in case I wrote down it was very simple yeah even that can happen ok we will see an example soon enough ok. So, I want to show you more examples where something more funky can happen ok alright ok. So, let us see another example I think to go to really interesting examples ok. So, maybe even here we can see this example yeah maybe you can try this example even over f4 it might work yeah this will work it will eminently work ok try this figure out binary codes ok. So, even using your exhaustive search method you can quickly find that the code words are 0 0 0 and 1 1 1 ok. So, you see 1 1 1 is also a code word ok and then and then you go to binary and do your you look at it very carefully. So, you will get 0 1 1 1 1 0. So, you see once again these two are linearly dependent ok ok, but the original two rows are actually linearly independent over f4 they are not linearly dependent ok when you expanded it out they became linearly dependent ok. So, it is a nice little bit of a trickery going on here ok something very subtle is happening ok it is not very difficult once I once I give you the result it looks like very simply, but still it is something something more involved can happen ok. I want you to attempt the Gaussian elimination on this and get me the row reduced form over f4 I think it is an interesting exercise should be comfortable doing that just to confirm that it is full rank ok what is the RREF of H row reduced echelon form in in f4 what is this ok you have to do operations over the field right it is a little bit confusing when you have to do elimination over the field ok what is it 1 0 ok well the row reduced echelon form should be I and something you should have to do also something else I want 1 0 0 1 here tell me what I need 1 0 1 0 1 1 ok it is not surprising that you get something like this ok. So, so clearly it has full rank in f4 ok there is no no problem it is rank is 2 in f4 ok, but when you replace with binary suddenly those the second row actually became linearly dependent ok. So, one needs to do you have a question ok one needs to one needs to be a little bit more careful ok the reason why this has happened the reason why this has happened is if you do ok why did this happen ok ok there is a very curious result about binary fields ok what is x plus y whole squared ok you typically write it as well this is always true x square plus y square plus 2 x y ok if x and y come from an arbitrary field x plus y whole square is x square plus y square plus 2 x y there is no problem if I say the characteristic of my field is 2 what happens 2 becomes 0 ok. So, when characteristic is 2 you get x square plus y square is equal to x plus y whole square ok. So, this is a bit little bit of a subtlety ok now you can also extend this if you have x plus y plus z whole square what will you get x square plus y square plus z square ok. So, so squaring becomes like that in fact if you have characteristic p where p is some prime one can show x power p plus y power p will be x plus y whole power p ok the proof is a little bit more subtle you will have to use some binomial expansion type thing and use the fact that p is prime you will get this answer ok x plus y to the power p will be x power p plus y power p ok. So, why is this why how did this show up here you will if you notice the second row and this edge ok what is what is the relationship between the second row and this edge and the first row. If you square the first row what do you get if you square each element of the first row you will get the second row ok. So, so there is some connection so why does it mean that the binary thing will have rank less ok I will show you what happens ok. So, what is the equation for the first row v 1 times 1 plus v 2 times alpha plus v 3 times alpha squared equals 0 this was the first the first equation ok equation from first row what I can do is I can square this equation if I square it what would happen ok if you square what happens ok squaring will give you v 1 plus v 1 times 1 plus v 2 times alpha plus v 3 times alpha squared whole square equals 0 ok this is another equation. But now what do I know about characteristic 2 fields I can simply square each term. So, I get v 1 squared times 1 squared which is again 1 v 2 squared times alpha squared plus v 3 times what alpha to the power 4 which is alpha equals 0. So, now these 2 equations are dependent right how did I get this I squared it and got it. So, it cannot be independent ok now what about this v 1 squared v 2 squared v 3 squared ok now v 1 v 2 v 3 are binary ok it is very important if you do not know that v 1 v 2 v 3 are binary you cannot do this simplification. But if you know v 1 v 2 v 3 are binary ok if you have a if you have 0 or 1 if you square it what do you get you will get the same thing in binary x square equals x ok. So, v 1 square equals v 1 ok remember vi belong to 0 1 ok that implies vi squared is vi ok. So, this equation will reduce to v 1 times 1 plus v 2 times alpha squared plus v 3 times alpha equals 0 ok. So, because these vi's were binary the second equation became linearly dependent on the first equation. So, that is why when you replace it with the binary equivalent the last 2 equations become dependent and when you do not in f 4 they are linearly independent ok. So, the squaring can actually give you linear dependence in f 2 ok. So, it is a little bit of a subtlety in characteristic 2 fields which should be squaring usually is non-linear right when you do not think of squaring as giving you some linear dependence ok, but squaring can be linearly dependent in if you if all your coefficients are binary it is a little bit subtle to think about ok. So, this is one point you have to keep in mind when you go from paraticic matrix over f 2 power m 2 paraticic matrix over f 2 rank does not mean anything ok. So, there are some more intricacies to how these things work out ok. So, I think that that is I mean I can do more complicated examples from f 8 and f 16, but it will only mean more careful linear algebra ok, but that is good practice ok. If you go to my website there is a link I think I do not know if you have ever gone to my website, if you go to my website there is a link to this course ok, there is also link to video lectures and this course actually has lots of assignments posted ok. So, apparently IITM is having some trouble with their courses website ok. So, it is not getting updated. So, you should look at the problems in my website for this course and you will see there will be some practice problems on course defined over f 8 and f 16 and all that it is very good practice to have ok, particularly for your exams it is very good practice ok. So, let me go ahead now and start defining BCH course ok. So, I will define it for a particular case and there can be more general definitions ok, I will define it only for a particular case ok. So, maybe later on we will see a generalization ok. So, I will pick n to be 2 power m minus 1 ok. So, my block length is going to be 2 power m minus 1 then I will pick like before I think I wrote this down alpha belonging to 2 power m will be primitive ok. So, I will take these two things and then I will write down a parity check matrix ok and claim that it will give you minimum distance d ok. So far I have not talked much about minimum distance, but minimum distance d will come about from that matrix is what I am going to claim ok. So, what is the parity check matrix? The parity check matrix will look something like this ok. So, d is my target minimum distance ok. So, parity check matrix will look like 1 alpha, alpha squared so on alpha power 3 I will write down that. So, on till alpha power n minus 1 ok. And the second row is 1 alpha squared alpha squared squared alpha squared raise to the power 3 so on till alpha squared raise to the power n minus 1 ok. And so on till I will go 1 alpha power d minus 1 alpha power d minus 1 raise to the power 2 alpha power d minus 1 raise to the power 3 so on till alpha power d minus 1 raise to the power n minus 1 ok. That is the parity check matrix which will give you minimum distance well actually it will give you minimum distance greater than or equal to d ok. So, let me write that down it is very important ok. So, how do you show that is one very important thing how did I get that is important I will come to it slowly ok k is something we will not talk about I do not know is it showing up clearly are you able to read it what will be the third row what will be the third row 1 alpha power 3 alpha power 3 squared alpha power 3 raise to the power 3 so on till alpha power 3 raise to the power n minus 1 ok. So, you have to go as long as d minus 1 ok. So, if you have d minus 1 you go up to d minus 1 you get minimum distance greater than or equal to d that is guaranteed ok. So, that is what I am going to see ok let us see a few examples of this and then we will see the proof for why minimum distance will work out ok. So, the example I am going to take I will take from f 16 because it is complicated enough and it is long enough so that you will get some non-trivial nice codes alpha squared to alpha power 14 ok. So, alpha power 15 is 1 and I say alpha power 4 is alpha plus 1 ok. So, that is my f 16 ok. Then if suppose I say up to d equals 3 I guess maybe it is not interesting we know already how to do d equals 3 but just it is just for the heck of it look at d equals 3 ok. Let us just look at d equals 3 what do you do for d equals 3 my BCH code is going to have parity check matrix what 1 ok what will be n once I say f 16 what is n 15 right I always said n is 2 power m minus 1 ok. So, one can relax this one can do n less than 2 power m minus 1 ok. So, you do not have to become equal but I will say equal ok anything lesser will be very clear ok. So, n equals 15 ok and then I should do what 1 alpha alpha squared alpha power 3 I will write down till say alpha power 5 ok just for fun it will go on till alpha power 14 right that is the first row what is the second row 1 alpha squared alpha power 4 alpha power 6 alpha power 8 alpha power 10 will go on till alpha power 28 that is my parity check matrix. You might have the urge to simplify this a little bit for instance you might say alpha power 28 is actually what alpha power 13 ok but that is up to you if you think you should really only give numbers that are in this list of the field elements then you can do that simplification but it does not matter I know what alpha power 28 is I can always evaluate ok. So, I know what it is so it is not a problem ok. So, this is my parity check matrix for d equals 3 ok. So, he asked a question what about k you have not said anything about k ok. So, if I have to find k how will I go about it ok. So, what is the step for finding k see this is the parity check matrix with entries from f 16. So, how will I find k I have to go to f 2 right. So, I have to replace each element with its column vector and then look at rank ok, but look at the second row what is the second row. Second row is the square of the first row which means when I do all that what will happen the second row will become linearly dependent on the first row. So, only the m equations from the first row will be linearly independent when I go to binary ok right is that clear. When I go to binary only first row provides independent equations ok second row why because second row equals first row squared ok. So, we saw in the previous example and that can be easily generalized ok. So, I wrote it in a very general fashion can be very easily generalized in general squaring will give you linearly dependent things when you do that ok. So, now go ahead and look at the first row what does it have 1 alpha alpha squared all the non-zero elements of f 16 ok. Now if I replace each of them with their vector representation what will I get what will I get all the 15 non-zero vectors of length 4 ok what is that code we already know that code what is that code. If I take you remember how did we do optimum D equals 3 constructions for a given R what did we do we looked at 2 power R minus 1 right all orbit vectors of that are non-zero we knew that is the maximum n for which you will get ok looks like enough people have forgotten this ok. So, you are going to be in trouble ok. So, that is the hamming code ok. So, you see when you when you go to binary you see this becomes the n equals 15 binary hamming code ok. So, those 4 rows will be linearly dependent and you can easily conclude this is a 15 11 3 code ok. So, if you want if you do not believe me you can actually go ahead and replace each of those things look at the vector notation that I had before you will see you will get all the vectors and you can rearrange to get the identity if you want you can do encoding you can do decoding you can do anything. So, you see like I claimed you are getting D equals 3 ok there is no problem ok. So, let us look at D equals 5 you know that is the most non-trivial example for us ok. So, even number we do not really care given any odd number we can get it is the next even number right we simply extend it is not a big deal. So, let us look at D equals 5. So, D equals 5 what is my BCH parity check matrix ok. So, now, we will get something which is genuinely new ok which we have never seen before we have not seen really codes with minimum distance 5 for n equals 15 we never saw ok. So, if you look at it first row is going to be 1 alpha alpha square I will stop with alpha 3 ok all the way to alpha part 14 what will be the second row what will be the second row 1 alpha square alpha part 4 alpha part 6. So, until alpha part 28 what will be the third row ok do I need a third row yeah I need D minus 1 no I need 4 rows ok. So, 1 alpha part 3 alpha part 6 alpha part 9. So, until alpha part 42 ok then the fourth row is 1 alpha part 4 alpha part 8 alpha part 12 alpha part 56 ok is that clear ok. So, what I want to do at this point is to ok. So, let us resume. So, that is all right I mean it is it is fine I mean we are getting up we are getting we have a parity check matrix with 4 rows in trace from f 16 and ok. So, that is fine ok. So, now, you might worry about ok n equals 15 is fine and I have not proved it to you, but I have already told you this will give me a minimum distance greater than or equal to 5 ok. So, by I mean we will see a quick proof it is not very difficult to prove this, but anyway, but this this we have already shown, but what about k ok you might worry about k first before you before you worry about anything else, but worry about k how do I find k now ok. So, again the only way we know is what replace each column with each entry with a column vector and see what happens ok. So, that is the only thing we can say, but before we do that we can smartly rule out some cases you can not only rule out the second one you can also rule out the fourth one why it is again repeated square right. So, you see in binary in characteristic 2 x plus y to the part say some 2 power s will be what x power 2 power s plus y power 2 power s right why you can keep on repeatedly squaring ok. So, you square you get x plus y whole square and you get one more square x plus y to the power 4 one more square you will get x plus y to the power 8 all powers of 2 will be covered ok. So, you see these 2 guys will be when you expand to binary they will be linearly dependent ok remember that once again ok will be linearly dependent in mean the binary version only if you insist your code words are binary ok the moment you relax that constraint they will in fact be linearly independent we can show that we will show that later also ok. So, this will be linearly dependent in binary version ok. So, that is that makes sense only when you when you say the code words are forced to be binary ok. So, I only worry about these 2 in fact those 2 when you expand out you will see they are linearly independent ok. So, you will get 8 linearly independent binary checks from this parity check matrix ok. So, other 2 rows give you independent ok when in binary it can be less than 8 yeah less than 8, but in this case I know it will be 8 if you want you can replace it that is why I was looking for the table can make a quick argument for why but I do not have the table with me, but you can you can substitute it and you will check it will be equal to 8 ok. In general it can be less than 8 in binary row 1 and 3 provide 8 linearly independent checks ok. So, based on that we can conclude k will be 15 minus 8 which will be 7 ok ok. So, another thing you can conclude once you come to binary is it is very easy to come up with a weight 5 code word. So, that the minimum weight minimum distance will actually be 5 itself ok. So, this code is actually a 15, 7, 5 code ok and that is the first such code we have seen in this class. So, it is a 2 error correcting code of length 15 with how many code words 128 code words 2 power 7 code words we have never seen a code like that ok and you see the construction it is so ready made and simple ok. So, it is elegant it is nice you know it is a very ordered structure with entries from F16 all you have to do is go look up the vector notation replace the columns ok, but what is hidden is where did the minimum distance 5 come from ok. How did I get minimum distance 5 ok of course I am doing d minus 1 rows there is a very close connection with that, but you will see yeah greater than or equal to 5 is what we can prove in the way we prove, but in this code in this code in the specific code once you convert to binary or even otherwise it is very easy to find a weight 5 code word. So, you know it is equal to 5 ok. So, yeah so that is the magic ok. So, now suppose if I say I want n equals 255 ok and d equals 10 ok you should be able to easily construct a parity check matrix right you know what to do n is 255 I will pick f 256 I know a construction for it I have a table for it then if I want d equals 10 what will I do I will go from 1 alpha alpha square all the way down to 1 alpha power 9 so on ok, d equals 10 maybe is useless maybe d equals 11 I will go all the way down to alpha power 10 then I have a 5 error correcting code the only non-trivial thing is then figuring out what k is ok and then encoding etc. etc those are those are things we can deal with, but at least I know how to design a parity check matrix and going to these extension fields f 2 power m is one of the most elegant ways of doing it of course there are other ways classical ways of just looking at binary matrices itself, but this is a very beautiful and elegant method which gives you nice construction for any minimum distance you want ok. If you increase n ok for a fixed d or fixed d by n fixed d by n in this construction k by n will not approach 1 or not approach 1 or it will not approach even a non-zero number it will go off to 0 ok. So, so anyway so this is at least one construction that we have which is very easy to understand any of us can reproduce at any time you know you know how to come up with a parity check matrix for any minimum distance ok. So, the next thing I want to prove to you is that this construction actually gives you minimum distance as guaranteed ok. So, I will sketch the proof it is very easy it uses a notion of what is called van der mohe on matrix ok. So, I will just write it down whenever it comes and as I said that matrix plays a crucial role in guaranteeing minimum distance ok. So, it is a simple matrix it is a very elegant idea ok. So, here is proof for minimum distance ok. So, the result for this proof is also called the BCH bound ok ok. So, let us see let us see let us say we have matrix H ok which goes from 1 alpha alpha square all the way to alpha power n minus 1 ok 1 alpha square alpha power 4 all the way to 2 to the power n 2 times n minus 1 all the way down to 1 alpha power d minus 1 alpha power d minus 1 squared all the way down to alpha power d minus 1 raise to the power n minus 1. This is my parity check matrix I want to claim the minimum distance of the code defined by this parity check matrix is greater than or equal to d ok. So, now go back to the connection between parity check matrix and minimum distance what should I show now? If there are no d minus 1 or fewer columns of this parity check matrix which will add to 0 ok that is what I have to show right which will add to 0 because my code words are binary right right go back think about that connection what is the connection between parity check matrix and I am sorry no no no singleton bound would not work here what why are you saying singleton bound? Singleton bound says d is less than or equal to something in any case it would not work you cannot say d is greater than or equal to something I want I want a greater than or equal to proof ok singleton bound is for all those bounds are always less than or equal to it is never greater than or equal to. The Gilbert Vashemov bound is what says that d is achievable it is the only thing ok. So, here I want to show no vector of weight less than or equal to d minus 1 right can multiply this matrix on the right and give me 0 that is what I want to show no binary vector of weight less than or equal to d minus 1 ok can multiply into that is what I want to show ok. So, the way I will show it is I will assume a vector of weight w which is less than or equal to d minus 1 actually multiplies and gets me 0 and then I will come to a contradiction ok that is what I will do ok. So, that is the way we will do it. Suppose you have some w less than or equal to d minus 1 and some vector v which is say let us say v 1 to v n with weight of v equal to w such that h times v transpose equals 0 ok. So, I am going to move towards assume that the contrary is true and then move towards a contradiction ok eventually I will get a contradiction and from there I will say this is not possible ok. So, that is the thing ok. So, once I say weight of v is w what does it mean there are only w positions here which are once everything else is 0 ok. So, I will say once in v are at positions. So, let once in v be at positions say I 1, I 2 so on till I w ok what does this mean ok. So, columns I 1, I 2 and I 2 I w add to 0 ok. So, when I multiply with v on the right ok. So, all the other columns will drop out of this right all the other columns do not enter this only these columns I 1 through I w are going to add to 0 ok. So, let me write that down by itself ok. So, what is the I 1th column ok go back and look at this thing what is the I th column ok. If I have to write the I th column what will it be it will be alpha power I here it will be alpha power 2 I so on till alpha power d minus 1 times I ok that is the I th column ok. So, what will be the I 1th column alpha power I 1 alpha power 2 I 1 so on till alpha power d minus 1 I 1 what will be the I 2 th column alpha power I 2 alpha power 2 I 2 so on till alpha power d minus 1 I 2. So, on till alpha power I w alpha power 2 I w ok all the way down to alpha power d minus 1 I w I am sorry yeah it is fine no I 1 equals 0 is fine I am happy with anything it is not a problem one of these things can be 0 do I have oh there is a problem with v 0 is it did I do something like that. Did I do v 1 to v n is that a problem. Yeah so maybe I should do v 0 to v n minus 1 I am sorry yeah you are right so you are pointing that out ok yeah yeah. So, I should put v 0 to v n minus 1 so that I get this alpha power to match this is not a problem ok. So, one of I 1 can be 0 if you want ok. So, I know what what is going to multiply here I am going to get this multiplying all ones to give me 0 all 0 ok ok. So, now I know w is less than or equal to d minus 1 ok and this matrix is actually a long matrix ok. So, what I will do is I will I will only take the square sub matrix ok it is enough I know I mean longer than that I am I am I am guaranteed that I will definitely have linearly dependent relationships. So, I do not want to throw I want to throw all that out I will take only the first w rows so that I get a nice square matrix and simplify it ok I know w is less than or equal to 2 minus 1. So, I just take the square part and how does it look let us let us write that down once again ok alpha power I 1 alpha power 2 I 1 so on till alpha to the power w I 1 alpha power I 2 alpha power 2 I 2 so on till alpha power w I 2 alpha power I w alpha power 2 I w alpha power w I 2 ok this times now I have a nice square matrix 1 equals 0 ok. So, 0 of suitable length is that clear ok. So, remember none of the two i's are the same ok I 1 is not equal to I 2 it cannot be equal right it is clear ok. So, they are distinct positions and all of them are 1s I have said we have w 1s so none of them are equal ok that is clear and this is a square matrix this is a w by w square matrix and it has a non-zero vector in its null space right clearly has a non-zero vector in its null space which means what it cannot be full rank or its determinant has to be has to be 0 ok its determinant has to be 0 ok. So, now we will write down the determinant for this and you will see this is actually what is called a Van Damme 1 matrix for which the determinant is a very simple expression and the determinant cannot be 0 whenever I 1 I 2 and I w are all distinct. So, you will get a contradiction which means the minimum weight cannot be less than or equal to d minus 1 ok. So, we will show essentially determinant of this matrix is non-zero once you show determinant of this matrix is non-zero you cannot have a non-zero vector in its null space which means you get a contradiction. So, that is the contradiction that we will be getting towards ok. So, for that all you need to do is this is the Van Damme 1 matrix ok I will identify this as the Van Damme 1 matrix ok. So, the way the Van Damme 1 matrix is written down as as follows ok. So, this matrix plays a central role you write it down as a 1 a 2 a let us say m I do not know some s ok the s by s Van Damme 1 matrix is written like this a 1 square a 2 square a s square you might have come across this in some in some in some version or the other ok. So, it is a very popular example even in school ok to get you to calculate determinants ok. So, you can use some nice identities you know about the determinants replacing columns with other columns etcetera and quickly show that the determinant of this will be product of a i minus a j ok of course some i less than j or some such thing ok. So, basically it will only involve terms such as a i minus a j there could also be some minus 1 par something here ok. So, I might be missing some non-zero factors here, but it only has a i minus a j ok what is the only way that this determinant can be 0 if some a i equals some a j ok. So, you just go back and look at this other matrix closely that we had it is exactly a w by w Van Damme 1 matrix with distinct a i s which means a determinant cannot be 0 ok. So, that is a very simple idea ok. So, this is exactly a Van Damme 1 matrix which means and the see the i 1 i 2 to i w are all distinct which means the a 1s are will never repeat the a i and a j will not be the same determinant is not equal to 0. So, you get a constant ok I know I did not write down all those things very clearly try to fill it up in your own words ok you know where we are heading ok. So, that is the elegance and underlying beauty of this construction ok. So, if you go and look at it carefully how this Van Damme 1 matrix comes about there will be a nice interchange between the way the powers are done ok. So, it is very nice very simple construction based on very elementary linear algebra and you get minimum distance guaranteed which is based on ok clearly again this only shows that minimum distance is greater than or equal to d right right less than or equal to d minus 1 is not possible is what we have shown. So, minimum distance is greater than or equal to d how will I show minimum distance is equal to d I have to produce a weight d code word ok that is one way of showing it right. In fact, one can argue that is the only way of showing it ok you have to produce a weight d code word. Once you produce a weight d code word its minimum distance is equal to d in case you cannot produce maybe it is actually actually strictly greater than d ok it can be greater, but people have studied this for a long time and conclusion is mostly the BCH bound is very very tight ok in various cases of interest in almost all cases of interest minimum distance is always equal to d for the BCH code and there are some places where it is violated also where it is there is a little bit away, but it is always close it is not too far away ok the BCH bound is a good bound ok that clear ok. So, ok so once again I want to I want to reiterate this point I want to go through this once again given any minimum distance d ok. So, I am I am only interested in some code of minimum distance d ok some d how do you go about constructing it you can do it for some n which is 2 power m minus 1 ok. So, I also said n can be less than 2 power m minus 1 right you see why that is ok. So, you go back and look at this proof and never really use the fact that n is equal to 2 power m minus 1 ok it should be less than that that is all ok I will always get my random one thing to work ok. So, it is fine, but we will just stick to n equals 2 power m minus 1 it does not hurt us. So, for n equals 2 power m minus 1 ok I have seen I can achieve a minimum distance d ok with by choosing entries in my for my parity check matrix from f 2 power m ok and what does that matrix look like ok I know I have done this before. So, I will just simply go cut and paste ok. So, ok so that is what I am going to do ok. So, I would simply pick my parity check matrix to be of this form ok and any d I want I can now deal with it ok. So, only thing that is missing ok. So, again it is not it is not difficult to imagine any m and any d as long as you have that finite field in your hand as long as you have a vector to power conversion you can always fill in the nonzero the vector equivalent and get a binary parity check matrix ok, but the numbers can be truly daunting. For instance suppose I say n is even let us say this is just for fun let us say 10 23 ok. So, it is a rather large number ok picking m equals 10 right ok and suppose I say I want d equals d greater than or equal to some 17 ok. So, it is a large large number. So, you have to deal with what some alpha belonging to f 10 24 which is primitive ok and how large will your h be 16 times 10 24 and if you were to replace everything with binary equivalent you are going to get what each element is how many bits 10 bits now. So, you will get 160 by 10 23 ok and if you have to do Gaussian elimination and do encoding or even try and do decoding minimum distance you are not going it is not going to work ok. So, it is going to be way too many check I mean message bits to worry about way too many such a large matrix you have to worry about too many syndromes it will not work very easily ok. So, you see for large numbers implementation is still going to be a big problem ok implementation can still be a problem ok. So, if you go the traditional route what is the traditional route you replace each of these entries with binary equivalence find its equivalent binary parity check matrix and do your encoding and decoding with that you are not you are going to be really limited by complexity you cannot really imagine anything larger than 63 or 127 you cannot go to 10 24 another ok. So, you need some better way of dealing with that is there any further structure to this then that is what is apparent ok. So, the first thing I want to address before I go to the special structure of this which will give us more handle on what this code actually is I want to first look at k ok. So, before we even worry about implementation you have to find k right what is the only way we have a finding k the same route you have to again replace again do linear linear nation all that again finding k also is quite non-trivial it is not very simple ok. So, even for finding k can be daunting my goodness k by n tends to yeah yeah yeah it is for large n it is not a good code for small n it is ok moderate n it is ok. So, let us look at some numbers ok. So, finding k also appears to be a problem ok. So, both these issues have to be solved in a very nice way and they can be solved ok using using very simple nice ideas from what are called ideals and all these things one can solve this very very beautifully and you will finally see every code word of a BCH code has a very very simple description. In fact, you can design a linear feedback shift register ok you know what a linear feedback shift register is right. A bunch of D flip flops with some connections ok to encode BCH codes ok. So, it is as simple as that ok. A very simple linear feedback shift register with bits being shifted in will encode BCH codes ok. It is very different from the way I was talking about ok m times g ok you do not have to store such huge matrices all you need is an LFSR ok. Such simplification is possible for BCH codes ok all that comes from looking at these code words with the slightly different viewpoint from a slightly different viewpoint if you see you will see there are wonderful properties that come out for this code and you get some very nice results ok. So, before that I want to first address this problem of k ok and try to see if I can get a nice simple bound for k which will work for now ok just to look at look at some numbers and then we will actually look into this theory ok. One thing that we knew is what square is going to be linearly dependent ok. So, any even number from 1 to d minus 1 ok I have d minus 1 rows every even numbered row is going to be linearly dependent on some odd number row. So, even though I have d minus 1 rows half of them are going to be clearly linearly dependent there is no problem ok. So, that is the first argument ok. So, since squaring works ok suppose I have n equals to power m minus 1 and suppose I want d to be let us say I will say d equals 2t plus 1 ok. So, my h has what d minus 1 by n rows which is 2t by n matrix right ok, but out of this 2t only t are linearly independent ok all even numbered rows are linearly dependent ok on that row by 2 ok. If you take the 10th row it will be the square of the 5th row ok. So, it is enough if you only keep the odd numbered rows ok. So, only the odd numbered rows will be ok you can one can expect to be linearly independent and most cases they will all end up being linearly independent also ok. So, you clearly see h in binary will have less than or equal to m times t linearly independent rows right not 2 times m times t only m times t linearly independent rows. So, from there you can conclude k is actually greater than or equal to n minus mt. So, it is a very simple result you can have without looking at looking at any further any deeper understanding of what these quotes actually are a simple result just based on the squaring and this bound also happens to be very tight for small t particularly ok. So, it is very tight for small t what do I mean by a bound being tight yeah it is very close the actual value is very close to this bound ok. And for many cases for small t it is exact ok it is not just tight it is exact for small t. So, if you take t equals 1 or t equals 2 or t equals 3 4 5 even till some 10 ok if you want only want to only correct 10 errors or something this bound is always exact more or less in most cases ok. So, you see I mean even without knowing anything about the code I can list out the parameters of possible bch codes ok. Suppose for instance I want to list out with m equals 8 bch code parameters ok. So, if I say t equals 1 what will I get ok 255 ok k is what greater than or equal to 255 minus 8 which is 247 right and then d is greater than or equal to 2t plus 1 which is 3 ok I know I can construct I know how to construct the parity check matrix for a 255 247 3 code ok. In fact this will also be the binary hamming code ok without I mean one can prove this for any m for any m for t equals 1 you will always get the binary hamming code as a bch code ok. But if you want t equals 2 ok why am I concentrating on t that is the error correcting capability right I am able to correct 2 errors ok what will be the parameters 255 255 minus 16 which is 239 and then 5 code ok. Then let us say t equals 3 255 231 7 code I know all these parameters are exact I know there is only a bound right I can only say greater than or equal to here and then greater than or equal to here but I know people have shown that all these things are exact ok. So, let us say t equals 4 255 223 9 ok likewise you can keep on listing ok. So, let us list for some number ok let us say for t equals 16 ok what would you get 255 what is 16 times 8 127 33 code ok. So, imagine the power of that statement ok if you are if you are not if you are not imagining the power of that statement I would ask you to step back and think about it ok what am I saying when I say I have a 255 127 33 code I can produce 2 power 127 vectors binary vectors of length 255 any 2 of them will be different at least 33 places ok. So, it is a remarkable achievement from where we started ok. So, if you imagine if I told you at the beginning of this class that you would do something like that how many of you would have believed me I do not know you would have believed me but it would have been very surprising if you had the tools to do something like that you can produce 2 power 127 if you imagine how large the number is that is a huge number ok right 2 power 10 is 10 power 3 ok. So, 2 power 127 is a huge number ok that many vectors of length 255 ok binary vectors you can produce and you are guaranteed that any 2 of them will always differ in at least 33 places ok. So, it is a remarkable achievement ok and you see the construction the way it works it just relies on very simple techniques without anything that is very extraordinarily great. I mean when they came up with it I am sure it was an extraordinarily great achievement but for now when you look at it in a structured way it seems like a very simple result of very few things put together ok. But I want you to go back and look at the Vandermonde construction once again and convince yourself I am not quite sure I think it is exact but I am not quite sure but yeah I think it is exact I think for all BCH codes for 255 satisfy the boundary meet the boundary I think I mean I might want to check that there are papers which you can look up that will give you all these things but that is the power of this elegance and simplicity in this BCH code construction ok. So, take your time and look at that Vandermonde matrix and how that structure beautifully comes about ok. The way you do the alpha power D and the way the powers will interchange and give you a Vandermonde matrix is really really nice ok. So, it is very very wonderful it gives you such powerful things ok. So, on the flip side unfortunately these codes are never implemented ok. So, people implement Reed Solomon codes they do not really implement BCH codes that some people do and today's reality is all these codes have been upstaged by codes such as LDPC codes and turbo codes which are completely inelegant in their construction ok. Totally inelegant and random and you know arbitrary is the word that comes to mind you know I mean it is just and but that is they are also powerful in their own way ok for all you are interested in this coding gain and all that they give you really good coding gain way better coding gain than what BCH codes can be and like he has been saying they are also good these LDPC codes are also good on average ok. So, these codes are not that good they become for large n they do not they are not as good ratios you get they are not that good ok. So, that is the problem and it is quite unfortunate, but anyway as far as we are concerned we will see this reasonably ok. So, we will see a little bit more of this see that structure which makes it which gives you a very simple LFSR implementation for the encoder we will see that and then we will move on to Reed Solomon codes very quick ok. So, I believe your first quiz is on February 20th ok. So, I am I am quite sure I will be done with Reed Solomon codes by that time ok. So, if you are not keeping up if you are not if you are not going to my website if you are not downloaded those problems if you have not tried to work it out on your own if you are not if you are not doing all that you will be in big trouble in your first quiz ok. So, before the quiz I will have a few tutorial sessions where we work out problems together ok. So, we will do that in the last week, but I want you to do this regularly ok. It is an elective course I am assuming that all of you are interested enough that you will go and do these problems on your own ok. I am not forcing you to do it, but if you do not do it and show up for the exam you will fail ok. So, I have failed people in this class it is quite miserable for me to say that, but particularly people who are not regular ok. People who just come and sample lectures and then hope that the exam will be a repetition of the problem sheet they have failed in this class ok. So, do not fail ok. So, do not do that to yourself ok. So, ok. So, that is the we will stop here for today. We will meet again tomorrow and pick up from here and I will show you some wonderful properties of this BCH code which makes which simplifies the encoding and understanding of this.