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

TOC Assignment

The document discusses the concepts of decidable and undecidable languages in the context of theoretical computer science, particularly focusing on Turing machines and the Halting Problem. It explains the significance of decidable languages, the characteristics of undecidable languages, and introduces techniques such as diagonalization and reduction for proving undecidability. Additionally, it covers the P vs NP problem and Ladner's Theorem, which states that if P ≠ NP, there exist NP-intermediate problems that are neither in P nor NP-complete.

Uploaded by

crid
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)
6 views

TOC Assignment

The document discusses the concepts of decidable and undecidable languages in the context of theoretical computer science, particularly focusing on Turing machines and the Halting Problem. It explains the significance of decidable languages, the characteristics of undecidable languages, and introduces techniques such as diagonalization and reduction for proving undecidability. Additionally, it covers the P vs NP problem and Ladner's Theorem, which states that if P ≠ NP, there exist NP-intermediate problems that are neither in P nor NP-complete.

Uploaded by

crid
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/ 11

Assignment On Theory of Computing

Submitted By
Name: Md. Mohtasim Hossain
ID: 2022200000163
Semester: Fall 2024
Dept. of Computer Science and Engineering, SEU.

Submitted To
Name: Mr. Nahid Hasan
Designation: LECTURER
Dept. of Computer Science and Engineering, SEU.

Submitted on January 24, 2025


2

Decidable languages
A decidable language is a language for which there is an algorithm that can
determine if a given word is in the language. Decidable languages are also
called recursive languages.
Explanation
 A Turing machine can be used to determine if a word belongs to a
decidable language.
 The Turing machine halts on all inputs and provides a yes or no answer.
 Decidable languages are important in theoretical computer science
because they show the limits of what can be solved using computational
models.
Properties of decidable languages
 Decidable languages are closed under union, intersection, and
complementation.
 A language is decidable if both the language and its complement are
recognizable.
A language L is said to be decidable if there exists a Turing machine that can
always decide whether any given string belongs to L or not. In simpler terms, if
we pass a string to this Turing machine, it will always halt, giving a clear
answer: either it will accept the string (if the string is in the language) or reject
it (if the string is not in the language).

Language Decidability
A language is called Decidable or Recursive if there is a Turing machine which
accepts and halts on every input string w. Every decidable language is Turing-
Acceptable.

A decision problem P is decidable if the language L of all yes instances to P is


decidable.
3

For a decidable language, for each input string, the TM halts either at the
accept or the reject state as depicted in the following diagram −

Given a regular language L and string w, how can we check if w ∈ L?


Solution
Take the DFA that accepts L and check if w is accepted

Undecidability of the Halting problem

Undecidable Languages
4

The language is said to be undecidable when it is not decidable. In other words,


there is no Turing machine that can decide every string in the language,
meaning the Turing machine cannot always halt with a decision.
Characteristics of Undecidable Languages
An undecidable language might be partially decidable, meaning there could be
a Turing machine that accepts some strings in the language and halts, but this
machine will not halt for some strings outside the language.
However, there are also languages that are not even partially decidable. For
these languages, there is no Turing machine that can reliably decide whether a
string belongs to the language or not. Such languages have no corresponding
Turing machine that can recognize them.
Undecidable Problem: The Halting Problem
The Halting Problem checks whether a given Turing machine will halt when
given a particular input or not. There is no general algorithm (and therefore no
Turing machine) that can solve the halting problem for all possible Turing
machines and inputs.

Turing Machine Halting Problem


Input − A Turing machine and an input string w.
Problem − Does the Turing machine finish computing of the string w in a finite
number of steps? The answer must be either yes or no.
Proof − At first, we will assume that such a Turing machine exists to solve this
problem and then we will show it is contradicting itself. We will call this Turing
machine as a Halting machine that produces a ‘yes’ or ‘no’ in a finite amount
of time. If the halting machine finishes in a finite amount of time, the output
comes as ‘yes’, otherwise as ‘no’. The following is the block diagram of a Halting
machine −
5

Now we will design an inverted halting machine (HM)’ as −


 If H returns YES, then loop forever.
 If H returns NO, then halt.
The following is the block diagram of an ‘Inverted halting machine’ –

Further, a machine (HM)2 which input itself is constructed as follows −


 If (HM)2 halts on input, loop forever.
 Else, halt.
Here, we have got a contradiction. Hence, the halting problem is undecidable.

Diagonalization & Reduction

Diagonalization
6

Diagonalization is a proof technique often used to demonstrate the existence


of languages or problems that cannot be solved by a given computational
model. It is closely associated with the concept of non-computability and is
famously used in proofs such as Cantor’s diagonal argument and the
undecidability of the Halting Problem.

Diagonalization in Automata Theory:


Proves there are languages that cannot be recognized by finite automata or
any given computational model.
Example: Use of diagonalization to demonstrate that not all languages can be
accepted by Turing machines (e.g., the Halting Problem).

To prove the Halting Problem is undecidable, we use a diagonalization


