0% found this document useful (0 votes)
78 views4 pages

Undecidability Document

Uploaded by

bhai m robot hu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
78 views4 pages

Undecidability Document

Uploaded by

bhai m robot hu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

1|Page

A problem is undecidable if there is no Turing machine which will always halt in finite amount
of time to give answer as 'yes' or 'no'. An undecidable problem has no algorithm to determine
the answer for a given input.

A decision problem (or language) is decidable if there is a Turing machine that solves a problem.

Solvable = Decidable and Unsolvable = Undecidable.

A problem is said to be Decidable if we can always construct a corresponding algorithm that


can answer the problem correctly. We can intuitively understand Decidable problems by
considering a simple example. Suppose we are asked to compute all the prime numbers in the
range of 1000 to 2000. To find the solution of this problem, we can easily devise an algorithm
that can enumerate all the prime numbers in this range.
Now talking about Decidability in terms of a Turing machine, a problem is said to be a
Decidable problem if there exists a corresponding Turing machine which halts on every input
with an answer- yes or no. It is also important to know that these problems are termed as Turing
Decidable since a Turing machine always halts on every input, accepting or rejecting it.

The problems for which we can’t construct an algorithm that can answer the problem correctly in
finite time are termed as Undecidable Problems. These problems may be partially decidable but
they will never be decidable. That is there will always be a condition that will lead the Turing
Machine into an infinite loop without providing an answer at all.
We can understand Undecidable Problems intuitively by considering Fermat’s Theorem, a
popular Undecidable Problem which states that no three positive integers a, b and c for any n>2
can ever satisfy the equation: a^n + b^n = c^n.
If we feed this problem to a Turing machine to find such a solution which gives a contradiction
then a Turing Machine might run forever, to find the suitable values of n, a, b and c. But we are
always unsure whether a contradiction exists or not and hence we term this problem as
an Undecidable Problem.
Examples – These are few important Undecidable Problems:
 Whether a CFG generates all the strings or not?
As a CFG generates infinite strings, we can’t ever reach up to the last string and hence it is
Undecidable.
 Whether two CFG L and M equal?
Since we cannot determine all the strings of any CFG, we can predict that two CFG are
equal or not.
 Ambiguity of CFG?
There exist no algorithm which can check whether for the ambiguity of a CFL. We can
only check if any particular string of the CFL generates two different parse trees then the
CFL is ambiguous.
 Is it possible to convert a given ambiguous CFG into corresponding non-ambiguous CFL?
It is also an Undecidable Problem as there doesn’t exist any algorithm for the conversion of
an ambiguous CFL to non-ambiguous CFL.
 Is a language learning which is a CFL, regular?
This is an Undecidable Problem as we cannot find from the production rules of the CFL
whether it is regular or not.
2|Page

Some more Undecidable Problems related to Turing machine:


 Membership problem of a Turing Machine?
 Finiteness of a Turing Machine?
 Emptiness of a Turing Machine?
 Whether the language accepted by Turing Machine is regular or CFL?

Decidable Problems
A problem is decidable if we can construct a Turing machine which will halt in finite amount of
time for every input and give answer as ‘yes’ or ‘no’. A decidable problem has an algorithm to
determine the answer for a given input.
 Examples
 Equivalence of two regular languages: Given two regular languages, there is an
algorithm and Turing machine to decide whether two regular languages are equal or not.
 Finiteness of regular language: Given a regular language, there is an algorithm and
Turing machine to decide whether regular language is finite or not.
 Emptiness of context free language: Given a context free language, there is an algorithm
whether CFL is empty or not.
Undecidable Problems
A problem is undecidable if there is no Turing machine which will always halt in finite amount
of time to give answer as ‘yes’ or ‘no’. An undecidable problem has no algorithm to determine
the answer for a given input.
Examples
 Ambiguity of context-free languages: Given a context-free language, there is no Turing
machine which will always halt in finite amount of time and give answer whether language
is ambiguous or not.
 Equivalence of two context-free languages: Given two context-free languages, there is no
Turing machine which will always halt in finite amount of time and give answer whether
two context free languages are equal or not.
 Everything or completeness of CFG: Given a CFG and input alphabet, whether CFG will
generate all possible strings of input alphabet (∑*)is undecidable.
 Regularity of CFL, CSL, REC and REC: Given a CFL, CSL, REC or REC, determining
whether this language is regular is undecidable.
Note: Two popular undecidable problems are halting problem of TM and PCP (Post
Correspondence Problem). Semi-decidable Problems
A semi-decidable problem is subset of undecidable problems for which Turing machine will
always halt in finite amount of time for answer as ‘yes’ and may or may not halt for answer as
‘no’.
3|Page

Rice’s Theorem
Every non-trivial (answer is not known) problem on Recursive Enumerable languages is
undecidable.e.g.; If a language is Recursive Enumerable, its complement will be recursive
enumerable or not is undecidable.
Reducibility and Undecidability
Language A is reducible to language B (represented as A≤B) if there exists a function f which
will convert strings in A to strings in B as:
w ɛ A <=> f(w) ɛ B
Theorem 1: If A≤B and B is decidable then A is also decidable.
Theorem 2: If A≤B and A is undecidable then B is also undecidable.

The Halting problem – Given a program/algorithm will ever halt or not?


Halting means that the program on certain input will accept it and halt or reject it and halt and it
would never go into an infinite loop. Basically halting means terminating. So can we have an
algorithm that will tell that the given program will halt or not. In terms of Turing machine, will it
terminate when run on some machine with some particular given input string.
The answer is no we cannot design a generalized algorithm which can appropriately say that
given a program will ever halt or not?
The only way is to run the program and check whether it halts or not.
We can refrain the halting problem question in such a way also: Given a program written in
some programming language(c/c++/java) will it ever get into an infinite loop(loop never stops)
or will it always terminate(halt)?
This is an undecidable problem because we cannot have an algorithm which will tell us whether
a given program will halt or not in a generalized way i.e by having specific program/algorithm.In
general we can’t always know that’s why we can’t have a general algorithm.The best possible
way is to run the program and see whether it halts or not.In this way for many programs we can
see that it will sometimes loop and always halt.
Proof by Contradiction –
Problem statement: Can we design a machine which if given a program can find out if that
program will always halt or not halt on a particular input?
4|Page

Solution: Let us assume that we can design that kind of machine called as HM(P, I) where HM
is the machine/program, P is the program and I is the input. On taking input the both arguments
the machine HM will tell that the program P either halts or not.
If we can design such a program this allows us to write another program we call this program
CM(X) where X is any program(taken as argument) and according to the definition of the
program CM(X) shown in the figure.

In the program CM(X) we call the function HM(X), which we have already defined and to HM()
we pass the arguments (X, X), according to the definition of HM() it can take two arguments i.e
one is program and another is the input.Now in the second program we pass X as a program and
X as input to the function HM().We know that the program HM() gives two output either “Halt”
or “Not Halt”.But in case second program, when HM(X, X) will halt loop body tells to go in
loop and when it doesn’t halt that means loop, it is asked to return.
Now we take one more situation where the program CM is passed to CM() function as an
argument. Then there would be some impossibility, i.e., a condition arises which is not possible.
It is impossible for outer function to halt if its code (inner body) is in loop and also it is
impossible for outer non halting function to halt even after its inner code is halting. So the both
condition is non halting for CM machine/program even we had assumed in the beginning that it
would halt.So this is the contradiction and we can say that our assumption was wrong and this
problem, i.e., halting problem is undecidable.
This is how we proved that halting problem is undecidable.

You might also like