0% found this document useful (0 votes)
80 views27 pages

Computability and Complexity Theory

Chapter Six discusses computability and complexity theory, focusing on what problems can be solved algorithmically and the distinction between decidable and undecidable problems. It explains that decidable problems have algorithms that can determine answers in finite time, while undecidable problems, like the Halting Problem, cannot be solved by any algorithm for all inputs. The chapter highlights the implications of these concepts in computer science, particularly regarding the limits of computation.

Uploaded by

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

Computability and Complexity Theory

Chapter Six discusses computability and complexity theory, focusing on what problems can be solved algorithmically and the distinction between decidable and undecidable problems. It explains that decidable problems have algorithms that can determine answers in finite time, while undecidable problems, like the Halting Problem, cannot be solved by any algorithm for all inputs. The chapter highlights the implications of these concepts in computer science, particularly regarding the limits of computation.

Uploaded by

ermagesgis
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

CHAPTER SIX

C O M P U TA B I L I T Y , D E C I D A B L E A N D U N D E C I D A B L E P R O B L E M S

1
C O M P U TA B I L I T Y A N D C O M P L E X I T Y

• A mathematical problem is computable if it can be solved in principle by a computing device.


• Some common synonyms for “computable” are “solvable”, “decidable”, and “recursive”.
Computability theory:
1. What problems can be solved on a computer ?
 Computability theory explores the question of which problems can be solved algorithmically,
meaning they can be solved by a computer program. It investigates the boundaries of
computation and identifies the types of problems that are solvable within the constraints of a
computing system.
2. What is a computable function ?
 In computability theory, a computable function refers to a function that can be effectively
computed by an algorithm or a Turing machine.
3. Decidable vs. undecidable problems
 decidable problems are those for which there exists an algorithm or a Turing machine that can determine the correct
answer in a finite amount of time.
 On the other hand, undecidable problems are those for which there is no algorithm or Turing machine that can
determine the correct answer for all possible inputs. These problems have inherent limitations that prevent them from
being solved algorithmically.
CONT’D

Complexity theory
• How much time and memory is needed to solve a problem ?
• Complexity theory, also known as computational complexity theory, is a field within computer science that
studies the resources (such as time and space) required to solve computational problems.
• Tractable vs. intractable problems
• 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.
Recall that:
A language is L Turing-Acceptable
if there is a Turing machine M
that accepts L

Also known as: Turing-Recognizable


or
Recursively-enumerable
languages

4
For any string : w
w L M halts in an accept state

w L M halts in a non-accept state


or loops forever

5
Definition:
A language is L decidable
if there is a Turing machine (decider) M
which accepts L
and halts on every input string

Also known as recursive languages

6
For any string : w
w L M halts in an accept state

w L M halts in a non-accept state

Every decidable language is Turing-Acceptable

7
For a decidable language : L

For each input string, the computation


halts in the accept or reject state
8
For a Turing-Acceptable language : L

It is possible that for some input string


the machine enters an infinite loop 9
Problem: Is number x prime?

Corresponding language:

PRIMES  {1,2, 3, 5, 7, }

We will show it is decidable

10
Decider for :
PRIMES
On input number : x
Divide x with all possible numbers
between 2 and x

If any of them divides x


Then reject
Else accept

11
The decider for the language
solves the corresponding problem

Decider for PRIMES


qaccept
YES
Input number x (Accept)
x is prime?
(Input string)
NO
qreject (Reject)

12
Decidable Languages
Recall that:
A language is decidable,
if there is a Turing machine (decider) M
that accepts the language A and
halts on every input string
Decision
Turing Machine M On Halt:
YES
Accept
Input
string Decider for A NO
Reject 13
A computational problem is decidable
if the corresponding language is decidable

We also say that the problem is solvable

14
UNDECIDABLE LANGUAGES

undecidable language = not decidable


language
There is no decider:
there is no Turing Machine
which accepts the language
and makes a decision (halts)
for every input string

(machine may make decision for some input strings)


15
UNDECIDABLE LANGUAGES

 One of the classic examples of an undecidable problem is


the "Halting Problem," which was first proven undecidable
by Alan Turing in 1936. The Halting Problem asks whether
a given program, when executed with a specific input, will
halt (terminate) or run indefinitely.

 It is worth noting that other undecidable problems exist


beyond the Halting Problem, such as the Post
Correspondence Problem, the Rice's Theorem... These
problems demonstrate the existence of computational
questions that cannot be decided by any algorithm in
general. 16
CONT….

Turing's proof showed that it is not possible to design


a single algorithm that can solve the Halting Problem
for all possible programs and inputs. The proof
involves constructing a "diagonalization argument"
that demonstrates a contradiction assuming the
existence of such an algorithm.

17
CONT….

In practical terms, the undecidability of the Halting


Problem means that there is no general algorithm
that can determine whether an arbitrary program will
halt or run indefinitely. This has significant
implications in computer science and theoretical
computer science, as it establishes fundamental
limits on what can be computed algorithmically.

18
19
H A LT I N G P R O B L E M :

 The output of TM can be:


 Halt: The machine will halt state (Accept/
Reject state) after a finite number of states.
 No Halt: The machine will never reach halt state (Accept/Reject state), no matter
how long it runs.

20
CONT…

Now the question arises based on these 2 observation:


• Given an arbitrary TM and arbitrary input for the
machine, then is it possible to determine whether the
machine will ever halt on given input? This is called
halting problem.
• That means we are asking for a procedure which enable
us to solve the halting problem for every pair(machine &
input). The answer is “no”. That is halting problem is
unsolvable.

21
H A LT I N G P R O B L E M I S U N S O LVA B L E :

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

22
T H E B LOC K D I AGRA M OF A H ALT I N G M AC H IN E

23
CONT…

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’

24
CONT…

25
SUMMARY

26
27

You might also like