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

Halting Problem

This document discusses the halting problem in computability theory. It defines what makes a language and problem decidable versus undecidable. The halting problem asks, given an arbitrary Turing machine and input, can we determine if the machine will halt on that input in finite time. The document proves that the halting problem is unsolvable - there is no Turing machine that can correctly determine if an arbitrary Turing machine halts on any given input in all cases.

Uploaded by

Shaheer Shahbaz
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
165 views

Halting Problem

This document discusses the halting problem in computability theory. It defines what makes a language and problem decidable versus undecidable. The halting problem asks, given an arbitrary Turing machine and input, can we determine if the machine will halt on that input in finite time. The document proves that the halting problem is unsolvable - there is no Turing machine that can correctly determine if an arbitrary Turing machine halts on any given input in all cases.

Uploaded by

Shaheer Shahbaz
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 13

HALTING PROBLEM

By
Shaheer Shahbaz Hyder
Fa17-MSCS-0081
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.
Decidable Problem
• A Problem is said to be decidable if there exist an
algorithm which can solve the problem in finite
amount of time.

• There are some specific problems that are


algorithmically unsolvable.

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

• 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
Example 1:
• Find out whether the following problem is decidable or not
− Is a number ‘m’ prime?

Solution
• Prime numbers = {2, 3, 5, 7, 11, 13, …………..}
• Divide the number ‘m’ by all the numbers between ‘2’ and
‘√m’ starting from ‘2’.
• If any of these numbers produce a remainder zero, then it
goes to the “Rejected state”, otherwise it goes to the
“Accepted state”. So, here the answer could be made by
‘Yes’ or ‘No’.
• Hence, it is a decidable problem.
Example 2:
• 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
Undecidable Languages

• For an undecidable language, there is no Turing


Machine which accepts the language and makes a
decision for every input string w.

• A decision problem P is called “undecidable” if the


language L of all yes instances to P is not decidable.
Example

• The halting problem of Turing machine


• The mortality problem
• The Post correspondence problem, etc.
Halting Problem:
• 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.

• 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.
Halting Problem is unsolvable:
• 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
Thankyou

You might also like