 So, far we have discussed about certain types of automata, particularly finite automata and its variants deterministic finite automata, non deterministic finite automata, etcetera push to an automata. And we have observed that this automata have certain limitations and we have identified that there are certain certain languages which are not accepted by this automata. Particularly, if I as an example you consider this a power n, b power n, c power n such that say n greater than or equal to 1 or. So, this language we understood that it is not context there is no push down automaton accepting that. And in the usual computation using your routine computer it is very clear that there are much more complicated languages than this particular example, you can compute it and see that the computer is handling such languages all that. Now, when one thinks for modeling this computation or the notion of algorithm, essentially you know these two this type of automata so far we have introduced are very restricted. And one looks forward for a better model which can accept much more complicated languages than whatever so far we have seen through this push down automata or finite automata. So, in the direction in this lecture we discuss about an automaton so called Turing machine this is named after Allen Turing mathematician. So, it is called Turing machines in this lecture and we understand that these are having enough computational facilities. And indeed that this is this will work for modeling the computation. And this Turing machine as having the features of an automaton there will be a tape finite control and all those things here is a very important point that in case of finite automaton we have a left just right side infinite tape and a finite control. So, we are taking symbols the input from the tape and with respect to the internal state what are the transition is given accordingly it will take the transitions. And finally, if it is reaching to a final state we are saying it is the input is accepted otherwise rejected that is how in finite automaton we have followed. And we have certain variants for the class of languages accepted by deterministic finite automaton finite automaton there is a regular languages. That is you have we have discussed about 2 DFA that is you are allowed to move this reading head not only to write may be left. That way we have discussed 2 DFA and it is not having much computational power than a typical deterministic finite automaton DFA. So, essentially the class of languages accepted 2 DFA is same as regular languages although you are allowed to move it. And we have discussed missions which give output there you have an output tape there you have an output tape. And you are allowed to print some symbols on this corresponding to each symbol there more milly sort of missions we have discussed. And we see that this type of missions are also very restrictive to handle some complicated languages or to give certain outputs as per the requirement. Now, in case of push down automaton we have a stack let me call for example, a push down stack sort of we have discussed in case of push down automaton there is a stack. And in which case we have things like this and now what are the symbols that we are reading corresponding to that you may push something some information to the stack and read using stack principle on this and so on. Now, in case of touring mission the situation is if you are allowed to write when printing the symbol and allowed to move both left and right. In which case we actually introduce the concept with that we introduce the concept called touring mission we introduce the concept called touring mission. And a touring mission is the utmost powerful device for the computation. In fact, whatever that you can do using a routine computer that you can do using this touring mission such a powerful this thing only two things extensions for a DFA that we can clearly see that you are allowed to print on the tape and number two you are allowed to move left and right. So, with these two we will gain the ultimate power to represent computation it means whatever we can do the routine computation in computer that you can do it using touring mission. Now, informally the things is like this a left just right side infinite tape and the tape is divided into cells. Now, here this is not only reading head in like in case of DFA this is reading and writing head reading and writing head. And you have finite control certain states say q naught q 1 and so on and the pointer pointing to this. Now, the transitions are something like this given a state and a symbol you are allowed to you know print also or you are allowed to move not only to right you can move one cell to left also. So, this kind of thing is allowed in case of this touring mission in case of this touring mission. So, with this we will get the ultimate power as I had mentioned. Now, let me give you a formal definition for this definition of touring mission as earlier you require a set of states and certain symbols that you will put it on the tape and here in contrast to the DFA here we designate one particular special symbol that is like final state we call it as halting state that once you reach to that particular halting state you will not have any further computation. That means, the no transition is defined. So, you will reach there and you will stop the computation there that is how one special state is introduced and once you give the input on in case of DFA on the tape and after that you see this is a right just left just right side infinite tape there are several cells. For example, if I give the input A B A B B now these are all the cells which are available and in case of DFA we simply go till the end of the input and we stop it there the computation this is what automaton you automatically stops over there. Since, you are allowed to go left and right and you have that facility now once you reach to this if you want to go further and if you have the situation to come back and read the input and what are the changes that you do in the input. So, based on that this input for example, here there are 5 symbols since you are allowed to write you may go and at the end you may print something and you may go further and print something. So, that you can always do such modifications and therefore, you are visiting these cells which are blank where you are not giving the input. So, this blank cell we may represent with the symbol this hash. So, we include a special symbol you know when we are talking about input input this special symbol will also be considered. So, now there are two things one for the final state or I call it as halting state the computation when we when the machine halts the such a state is called halting state the machine comes to that particular state and after that there we do not define any transitions. And this new special symbol for the in case of input that we are considering is blank to represent the blank cells on the tape. So, these are the two important new things that we have not so far discussed. So, this Turing machine we introduce it as a quadruple the quadruple there are four components let me write q sigma delta q naught as you know q we normally write for the states q is a finite set of states. And here we assume that this a symbol h this is writing for halting state this is not in q this is this is we write for halting state. So, this is 1 and sigma is again a finite set this is the alphabet from which you give some input and what are the symbols that you want to type. So, all this symbol should be available here this is a finite set this include this particular symbol hash. So, including this symbol, but of course here now moving left and right because in case of d f a or finite automaton what is the situation there automatically the reading and writing head in a particular transition takes a right move. And in case of 2 d f a if you remember we have defined this as define in the transition we are defining it either it has to move to left or it has to move to right we are defining it. So, here also we have to define. So, those symbols we assume that they are not part of the sigma. So, further you assume that the symbols L and R which are indicate which we are using for the reading head to move to right or left they are not elements of sigma. So, this care you take. So, blank symbol has to be there in sigma this is representing blank cell on a tape. So, this will be there and now as usual q naught this is a state for the initial state is the initial state is the initial state. Now, let us look at transitions as we have discussed given a symbol and a state you may be allowed to print in the particular cell or you may be allowed to now move left right. So, these are the possibilities that we have we have discussed. So, I give you delta the transition function given a state and a symbol of sigma of course you change a state it can be halting state you may finally, halt after reaching to this state. So, this h is not part of q. So, there are no further transitions defined for this because delta we are defining from q cross sigma h is not in q once you reach to the halting state then we do not have further definition. So, that is how we have taken care here this is a function from q cross sigma, but you may have you know in a particular transition you may reach to this state. So, a state component is this and you may print in which case that is an element of sigma or you may move to left. So, that is l or you may move to right. So, a function called transition function this is the transition function of the Turing machine. So, this is the quadruple. So, you take a finite set of states you take some alphabet from which you may give the input and the symbols from which you may print on the tape and so on. And now blank symbol has to be there in that and a halting state is not part of the state set q naught is the designated initial state and the transition function from this set q cross sigma to the set q union singleton h cross sigma union l r. The meaning of this I have mentioned that is if you take the element of sigma in which case in that particular transition you have to print some symbol on the tape and if it is l if you are assigning l. That means the you are asked to move the reading and writing head to reading and writing head one cell to its left if it is r it is asked to go to right one cell this is the transition map. Now, let us look at some example just for the sake of simplicity let me take it this way q just one state because I want initial state and sigma say a b blank symbol has to be there and I designate q naught as initial state because there is only one state here and now I define it like this. So, for the symbol a the symbol b blank in the initial state if I am reading I will change the state to q naught the continue in the same state and go to left if I encounter this b is only one state I encounter this and when I am reading this I will halt and say take a right move or let me give it this way print blank. So, suppose if I define transition map like this because this is a state q naught a b blank for the symbols I have defined. Now, by definition q sigma this delta and the initial q naught is a Turing machine likewise you know you take a finite set of states and some alphabet and for every state and a symbol you give some transition here that means a state either you ask it to move to left or maybe move to right let me choose for example maybe here right. So, that you have all the things represented so move to right or you print here I am printing blank. So, likewise you define and you see by definition this quadruple is a Turing machine. Now, what is the behavior of this Turing machine what type of jobs like that you can pursue and all those things that first we have to talk about the language acceptance and all those things. Now, in case of DFA or push down automaton you have understood that this is that is defined as a language acceptor. As I had mentioned sometime back that these Turing machines will be shown as ultimate computational device that means the utmost powerful device for computation because in case of computation it is not only the language acceptance it is not only language parsing it is that you may be given some input and you may expect some output in your program in your algorithm. So, that kind of computation we do. So, here we have the facility of writing on the tape. So, this Turing machine will be introduced is not only as a language acceptor, but also to see like Moore and Milley missions like Moore and Milley missions are to give some output give some input and expect some output on the tape. So, this kind of computation that we will pursue with this Turing machine anyway since we are already familiar with the language acceptance part. That means given a string on the tape with the initial state the this is an automaton it takes the transitions automatically and it will finally, if it is finally, coming to the final state by the time of you know this transitions after completing that input, but here the situation is you are allowed to move to left right all the directions. So, it is not like completing the input in case of finite automaton or push down automaton you see that the reading and writing head on the tape is moving only one direction and end of the input if you see the state is final state you are saying it is accepted, but in case of Turing machine we are allowed to move it to both left and right. Now, you see when you are going to finish or you know and more tricky thing here is you are allowed to print also what are the input is given end of the thing you may go on to print some more. So, it is may be part of input or something newly you have printed. So, there is nothing like you know completing the input here. So, this is an automaton transitions takes place instantaneously it will not take any time. So, in the initial state you start the machine Turing machine and see eventually that means eventually if it is coming to the halting state that is the final state as I had mentioned. If it is coming to a halting state we define the notion like the input is accepted whatever the changes it is doing let it do it may print certain symbols it may erase certain symbols it may print some symbols and so on, but eventually if it comes to the halting state we say that the input is accepted. And when we are expecting some output on the tape we are expected we are we will expect that this particular output need to be printed and eventually it has to halter because once again I emphasize the point that this is an automaton each transition takes instantaneously even if it is 100 transitions or 1 pore transitions whatever the total time it takes is 0 time that means instantaneously you give the input and eventually that means immediately right after pursuing that it will if it is halting it will come to the halt state with 0 time or you know if it is not halting it will go to some sort of infinite loop one can say. So, that kind of situation that you will see with the Turing machine. Now how do we give the input and all those things we will discuss some and we fix some pattern here and accordingly I will define the formal notions based on that. So, I fix this notation that for the Turing machine of course, there is a left justified right side infinite tape divided into cells. I always give the input by leaving one cell in the beginning you will understand that why I am leaving this. So, this is a blank blank cell. So, I am representing it and the input whatever is that x may be a b b a b whatever. So, I give the input like this and we start the computation from the right most from the right most side of this. So, the reading head writing head initially will be here and we set the state to the initial state that is how it starts this is the convention we follow. And now as per the transitions of the finite control the automaton works and eventually if the pointer shows the halting state if it shows the halting state then I say the input is accepted this we formalize. So, this notion I will formalize it here. So, as in case of finite automaton or pushdown automaton given a particular situation that is so called instantaneous description or configuration we call configuration or instantaneous description is what the word we are using instantaneous description. So, that means at a given point of time what is there on the tape what is the current state where is the reading and writing head. So, this particular picture need to be represented. So, this is called configuration. So, the initial configuration that means how we are starting you are having blank on the tape and whatever is the input x is given and the reading and writing head is here on the tape and whatever is the current state that is. So, this particular picture I need not draw the tape and whatever this reading and writing head and the finite control all that this is the information that I am seeing on the tape with x is equal to a b b a b here x is equal to a b b a b. So, this is the information if I somehow mention then I know to how to draw this diagram for a given point of time say for example, reading and writing head is pointing this particular b and say for example, state is say for example, q 5 we know that by just mentioning what is the tape content and where is the reading and writing head and what is the current state if I give this I can always draw this picture. So, that is what the notion of instantaneous description or configuration you know already in case of finite automaton thus other places we have discussed. So, this instantaneous description or configuration we define it formally that is the current state we have to mention it is a state component and you see from the reading and writing head the left side to this there will be some tape content this is a left justified tape. So, the finite amount of information will be here that is the maximum because this is a left justified tape. So, this is an element of sigma star it is a combination of symbols of you know elements of sigma. So, the left to the reading head is an element of sigma star and the reading head always points out some symbol of sigma and then when you see right I cannot say that is just a element of sigma star the reason is I am interested about the input what is there on this. There are infinitely many blank cells on this side on the right side because this is right side infinite tape and therefore, I have to take care of this situation that is I cannot simply write sigma star here because right to the current particular symbol it is an element of sigma star because blank is an element of sigma and therefore, writing sigma star means so many blanks which I am not interested in unless the reading and writing head is on a blank cell I am not going to look at this. So, till this we write so we restrict we restrict writing leading blanks here on the right side in a given string. So, how does that set how it can be represented that is an element of sigma star and at the end I have to remove this blank that means sigma minus this blank. So, all those strings which are not ending in blank represented like this and of course, if you are at the end of the end of this I have only blanks here since we have restricted that. So, for example, if this is the situation here all blanks that means empty string is here. So, that is that has gone here because I have concatenated this set with this. So, I include that separately. So, this is epsilon. So, configuration formally configuration or instantaneous description is an element of is an element of this set. When the state component you declare what is left side to the current symbol and what is the right side to the current symbol this is to be declared. For example, in this particular situation I have these two descriptions. In case of the first one q naught blank we have written a b b a b. So, this blank a b b a b this is the string and the current symbol is blank and the right side to that is epsilon. This is the configuration in this picture or as I have mentioned second time that is q phi is the current state as I have mentioned and left side to the current symbol is a blank a b and the current symbol is b and right side to this a b. Now, you see this of course assuming this I do not have this two point point out. So, there are several blanks of course, we are not going to write that only the part of sigma star excluding means which is not ending in blank. So, this is the second one. So, this is these are the configurations in that representing that particular this pictures whatever I have drawn here. So, this is how the configurations are formally defined. Now, what I follow is whenever the input is given on the tape I leave one blank here and the input will be given and I start from the right side of the input. You will understand why I am normally. So, far in the finite automaton because the convention is we are always moving to right in case of push down automaton also, but here since we are allowed to both move left and right first some reasons that you will realize little later after few lectures that I always start from the right side of the tape I do not have any problem because I am allowed to move left and right. So, I can always go to left and read this input. So, I start from the right side of the input that means this particular blank from here I will start this is the convention we follow. And then of course, we have to start with the initial state. Now, let me give some abbreviation here. So, instead of writing 1 2 3 4 components like this just by distinguishing where is the reading and writing head I can always simply write this as say state component let me write like this. And this I will write it as blank a b b a b blank and the current symbol is this I will represent this by underscore. So, this is the short hand that I use for this you know instead of writing this many components. Similarly, for this using that notation I may simply write it as q phi blank a b b a b this is how I will write when by giving the underscore at a particular symbol the reading and writing at this particular symbol that is the meaning. Now, I give some more notations here as I had mentioned the initial configuration the initial configuration is of if q naught is initial state it is of the form blank x blank here we start when x is the input and q naught is the initial state. This is the initial configuration any Turing mission I start I start with this configuration. And now final configuration if exist final configuration that means given an input on that particular input the mission may halt or may not halt whenever it is halting you get the final configuration or you may not have a final configuration. So, the final configuration is essentially the one in which the state component is halting state that is how we define. So, and where will be the reading and writing head it may be somewhere on the tape. So, I may simply write it as say since I have used x as for input let me write some y some current symbol a z for some y z in sigma star and a is the current reading symbol some because configuration should be of this form. So, if the halt if the state component is halting state we call it as final configuration or halting configuration we will call it as halting configuration. And now let me discuss some more situations for example, the mission you may be asked you know to keep moving to left for example, from here I have started on this input and we are moving left as per the transition. Suppose, we have defined the transitions like this it will come and there is a this is left to justify tape let me call this as the boundary of this tape. So, it will come here if you are further asked to move to left what will happen you are not going to read any symbol and such transitions such configuration you cannot actually represent which is going beyond the tape. I may say that whenever it is coming and hitting this left boundary I may call it as the mission hanks. So, we call touring mission hanks if you are asked to in a particular transition if you are asked to cross this left boundary in this touring mission. So, that is called I may call the situation of hanging. So, hanging situation is that the mission hanks touring mission hanks if you are asked to if a particular transition you are asked to means a particular transition is forced the mission to move to left further when it when it is at the left boundary that is what is hanging and of course, one more thing that you can quickly realize is where you will not have this sort of halting configuration. Because, here in a in a such a situation this mission with the particular input cannot have halting configuration because the mission is hanging and one more instance is you know you may be asked to go to write in which case you will never come back. So, this is a right side infinite tape. So, you can always find a new cell and and so on and so on and thus in the situation it will go to that infinite side. So, you will not have halting configuration or you can always create at a on a finite tape you can go back and forth. For example, the transitions are defined such a way that for example, if I am here I may be asked to go to say for example, two cells left and then you I may be asked to go to some three cells right two cells left three cells right and and so on. For example, if I keep doing this again you see that you cannot have halting configuration because two cells left three cells right that means from a current position finally, I see that I am one cell to right and in each such loop I am going once one cell one cell to right and so on. So, in such situation I cannot have halting configuration even if I change this idea that three cells to left two cells to right that means from the current cell I may go one cell to left and so on after sometime it will hit the left boundary because this is left to justify tape wherever I am left to that there are only finitely many cells and thus the mission hangs. So, if you do not want the mission to halt that means if you do not want the halting configuration you can actually define in two ways one making some sort of infinite loop going to the right or oscillating on a finite tape finite tape in such situation you may say that it is going to infinite loop or the mission which is stretching the left boundary in which case we may say that the mission hangs now infinite loop. So, this situations I hope now you understand with this now let me give an example for accepting example of a Turing mission accepting this language a simple language that I consider that is set of all strings x in or the set a b such that a is a symbol of x. So, that means a is a substring of x a is a substring of x that means there is an a in x you see this is a regular language we have constructed finite automaton for this language. Let me construct a Turing mission as I had mentioned that this is ultimate powerful device. So, what are all the regular languages you can always construct a Turing mission what are all the contextual languages for which also you can construct a Turing mission. So, this is such a general device that we are introducing and as a more general automaton which can accept any of the languages that we have discussed. So, for regular languages context free languages etcetera now for this let us first discuss on this picture and then corresponding to that we can write the transitions. So, the finite control let me call q naught is the initial state. So, the point is pointing to this what I do we start with here I am leaving one blank here. Now, I keep searching for the symbol a on the tape. So, input is given here assume input is given here you come to left in q naught just to distinguish that you have started because this is a blank and after sometime you are encountering one more blank if you do not for example, encounter a. So, let me change the state. So, that I understand that the computation is started. So, come to left from this blank and change the state for example, to q 1 and now you see that this particular symbol is a or not in this particular cell. If it is a then I am happy that there is an a in the input and simply you change it to halt state and then the computation completes and that particular input will be accepted. If this is not a further in that state q 1 you may ask to go to left in this situation you need not actually change the state because because state we define in case of automaton to remember something to create such some sort of memory. Here I need not remember anything because the computation started that is only signal with q 1 I am having. So, if a is there I am halting if a is not there I go on further left and search if a is there and so on. But only thing is I have to cross check whether I have encountered you know this blank if you do not want to hang the machine or you know you keep going to left and if it hangs there is no problem because if you do not want to accept a string you can hang it or you can put it in infinite loop or if you are searching for this blank you can search for this blank and you can go to right side further infinite loop. So, in which case of course I do not require any new state as well. So, I am in q naught if I want to hang the machine I may simply define it like this. So, the symbols are a b this is a special symbol always there I mean q naught assume I am at this blank. So, I have to go to left I will continue in q naught go to left if I am encountering b I will be in q naught and go to left and if I am encountering a I will halt it when you are halting you may take one cell to left or you may take one cell to right there is no problem or you can print something and halt may be some a is there. So, I will same print a. So, this is how if I define delta now you see this quadruple only one state I have chosen q naught and sigma is now a b blank this is always there blank and delta as defined here and there is only one state. So, this is initial state is a Turing machine and we see the language accepted by. So, let me call this as m since we are calling machines let me use m the language accepted by m we see as desired if I call this as L this is what is the language. Let us do some computation or this and and and see like how this is happening for example, you are given the input say blank b b a b for example. So, this is the initial configuration as earlier with this notation in one step let me use this one step relation. So, in q naught if you are reading blank it will be in q naught it will change to q naught and go one cell to left there is a definition. So, the current state is again q naught blank b b a b I am not going to represent this blank now because the reading leading the right side this blanks will not be represented in a configuration. So, this is the situation again now in q naught as per the definition if you are reading b it will go to left changing to the state q naught. So, I will continue to the state q naught and now this is b b a this is the current symbol of course, this b will be there we have not changed anything. Now, you look at in q naught if you are reading a you change to halting state and print a. So, at this place we are printing that this is over writing. So, whatever ultimately you write that will be shown. So, what is shown here again a. So, this is the current place this is the configuration this is the initial configuration and now the computation because this is one step relation I have written for each transition what is happening I have updated on this and see we have got a halting configuration. And thus this particular string we say is accepted if you take a string in which there are only b's let me take say 2 b's this is the initial configuration I have to start with. So, what will happen since it is reading blank it will come here b b and since in q naught again it is in q naught it will come to this b and in q naught again b. So, it will come to this place. So, b b and in q naught when you are reading blank it will come to left. So, but coming to left means here is a boundary. So, I do not have anything to write here. So, after this what will what situation will come I do not have any configuration here. So, this machine hangs here this machine hangs here thus if you have only b's in a string that will not be accepted. Let me give you the formal notion of acceptance using this notation as earlier the reflexive transducer of this one step relation the one step relation is on the given. So, this is over again as usual we define this is a relation or configuration the set of configurations. If you apply one transition on a particular configuration to give the another to give another configuration we say for example, says this is c and c dash these two are related by this one step relation if you can get c dash the configuration c dash from c by applying one transition. So, this is definition as earlier and we use this to represent the reflexive transducer of this one step relation and using this let me define formally let m be a Turing machine language accepted by m denoted by L of m is set of all strings in let me write sigma naught star. So, where m is say q sigma delta q naught as such that you start with this as input the initial configuration after finitely many steps you will get a halting configuration in which case you may have something on the tape. So, from the initial configuration you get a halting configuration. So, all those strings now what is sigma naught because let me write where sigma naught is accept this blank symbol whatever is the input alphabet you take this string. So, this is what is formally let me write the language accepted by the Turing machine m the language accepted by m L of m. Now, using this definition you see that any string which is having a if you give to this it will hard once it encounters that particular a if it is not encountering a it will keep on going to left and you see the machine hangs and thus only those strings which are having a at least one a is if it is existing in the input on the strings. So, only this Turing machine holds and thus the language accepted by m here is L. Now, let me give one more example the set of all strings these are all the regular languages that we have observed x in say over a b does not matter such that 2 m for some. So, all those strings of even length. So, what I have to do here once again let me discuss with this tape and then once you are familiar with this because I am reading from right to left from this side. So, then you will be familiarized with. So, the input is given to you I have to see whether the it is of length 2 n or not as earlier in case of finite automaton you have 2 states in the beginning you will be maintaining say for example, in q naught when you encounter a symbol you are going to say for example, q 1 which is understanding which is recognizing this is odd length string and once you read one more symbol we change it back to q naught this is how the finite automaton you have maintained there let me write that. So, that so the initial final state is considered to be this under all the symbols from this you may change to say q 1 and all the symbols you may change back to this if you are reading a symbol here. So, a belongs to sigma for all a in case of finite automaton. So, we follow it this way the same thing we can write and see here I have the symbols a b blank and q naught let me start looking at in the beginning I have a blank. So, I will come to this the first symbol after reading then I will change it to say for example, another state. So, to distinguish between this blank and this blank you can change the state for example, q 1 and go to left and when I am in q 1 when I am in q 1 I may encounter b a or blank because if this is empty string I may straight away encounter blank for example, I am encountering blank in q 1 that means, this is even length string this is even length string and therefore, it should be accepted. So, in q 1 if I encounter this blank. So, I heart may be I will print something or I may take a right move does not matter. So, this is how you can do if you are encountering a symbol say for example, I have encounter a or b I will count that now change it to for example, say q 2 if I am in q 2 that means, I have read one symbol you may change the symbol or you know let me go to left similarly, even if I read b in. So, let me change to q 2 and go to left now in q 2 the meaning of this I have read one symbol if you encounter blank you see this is essentially only one symbol say odd blank here. So, I may ask it to go to further say left. So, that it will hang if I am encountering one more symbol I will put it back to q 1. So, q 1 and go to left similarly, say q 1 go to left and I am not going to encounter a and b in case of q naught. So, I can arbitrarily define anything. So, let me for example, define say q naught a does not matter because I am not going to encounter as per our convention. So, this is the transition map I have defined here the states I have considered 3 states here q naught q 1 q 2 the symbols are a b blank and the initial state let me declare q naught as initial state. So, this quadruple accepts I claim that this quadruple accepts the desired language what do you do as an exercise take various types of inputs like for example, you take empty string or may be some string non empty string which is of even length some non empty string which is of odd length you take and see the way that I have done the computation you do it and realize that this accepts this language or the desired language. Now, let us discuss one more example if you consider because when I am talking about a sub string because we have seen that when you are reading from in case of finite automaton we read from left to right when I say for example, set of all x in say a b star such that a b is a sub string of x. If you consider this example in case of finite automaton I see that whether a is encountered when a is encountered immediately after that whether b is encountered that we have to see. But as per our convention since we are coming from right side first we have to see whether b is encountered then immediately after that whether a is encountered this is how we have to design. So, let me do this construction also say we have started with the initial state q naught in the blank. So, on the tape when the input you are coming let me change to q 1 conventionally I am coming to left. If I am encountering yes I am not worried I will continue in q 1 going to left I do not remember these things sorry. So, when I mean q 1 if I encounter a I will continue in q 1 and go to left, but if I if I got b then I will remember this. So, that means I will change to q 2 and go to left if I am in q 2 that means I have encountered 1 b. So, in the state q 2 if I have encountered some more b's I can safely continue in q 2 itself. So, that means anyway I have at least 1 b I have right now after that left to this whether I have a that is what is important. So, in q 2 if I get a I can halt now. So, let me print a itself so that the mission will halt there itself. Now, let us look at the situations in the q naught I am not going to encounter this a and b because in the beginning in the initial state I will start with this I can arbitrarily define anything here because I have to define because the transition function is a total map from q cross sigma for every state and symbol I have to define something let me write a for the time being arbitrarily I can define anything. So, now in q 1 if you encounter blank that means in q 1 I encounter blank means I would have so many a's or may be empty string because in if I have encountered a I continue in q 1. So, that way the input may be only a's or may be empty string in which case I have in I mean I am continuing in q 1. So, in that case I should not accept the string. So, what I do you can ask it to go to further left. So, that it will hang or you can ask it to go to infinite loop whatever it is. So, what we do say let me write q 1 left it will hang now in q 2 I have encountered blank if this is the situation what is the meaning of this I have encountered a b or so many b's from when I am coming from the right side, but I have not encountered a. So, in which case also the same thing. So, I have encountered blank means I can ask further to go to left say q 1 left. So, from blank if it goes further it will hang. So, when or we can define anything here, but it has to hang or go to infinite loop in these situations that is how we have to define, but here I can define anything arbitrarily. So, where a whatever we can give say for example, q 2 b let me give something I have to give. So, arbitrary. So, this and this I may fill with this. Now, you as again as earlier what do you do you take the initial configuration with whatever the input that you want to consider and do the computation and see like what are the respective final configuration if they exist. If there is no final configuration that means either it will hang or it will go to infinite loop whatever is happening you just observe it and observe that this particular machine accepts this language. And in this line up may be some more regular or contextual languages you may you may try to construct a Turing machine. So, let me give 1 or 2 exercises as a homework set of all those strings or a b star such that a a is not a substring. So, or there is no consecutive a's no consecutive a's such that no consecutive a's in a there are no consecutive a's in x or you can try this you know this is a contextual language a power and b power n such that say n greater than equal to 1 or you can try we will discuss some of these things in the next class x equal to x power r these are palindromes we have discussed. And whatever is the language I have mentioned which a power n b power n c power n which is you cannot have pushed on automaton for this you can try this also. How to remember because you know in case of a finite automata how to create the memory and do I mean this computation. So, you try these examples means constructed Turing machine that accepts these things and we will discuss further on this in the next class.