Lecture on Mar 4, 2004 Undecidability of the Halting Problem Diagonalization - PowerPoint PPT Presentation

1 / 10
About This Presentation
Title:

Lecture on Mar 4, 2004 Undecidability of the Halting Problem Diagonalization

Description:

Prove the Halting Problem is undecidable. Introduce reduction (informally) ... Cantor, 1873. Used to prove that real numbers are not countable. Proof of Theorem ... – PowerPoint PPT presentation

Number of Views:40
Avg rating:3.0/5.0
Slides: 11
Provided by: yanzon
Category:

less

Transcript and Presenter's Notes

Title: Lecture on Mar 4, 2004 Undecidability of the Halting Problem Diagonalization


1
Lecture on Mar 4, 2004Undecidability of the
Halting ProblemDiagonalization Reduction
  • Topics
  • Prove the Halting Problem is undecidable
  • Introduce reduction (informally)
  • Reading Sipser, pp. 165-167 in Section 4.2 ,
    pp. 171-173 Section 5.1.

2
Halting Problem
  • Consider programs M with 3 possible outcomes on
    an input w
  • M accepts w and halts
  • M rejects w and halts
  • M loops (i.e. does not halt)
  • Halting Problem Is there an algorithm that given
    any program M and any input w, decides whether M
    accepts w, i.e.
  • outputs 1 if M accepts w
  • outputs 0 if M does not accept w, i.e. M either
    rejects w, or loops.
  • ATM ? ?M, w? M is a program and M accepts w.

3
Halting Problem
  • Does the following algorithm N decide ATM?
  • On input ?M, w? , run program M on input w
  • Accept if and only if M accepts w
  • Answer No!
  • M may not halt on w, so N may not halt on ?M, w?.
  • By definition, a decider must halt.

4
Halting Problem is Undecidable
  • Theorem ATM is undecidable.
  • Proof by Diagonalization
  • Cantor, 1873
  • Used to prove that real numbers are not countable

5
Proof of Theorem
  • Sipser, pp. 165 167
  • By way of contradiction, assume that ? an
    algorithm H that decides ATM . That is, on every
    input ?M, w?
  • H(?M, w?) 1 if M accepts w
  • H(?M, w?) 0 if M does not accept w
  • Construct algorithm/program D that on every input
    ?M?
  • Run H on ?M, ?M? ?
  • D accepts ?M? if H(M, ?M?) 0, i.e. M does not
    accept ?M?
  • D rejects ?M? if H(M, ?M?) 1, i.e. M accepts
    ?M?

6
Proof of Theorem
  • But what happens when D takes ?D? as input?
  • D accepts ?D? if D does not accept ?D?
  • D rejects ?D? if D accepts ?D?
  • Contradiction!

7
Diagonalization
?M1? ?M2? ?M3? ?M4? ?D?
M1 M2 M3 M4
1 0 1 0
1 1 1 0
0 0 0 0
1 1 0 0
?
D
0 0 1 1 ?
?
8
Reduction (Informal)
  • Problem A reduces to Problem B if ? an algorithm
    that converts A to B s.t. a solution to B ? a
    solution to A.
  • If A reduces to B B is decidable, then A is
    decidable.
  • To decide A, convert A to B decide B.
  • If A reduces to B A is undecidable, then B is
    undecidable.
  • Contra-positive form of above
  • If B is decidable, then by above A is decidable,
    contradiction.

9
Halting Problem Another Variant
  • Is there an algorithm that given any program M
    and any input w, decides whether M halts on w,
  • outputs 1 if M halts on w (i.e. either accepts or
    rejects)
  • outputs 0 if M loops on w (i.e. does not halt)
  • HTM ? ?M, w? M is a program and M halts on w
  • HTM Is Undecidable
  • Can again prove this by diagonalization
  • But have a simpler proof Reduce ATM to HTM !

10
HTM Is Undecidable Reduction from ATM
  • Sipser, pp. 172 173
  • Assume ? algorithm R that decides HTM
  • Construct algorithm S that decides ATM ,running R
    as a subroutine On input ?M, w?
  • Run R on ?M, w?
  • If R rejects, reject
  • If R accepts, run M on w until M halts
  • If M accepts, accept if M rejects, reject
  • Algorithm S decides ATM. But ATM is undecidable!
    Contradiction!
Write a Comment
User Comments (0)
About PowerShow.com