00:01
We're asked to construct a touring machine that computes the function f of n equals n minus 3, if n is greater than or equal of 3, and is a non -negative integer, and f of n is equal to 0, if n is equal to 1, 2, or 0.
00:31
So this covers all non -negative integers.
00:36
So to do this, we'll use unary notation.
00:39
So essentially what we're seeing we want to do is we have an input string, which is, well, in the case of n greater than or equal to three, we're going to have n plus one ones, where n is greater than equal to three, and the output should be n minus three plus one, which is equal to n minus two ones.
01:15
Again, n is greater than equal to 3, so it follows that we'll have at least 1 -1, so this does make sense in unary notation.
01:25
Otherwise, if the input is going to be 1, 2, or 3 -1, the output should be 1 -1, which symbolizes that f -n is going to be 0.
02:01
So, if n is greater than equal to 3, we want our machine to erase 3 -3.
02:07
Of the ones so that we end up with n minus two ones in the end.
02:39
And the case that we have fewer than four ones, we really want to erase all the ones except for one.
02:53
So suppose the n is greater than or equal to three.
03:00
Well, starting out in state s zero, we're going to recognize a one.
03:07
And then we're going to want to shift into state s one, change the one to a blank and move right.
03:23
If we've erased one of the ones, we want to erase two more ones.
03:28
So in state s1, we encounter a 1.
03:31
We'll want to shift into state s2, change the one to a blank, and move right.
03:36
And finally, when we're in state s2, if we encounter a 1, we'll want to shift into the final state s3, change the one to a blank and move right.
03:49
And then we will obtain a string with three less ones than we started with.
04:05
Now, while s3 is a final state, we want to also account for the possibilities that n is less than three...