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.

PROBLEMS 61<br />

Figure 5-17. Minimization.<br />

emptied <strong>and</strong> a single rock place in box 2, preparatory to the computation of f (x, 1).<br />

If this value is 0, the program halts, with the correct value, h(x) = 1, in box 2.<br />

Otherwise, another rock is placed in box 2, <strong>and</strong> the procedure continues until such time<br />

(if any) as we have a number y of rocks in box 2 that is enough to make f (x, y) = 0.<br />

The extensive class of functions obtainable from the trivial functions considered<br />

in the example at the beginning of this section by the kinds of processes considered<br />

in the rest of this section will be studied in the next chapter, where they will be given<br />

the name recursive functions. At this point we know the following:<br />

5.8 Theorem. All recursive functions are abacus computable (<strong>and</strong> hence Turing<br />

computable).<br />

So as we produce more examples of such functions, we are going to be producing<br />

more evidence for Turing’s thesis.<br />

Problems<br />

5.1 Design an abacus machine for computing the difference function . − defined by<br />

letting x . −y = x − y if y < x, <strong>and</strong> = 0 otherwise.<br />

5.2 The signum function sg is defined by letting sg(x) = 1ifx > 0, <strong>and</strong> = 0<br />

otherwise. Give a direct proof that sg is abacus computable by designing an<br />

abacus machine to compute it.<br />

5.3 Give an indirect proof that sg is abacus computable by showing that sg is<br />

obtainable by composition from functions known to be abacus computable.<br />

5.4 Show (directly by designing an appropriate abacus machine, or indirectly) that<br />

the function f defined by letting f (x, y) = 1ifx < y, <strong>and</strong> = 0 otherwise, is<br />

abacus computable.<br />

5.5 The quotient <strong>and</strong> the remainder when the positive integer x is divided by the<br />

positive integer y are the unique natural numbers q <strong>and</strong> r such that x = qy + r<br />

<strong>and</strong> 0 ≤ r < y. Let the functions quo <strong>and</strong> rem be defined as follows: rem(x, y) =<br />

the remainder on dividing x by y if y ≠ 0, <strong>and</strong> = x if y = 0; quo(x, y) = the<br />

quotient on dividing x by y if y ≠ 0, <strong>and</strong> = 0ify = 0. Design an abacus machine<br />

for computing the remainder function rem.<br />

5.6 Write an abacus-machine flow chart for computing the quotient function quo<br />

of the preceding problem.

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

Saved successfully!

Ooh no, something went wrong!