argument:
 Suppose there is a Turing machine M that decides the Halting Problem.
 Construct a new machine D that behaves differently on its own
description.
 The contradiction shows M cannot exist.

Reduction

Reduction is a method used to relate the complexity of different problems or


languages. It transforms one problem into another, showing that solving the
second problem allows us to solve the first.
Types of Reductions:
1. Many-One Reduction (≤m):
o Transforms an instance of one problem A into an instance of
another problem B such that A is true if and only if B is true.
7

o Used to prove undecidability and complexity results.


2. Turing Reduction (≤T):
o Allows the use of an oracle for problem B to decide problem A.
o More general than many-one reductions.
Reduction in Automata Theory:
 Shows relationships between languages and computational models.
 Example: Reduction between language classes:
o If L1 is reducible to L2 and L2 is decidable, then L1 is also
decidable.
o Reductions can demonstrate completeness in a complexity class
(e.g.NP-completeness).
Applications of Reduction:
1. Proving undecidability:
o Reduction from the Halting Problem to another problem shows
the second problem is also undecidable.
2. Complexity theory:
o Reductions classify problems into complexity classes (P,NP,PSPACE
etc.).

Comparison: Diagonalization vs. Reduction


Feature Diagonalization Reduction
Relate complexity or
Prove non-existence or
Purpose decidability of
undecidability
problems
Techniq Constructs a Transforms one
ue counterexample problem into another
Fundamental proofs Used extensively in
Scope
like Halting Problem complexity theory
8

P, NP,NPC class problems

The Ladner’s Theorem deals with the complexity classes: P, NP, and NPC (NP-
complete). The theorem addresses a fundamental question in computer
science: if P is not equal to NP, then are there problems in NP that are neither
in P nor NP-complete? The Ladner’s Theorem answers this question by proving
that there are indeed such problems, known as NP-intermediate problems.
Understanding the Basics: P, NP, and NP-Complete
Before understanding the Ladner’s Theorem, it is important to get the basics of
P, NP, and NP-complete problems.
 P (Polynomial Time) − In simple term, this class consists of problems that
can be solved by an algorithm in polynomial time. In other words, if a
problem is in P, there is an efficient algorithm that can solve it in a
certain amount of time as the input size grows.
 NP (Nondeterministic Polynomial Time) − This class includes problems
for which a solution, once found, can be verified in polynomial time.
However, it is not known whether these problems can be solved in
polynomial time or not.
 NP-Complete − The most complex class is the NP-Complete. If any NP-
complete problem can be solved in polynomial time, then every problem
in NP can also be solved in polynomial time, implying P = NP. Conversely,
if P ≠ NP, then NP-complete problems cannot be solved in polynomial
time.
9

The P vs NP Question
One of the most famous problem in computer science is whether P = NP or not.
If P were equal to NP, every problem that can be verified quickly could also be
solved quickly. However, if P ≠ NP, then there are problems in NP that cannot
be solved as efficiently as they can be verified.
NP-Intermediate Problems
Now it comes to the Ladner's Theorem. It introduces the concept of NP-
intermediate problems. These are problems that belong to NP but are neither
in P nor NP-complete. They sit in between the two classes, having an
intermediate complexity.
We can define this formally in this way, a language L ∈ NP is NP-intermediate
iff L ∉ P and L ∉ NP-complete.

In simpler terms, if P ≠ NP, then NP contains problems that are too difficult to
be in P but not as hard as NP-complete problems.

Ladner’s Theorem
The Statement: Ladner's Theorem states: If P ≠ NP, then there is a language L
which is an NP-intermediate language. This means that if it turns out P is not
equal to NP, then NP must contain problems that are neither easy enough to be
solved in polynomial time (P) nor hard enough to be NP-complete.
10

Ladner’s Theorem is proved using a technique called diagonalization, this


method often used in theoretical computer science to construct new problems
that are not part of a given set.
Limits of Diagonalization
Diagonalization is a technique that used to separate different sets, such as P
and NP, for NP-intermediate problems. However, it has its limits.
Kozen's Theorem shows that b diagonalization does not relativize, meaning it
cannot be used to separate P from NP under all circumstances. While Ladner's
Theorem uses diagonalization, it does so in a way that highlights these
limitations.
Examples of NP-Intermediate Problems
Ladner's Theorem implies the existence of NP-intermediate problems if P ≠ NP.
Some examples of problems believed to be NP-intermediate, these include −
 Computing the Discrete Logarithm − This problem involves finding the
exponent in the equation gx ≡ h (mod p), where g, h, and p are given.
 Graph Isomorphism Problem − This problem asks whether two graphs
are isomorphic, meaning they contain the same structure.
 Factoring the Discrete Logarithm − Like the discrete logarithm problem,
but focusing on factoring numbers.
 Approximation of the Shortest Vector in a Lattice − This problem deals
with finding the shortest non-zero vector in a lattice.
 Minimum Circuit Size Problem − This problem involves finding the
smallest circuit that computes a given function.
These problems are not known to be in P or NP-complete, making them
candidates for being NP-intermediate.
11

END

You might also like