Were asked to construct a Turing machine that computes the function f of N one and two equals and two plus two for all n. One and n two non negative integers. So recognize that input for this function, which is a pair and when end to is going to be a string which has and one plus one ones, followed by a star symbol, which separates the two components of the payer and then end to plus one one's for the second components and to you want to end up with End to Plus two plus one, which is, and two plus three ones as our output. This represents the non negative manager end two plus two. So we see that in our original input to the right of the asterisk we're being given and two plus one ones. So you want to add to ones to this somehow. One way to do this is to replace the aspirin with the one and then to replace the blank to the U right of our input with the one and then we'll have and two plus three ones. As long as we delete the first and one plus one ones And so this is actually a fairly simple machine to make. We're going to start out in the state s zero, and whenever we find a one in the States, we're going to delete it. Point it changes to a blink. We're going to stay in state s zero until eventually one state s zero and we reach the asterisk symbol. At this point, we're going to change the asterisk symbol to a one, and we're going to shift into State S one. And now, once we're in state s one, you want to move through the rest of the ones until we reach a blank in the first blank we reach. We want to change this into a one after shifting in the state s to. And so now our string has end two plus three ones. Exactly. And it doesn't have any asterisks separating any parts of the string and also s two is a final state, so this will be accepted by the machine. Now, this is one way to go about it. Another way is to actually, instead of having to go through all the ones we could back up after erasing the asterisk, complacent with the one. So you moved to the left, and then we don't have to worry about encounter in a one worm. Where in state s one. All we have to worry about is encountering that blank, which inevitably, Whoa! And then we want to change that blank into a one to changing into state s to We can move left or right.