0% found this document useful (0 votes)
2 views17 pages

Halting Problem

The document discusses the classification of decision problems and languages, defining decidable and acceptable languages. It explains the Halting Problem, demonstrating that it is undecidable, and outlines other undecidable problems such as the Acceptance problem and Diophantine equations. The document emphasizes the implications of Turing's Thesis regarding the limitations of algorithmic solutions for certain problems.

Uploaded by

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

Halting Problem

The document discusses the classification of decision problems and languages, defining decidable and acceptable languages. It explains the Halting Problem, demonstrating that it is undecidable, and outlines other undecidable problems such as the Acceptance problem and Diophantine equations. The document emphasizes the implications of Turing's Thesis regarding the limitations of algorithmic solutions for certain problems.

Uploaded by

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

Computability and Complexity 5-1

Classifying Problems
Computability and Complexity 5-2

Problems and Languages

We have seen that every decision problem  has an associated


language L(,e) (via a suitable encoding e)

Hence, to classify decision problems we will develop methods to


classify languages
Computability and Complexity 5-3

Decidable Languages

Definition A language L is decidableª if there exists a TM T, with


2 final states q A and qR , such that
• If x  L then T(x) halts in state q A
• If x  L then T(x) halts in state qR
ªalso known as recursive

T is said to decide the language L — it gives a yes or no answer


for each possible string from *
Computability and Complexity 5-4

Examples

The following languages are decidable:

• *
• 
• {x| |x| = 20}
• {x | x is prime}
• {x | x encodes a graph G, and a Hamilton circuit of G}
• {x | x is a valid encoding of a TM}
Computability and Complexity 5-5

Examples
All languages accepted by finite automata, or generated by
context-free grammars are decidable

All
Languages
Decidable
Languages
Regular Context-free
Languages Languages

(for finite automata see Discrete Mathematics course or Sipser)


(for context-free grammars see Compilers course or Sipser)
Computability and Complexity 5-6

Acceptable Languages

Definition A language L is acceptableª if there exists a TM T, with


2 final states q A and qR , such that
• If x  L then T(x) halts in state q A
• If x  L then T(x) halts in state qR or infinite
ªalso known as Turing-acceptable or Turing-recognizable

T is said to accept the language L — it gives a yes answer for each


string in L, in all other cases it gives a no answer or fails to halt
Computability and Complexity 5-7

Acceptable vs. Decidable


• If a language is decidable, then it is acceptable.
• If a language, L, is acceptable, and its complement L is also
acceptable, the it is decidable.
(Proof: run the two acceptor machines alternately until one halts)

So, to show that there are languages that are not decidable, we must
find a language that is not acceptable …
Computability and Complexity 5-8

The Halting Problem


Halting
Instance: A Turing Machine T and an input string x.
Question: Does T(x) halt?

Once we choose an encoding for Turing machines, the corresponding


language is:
LHalting {" T ; x" | T ( x ) terminates}

• LHalting is acceptable
- use a universal TM U to simulate T on x and modify it so that
that if it halts then it moves to “Accept” state
• LHalting is not decidable
- see next slide
Computability and Complexity 5-9

• Assume, for contradiction, that there is a TM TH that decides


LHalting

• Construct a new T from TH so that for input x, T simulates


TH ( x; x ) but

- if TH accepts “x;x” then T goes into an infinite loop,

- if TH rejects “x;x” then T accepts x.


Computability and Complexity 5-10

I N P U T

A? R?

T
Computability and Complexity 5-11

I N P U T

A? R?
I N P U T ; I N P U T

T
A? R?

TH
Computability and Complexity 5-12

• Consider the computation T(T)

- if T(T) halts this implies that TH rejects “T;T”,


implying that T(T) does not halt!

- if T(T) does not halt this implies that TH accepts “T;T”,


implying that T(T) halts!

• Hence TH cannot exist, so LHalting is undecidable.


Computability and Complexity 5-13

Consequences

• The language LHalting is not acceptable.

• There is no Turing machine that can give correct answers to the


Halting problem on all inputs.

• Hence, by Turing’s Thesis:

The Halting problem cannot be solved by any algorithm!

This result was first announced in Turing’s 1936 paper


Computability and Complexity 5-17

Other Undecidable Problems


ACCEPTANCE
Instance: A Turing Machine (acceptor) T and an input string x.
Question: Does T accept x?

The corresponding language is:


LAccept {" T ; x" | T accepts x}

Theorem LAccept
Theorem isisundecidable.
undecidable.

Proof
see next slide
Computability and Complexity 5-18

We show that LHalting m LAccept

For every input “T;x” of LHalting , we do:

• Add to T two new states q A and qR (to guarantee that they


are not in T already we may need to rename the states of T)
• Change the transition function by adding transition from every
final state to q A
• Denote the obtained machine T’

Note that T’ accepts x if and only if T halts on x

Therefore, the function f : *   * which maps “T;x” to “T’;x”


is computable and provides a mapping reduction from LHalting
to LAccept
Computability and Complexity 5-19

Regularity
Instance: A Turing Machine T.
Question: Can T be simulated by a finite automaton?

Ambiguous Grammars
Instance: A context-free grammar G.
Question: Is G ambiguous?
Computability and Complexity 5-20

Diophantine Equations
Instance: A multivariate polynomial equation such as
x 2 y  3xy  y 2  17 0

Question: Does this equation have an integer-valued solution?

See “Hilbert’s Tenth Problem is Unsolvable”


M.Davis, American Mathematical Monthly 80 (1973) pp.233-269

You might also like