 In today's lecture, we discussed about some of the variants of this finite automata. You have seen this finite automata as a language acceptor. That means, as a language recognizer, given a string, supply that to the initial state and see whether you are reaching to a final state or a non-final state. According to that, you decide that the string is accepted. So, that is how this finite automata we have seen as language acceptors. So, among this language acceptors, you have known the variant of DFA, Deterministic Finite Automata. You have known, you have already learned NFA, Non-Deterministic Finite Automata, in which you know you have epsilon transitions and for each, in each transition you can have, if you apply any symbol in a particular state, you can have several transitions. So, that way the non-determism is defined and we have observed that these two are equal and also. And now, there are some other variants in finite automata, like two way finite automata, two tape finite automata, like that we have. In case of this two way finite automata, if you recollect this, the schematic diagram of DFA or NFA, there you have input tape divided into cells and the input symbol that you are placing, say like this and you have a finite control, from which a reading and a reading head is connected to this input tape and there the state components that you have a pointer. So, the current state is pointed by this pointer, the left justified, right side infinite tape divided into cells. The input you are placing on this tape and in the initial state, if you start from the left most cell, by the time of completion of this tape, I mean that input that you have given, if the current state is a final state, then you say that the string is accepted. That is how the notion we have, in case of this two way finite automaton, the situation is you look here, in case of DFA or NFA, this reading head is after one transition it is taking from this cell to this cell, it will move automatically and then another transition from this cell to this cell, this will move and continues till you know the input is exhausted. That means, exactly there will be n transitions for a string of length n, but in case of two way finite automaton, in case of two way finite automaton we allow this reading head to move left and right in each transition. Of course, either left or right in each transition, so that is what is the two way mechanism. That means, for example, in a particular transition, you might be moving from this cell to this cell, in the next transition you may move back to this cell, but of course, in each transition one left move or one right move, of course this is a reading head only, so this reading head will read a symbol and looking at the current state. So, you will supply transitions to move right as well as left, so this kind of mechanism is allowed to I mean in two way finite automaton and in case of the variant two tape finite automaton, what you have here we have only one here we have only one input tape, but in case of other variant you may be allowed with one more tape and of course, input will be always be given, input will be given on one tape only say for example, this is the first tape on this you are given input. Now, another reading head will be connected to this and this will be used for some computation some rough work sort of thing like certain things that you can remember by storing some information on this tape second tape and you will be doing the computation on the input of the first tape only and pursue the input and accept by final state. So, this kind of variant is also there like allowing two tapes of course, left justify right side infinite tape and two reading heads from the finite control will be connected one each to the tape and the computation will be processed on the input of the first tape. So, this kind of variant is also there in the literature the two tape finite automaton, but here is the point that like NFA and DFA are equivalent which are accepting regular languages two way finite automata or two tape finite automata these variants also precisely accept regular languages. So, these results of course, I am not proving here in this lecture, but you can make a note that these are no more powerful than the DFA that means, this gives you certain facilities like NFA for a given regular language you can construct an NFA very sort of easily compared to DFA sometimes. Similarly, two way finite automata may be helpful in order to accept certain regular languages very quickly you can construct two way finite automata relative compared to that of DFA or two tape finite automata may be useful in the sense that that may give you facility to construct finite automata very quickly this variant, but of course, the language the class of language accepted by this any of these things may not be bigger is not bigger than the class of regular languages they are precisely accepting regular languages. Now, these are the part of language acceptors some variants I have presented now there is another notion called finite state trans induces. So, these are actually the sort of like output devices here in the language acceptors you are giving the input on the tape and you are just seeing that whether the input is accepted or rejected or. So, that is what we are seeing in case of language acceptors, but in case of finite state trans induces what is the mechanism there you give the input and expect some output. So, this kind of mechanism this kind of variants are available in the literature and of course, these are also philosophically equivalent to this finite automata the class of finite like DFA NFA this kind of things. So, in which I just mentioned these two classes like milli missions and Moore missions. So, in this case like here you have one input tape of course, now I call it as input tape a finite control and a reading head to this input tape and now we assume one output tape again divided into cells and one this writing head will be connected to the output tape this is input tape this is output tape this is output tape this is writing head of course, this is finite control as earlier in case of DFA finite control this is writing head there is this is sorry this is reading head here this is reading head and this is writing. So, in case of Moore and Milley machines this kind of mechanism is allowed and you will be giving input on this input tape and according to the transitions some output will be left on the output tape. This kind of devices as finite state transducers are available in the literature among the variants of finite automata. Now, let me just introduce some of the variants and how they are accepting languages or you know how they are giving the output that I will explain through certain examples. Let me start with the two way finite automaton. Let me formally define that because whatever the way that it is working it is supposed to work that I have already explained that in each transition you may be allowed to go to left or right other than going changing the state. So, formally a 2 way DFA I may simply call it as 2 DFA that is a quintuple again q sigma delta q naught f like a DFA where this q sigma q naught f are as in DFA that is state set input alphabet q naught is the initial state f the set of final states. But the transition function delta in case of DFA what do you have given a state and input symbol you have a next state only one state is assigned. But here given a state and an input symbol you can you will be assigning a state and in addition to that you can move either to left or right your the transition there in case of DFA you will be moving only to right therefore, it is not mentioned. But here you are allowed to move left also that means in a transition you may the transition function is thus a function from q cross sigma to q cross set of L r where L is indicating left move r is indicating right move. Now, to talk about the computation and the language acceptance all those things now again formally let me discuss about the concept of configurations and computation all those things here in case of 2 DFA also a configuration or instantaneous description of a 2 DFA is an element of q cross sigma star cross sigma cross sigma star r it is an element of q cross sigma star because you look at in case of in case of this 2 DFA like this is the input given to you now at this point of time it is pointing to this current state q naught and you are reading symbol a. Now, the situation is in case of DFA you have just mentioned the current state and whatever the string that you are going to read that much only you will be mentioning that means for example, here the current symbol is a and after that whatever is the string that is only you are interested in whatever the string left to the current position of the reading head you do not require because you are not going to anyway visit the string. But here you have a possibility to come back that is why you have to mention the entire type content and where the current where is the reading head what is the current position of the reading head all the things need to be mentioned. So, that way in case of DFA if I would have written just that q x where the first symbol of x is the reading symbol current read currently reading symbol if this is in case of DFA in case of 2 DFA I require the total information of the input type that means if the current state is p and say for example, x a y if I write. So, the string which is left to the current symbol that we are reading say a the left to that is x and right to that is y. So, this is how the configuration in 2 DFA we have to declare because when the transition is taking to left you have to visit what is the content of the tape left to it. So, in the because of this reason now you see the element is the state component you have to mention and left to that whatever is the tape content that is a string element of sigma star a this is an element of sigma the currently reading symbol and then whatever is the string right to that there is sigma star. So, that is a configuration is an element of this or we have mentioned that it is an element of q cross sigma star what is the reason for this for example, you have finished reading this input and you went beyond the beyond the input. That means say for example, this reading had in a particular situation suppose reach to this position now it is not reading anything that means we do not have any transition defined for that because we have defined the transitions from the for the current reading symbol the current state if you know then according to that you can talk about the what is the next state and to which it has to move say for example, from here after reading b if you are asked to go to right that means you have gone beyond the input and thus you are not going to have any the current symbol to read and there is nothing right to that that means the tape content that left to that will only be there that is an element of sigma star and thus the configuration has to be an element of q cross sigma star in which we are not going to have any current reading symbol or thus anything right to that. So, that is why formally we define configuration or instantaneous description if you take a snapshot or instantaneous description of this you have if you can give this information that is sufficient and thus formally it is an element of q cross sigma star cross sigma cross sigma star this is one option another option is q cross sigma star when the reading head is going beyond the input. So, I have mentioning that a configuration q x a y is an element of this indicates that as a just I have explained the current state of 2 d f a is q the input is x a y that is the total string on the tape the reading head is in the currently scanning symbol a. So, that is what is the for convenience instead of writing this in a four components we may simply denote it as two component I mean that is as a tape, but we have to mention what is the currently reading symbol. So, for convenience we may mention the configuration as q x a y and with an underscore at a to understand that the current currently reading symbol is you know the reading at reading head is at this particular position. And thus a second type of configuration that q x that means that the reading head is beyond the input as I have explained. Now, let us come to the part of computation in 2 d f a as earlier in case of d f a computation is of this form where this is the relation that is one step relation between configurations. So, this is reflexive transitive closure of this relation as earlier. Now, let me define one step relation in the in the context of 2 d f a let us look at this because this one step transition is because of the transition function delta is a current state and a current reading symbol based on that whatever is the transition given to you that transition has to be implemented on the on that instantaneous description or that particular configuration that is how you are getting next configuration in one step. If so how we are defining this one step function one step relation that is if delta of p a the current state is p and when you are reading the symbol a if the transition is giving you q x where x can be you know either l or r then the configuration c with the current state p with the input x a y with a as a reading thing gives the configuration c dash and we are denoting it with this relation c related to c dash in one step in this following cases. In case x is right what you understand there are again two things one is if y is epsilon that means there is no string right side to the current currently reading symbol then you are changing to the state q and then the reading head is going beyond the tape that means this is an element of q cross sigma star that kind of configuration is coming this s c dash or in case you have some string which is non empty then I can always mention it as b y dash because the right side string some non empty string is there that is of the form b y dash for some b in sigma then the currently reading symbol will be b next to that a. So, this kind of configuration will be now we see as c dash it is in case of if x is l then now you look at the left side if there is nothing left to that that means you are going beyond the tape and in this situation we say the machine hangs. So, we do not have any definition if left to the current symbol if there is no string there is no cell to move otherwise of course there if there is some symbol that particular symbol will be the currently reading symbol in c dash. So, thus the configuration is of this form. So, this is how we define one step relation this is how we define one step relation and then the reflexive transducer of that relation one step relation we denote by star of that relation and that is how we define the computation. Now, if you give a string a 1 a 2 a n in sigma from sigma star we say that is accepted by given 2 d f a a if you give this in the initial state start with the initial state with the currently reading symbol is the left most symbol of the input. In finitely many steps if you because the input we are not going to trans of anything, but the reading head if it is going beyond the input of course with the situation that it is to the right most end because the reading head is going beyond the input does not mean that you will you will go towards left hand and hang. Here the configuration we are defining only when the reading head is going beyond the input right side because where the cells are existing because we have right side infinitely many cells the reading head reading head has to go out beyond the input towards right of the input. So, if you get this kind of configuration p a 1 a 2 a n without having the indication of that reading head for some p in f then we say the string x is accepted by the given 2 d f a. Now, as earlier we can now say that the language accepted by 2 d f a a is of course denoted by l of a is set of all those strings in sigma star that is accepted by a. Now, let us look at some examples because how this variant of 2 d f a will be helpful in order to understand some regular languages. Now, I mention this language here consider language over 0 1 that contain all those strings in which every occurrence of 0 1 is preceded by a 0. Whenever you find a 0 1 then you should have a 0 before that this is a regular language that of course you can find a d f a for this. Let me just spell out some instances of this language this is an element this is a string in l you just look at for example, if I take this 0 1 first 0 1 I have prior to that 1 0 if I consider this 0 1 I have 1 0 before that for this 0 1 I have 1 0 before this. In this example for this 0 1 I have a 0 here, but for this 0 1 I do not have a 0 before this. So, this is not a string in l. So, I hope you now you understand what kind of language is under consideration. If you take any sequence of 0's and 1's a string over 0 1 whenever you have an occurrence of 0 1 there should be a 0 before that 0 1 that is what is the criteria for this language. Now, let us try constructing a 2 d f a for this for every occurrence of 0 1 there should be a 0 before that that is what is the there is a 0 before this for every occurrence there is a 0 before this. Now, let us let me consider this as the tape and the input is given on this and the input symbols are from 0 1 start with the state say q naught. Now, you keep looking at the symbols going to the right on this tape for example, from here I am going towards right I scan for 0 1. So, whenever you are getting 0 1 you remember that and then go back 2 cells left to that go back 2 cells left to that and see that particular cell is having 0 or not that is how I will be designing here. So, that means in the initial state q naught if I receive 1 I do not have to worry to remember or anything I simply go to write in the same state because state component is remembering certain things. If I have 0 I have to now wait whether I am getting 1 to come back that is why I am changing the state let me call it as q 1 and go to write to scan the next symbol. Now, in q naught I have defined the transition for 0 and 1. Now, let me consider q 1 in q 1 the situation is if I have 1 in q 1 now I have to move to 2 cells left. So, I will come to left now let me call it as q 2 if in q 1 I have received 0 that means I will continue to wait for 1. So, in the same state I continue to go to write that is how we define here. Now, in q 2 for example, here I have 1 0 1 say 0 0 like that of course, this string cannot be accepted because before this 0 1 I have 1, but not 0. So, when I am reading this 1 I continue in q naught and move to write I read this 0. So, at this particular place I am in q naught when I move to write here also I am in q naught after reading this 0 I move to q 1 and go to write that means while reading this 1 I am in q 1. So, in q 1 when I am reading this I move to q 2, but come back to this left cell that means I am coming to this q 2, but this cell I am reading now the second cell. I have to check this symbol is 0 or not that is why I have to come back in q 2 once more that means I have to remember you know the number of cells that I have moved. So, in q 2 we are in that means 1 cell is moved we know that is always 0 here, but I am not worried about it I am not worried about it. So, you just move once more that means moving is now denoted by q 3 move to left and move to left of course, you know that when you are in q 2 you will be receiving 0 only, but reading 1 is not a possibility we are not worried we just define it like this. Now, in q 3 you have to cross check now in q 3 you have to cross check whether you are having in this position 0 or 1. If you have 1 you continue the transitions and keep going to write beyond the input and you do not accept it you can put a state which is not a final state. For example, if you have a 0 here if you have a 0 here what do you do then you keep processing this way that you continue the transitions which continues beyond this 0 1 and then from this point again you have to repeat the same mechanism. You keep searching for 0 1 and come back whether you have 0 or not you cross check and so on. So, with this logic if I pursue of course, here I have defined it as this in q naught I am changing to when I am reading 0 q 1 then q naught in q 1 we are continuing to write and changing to q 2 and coming back to left and in q 2 I am coming further back in q 3 if I am receiving 0 that is the situation that I will continue to cross check again whether 0 1 is existing or not on the tape and whenever 0 1 is existing I will come back to cells and see whether I have 0. So, whenever it is failing that means in q 3 if I am getting 1 that means before 0 1 I do not have 0, but 1 is there then in that situation I am putting in q 5 in q 5 you just cross check that what I am doing is whatever the symbols I am receiving whether it is 0 or 1 I am just keep I am just going write that means I will go beyond the input and q 5 is not declared as a final state thus the input will not be accepted. On the other hand if I have received you know 0 there then I am putting it in q 4 you see I have to pass 2 cells. So, I will be passing these 2 cells 0 like the input 0 1. So, to indicate that I have these 2 states q 4 q 6 after passing 2 cells I will be putting setting back to q naught and q naught will pursue the input to cross check whether 0 1 is existing before 0 1 whether 0 is there or not like that it is pursued. So, thus you see whatever is the condition exactly given to you for every occurrence of 0 1 before that 0 is there or not that is to be cross checked. Now, we are not characterizing this language I mean characteristic properties of this language you can analyze and probably you can find a DFA corresponding to this, but you see whatever the way the language is presented the property is given that if 0 1 is existing before that you have to have 1 0. So, that means you have to come back and cross check unless you have the mechanism because just as it is if you want to implement a finite automaton unless you have the mechanism to come back means that means the reading head if it cannot come back you are unable to see what is the particular symbol before that. So, this particular variant will be helpful to construct a variant of finite automaton I mean finite automaton to accept this kind of language and the property whatever is given as it is you cross check and construct. Let me look at some computation in this particular finite automaton if you take the string 1 0 0 1 1 you see before this 0 1 occurrence of this 0 1 you have a 0. Now, if you just follow that DFA I mean the 2 DFA whatever is constructed and implement this is the computation that you can realize and see at the end of that the finally the reading head goes beyond the input in the state q naught and we have declared that both q naught and q 1 as final state and see that is the string is accepted because of this configuration and you can verify this computation because as I have mentioned in q naught you are reading 1 and you will be continuing to write and you will be continuing to write you see this underscore is mentioning that what is the current reading head position. So, after completion of this 0 1 you will be coming back you will be coming back to this 0 and since it is 0 you are going again now these 2 cells right that is what via q 4 and q 6 that we have indicated and in q 6 again it will be set back to q naught and it will continue to cross check whether 0 1 is existing and after this portion there is no 0 1 and once it goes beyond the input the current state is q naught and hence the string is accepted that is how the computation is presented for this on this string. Now, if you take this string 1 1 0 1 you can clearly see that this is not a string in the language and if you observe the computation that is as follows and finally you are having this as a final configuration the reading head is going beyond the input of course, to write and the current state of this configuration is q 5 and thus you see that this configuration is not having final state as a state component this is a non-final state and hence you know we say that the string is not accepted by this 2 d f a. Now, let me give you one more example you consider this language or 0 1 that contains all those strings with no consecutive 0s of course, for this I hope that you have constructed a d f a by now, but no consecutive 0s suppose if I say that means there should not be any 2 0s in the input. So, 0 0 is not a string that means here you can cross check whenever you have 0 you just come back and cross check whether you have a 0 there if you have 1 you are happy you continue further if you have 0 there because whenever you are getting 0 you just come back and see what is the current what is the symbol before that. So, here you have an advantage you have a mechanism that you can come back and cross check. So, I can state this as a property for this no consecutive 0s. So, you have a d f a now you can construct a 2 d f a using this you just whenever you are getting 0 you just come back and cross check what is the current symbol. Now, take this property into count and now you try constructing a 2 d f a for this and you will understand that you can get a you can get a better advantage in understanding this language through 2 d f a. Now, we will introduce another variant of finite automata as I have concentrated on one particular language acceptor. Now, I will go to finite state transducers and define and formal introduce those things and discuss certain examples because here I have mentioned that there are 2 types of variants one is as a language acceptor another is a finite state transducers. So, we have touched the 2 d f a now let me introduce 1 finite state transducers in the class I am considering millimissions as mentioned earlier here the situation will be like this because you have an input tape finite control the reading head to this a writing head to output tape that is how it is. So, corresponding to that we have the required we require the number of components here that we declare thus we declare as x triple a millimission m state component. So, here state component that input alphabet transition map the q naught as initial state as in d f a now whatever the new thing that we are seeing the delta is there of course, that is again a finite set called output alphabet, but the transition function is not I mean the transition function you know there that is as in d f a that means given a state and an input symbol you are getting an x state assigned, but another new component that you are seeing is a little lambda that is this lambda is a function from q cross sigma to delta is a function called output function. So, that means what it is doing given a state and a symbol you are assigning an output an output symbol to this. So, millimission is formally defined like this. So, if you are reading a particular symbol on the input tape immediately you will be changing the state through the state transition delta that transition function and simultaneously you are printing a particular symbol on the output tape. For example, if this is the situation and whatever the current state say for example, you have the input a b a b for example, and while reading a if you are asked to move from p to q. So, from the current state p it will move to q and on the tape for example, corresponding to a when you are reading in b if it is assigned that you have to print one it will print one here. Then automatically this reading head goes here second place and what is the corresponding state and the symbol whatever is the assignment is given to you will change to the state and according to that whatever you are asked to print by delta the output function lambda. So, you will be printing the output here and so on. So, by the time you finish this finish reading this you will be printing this also simultaneously according to the transition and delta and the output function lambda given in the finite control. So, that is the behavior now the situation is we have mentioned this finitely here finite sets are here involved and the transition function is q cross sigma to q of course, you know in DFA how to extend this to naturally to all the strings. Similarly, this output function this is defined finitely here that means state and a symbol is given an output symbol is assigned here. Now, you can extend this to input strings that means elements of sigma star naturally that is how that is is given here the extension of lambda to the strings can be formally defined can be given by this function I am calling it as lambda cap that is from q cross sigma star to delta star that is defined by as I had mentioned in this well mechanism you read a symbol you change the state and simultaneously you print corresponding to that whatever is lambda is saying and then you are going to the next place. Now, I am reading B depending on the current state when you are reading B what is the state it is asked to change by delta you change that state move to write one more cell here and according to the lambda whatever you are asked to print you print it here. That means whatever is the sequence of input that you are reading here corresponding to that while finishing this 5 symbols you will be printing 5 symbols here and that is what is is naturally to be considered here formally. If you are reading empty string on the tape you will have empty string as output if you are reading x a string of the form x a where a is a symbol of sigma and x is a string. Then whatever is the output for x you give it and then in the state the in the current state after pursuing x that is what is delta cap of q comma x that you know in this state if you apply a whatever is the symbol that is to be printed that is what is given by function lambda that symbol need to be juxtaposed to the string lambda cap of this is how in the quealy we have defined that is what is exactly what I have explained. So, that is for the input a 1 a 2 a n in the state q the output will be the output will be that is lambda cap of q comma x will be in the state q 1 in the state q 1 you apply a 1 where q 1 is the state q because that is the current state what is the symbol that you printed here. Now, you go to q 2 what is the q what is the state q 2 in q 1 if you apply a 1 you are going to q 2 that is what I am assuming. So, in q 2 if you apply a 2 what are the same output symbol you are asked to print that you will be printing in the second cell and so on in q n that means in q n minus 1 if you apply a n minus 1 whatever is the state that you are getting I am calling it as q n and in which you apply a n and what are the symbol that corresponding to that is ascent by lambda d 2. So, here you understand that a 1 a 2 a n if it is the input the output sequence will be this and the length of the input is same as the length of the output here. Now, the output of a millimission is defined to be the string lambda cap q naught x where q naught is the initial state of the machine because you have to set the machine in the initial state and give the input and what is the output in which that it is given because what are the string you give in any state and you see what is the output that you are getting that is how we have defined lambda cap. But what is the output of the millimission is what are the string you give it in the initial state and whatever is the output from initial state that you get that is what we call as output of the machine. Of course, as I have remarked earlier that the length of the input is same as length of the output. Let me give some example of this variant. Let us consider q 2 b this q naught q 1 q 2 3 states input alphabet I am taking a b output alphabet 0 1 and the transition function delta and the output function lambda are given by this tables. Now, by definition you can clearly see I have a state set input alphabet output alphabet transition output function transition function output function and I am declaring q naught as initial state from by definition this is clearly a millimission. But what is the behavior of this before looking at that you can first draw the diagram I mean through diagram representation like a d f a in the initial state q naught if I am applying a whatever is the output that I am assigning in this lambda table. Just look at in q naught if I apply a I am printing 0 as output in q naught if I apply a I am going to q 1 and printing 0 as output. So, by incorporating the output also on this transitions in this form the input slash output I can give this diagram. Now, in this diagram you see how the input is actually pursued to give the appropriate output. You look at here if you are getting some b's it is simply continuing in q naught and printing 0. So, as long as you are getting b's in the initial state you are printing only 0's whenever you get a you are changing the state that means you are remembering that you have write a of course, you are printing 0. But whenever from this state of course, in this state if you are still getting yes you are continuing in the same state that means you are not worried to remember further 0's and printing 0 only. But in this state q naught if you get b, but then in which case you are printing 1 that case you are printing 1 and changing the state to q 2. Now in q 2 if you are getting b that you are resetting to q naught you are coming back to original position. If you are getting yes that I am coming back to q 1 that means essentially you see here whenever I am getting a b whenever I am getting a b end of that part I am printing 1. Otherwise I am printing 0 that is what is the mechanism is going on. For instance the output m for this input string 0 0 say for example, a b b b a b a you look at that we are printing 0 0 0 1 because this is corresponding to this a b and after this a b again I have printed this 1 and if you have a that is 0. So, that means if you look at the what is called the number of 1's of the output that is exactly counting the number of a b's occurring in this input. Now likewise you can think of some other examples to count the number of certain substrings. For example, let me give you this as an exercise when a similar 1 count the number of a b a's that means what is my instruction here is if you take a string from a b star you are asked to print I am assuming q naught to be the initial state. This is for a 1 a 2 a n x is a 1 a 2 a n whenever you are having a b a you will be printing 1 otherwise 0. So, that means end of this for example, b a a b a b a b b for example, this is the input corresponding to this I am printing 0 this is also 0 and a b a has not come. So, this is also 0 this for this b you will be printing 0 since I have got this here a b a I will print 1 here you look again this is an a b a thus you have clearly that a b this is 1 a b a with a common you have another a b a. So, that way you see you have to print 0 here, but here 1 is it is not resetting here after this rather it has to remember this particular a then corresponding to this b 0 you print and for this. So, this is the output expected there. Now, that means the exercise is construct a millimission that prints 1 for every occurrence of a b a in the input otherwise 0. So, a similar example, but you have you know you have to take care of this common a and appropriately design that. Now, let us discuss another example that you find the concept of millimission is sort of appropriate to have as a usual computer. If you consider two binary numbers let me call say a 1 a 2 and so on a n b 1 b 2 b n. Now, what I am expecting is these two binary numbers given to you x y somehow as input how we have to give the all those things that we have to discuss now you will be asked to give the output x plus y the binary addition need to be performed. That means now what I will do as you understand in case of millimission if you give an input string say for example, w of length n you know the output that lambda cap of q naught w that is also of length n. And when I am constructing a millimission on the tape in a cell I can give only one symbol in a cell I can give only one symbol. Now, on the corresponding to that symbol on the output tape this is input assume this is output. So, corresponding to this symbol I can print only one symbol here. Now, what kind of input to be considered and the output how I appropriately we have to get here that we should understand that. Now, when you are adding naturally in case of binary. So, you will add these two things let me call it as c n and so on you will do that and you may have a carry. So, thus the string here possibly the string here possibly of length n plus 1. Now, the thing is just to balance all these things whenever you want to add two strings or I mean two binary numbers first you ensure that the first position this a 1 b 1 to be 0. So, that whatever is the carry for carry that you will get in the addition that you have one bit ready to place that. And one more point is if the length of x that means the number of you know thus as a string when you are considering that particular binary number if it is less than y then you fill them with leading zeros. And you consider the input this always of you can always manage that input both x and y of same length, but now the question is there are two strings here how do you place as input to the millimission. What I would suggest you consider the symbols when because we give them as symbols as input here what are the possibilities because when you are taking sequence of zeros and ones for example, 1 0 1 1 and I am I want to add this with for example, 1 0 0 1 0 1 what my session is as mentioned you first fill these two with zeros and take one more leading zero one more leading zero here this I am calling it as x this is y say. So, these two are to be added now whatever that I get I know that this many places will be sufficient now whatever the length here I made up that will be sufficient here. Now at a given point of time you will be adding you know these two like that. So, thus what I will do these two things together you will be accepting it as a input that means the input now I will consider the sequences either it is 1 1 or may be you have the possibility 0 1 or the possibility 1 0 or the possibility 0 0 these are the 4 possible input symbols. So, now you can take sigma to be let me call it as say for example, a 1 a 2 a 3 a 4 or a b c d whatever you like to call. So, these are the input symbols you consider now the situation is naturally what you are doing you are adding from this side. So, you consider the same because we are constructing a millimission by considering this way now whatever the output that you are getting you can of course, reverse it and present to understand that this is what is essentially the sum of that. So, now what I would suggest you that you are calling them as a 1 a 2 a 3 a 1 a 2 a 3 a 4 or a b c d whatever that and now you see the situation is when you are adding 1 1 here you clearly see that I get 1 here 1 is carry forward and when I am adding this thing here this these two I have to cross check whether I have some carry if there is a carry then I have to include that also to identify the output for the corresponding symbol otherwise you know if there is no carry that means, if there is no carry then in which case I do not have I will continue just what are the current symbols. That means, first of all from this you should understand that you should have two states one is indicating that when you are given an input either 1 0 or 1 1 or 0 1 or 0 0 depending on whether you have carry or not the output is associated to the particular symbol. That means, for example, for a 1 the output will be you know just 1 the output will be just 1 if there is no carry suppose already some carry is there for a 1 what will happen because you have 1 1 you want to add and you have one more carry. So, that way what is the total sum. So, here this is otherwise it is 0 sorry if there is no carry if there is a carry you have to because this 1 plus 1 plus 1 that means, you will have one output. So, this is how we have to distinguish for example, let me consider this symbols which are coming a 1 a 2 a 3 a 4 assume I do not have any carry that means, as it is when I am adding 1 with 1 I have to print 0 and of course, there will be 1 carry when I am adding this 0 with 1 that means, the output has to be 1 here there is no carry of course, in this case when I am having a 3 as input I will be adding 1 0 that means, here 1 as output when I am adding 0 with 0 this is 0 here the assumption is these are the outputs with the assumption that no carry while adding that particular if there is carry that means, the carry possibility is 1. So, that is say when you have a 1 a 2 a 3 a 4 when you are getting them as input then, I have to consider that into the picture because a 1 is 1 1 1 carry is there here carry whenever carry is there. So, here now I will have 1 as output 1 carry will be there for a 2 that is 0 1 I have 1 carry 0 1 when you are adding that is 1, but 1 carry is there thus it will get 0 and here you have a carry. Similarly, when I am adding 1 0 you have 1 carry that means, this is 0 and you have a carry here when I am adding 0 0 I have carry 1. So, that way when you add this 0 0 the output will be 1 this is how we give and finally, since as we have assumed that the input we will always maintain 1 leading this pair 0 0. So, the carry if it is if a carry is existing that will give you the appropriate output now following this if I consider q naught as the state which is having no carry and q 1 for the state which is having carry 1. So, now of course, in the beginning with the initial state q naught no carry state now as I had mentioned here a 1 is 1 1 this is 0 1 1 0 0 0. So, let me once again write that say a 1 is 1 1 this is the symbol a 2 is the symbol that is 0 1 a 2 is the symbol 0 1 a 3 is 1 0 and a 4 is 0 0 this is how we have taken. Now, you see the transition for a 1 when you are adding this with this you have you are getting a carry here, but the output is 0. So, in a 1 you have a carry that means, you are going to the state q 1. So, a 1 as input and output is 0 and a 2 when you are adding then you do not get any carry because when you do not have any carry that means, in q naught. So, you will have a loop here a 2 as input and output is 1. Similarly, a 3 you will have output 1 carry 0 for a 4 0 as output and no carry. Similarly, as I had listed here when the carry is there that means, in the state I am in q 1. So, now you can declare that when I am getting 1 1 here I have already 1. So, that means, it will become carry 1 because 1 plus 1 plus 1 there that means, carry 1 and output is also 1. So, a 1 you will have output 1 and continuing to this when you are getting a 2 here you have already carry 1. So, 1 plus 0 plus 1 which is a carry already because of the state q 1. So, a 2 will continue here, but here the output is 0 for a 3 also similar situation you get the carry the output is this when you are having a 4 as input that is 0 0 and in q 1 you have 1 carry. So, you will get the transition 0 carry mean there is no carry. So, you are transferring to q naught state that means, a 4 with the output here 0 0 plus 1. So, here you get 1. So, thus you can construct a millimation to pursue this addition of course, thus we are pursuing from the way usually that you consider from right to left that is how this is pursuing. And you know in case of regular languages all these things that the reversing mechanism that you can you can handle using a DFA. So, thus the binary addition including that concept binary addition you can see that you can represent via a millimation as constructed here.