Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Standard view
Full view
of .
Look up keyword
Like this
0 of .
Results for:
No results containing your search query
P. 1


Ratings: (0)|Views: 183|Likes:
Published by api-19970469

More info:

Published by: api-19970469 on Dec 03, 2009
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as DOCX, PDF, TXT or read online from Scribd
See more
See less






There exist problems that cannot be solved using a computer or a Turing machine. The difficulty in solving such problems is not due to limits of processing power or memory. Such problems are called undecidable problems. Since Turing machines have infinite memory, they represent the theoretical limits of computation i.e. they define what all problems any computer can solve. So if Turing machine fails, the problem ends up undecidable. A popular undecidable problem is the halting problem (determining whether a Turing machine halts or runs forever).

Decidable problems are those that can be solved using a Turing machine. A decision problemA is

called decidable or effectively solvable ifA is a recursive set. A problem is called partially decidable, semi decidable, solvable, or provable ifA is a recursively enumerable set.Fig I shows the closure of decisionproblems. A classic example of a

decidable decision problem is the set of prime numbers. It is possible to effectively decide whether a
given natural number is prime by testing every possible nontrivial factor.
Fig I: Closure of decision problems

We can divide problems that can be solved by a Turing machine into two classes: those that have an algorithm (halts whether or not it accepts its input), and those that are only solved by Turing machines that may run forever on inputs they do not accept. The latter form of acceptance does not actually solve the problem, since no matter how long the TM runs, we cannot know whether the input is accepted or not. Thus, those problems with no algorithm are classified as undecidable, regardless of whether or not they are accepted by a Turing machine that falls to halt on some inputs.

Undecidable Problems

An undecidable problem is a decision problem for which it is impossible to construct a single algorithm that always leads to a correct yes-or-no answer \u2014 the problem is not decidable. The language of an undecidable problem is not a recursive set.Ther e

are problems that are often easily expressed but still end up undecidable.
Let us imagine simulating an undecidable program. Here the problem will take unimaginably long time
before we will be eventually getting an output from the program. This uncertainty about when we will be
getting an output makes the problem undecidable. The problem of undecidability can be understood by a
simple example. Everyone knows the famous \u201cHello World\u201d program.
{printf(\u201cHello World\u201d);
}Now let us introduce the undecidable problem using the above program. The undecidable problem

statement is: \u201cDetermine whether a given program prints \u2019Hello World\u2019\u201d. At first this problem seems to
be easy, and a solution will be to run the program and see the output. If the output is \u2018Hello World\u2019 then
output \u201cYes\u201d otherwise output \u201cNo\u201d. Is it as simple as it seems? There are infinite ways one can write a
program that eventually prints \u2018Hello World\u2019. Let us consider another program that eventually prints
\u2018Hello World\u2019.

int exp ( int i, n)
/* computes i to the power n */

int ans, j;
ans = 1;
for (j=1; j<=n; j++) ans *= i;
return (ans);

}main ()

int n, total, x, y, z;
scanf ("% d",&n);
total = 3;
while (1)

for (x=1; x<=total-2; x++)
for (y=1; y<=total-x-1; y++)

z = total - x - y;
if (exp(x, n) + exp(y, n) == exp (z, n))
printf ("Hello World")

total + +;
}The peculiarity in this program is that it takes an inputn, and looks for the positive integer solutions to the
equations x" + y" = zn . If it finds a set of valid x, y and z values, it prints \u2018Hello World\u2019. Otherwise it will
continue searching forever and never print \u2018Hello World\u2019.

To understand what this program does, first observe that exp() is an auxiliary function to compute
exponentials. The main program needs to search through triples (x, y, z) in an order to get to the valid
combination satisfying x" + y" = zn . To organize the search properly, we use a fourth variable,tot al, that
starts at 3 and, in the while-loop, it is incremented by one, eventually reaching any finite integer. Inside
the while-loop, we dividet ot al into three positive integers x, y, and z, by first allowing x to range from 1
to total-2, and within that for-loop allowing y to range from 1 up to one less than what x has not 'already

taken from total. What remains, which must be between 1 andt ot al-2, is given to z. In the innermost loop,
the triple (x, y, z) is tested to see if xn + y" = zn. If so, the program prints \u2018Hello world\u2019, and if not, it
prints nothing.

Suppose we give the value 2 for n, then it will eventually find combinations of integers such as total = 12,
x = 3, y = 4, and z = 5, for which xn + yn = zn. Thus, for input 2, the program does print \u2018Hello World\u2019.
However, for any integer n > 2, the program will never find a triple that satisfy xn + yn = zn. This
example gives us the notion of undecidability in a problem. Now if we can plan to write a solution to this
undecidable problem i.e. to write a program which takes any program P , run with I as input for P, and
decide whether P prints \u2018Hello World\u2019. Then we can prove that no such program exists.

Problem vs. Program

Problem and program are two different concepts when it comes to undecidability. A problem can be
considered as the membership of a string in a language. The number of different languages over any
alphabet of more than one symbol is uncountable. That is we cannot assign integers to all possible
languages such that every integer is assigned to one language. Thus the numbers of problems possible are

On the other hand programs, being finite strings over a finite alphabet, are countable. That is, we can
order programs by their length and it is possible to assign numbers to all programs of the same length.
Thus there are infinitely fewer programs than there are problems. If we pick up a random language, it will
most probably be undecidable.

Proof of non-existence of the \u2018Hello World\u2019 testing program

Proving that there exists no program that can test the \u2018Hello World\u2019 program can be tricky. But we can achieve this using proof by contradiction. That is we first assume that a \u2018Hello World\u2019 tester program exist, then be contradict this assumption and prove the non-existence.

Assume there is a program H, that takes as input a program P and an input I, and tells whether P with
input I prints \u2018Hello World\u2019. Figure A is a representation of what H does.
Hello World Tester
Figure A: A hypothetical Hello World Tester

In particular, the only output H makes is either to print the three characters \u2018YES\u2019 or to print the two
characters \u2018NO\u2019. It always does one or the other. If a problem has an algorithm like H, that always tells
correctly whether an instance of the problem has answer \u2018YES\u2019 or \u2018NO\u2019 then the problem is said to be

decidable. Otherwise, the problem is undecidable. Our goal is to prove that H doesn't exist; i.e., the hello-
world problem is undecidable.
To start the proof by contradiction we make small changes to the program H resulting in a new program
H2 which we show does not exist. The changes made to H are simple transformations that can be done to

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->