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.

30 TURING COMPUTABILITY<br />

Example 3.4. The object is to erase the leftmost stroke, fill the gap between the<br />

two blocks of strokes, <strong>and</strong> halt scanning the leftmost stroke that remains on the tape.<br />

Here is one way of doing it, in quadruple notation: q 1 S 1 S 0 q 1 ; q 1 S 0 Rq 2 ; q 2 S 1 Rq 2 ;<br />

q 2 S 0 S 1 q 3 ; q 3 S 1 Lq 3 ; q 3 S 0 Rq 4 .<br />

Example 3.5. A flow chart for a machine is shown in Figure 3-7.<br />

Figure 3-7. Multiplication machine.<br />

Here is how the machine works. The first block, of p strokes, is used as a counter,<br />

to keep track of how many times the machine has added q strokes to the group at the<br />

right. To start, the machine erases the leftmost of the p strokes <strong>and</strong> sees if there are<br />

any strokes left in the counter group. If not, pq = q, <strong>and</strong> all the machine has to do is<br />

position itself over the leftmost stroke on the tape, <strong>and</strong> halt.

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

Saved successfully!

Ooh no, something went wrong!