0% found this document useful (0 votes)
223 views

Chapter 2 - Undecidability

The document discusses complexity theory and summarizes key concepts related to decidability and undecidability of problems. It defines decidable and undecidable problems, and provides examples of each. Decidable problems can always be solved algorithmically in a finite number of steps, while undecidable problems cannot. The document also outlines the relationships between different types of formal languages, including regular, context-free, recursive, and recursively enumerable languages. It explains how recursive languages are decidable, while recursively enumerable languages can be either decidable or undecidable.

Uploaded by

Hussien Mekonnen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
223 views

Chapter 2 - Undecidability

The document discusses complexity theory and summarizes key concepts related to decidability and undecidability of problems. It defines decidable and undecidable problems, and provides examples of each. Decidable problems can always be solved algorithmically in a finite number of steps, while undecidable problems cannot. The document also outlines the relationships between different types of formal languages, including regular, context-free, recursive, and recursively enumerable languages. It explains how recursive languages are decidable, while recursively enumerable languages can be either decidable or undecidable.

Uploaded by

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

Complexity Theory

Chapter 2

Compiled By: Hussien M. KIoT, 2021


Outline

• Undecidability

• Properties of decidable problem

• Properties of undecidable problem

• Relationship between languages


Decision problems and languages

• A decision problem requires checking if an input (string) has some


property

• Thus, a decision problem is a function from strings to Booleans

• A decision problem is represented as a formal language consisting of


those strings (inputs) on which the answer is “yes”
Cont…

 In mathematics and computer science, a “problem” is often defined as a


function from input to output

 In principle, a “function” problem can be converted into a “decision”


problem that only has “yes/no” answers

 So to solve a problem means to decide whether a given string belongs


to a language
Continued …
• Every existing problem is generally classified into two:
solvable and unsolvable.
Decidable
•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 TM, a problem is said to be a decidable if


there exists a corresponding TM 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.
Cont…

• If a language L is Turing decidable, it halts on all the input strings.


• If an input string is found in the language L, then the Turing machine halts and
accept
• If the input string is not found in the language L, the Turing machine halts and
reject.

• During those conditions, the problem is decidable on the above Turing


machine.
Properties of Decidable problem

• It always has one possible answer yes or no

• Has finite number of steps to solve

• Has a TM to solve the problem

• Accept or reject all the input string

• 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 …

• 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 and M are equivalent.

• 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

• Has more than one possible answer sometimes yes or sometimes no

• Sometimes there is no finite step to solve the problem

• Sometimes there is no Turing machine to solve the problem

• It may accept, reject, halt and loop

• Halting and looping problems are un-decidable


Examples of undecidable problem
• Is there flooding next month? sometimes yes/ sometimes no

• Is next Monday rainy day? sometimes yes/ sometimes no

• 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.

• Such problems are termed as Turing Recognizable problems.

• A semi-decidable (recursively enumerable) problem could be:


• Decidable: if TM halt and accept the given input

• Undecidable: if TM loop forever and fail to halt


Relationship Among Languages

• 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 (decidable): {0n1n2n}

Recursively Enumerable: Lu = {(M, w) | w is in L(M)}

Non-RE: Luc = {(M, w) | w is not in L(M)}


Relationship …
• 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.

• Clearly, every recursive language is also recursively enumerable. It is not obvious


whether every recursively enumerable language is also recursive
Relationship …
• A language L is Turing recognizable if it halts and accepts all the input strings in the
language L and it may loop, halt and reject all the strings in the language L

• 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

• All Recursive languages are decidable and vice-versa.


• All Recursive languages are Turing Recognizable not vice-versa.
Relationship …
• Recursive Enumerable language L is always halt and accepts all the
input strings in the language L or may loop and halt and rejects all the
strings that are not in the language L.

• Therefore, recursive enumerable language L is defined as in the


following function f.
Relationship …

• All Recursive Enumerable languages are undecidable not vice-versa

• All Recursive Enumerable languages are Turing recognizable and


vice versa

• All Recursive languages are Recursive Enumerable language not


vice versa

• All decidable languages are Recursive Enumerable language not vice


versa

You might also like