12.07.2015 Views

A Practical Introduction to Data Structures and Algorithm Analysis

A Practical Introduction to Data Structures and Algorithm Analysis

A Practical Introduction to Data Structures and Algorithm Analysis

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

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

584 Chap. 17 Limits <strong>to</strong> Computation1 2 3 4 5x123456f 1 (x) x f 2 (x)11111123456123456x1 123456f 3 (x)7911131517x123456f 4 (x)15171327Figure 17.7 An illustration of assigning functions <strong>to</strong> bins.Can we assign every function <strong>to</strong> a bin? The answer is no, because there isalways a way <strong>to</strong> create a new function that is not in any of the bins. Suppose thatsomebody presents a way of assigning functions <strong>to</strong> bins that they claim includesall of the functions. We can build a new function that has not been assigned <strong>to</strong>any bin, as follows. Take the output value for input 1 from the function in the firstbin. Call this value F 1 (1). Add 1 <strong>to</strong> it, <strong>and</strong> assign the result as the output of a newfunction for input value 1. Regardless of the remaining values assigned <strong>to</strong> our newfunction, it must be different from the first function in the table, because the twogive different outputs for input 1. Now take the output value for 2 from the secondfunction in the table (known as F 2 (2)). Add 1 <strong>to</strong> this value <strong>and</strong> assign it as theoutput for 2 in our new function. Thus, our new function must be different fromthe function of Bin 2, because they will differ at least at the second value. Continuein this manner, assigning F new (i) = F i (i) + 1 for all values i. Thus, the newfunction must be different from any function F i at least at position i. This procedurefor constructing a new function not already in the table is called diagonalization.Because the new function is different from every other function, it must not be inthe table. This is true no matter how we try <strong>to</strong> assign functions <strong>to</strong> bins, <strong>and</strong> so thenumber of integer functions is uncountable. The significance of this is that not allfunctions can possibly be assigned <strong>to</strong> programs, so there must be functions with nocorresponding program. Figure 17.8 illustrates this argument.17.3.2 The Halting Problem Is UnsolvableWhile there might be intellectual appeal <strong>to</strong> knowing that there exists some functionthat cannot be computed by a computer program, does this mean that there is anysuch useful function? After all, does it really matter if no program can compute a“nonsense” function such as shown in Bin 4 of Figure 17.7? Now we will prove

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

Saved successfully!

Ooh no, something went wrong!