TOC Unit 6 Part
TOC Unit 6 Part
unsolvable, based on whether there exists an algorithm that can solve the problem or not.
Solvable: A problem is said to be solvable if there exists an (solution) algorithm that can solve
it in a finite amount of time, i.e., for any input of the problem, the algorithm can produce the
correct output in a finite number of steps, or you can prove that the problem cannot be solved
(there is no algorithm (solution) available to solve the given problem).
Unsolvable Problem - On the other hand, a problem is said to be unsolvable if there does not
exist any algorithm that can solve it in a finite amount of time. One well-known example of an
unsolvable problem is the Halting problem, which asks whether a given program will
eventually halt or run forever. It has been proven that there is no algorithm that can solve the
Halting problem for all possible inputs.
b) Semi- Decidable Problems – Semi-Decidable problems are those for which a Turing
machine halts on the input accepted by it but it can either halt or loop forever on the
input which is rejected by the Turing Machine. Such problems are termed as Turing
Recognisable problems.
Examples – We will now consider few important Decidable problems:
• Are two regular languages L and M equivalent?
We can easily check this by using Set Difference operation. L-M =Null and M-L =Null.
Hence (L-M) U (M-L) = Null, then L,M are equivalent.
• Membership of a CFL?
We can always find whether a string exist in a given CFL by using on algorithm based
on dynamic programming.
• Emptiness of a CFL
By checking the production rules of the CFL we can easily state whether the language
generates any strings or not.
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 can not find from the production rules of the
CFL whether it is regular or not.
Remember that there are three possible outcomes of executing a Turing machine over a given
input. The Turing machine may
• Halt and accept the input;
• Halt and reject the input; or
• Never halt.
A language is recursive if there exists a Turing machine that accepts every string of the
language and rejects every string (over the same alphabet) that is not in the language.
A language is recursively enumerable if there exists a Turing machine that accepts every string
of the language, and does not accept strings that are not in the language. (Strings that are not
in the language may be rejected or may cause the Turing machine to go into an infinite loop.)
Recursive Language
Clearly, every recursive language is also recursively enumerable. It is not obvious whether
every recursively enumerable language is also recursive.
Recursive Enumerable language, A language is said to be recursively enumerable if there
exists a Turing machine which will accept and halt for all the input strings which are in L. But,
It may halt or may not halt for all the input strings which are not in L.
Important Note:
1. Recursive Language (TM will always halt) = Decidable Language (vice-versa)
2. Recursively Enumerable Language (TM will halt sometime & sometime may not)
= Partially Decidable Language
3. If no Turing machine exists for Language then language is undecidable
In 1936, A method named as lambda-calculus was created by Alonzo Church in which the
Church numerals are well defined, i.e. the encoding of natural numbers. Also in 1936, Turing
machines (earlier called theoretical model for machines) was created by Alan Turing, that is
used for manipulating the symbols of string with the help of tape.
It is a Hypothesis that can be stated as: “The assumption that the intuitive notion of
computable functions can be identified with partial recursive functions.”
Or in simple words we can say that “Every computation that can be carried out in the
real world can be effectively performed by a Turing Machine.”
In 1930, this statement was first formulated by Alonzo Church and is usually referred to as
Church’s thesis, or the Church-Turing thesis. However, this hypothesis cannot be proved.
The recursive functions can be computable after taking following assumptions:
1. Each and every function must be computable.
2. Let ‘F’ be the computable function and after performing some elementary
operations to ‘F’, it will transform a new function ‘G’ then this function ‘G’
automatically becomes the computable function.
3. If any functions that follow above two assumptions must be states as computable
function.
Turing Reducibility