To compute g, the following algorithm works:
1. Replace the basic 1 by a blank. (This marks the beginning.)
2. Move outgoing the end of the jump gear head off of 1s.
3. Print a 1.
4. Move to the end of the atomic number 42 block of 1s.
5. scratch 3 1s, moving backwards.
6. Move back to the freshman blank, and replace it with a 1. I will design a Turing machine that does
this, in class.
For the third, we need to take an input of 1x+1, 0, 1y+1 and return an output of 1xy . I will
only line the algorithm in general terms, and let you puzzle everyplace the implementation in the
book. The idea is to use the first block of 1s as a counter, to move the second block of 1s
(minus 1) over x time; and then fill in the blanks. I will not worry about leaving the output in
the offset position; I will leave it to you to make competent modifications to this effect.
Here is the algorithm:
1. Delete the leftmost 1.
2. If there argon no more 1s in the first block (i.e. x = 0), delete the second block, and halt.
3. Otherwise, delete the right 1 in the second block.
If there are no more 1s (i.e. y = 0),
erase the first block, and halt.
4. Otherwise, now the string on the tape reads 1x, 0, 1y . Delete a 1 from the left side of the
first block.
5. Repeat the following
(a) skid the second block y places to the right. (b) Delete a 1 from the left side of the first
block.
until the first block is empty.
6. instantly the tape head is on a blank (i.e. a 0); to the right of the blank are (x ? 1)y blanks,
followed by y 1s. Fill in the blanks to the right of the tape head with 1s.If you want to get a full essay, order it on our website: Orderessay
If you want to get a full essay, wisit our page: write my essay .
No comments:
Post a Comment