 Let us now describe the Turing machine, which will perform this conversion of unary representation of a number to its binary representation according to the strategy, which we had outlined. So, as an example, think of this string of ones, which is of course, 5 in unary and we would like to convert it to binary. Remember that we will use for binary representation, the symbols a and b, where a would stand for 0 of the normal binary representation and b will stand for 1. So, this is 5 and therefore, what we should get here b a b, which is 1 0 1, which is the binary representation of this unary number. What we will do is, we have the convention that our Turing machine will start at the left most one of the dis-input string. So, the Turing machine will start here scanning this particular symbol. So, let us see how we can carry out the strategy by means of a Turing machine. Let us say this is the initial state and in this initial state, it is scanning this left most one. Now, we said that as soon as this machine sees this one, it will convert to an x. This one, it converts to an x and what should it do? It should move to the right, it is skipping the next one etcetera. So, therefore, this is a right moving state, it comes to and in this when it sees a one, what should it do? It should just go back to this state, so that it can cross off the next one. So, and as it remember that initially it was here. So, this was converted to x and the machine came here and in this when it sees a one, it just keeps that one. So, this one is written as one and it moves to this state and in this state, it should be scanning this particular symbol. So, therefore, now we know that this is also a right moving state. So, this one is left as one in this state. Now it is scanning this particular symbol which will be converted to x, it comes here and in this state, it is now seeing this one which will remain as one because one is not being changed. So, one is being overwritten by one itself and then it moves to the right. Therefore, the head will be here scanning this one, but this particular one will be converted to x and it comes here having converted to x and then since it is a right moving state the head will be under this blank. But what does now seeing a blank mean? It means that the input is entirely scanned in this pass and also see what has happened is this one was crossed and you found a one corresponding to this, this one was crossed, you found a one corresponding to this, this one was crossed and you did not find a one corresponding to this particular one which was here. So, that means this original length of the string is odd and therefore, it should print b to the first blank cell available. So, therefore, it keeps on now moving to the left and in this as it moves to the left, you know it just keeps on moving to the left, keeps on moving to the left when it reaches a blank symbol here it will convert it to b. Why b? Because it knew that the string of once that it had considered in this pass is odd and the remainder by division with two is one and therefore, our code of one being b it should print that b and so it is here. So, therefore, having written this blank this blank by b. So, the situation will be like this what should it do? Now, it should again start this process all over again on the remaining one which are the remaining ones the ones which is the remit the quotient of division by two and that is indeed c 5 when you divide by two quotient is two and that is what you have here there are two ones. So, it will come here and then having written b it should go over this side. So, therefore it is a right moving state and in this as it moves to the right it ignores this cross it sees a one and this one it is converted to x and this process begins again. So, now let us go over again. So, this one is now changed to x having changed to x the machine is in this state this sees an x whatever self loops we are not writing that means it remains there without changing the symbol. So, this x it skips this one takes the machine to the top state without converting that one into anything that one remains as one this one is here and this comes here in this right moving state and now it will again keep moving to the right sees an x which of course it ignores. Now, it sees a blank the head will be here in this state and blank means again that the current once we have already taken care of and in this case you see what had happened was this iteration what had happened this one we converted to x this one we could match it off to this and which remain one and now it is here seeing a blank which means that the number of once in this part left was even. So, it now should print a and therefore, it is similar to this except in this part what it remembers is that it should print an a whenever it sees a blank. So, in corresponding to this there is a left moving state and so this is actually as it is from here it is moving to the right and when it keeps on moving to the left till it finds a blank which it changes to a. So, let us go over it again what is going to happen this it will keep on after after after seeing this blank it would have come to this state and it will start moving to the left to skip all once all x's this b and when it sees this blank it will change it to a and then moves to the right. In this right what it should do it will keep on going to the right till it sees this one. So, these things do not change this one is converted to x x blank now it sees. So, it is here and what it finds that it has reached a blank. So, you know on blank in these cases it would go to the left, but now remembering the left string of once that it had considered in this situation was odd and therefore, a b needs to be printed. So, it will now again go over to the left and here this blank would be converted in the next step to b and as the machine converts the blank to b. So, where did where is this machine now this machine was here it converted this blank to b and it is now in the right moving state and it will now it is not going to see any more once because all the once have been crossed off. So, it will keep on moving to the right and what will happen it is going to see a blank the moment it sees a blank in this state what does it mean that means you know that there was nothing more to do because all the once now have been converted to x s and that is why you are not seeing any one in the current space on which you need to work and since it you found that all once have been taken care of therefore, the job of conversion is over. So, let us see this once more and remember here we are talking of a Turing machine where we have used our own convention that any transition which is not shown means the machine remains in that particular state without changing the symbol. So, I wrote here blank but more technically or to be consistent with what we are writing I should have said blank is replaced by blank. So, let us go over once more very quickly this transition diagram. So, remember that the machine would start at the left most one of a block of once which are flanked on both sides by blanks the machine would start here and in this state why this is the state how do we know from this transition diagram that this is the initial state because there is an arrow coming from nowhere into this state which indicates this is the state in which we start the operation. So, in this state if you see a one you converted to x go to this right moving state that means the machine moves to the right and when it sees another one it does not bother to change it because this is the one which corresponding to the one which you had crossed off. So, one converts gets converted to x next one is not converted to anything it remains one but it means that we have corresponding to this one we have found a one. So, you are back in this particular state. So, this alternately so this we know that given a block of once what we are doing is we are putting it crossing it to x. So, first one next one we are leaving it as such crossing it to one next one as such crossing it to one leaving it as such. But now when we see a blank that means that input space is over and depending on whether the machine is here or here it knows whether the input space had once which is the input which is whose length is either odd or even in this case it is even in this case it is odd. So, this is what is going on and here those transitions which we have not shown. So, for example, in this if there was an x in this state if you see an x what does it mean it means the machine remains here and moves to the right that is the convention we have made use of. Notice that in this machine we have made a transformation of unary to binary and something again you do not know how it is it could have been done at all by finite state machine. So, this is something extra that we can see that Turing machines can do which we could not do by finite state machine or by PDA. We have seen now several at least two examples of Turing machines both doing fairly interesting tasks. The first example was checking whether a string of A's B's and C's had equal number of A's B's and C's the second one was converting unary representation number into its binary representation. But in this particular course of theory of computation our focus is not so much computing functions, but our focus has been to recognize languages. How do we recognize languages or what is really what does it mean to say Turing machine recognizes a particular language? As we are now seeing several examples of Turing machines now we know what are the components or what go to define a Turing machine. Like if you look at this Turing machine first of all it has a finite number of states. We can see a Turing machine consists of q of finite state of states it uses tape alphabet that is all this is the set of all symbols which can appear on a particular Turing machine tape. Now, a subset of this sigma which is a subset of this comma is the input alphabet. Then one particular symbol we made a special and that was the blank symbol you can say blanks which is an element of the tape symbol, but which was not in the input is the blank symbol and the importance of the blank symbol is that this is the symbol which most of the cells in a Turing machine tape will have. Then of course, we had a transition function and this transition function in this example was graphically or pictorially represented, but what is the transition function for deterministic Turing machine? It takes a state and a some symbol which appears on the tape. So, this is the present state and the symbol that is being scanned and corresponding to which they will be a next state and the symbol that will over write and the move. So, therefore, transition function is a mapping which is from the set of states crossed with the set of tape symbols and its range is that means given a present state and the present symbol being scanned this transition function should tell you what is the next state and therefore, this component is q what is the symbol being written therefore, this we write and with what is the move to one of left or right. Then you have of course, a special state which is the start state. So, q 0 which is an element of q is the start state of the Turing machine and in the content of text of language recognition we should have some final accepting states. So, some f which is a subset of q the final accepting states and in these states once the machine if the machine at all reaches one of these states then the machine holds that is the convention we have. So, final accepting states are all halting. So, if you specify all these then you specify a particular Turing machine different Turing machines of course, can have different q gamma sigma blank symbol may be different transition functions will be different etcetera. However, notice that this is finite this is also finite this is also being a subset of gamma this is finite this is one particular symbol this is a map from q cross gamma both of finite. So, therefore, when it is a deterministic machine we have said corresponding to each one there will be one such component give one q one symbol will tell me what is the next state symbol being written the direction of the move. So, point is even this is a finite function. So, everything here is finite. So, therefore, the description of a Turing machine whether you use a diagram or whether you use these symbols and then elaborate each one separately whatever it is a Turing machine can be described finitely and that is a very important point Turing machine as a finite description. Now, you must realize that this is what is expected why because what we are trying is our overall motivation is to capture the intuitive notion of an algorithm by Turing machine. Now, they can of course, be many many infinitely many algorithms they can be infinitely many Turing machines that is fine, but an algorithm is a finite object is not it supposing I code an algorithm in my favorite language programming language whether it is c or java in that is a text and that text is something finite. So, my every program is a finite you know I can think of a program as a finite text with something like a finite you know entity or an object. So, if I am seeing that our algorithms can be captured by Turing machines in to retain that correspondence since algorithms are finite things or entities Turing machines also must be finite entities and indeed these are as you can see a particular Turing machine is represented in terms of these things and these are all finite things and therefore, this particular Turing machine is also a finite entity. Now, let us consider what we mean by recognition language recognition by deterministic Turing machine and the notion we shall use here is the configuration of Turing machine we have spoken of configuration at least several times before when we talked of pdf for example, we had a notion of configuration and configuration is kind of snapshot which tells me at what point the computing devices and this snapshot should have enough information that from the point onwards if I would like to carry out the computation by the computing device the configuration should have all the information to tell me to how to carry out that further those further steps of the computation. Now, configuration of a Turing machine at least one type Turing machine the kinds of Turing machines that we are talking of should have then what it must tell me what are the symbols which are there now on the input and their order in which they are there that is the configuration must have the tape contents and it should also tell me the state of the machine and it should tell me where the head of the Turing machine is position currently. Again remember that configuration should give me a snapshot which has complete information about the current affairs of that running of a particular Turing machine. So, at any given time a Turing machine tape has some symbols and the redried head is position to be reading a symbol on the tape and the machine is in some state q the configuration of the Turing machine must consist of all this information. However, tape is an infinite thing is not it we said it extends to infinity in both directions then how do I represent this infinite thing finitely. Fortunately, remember that if begin with we had only finitely many symbols on the tape initially and after a number of steps non blank cells will still be finite will be bounded because why because you see it is like this it suppose initially this much was the space of the tape which had which contained all the non blank symbols if you can imagine the input and then the machine after n steps may have moved to all this area in n steps it would have at best converted n more blank cells into non blank to contain non blank symbols. So, after n steps the number of cells which would contain all the non blank symbols will be the original ones plus n at most that is the bound. So, in providing tape contents we do not have to of course, say give all the blank cells all we do is. So, let us take this picture and let us say I had here a blank a b a d blank and all these cells are blank. So, I would represent this situation by saying a blank a b a d a and that is all I will write with the understanding all the symbols to the left of this and all the symbols to the right of this all these symbols are blank. So, now the machine is in machine is scanning this particular b in state q in this picture a convenient way of writing all this in one single line is to do this will write a blank a and here we write the state and then b a d this is the way we will represent configuration. So, couple of things again to say here that this is a string which will contain symbols from the tape alphabet including blank like here we have one blank, but the idea is the current tape contents is this and everything to the right are blanks everything to the left are blanks and now you see there is a state symbol appearing the idea is that this the machine is in this particular state scanning the symbol immediately to the right. So, it is scanning this b all right and if you notice that this very conveniently represents whatever information that particular picture had all right. So, now what we can say that initially you know we always say that initially the Turing machine is scanning the left most symbol of the input that is the kind of convention we all have all the time. So, what is the initial configuration initial configuration will be the input let us say x some string and the machine is going to be scanning the left most symbol of this input and that situation is very conveniently represented by this configuration and notice our. So, we are saying that the machine is in state q 0 scanning the left most symbol of x which is our input now let us elaborate it a little bit. So, let us say x is a b y and suppose our Turing machine is such that that in q 0 if the input is simple or not the input symbol this symbol which is being scanned is a then it goes to the state p writing b and moves to the right. So, therefore, what would happen initially in picture we may write like this these are all blanks here a then b and then this whole thing is y and they these are all blanks initially the machine is here in state q 0 and this in one step what will be the situation of course, these will be blanks and this a is converted to b. So, b and of course, nothing else changes. So, this a has become b there was a b here so that b is here and then the string y and then of course, blank and so on and the head will be since the move is to the right the head will be here. So, in terms of configuration what is the situation initially my configuration was q 0 a b y and in one step the configuration became b p p b y from this configuration we are getting this particular configuration why because this Turing machine had carried out one step of it. So, what we can see that if we consider that if we consider that if we consider that if we consider that there is a space of configurations of a Turing machine there is a relation amongst configuration and what is that relation supposing there is configuration c 1 another configuration c 2 we see c 1 derive c 2 in one step or c 1 is related by this relation c 1 is related if the Turing machine in one step can go from c 1 to c 2. So, let us see let us this way put it we define c 1 you know then this relation symbol to c 2 if in a single step the Turing machine can go from configuration c 1 to c 2. So, therefore, this is a binary relation relating configurations and of course, you can define another relation which we can say. So, if you remember we are saying that this relation stands for machine so machine one step situation in a single step configuration. Single step from configuration c 1 the machine goes to configuration c 2 this we will say in 0 or more steps one way of relating this two is that you know this particular relation this is again a relation on configurations and this particular relation is the reflexive and transitive closure of this relation even without going into those kinds of mathematical jargon intuitively the idea is very simple will write c 1 goes to c 2 will express like this for a Turing machine m in case the configuration c 1 from starting from configuration c 1 in 0 or more steps you can go to configuration c 2. Why are we doing all this? You are doing all this because very precisely we would like to capture the notion of accepting or recognizing a language by Turing machine. We are trying to understand very formally and very rigorously what does it mean to say a Turing machine recognizes a language and towards that we define a relation on configurations and this relation will relate two configurations provided from the first you can go to the second configuration in 0 or more steps using that Turing machine which you have in hand. So, begin with a Turing machine m remember it has a number of states its tape uses an alphabet which we are calling gamma let us say the input again is over an alphabet sigma then it has a transition function delta and it has an initial state q 0 is a special symbol which is blank symbol let us write it as this and then let us mention the states which are final accepting states. So, these are this is final accepting states once more this is the set of states of the Turing machine this is the input alphabet or rather tape alphabet this is the input alphabet this is the transition function the initial state the special blank symbol and the final accepting and l m is the language accepted by Turing machine m this Turing machine. So, this stands for language accepted by m and using our terminology now we can very precisely say that this l m is this set of all strings x over alphabet input alphabet sigma such that q 0 x which is a configuration which really stands for configuration in which the every part of the tape is blank except where the input x is written the machine is in its initial state q 0 scanning the left most symbol of the input and from this configuration if in 0 or more steps you can reach a configuration where you know some alpha is here and maybe p and beta where p is an element of f. So, what we are saying is scanning the left most symbol of the input initially in state q 0 if in 0 or more steps the machine m if it reaches a final accepting state in that case the original x is in the language accepted by the Turing machine m. Now, right away let me use another terminology this set of all languages for which we have a Turing machine recognizer Turing machine which can accept a language the such a language is called recursively enumerable language. So, let me since this is an important concept let me note it down this is the definition a language l is said to be recursively enumerable if there is a Turing machine m which is such that this language l is the language accepted by the Turing machine m. So, recursively enumerable languages are those languages which are accepted or you know we also use the term recognized accepted by Turing machine and this is the class of languages which will consider you know extensively in next classes, but we already know from the first example that the language of equal number of a is followed by equal number of b is an equal number of c. That means this language because we gave a Turing machine which recognize precisely this language. So, therefore, this particular language which we know is not context free is a recursively enumerable language. So, our goal will be to study this class of recursively language enumerable languages and c which all languages at least intuitively which all languages are recursively enumerable and if there are languages which are not even recursively enumerable that will be our concern. Before we end let me see that we do not always write this whole thing recursively enumerable languages we just simply write R e. So, this is an abbreviation.