Chapter 2 - Undecidability
Chapter 2 - Undecidability
Chapter 2
• Undecidability
• Any input string does not loop and halt until final state
Cont...
• Examples of decidable problem
• Are you private employee………yes/no
• Are you sick………yes/no
• 2+5=7………yes
• 6+5=7………no
Examples of decidable problems …
• Membership of a CFL?
• We can always find whether a string exists in a given CFL by using an 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.
Un-Decidability
• In computability theory and computational complex theory, undecidable problem
is a decision problem for which it is proved to be impossible to construct an
algorithm that always leads to a correct yes or no answer.
• To say that a problem is ‘UNDECIDABLE’ means that there is no way, even given
unlimited resources and an infinite amount of time, that the problem can be
decided by algorithmic means.
Properties of undecidable problem
• 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 not 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.
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.
• 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 (loop).
• A language “L” is said to be recursive if there exists a Turing machine which will
accept all the strings in “L” and reject all strings not in “L”.
• The Turing machine will halt every time and give an answer (accepted or rejected)
for each and every string input
Relationship…
Regular: {0*1*}
Context-free: {0n1n}
• Recursive language L is always halt and accepts all the input string in the language L and
halt and rejects all the string that is not in the language L. defined with the following
function