 The previous lectures, we have already introduced the concept of NP completeness and I have talked about the importance of NP complete problems or NP complete languages. In this lecture I will now formally establish some of the NP complete languages systematically and as I had mentioned that the first problem in the history which was observed that it is NP complete satisfiable to problem. It is so called Cook's theorem Stefan Cook has established this theorem this result. So, I will be proving this Cook's theorem in the sequel. What we do? Although satisfiable to problem was the first one to establish that it is NP complete. I will take a classroom approach we will systematically develop the proof of that may not be the original the proof, but we will systematically develop using the techniques and the approach that we had adopted in this course. And give a give an elegant proof I mean a proof that it is very quickly understandable based on the previous lectures we give in this lectures on NP completeness. Let me just recall what is NP complete language what we have talked. A language L in sigma star is said to be an NP complete language. If it is an NP language and you take any language in NP the class NP there is a polynomial time reduction from that language to L. And also I have mentioned about you know establishing NP complete languages in this you know you look at if you are knowing an NP complete language say L dash. And to establish a language which is in NP as NP complete if you can polynomial time reduction from that language L dash to L that is sufficient. Why? Because to L dash because if you take any L double dash an NP language from L dash from L double dash to L dash you will have a polynomial time reduction. Because it is NP complete because L dash is NP complete and now from L dash to L if you have a polynomial time reduction you know the transitive property of this polynomial time reduction this reduction in polynomial time. This less than equal to p what we are writing this relation this is a transitive thing. So, that you will have L double dash is reduced to L in polynomial time this is you take an arbitrary L double dash in NP. So, take an arbitrary L double dash in NP since L dash is NP complete you have this and since this is given you get the transitive t L double dash is less than equal to p L. So, that every NP language can be reduced to L in polynomial time. So, we have already discussed this theorem, but anyway I wanted to just recall this. So, this is one that will be useful if you are already knowing an NP complete language because you see to establish a language is NP complete you have to observe that this is NP. And second thing what we have to observe is for every language in NP we have to give a polynomial time reduction to L. So, this is a hard problem. So, and the complex and you see we have to give such a polynomial time reduction from every language to the considered language L. So, instead what can be done if you are already knowing a language is NP complete then you can establish a new language if you NP complete by giving polynomial time reduction from that language to this, but observing one language is NP complete anyway requires all this you know I think to be looked into. Now, when we are talking about language in NP to prove this thing let me first give a criterion here a language L over sigma an alphabet of size at least 2 and assume dollar is not a symbol in sigma. Now, if there is a polynomially balanced language L dash in sigma star dollar sigma star. So, L dash how does an element in L dash look like that is every element is of the form x dollar y for x and y in sigma star. So, if you can have a polynomially balanced language L dash such that this L dash is in P this is there is a polynomial time deciding algorithm for L dash and this L is just you know a coefficient of L dash with dollar sigma star. That means in the language L dash the polynomially balanced language L dash if you just remove all the things from and after dollar whatever is there if that is L then we can observe that this L is in NP what exactly is this L dash. So, L dash what we are trying to give here after dollar because you know what is what is language in NP a language is in NP if you have a polynomial time verifying procedure polynomial time verification procedure for the language at a given a certificate. So, for the language L if you want to look at a language L if you want to see this is in NP. So, suppose these are the strings in L etcetera now any string you take if I give a certificate y and if there is a polynomial time procedure to verify this, but how to give this certificate this certificate we give non deterministically. So, that is why this NP you know this non deterministic Turing mission which verifies that x is in the language L or not in polynomial I mean x is in the language in polynomial time. So, given a string x in sigma star say L is a language in sigma star now you given a string x in sigma star what do you require a non deterministic Turing mission you take x as the input and this non deterministic mission you know has to check whether x is in L. So, if x is in L this non deterministic mission halts and the time it takes should be a polynomial time that is what is the definition right. So, an alternatively you know I can say like this if checking non deterministically means given a certificate say I will give that on the input itself I give non deterministically a certificate a solution you know this and then this x y if I have a polynomial time decision for this polynomial time decision for this then I can say the language L is in NP that is what is exactly we are trying to look at in this criterion. So, once again now here the why what we are we are taking the language L dash what we are creating that is subset of sigma star dollar sigma star. So, what are the certificates we are going to give that we should be able to give in polynomial time with respect to the string x. So, that is what is essentially the language is polynomially balanced the meaning of polynomially balanced language is exactly this. So, let me look at that L dash in sigma star dollar sigma star is polynomially balanced what is the meaning of that means there is a polynomial p such that x dollar y is in L dash then the length of y is less than equal to p of mod x that means with respect to x you know the length of y is in a polynomial bound. So, that is a polynomially balanced language now what is another point in the high process this L dash the polynomially balanced language L dash is in p that is also given to us the meaning of this is there is a Turing machine m dash that decides L in a polynomial time let me say that is q time. Now, what I want to look at that this L is in n p. So, to show L is in n p I have to give a non deterministic machine which accepts L in a polynomial time. Now, the following non deterministic Turing machine that accepts L what is L dash by dollar sigma star in non deterministic polynomial time we are constructing it here. How do we construct you just take the tape and the x is given as input to you from sigma star to accept L what I am going to do first you print dollar here. So, that is what is this p dollar this component of the Turing machine and then here non deterministically generate the possibilities of certificates. So, this y it is from sigma star. So, if I assume sigma is a 1 a 2 a k I have the possibilities of you know printing a 1 or a 2 and so on. So, I have here k loops printing connecting to a printing machine printing a 1 or a 2. So, whatever is the certificate I mean whatever is the string from sigma star I should be able to generate following this loop this particular portion of the this thing Turing machine and since this is non deterministic machine you know whatever is you want whatever is that you want you can print using this loops and then once you print a certificate y you know you connect it to m double dash. Now, you ask me what is m double dash m double dash here this is a simple variant of m dash because this m dash you know because L dash is in p we have a Turing machine m dash right which decides L dash in polynomial time. Now, what I am doing this m double dash is just a simple variant of m dash which would loop forever when m dash halts with no because m dash is an algorithm you know one when you give an input to that it will say yes or no if it whenever it is saying no this variant m double dash will simply loops forever when it is not going to halt in all other respect you know m double dash is just identical to m dash whenever it is halting by saying yes in all other aspects. So, we will just leave it that way. So, that is what is m double dash now you look at once again the Turing machine m. So, this m the Turing machine what we are doing in the beginning whatever is the input that you are taking x we first print the dollar non-atmistically you will be able to print any string y from sigma star and then this input will be given this will input will be given to m double dash where m double dash is simply m dash except that whenever this is saying no it is not going to halt it will go simply you know it will loop forever. So, that you know the no case will not be accepted because we are constructing a non-returnistic machine here. So, now you look at this x is in L if and only if there exists y in sigma star with you know length of y is less than equal to p mod x because it is such that this x dollar y is in L dash because you see the language L is equal to L dash by dollar sigma star since L is equal to L dash by dollar sigma star whatever is x is in L you know you will have some y with this kind of property. Now, you look at because this x dollar y is in for some y this is in L dash there is an halting computation of m with no more than this many steps. Now, you look at how many steps you would require because to print dollar as a given position one step and then take a right move and whatever is y that you want to print every time you will be taking a right move and print it alright and thus see whatever the length of y you know it is bounded by p mod x. So, printing that many to p mod x this many printing steps for that and then printing dollar is one step and finally you will be taking one more right move to go to this position right. So, printing dollar is one step going taking a right move one step here. So, that you know there are two steps here printing y which is of length maximum p mod x. So, that is two p mod x number of steps to print y two steps for this purpose what I have mentioned dollar and taking a right move there and once you have this input since the mission m m dash is taking the polynomial time q and now the what is the input size here this is mod y mod x plus 1 right and mod y is less than equal to p mod x. So, this is the total now input length for m dash. So, now it is to m double dash. So, the that is the polynomial time with respect to q here. So, this is the this is the total number of steps that this mission takes and you see this is a polynomial because p is a polynomial q is a polynomial right with respect to the length of x what you are having this is you know in a polynomial time. Hence, m accepts L in a non deterministic polynomial time t n where the function t is given by the expression 2 times p n plus 2 plus q times p n plus n plus 1 right this is the polynomial to compare with this and thus you can understand that L is in N p. Once again we look at the statement what I what we are trying to see here to observe a language is in N p if you can identify a polynomially balanced language polynomially balanced language is nothing else, but you know given a certificate given a certificate which is within polynomial time you should be able to decide whether that you know is in p. So, this with this criterion we can cross check the given language is in N p all right and here is a small remark, but of course very interesting that corners of this statement is above result is also true what is the meaning of that if you take a language L in N p you will be able to identify a polynomially balanced language L dash in which is a subset of sigma star dollar sigma star such that L dash is in p and the given language L which is in N p is equal to L dash by dollar sigma star. So, we will be able to identify a polynomially balanced language L dash always. So, polynomially balanced language means the one which satisfies this criteria right. So, this is also true that is this there exist a polynomially balanced language L dash contained in sigma star dollar sigma star such that L is in p and L is equal to L dash by dollar sigma star right. You can try this as an exercise because what is the language L dash that you wanted to identify right. So, a simple hint can be you know whatever the certificate what are the certificate corresponding to the given input you have to append those certificates right when you are creating this L dash when it is in N p you know you are non deterministically accepting it non deterministically accepting in a polynomial time. Now, when you want to have a polynomially balanced language this L dash how do we construct next to the input x you have to give a certificate y right and this y length should not be more than you know some polynomial p mod x the length of x. So, that kind of language we have to identify. So, this is in fact you can use the what is called the computation history of this machine the machine corresponding to L you can make use of that and you can create the certificate right this is a hint here you can try this as an exercise. Now, to prove to establish a language N p complete you see we have two conditions one is to observe that the language is in N p and the other is you take any language in N p you have to give a polynomial time reduction to the language what you are targeting to show that is N p complete. For both the things I have mentioned like you know what is the approach that we will be following this is a necessary and sufficient condition corresponding to N p to observe that language in N p and thus more or less you know you can consider this technique and understand that a language is in N p. So, you have to essentially give certificate in a polynomial time and verify in polynomial time that the string is in language L dash or not and second thing is if you have already established some language is in a language is N p complete then we know that you just give from that language to the targeted language a polynomial time reduction these two things I have just mentioned. Now, what do we do anyway first we have to establish some language is N p complete then that kind of reduction just single reduction will be sufficient how do we do that what is the approach now again you look back when we are talking about undecidability we have first established that halting problem is undecidable. So, once we have established the halting problem is undecidable using the halting problem we have reduced many other languages to show that they are undecidable language. So, in this course particularly if you just look at whenever we wanted to show some language is undecidable either directly from halting problem or some variants of the halting problem or you know whatever that we have already established they are undecidable from there you know we started reducing the targeted problem right and establish that they are undecidable. Here also we will go in a in a similar approach what do we consider an a variant of halting problem in the present context what is the halting problem halting problem ask you to verify I mean to decide whether given a Turing machine M under input string W whether M halts on W whether there is an algorithm for that. So, that decision problem you know we have observed that it is undecidable all right that is an unsolvable problem. Now, a variant of that in the present context means what do we consider in place of a Turing machine I consider a non deterministic Turing machine. So, now you see the system is going even more complex and the question is not the question is not you know given a non deterministic Turing machine input string W whether M halts on W it is not it is not the question because even considering a standard Turing machine you know the problem is undecidable. So, when I am looking at this of course I ask you I give you some other parameter now what is the time what is that time parameter that means I ask you to see whether this M accepts W the non deterministic machine M accepts W in so many steps I give you a fixed number of steps corresponding to give a Turing machine under string and I ask you this question. Now, this is the first language this I can call it as a non deterministic quantitative analogous problem to the halting problem. So, such a variant we consider and I will establish first that this problem is NP complete to when what are the definition we give. So, we will verify both the conditions and establish that this particular problem is NP complete for halting problem we would have written H H naught or whatever halting problem similarly here since it is non deterministic machine let me start writing N naught the problem let us look at this problem. This is a variant of halting problem for non deterministic Turing machine which includes time parameter formally the language when I am looking at you see we are considering a non deterministic machine M and a string input string W. Of course, we are considering the encoding of that because I am giving you a language and then of course, this ampersand symbol that at the right 1 T that means you know this is the time that this many steps because we are giving this in the unit representation you know that M and W we would have given that using the alphabet 0 and 1 you know that we have considered an encoding of a Turing machine using a sequence of 0s and 1s. Similarly, a non deterministic machine also you just encode it the given input and M. So, this is encoding of that and then this separator tells you after this what are the so many once I am giving that is the number of steps that I am expecting that M should accept W in that many steps. So, this problem N naught is what given a non deterministic Turing machine M and a string W whether M accepts W in T or fewer steps. So, formally we write a language concerning that is this way. So, we prove that this language is NP complete to show the language is NP complete N naught I give you a polynomially balanced language N naught dash and observe that this is in P and moreover this N naught dash quotient with dollar sigma star whatever is the underlying alphabet of course, is N naught. So, that is how we consider this N naught dash you look at this how do we define. So, define the language N naught prime N naught as what is that what we are going to give this M W the T the time of course, 1 power T we write that means, so many once right the with respect to time. Now, the dollar is the separator for the certificate and what is the certificate we I am going to give here is encoded configurations of M on W you look at. So, all this C naught C 1 C T dash this is this string satisfies you know the following 5 statements what is that M is an N T M non deterministic Turing machine Q sigma delta Q net and W is an input. And what are the C i's C i's are configurations of M for all this C i's and C naught is the initial configuration of M with W as input that is what is written this way. So, Q naught blank W blank. So, this is what our initial configuration and the C T dash is a halting configuration that means, you are in a halting you are in the halting state H and with some thing on the tape that X A Y for some X and Y in sigma star A in sigma the current reading symbol is A. And moreover what is the sequence C i C naught C 1 and so on from C naught in one step you are getting C 1 from C 1 you are getting in one step C 2 and so on. So, C i gives C i plus 1 in M in one step for all this and then the number of steps here the number of configurations that I am writing it here the number of steps here the T dash is less than equal to T whatever is that number T we are given. So, let us consider this language. Now, you look at once again what is the certificate we are going to give we are giving the computation history of M on W. And we are considering all possible configurations which leads to a halting configuration from the initial configuration within you know T steps that is what we are considering in this language. This is exactly gives you the hint of the exercise I have I had given you this kind of thing you consider and then you can observe that for the converse of the previous result. Now, you look at this N naught dash is a polynomially balanced language and is in P how do we say that why this is polynomially balanced because any string you consider here as a form x dollar y is in this N naught dash what is x here this encoding of M on W at the rate 1 T. So, that is what is x now x dollar y is in N dash then what do we require what is the condition the length of y should be less than equal to some polynomial time the polynomial of the length of x. Now, you look at this configurations how many configurations we have T number of configurations how am I am going to encode the configurations you encode appropriately like you know the Turing machine the transitions are encoded as blacks of zeros and ones. And similarly you know in a configuration you know that there is a state component and the input that is what is essentially a configuration and always the input W it changes what say for example, W a 1 a 2 a n in each step what an increment of at most one symbol a symbol like if I go towards and I may increase by one more symbol if it is the case. So, in each step either you are going to take a right move you know are making a printing step. So, each step with respect to W you know I am not making any larger change as far as the configuration this thing concerned the length of the tape concerned right and then you see this transitions from with respect to this. So, a state component is there if you look at a configuration a state component is there and the input. So, W is the input and the change what you are going to have whatever is the way that you encode each symbol you know this is with respect to with respect to the W this C naught is within a polynomial time with respect to what is called the length of x because the entire thing as x we have. And how many such configurations that we are going to give we are going to give configurations which are less than or equal to t the number of configurations. So, since this parameter t is part of x you see this configuration let me say each configuration with respect to W is of maximum say k length. And now you have k t dash k t dash this I am once again reemphasizing that this configuration with respect to W I would have may be let me put a parameter this is k mod W suppose this is how when you have encoded which is coming up. And then since t is already a parameter inside x you see I am taking t dash steps. So, this is also with respect to that a polynomial times and thus whatever is the certificate we are going to give here. That means x dollar y is in n naught dash then the length of y what we are going to give the certificate it is less than or equal to you know with respect to the input input that x it is a polynomial it is a polynomial bound with respect to the parameter mod x. So, this is therefore, polynomially balanced and it is in p also why this is in p. Because everything is available now only thing what I have to verify you know once I have printed this certificate that this is a non deterministic Turing machine W is in sigma star. So, these are the things that you have to look at and then since these are the configurations of m you have to just cross check that once this c naught is of this form this c naught whether you are going to get c 1 or naught how do we know this that is from the machine m because the transitions of m are also available. So, c naught to c 1 whether you are going to get r naught you have to see c 1 to c 2 you are getting r naught you have to see and so on c t dash this is the step that you have to verify. So, on this input when I am going from c naught to c 1 I have to carefully verify whether this is following the transitions of m r naught that is what I have to cross check and if this c naught is the initial configuration and c t dash is the halting configuration that way and the number of such configurations whether they are less than equal to t r naught. So, all these conditions that we have to verify for x dollar y the string which is in n naught dash. So, you can do this in polynomial time because this is just you have to go back and forth on this how many times because the number of transitions that you have to verify here. So, you can observe carefully you can give little more details and observe this n naught dash is a polynomially balanced language and is in p and moreover here the way that we have constructed is n naught is n naught prime by dollar 0 1 star I am writing 0 1 star here with the assumption that I am encoding these configurations using the sequence of 0's and once again like the way we have encoded a Turing machine. So, dollar 0 1 star that is what is n naught. So, this will be in p because once this is a polynomially balanced language in p I will use that result and observe that this n naught is a language in n p. So, the language n naught we have observed that this is in n p using that result. Now, the second thing what I have to observe you take any language in n p I have to give a polynomial time reduction to n naught. That means, I have to show this l is less than equal to p n naught let us see how do we do that. Since, l is in n p there is a non deterministic Turing machine m l and a polynomial p l such that m l accepts l right this is the definition of n p language all right accepts l of course, in non deterministic time p l because the polynomial p l for a non deterministic machine we say this is a non deterministic time right. So, this is the definition now what do I do I give you a polynomial time reduction here. So, reduction means what I have to do I have to give a Turing computable function that reduces l to n naught I have to give a Turing computable function which reduces l to n naught and that computable function we should be that reduction should happen in a polynomial time these two things that I have to look at. How do we do that I define the function f l from sigma star to 0 1 at the rate star because the encoding of Turing machines that we are doing with 0 and 1 and anyway we are separating the time with respect to this at the rate symbol. So, therefore, these three are taken into count all right and now how do I define that you take any string w and sigma star first I simply print m l because m l is in my hand right. So, for l there is corresponding non deterministic Turing machine m l. So, there is a constant that is with me so I print m l encoding of that and whatever is the w that you are giving me the same w you know encoded. So, this this pair we considered encoded and then what is the time I give associate to this is because this m l accepts w in non deterministic polynomial time p l I just give that much time the time here is p l of mod w right. So, this is the time we are associating to this. Now, let us look at this f l can we prepare this. So, given w as input to a Turing machine a Turing machine you give can we create such an output in polynomial time with respect to the length of w you look at what we have to do here what I have to essentially do is I have to print the encode of m l you can consider may be 2 tap Turing machine for the time being say I will just print this is a constant one right I have printed encoding of this. Then the w encoding you will also print because w is available here. So, now this m l for every string this is always constant this w corresponding to that I have to print. So, this is say for example, printing m l for any w say for example, k number of steps and now this w you encode it for example, you know depending on the type of coding that you have for each symbol that is with respect to length of w you will have some polynomial right. Say some polynomial times length of w that is how you will be coding this and after this what I have to do I have to print so many ones which are you know how many ones I have to print p l mod w this is what I have to print you see clearly p l is a polynomial I have to print that many ones. So, that means printing that many ones means twice p l mod w steps you would require right. So, some constant number of steps to print the encoding of m l and then some polynomial you know bound with respect to mod w to print the encoding of w and thereafter I have to print at the rate symbol that means again two steps there and then to print this many ones I have to take this many steps you look at this is a polynomial p l is a polynomial p is a polynomial this k is a constant. So, thus you can see this can be this can be done in polynomial time and this you can manage using a Turing machine. What is the meaning of that this f l the function f l given w on the tape of a Turing machine you know to creating this f l w that you can manage using a Turing machine in polynomial time that means this f l is a Turing computable function and can be computed in a polynomial time. So, now you observe the w is in l if and only if this f l w is in n naught. So, this f l w is in n naught. So, string w is in l then f l w is in n naught because this will be accepting that is what is exactly this since l is in n p there is a non deterministic Turing machine m l you know that accepts l in non deterministic polynomial time p l right. So, this f l w is in n naught and whatever is that we have created here if this is in n naught then w has to be you know that w is accepted by m l in non deterministic time p l. So, w is in l. So, we have this situation that means what this is this is a Turing computable function and you are computing this in polynomial time more over this condition is also satisfied. That means this f l is a polynomial time reduction from l to n naught that means l is less than or equal to n p n naught. Now, what is l l is an arbitrary language in n p. So, you take any arbitrary language in n p this procedure it is a very elegant simple procedure you see that can be that l can be reduced to n naught in polynomial time. So, what is that? So, this is the second condition for n p complete to establish a language is n p complete. So, combining these two now we can conclude that n naught is n p complete all right. So, if you look at here the way that we have handled this undecidability that mean certain languages are undecidable we have started with halting problem. Now, analogous problem of that halting problem that we have introduced and establish that it is n p complete. Now, as an exercise what we have done there certain variants of halting problem that we have considered. So, those variants that you could establish that they are undecidable how would we do that? So, from the halting problem you have reduced to those variants the halting problem you give a polynomial sorry you give a reduction to the targeted problem that variance right here what we are going to do that reduction we have to verify that it is polynomial time. So, this polynomial time reduction is required here. So, now I give you such similar exercise you look at given a non deterministic Turing machine m whether m halts in t steps when started on a blank tape. So, this kind of problem we have considered in the undecidability also given a Turing machine m whether m halts when you start that in a blank tape. Now, an analogous problem here what is that I give you a non deterministic Turing machine m and of course, a time parameter also. So, it is a T in t steps whether you know m halts when you start that machine in a blank tape. So, how do I write the corresponding language say let me call it as n 1 n coding of m and the time I am separating that by at there at symbol right. So, this is the string where m is a non deterministic machine and when you start this on the blank tape that means, this is the initial configuration right. And in t steps it will halts with something on the tape that x a y for some x and y in sigma star a is sigma and this t this t dash should be less than equal. So, within t steps. So, I am just writing t dash I mean within t steps all right we can observe that again n 1 is also n p complete you see if you look at the history of n p complete problems you know there are very important problems several you know dation problems concerning certain optimization problems all those things that we are going to discuss, but you look at for the classroom concerned you look at such a nice simple languages that anyone can sit and establish that they are n p complete. And the approach is also you know what you have practice the reductions in undecidability. So, what I what you have to do here first you have to establish that n 1 is in n p right that is n p language. And then now since we are already knowing that n naught is n p complete you can make use of you know that n naught is now it is sufficient to give a polynomial time reduction say from n naught to n 1. So, you can target to do this as an exercise to establish that this is n p complete regarding polynomial time reduction from n naught to n 1 I give you a small hint here. So, that you know you can complete this problem by showing that there is a polynomial time reduction from n naught to n 1. So, that n 1 is n p complete what do I suggest you look at in n naught what do we have in n naught we have you know encoding of non deterministic machine and a string. And then you know the respective number of steps within that you wanted to pursue. So, and corresponding to this what we have to assign we have to assign a non deterministic Turing machine which when you start an empty tape it has to finalize finalize whether this is in n 1 within the given number of steps. What do we suggest here you take a string because the encodings I am just assuming we will be able to make with 0 1 here. Because as earlier in the Turing machine what we are writing this at the rate symbol is extra that we are using just to separate between the Turing machine code and the time. So, now you take a string x in this 0 1 at the rate this star take any x if that is of the form some non deterministic Turing machine m and a string w input string w. And sometime this at the rate un power t if this is not of this form then you simply assign some string which is not in you know in n 1 from this. In n 1 we know that at least at once at the rate symbol has to come when I assign some 1 or whatever it is not clearly in n 1. So, what I am doing if a string x is not of this form that m w at the rate 1 power t then I will simply assign some string which cannot be in n 1. And if that is of the form then what do we do so for some non deterministic Turing machine m w all this I will assign this string I will tell you how what is this string this what do I suggest you construct you take a Turing machine non deterministic Turing machine m dash what we what is our desired intention. Because when you start on empty tape in given number of steps whether this will halt or not that is what is our this thing question. So, you simply from the current cell because you are starting on the blank tape. So, the current cell you take a right move and print a 1 here and take a right move print a 2 here and so on a n what is this a 1 a 2 a n that is the string w. Because this is axis of the form m w form m w at the rate 1 power t what do I suggest first you print the string a 1 a 2 a n and take a right move. So, now the reading and writing at position is this. So, this part can be managed by this portion of this m dash and then simply you connect to the machine m. So, if you consider this non deterministic Turing machine m dash what exactly we are doing whatever is the part of input w that you will first prepare it on the tape and then connect it to m. Now, to prepare this string how much time you would require the length of length of this w of course, this is w and you know a plus 1 more step essentially. So, 2 mod w plus 1 steps that this will take 2 mod w plus 1 steps this will take to prepare this a 1 a 2 a n and then when you start m here this will pursue this input within this t time or not that is what we have to causes. So, the total time we are giving here is 1 t plus 2 mod w plus 1 time suppose if you give this now you can observe that whenever this is in whenever this m w at the rate 1 t is in n naught if and only if you know the f of x. So, whenever x is that means x is in n naught if and only if you can see f of x is in n 1 and you can observe that this reduction is in polynomial time because you can look at with respect to the input size how much this is coming in. So, with this hint you know with this kind of function I can ask you to complete this exercise that to show that n 1 is n p complete.