 Hello! Welcome to the session on Conversion of Contacts Free Grammar to Chomsky Normal Form. At the end of this session, students will be able to convert a Contacts Free Grammar to Chomsky Normal Form. We convert the given grammar into Chomsky Normal Form i.e. producing a x format. Now in this case, initially we start with the grammar g consisting of format g is equal to vtps that is non-terminal terminals production and start. Next, we are eliminating useless variables that cannot be become terminals, then eliminate useless variables that cannot be reached, then elimination of null production, elimination of unit production, then conversion of grammar to Chomsky Normal Form. Now in this given grammar, s producing a a c d, a producing a a b or null, c producing a c or a d producing a d a or b d b or null. In this first step, we will check whether any useless production is present. Here s is starting a a c d, a c is having value, c is having terminal value, d is having terminal value. So, here there is no useless production which is not having terminal value. Now next, we will check useless variable that cannot be reached. Now here s is having values, c is having values and d is also having values. So, s is reaching to every variable. So, there is no useless variable that cannot be reached. So, we will move to the next step. Here we will check null production and eliminate if any present. Here in this production, a and d are having null productions. So, here we can see that l is producing null, d is producing null. Now these are nullable variables, a and d are nullable variables. Now in this a variable after null replacement, we will check what are the changes will be there. In this case, this is the new grammar we are defining. Now here a a c d only single variable it was defining first. Now when we are putting null at that time a will be null. So, your value will be a c d. Next a will be null. So, your value will be again a c d is there. Then next we will check for d we are putting the value of d is null. So, we are getting a a c. Next when we are putting both a and a null value we are getting c d and when a and d both value we are putting null only c remains. So, that value is c. So, next a is there. Here there is no value for that. So, only a is there which is having null value. So, we are putting here a is null. So, it will get a b value. In this case a c is there as it is there is no use of capital A and capital D and in the d value we are putting here a and d. So, only d is there. So, when we are putting d as a null. So, we are getting a a and here b b. So, here we are producing new grammar by with using that elimination of null variables. Next we are having the elimination of unit production. Here we need to search unit production in the given grammar. As we have seen we can check the unit production here no here no. Here c c is the unit production in the start symbol s. So, the and that is the single unit production nowhere other places we are finding any unit production. Now by putting the value of c wherever the c is present we will get that new grammar. Now here c value is ac and a. So, we are putting here in the s instead of c keeping the value ac and a. So, here we are eliminating any unit production that is c. Next now once the format is clear now we can convert c and f format that is a defining or a producing ax. Now here restricting right side of the production to single terminal or string of two or more variables. Now steps in this we will add x a and x b instead of single terminal wherever it is present. Now wherever single terminal a is there we are not replacing, but wherever this a b a b these terminals are there we are putting x a value for a and x b value for b. Now accordingly we will see that new grammar is there. So, a acd here we found first single a with non-terminal. So, it is replaced by x c. Next in the a x a is replaced here b is replaced as x b. So, here again x a and x b here again x a this is a single terminal. So, next whatever a is replaced by x a then x a like this all b is x b x b x a x a and x b x b. So, this is the new grammar we are producing. Now one more step here it is whatever big or long productions are there we have to short that productions. Now I will take one example how to short that productions here a a cd a acd has to be converted into the short. So, directly I am keeping s producing a t 1, t 1 is what t 1 is equal to a t 2 and t 2 is cd like that a cd is converted into s producing a u 1 a ac is producing s a v 1 and like this would the next all the productions are shown over here and they all are shortened and thus we have converted the cfg into cnf. There is one question for you remove the null production from the following grammar here s is having this value and a is having this value. If you find any null production here then remove it after elimination of the null production we are getting the new value. So, here a is having null value. So, we are putting wherever the a values are there and we are keeping the null values. So, here first here we are putting null value. So, a b c here b ac then both a is as a null value. So, b c value is there. So, these are the new values if any duplicate then you can remove it and you can write that new value. Thank you.