27.04.2015 Views

Computability and Logic

Computability and Logic

Computability and Logic

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

28 TURING COMPUTABILITY<br />

3.2 Example (Doubling the number of strokes). The machine starts off scanning the leftmost<br />

of a block of strokes on an otherwise blank tape, <strong>and</strong> winds up scanning the leftmost<br />

of a block of twice that many strokes on an otherwise blank tape. The flow chart is shown<br />

in Figure 3-5.<br />

Figure 3-5. Doubling the number of strokes.<br />

How does it work? In general, by writing double strokes at the left <strong>and</strong> erasing single<br />

strokes at the right. In particular, suppose the initial configuration is 1 1 11, so that we start<br />

in state 1, scanning the leftmost of a block of three strokes on an otherwise blank tape. The<br />

next few configurations are as follows:<br />

0 2 111 0 3 0111 1 3 0111 0 4 10111 1 4 10111.<br />

So we have written our first double stroke at the left—separated from the original block<br />

111 by a blank. Next we go right, past the blank to the right-h<strong>and</strong> end of the original block,<br />

<strong>and</strong> erase the rightmost stroke. Here is how that works, in two phases. Phase 1:<br />

11 5 0111 110 5 111 1101 6 11 11011 6 1 110111 6 1101110 6 .<br />

Now we know that we have passed the last of the original block of strokes, so (phase 2) we<br />

back up, erase one of them, <strong>and</strong> move one more square left:<br />

110111 7 110110 7 11011 8 0.<br />

Now we hop back left, over what is left of the original block of strokes, over the blank<br />

separating the original block from the additional strokes we have printed, <strong>and</strong> over those<br />

additional strokes, until we find the blank beyond the leftmost stroke:<br />

1101 9 1 110 9 11 11 10 011 1 10 1011 0 10 11011.<br />

Now we will print another two new strokes, much as before:<br />

01 2 1011 0 3 11011 1 3 11011 0 4 111011 1 4 111011.<br />

We are now back on the leftmost of the block of newly printed strokes, <strong>and</strong> the process<br />

that led to finding <strong>and</strong> erasing the rightmost stroke will be repeated, until we arrive at the<br />

following:<br />

1111011 7 1111010 7 111101 8 0.<br />

Another round of this will lead first to writing another pair of strokes:<br />

1 4 1111101.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!