Halting Problem - PowerPoint PPT Presentation

About This Presentation
Title:

Halting Problem

Description:

A state diagram that tells the head what to do, move left/right, print a symbol ... computers could pass this test with 30% of humans as the judge by the year 2000. ... – PowerPoint PPT presentation

Number of Views:73
Avg rating:3.0/5.0
Slides: 12
Provided by: chr15
Category:
Tags: halting | problem

less

Transcript and Presenter's Notes

Title: Halting Problem


1
Halting Problem
  • Introduction to Computing Science and Programming
    I

2
Alan Turing
  • Alan Turing 1912-1954
  • Father of modern computing science
  • 1936
  • Turing Machine
  • Church-Turing thesis
  • Halting Problem
  • 1950 Turing Test

3
Turing Machine
  • A Turing machine is a very simple theoretical
    computer with a couple basic elements.
  • An infinitely long tape broken up into cells that
    can each store a single symbol from a finite set
    of symbols
  • A head that can read or write one symbol at a
    time from the tape
  • A state diagram that tells the head what to do,
    move left/right, print a symbol

4
Church-Turing Thesis
  • This thesis proves has to do with comparing what
    problems can be solved by different types of
    computer.
  • It proves that a Turing Machine could
    theoretically be created that can do anything any
    digital computer can do.

5
Halting Problem
  • An important question of computing science is
    Are there problems that cannot be solved?
  • There are, and probably the most famous of these
    is the halting problem described by Turing.
  • He was thinking in terms of Turing machines
    (there were no computers), but it is easy to
    extend the idea.

6
Halting Problem
  • Halting problem
  • Can we write a program that will look at any
    computer program and its input and decide if the
    program will halt (not run infinitely)?
  • A practical solution might be to run the program
    and if it halts you have your answer. If after a
    given amount of time it doesnt halt, guess that
    it wont halt. However, you wouldnt know if the
    program would eventually halt.

7
Halting Problem
  • As it turns out the problem is undecidable.
  • For a problem to be undecidable you just have to
    prove that there is one case it cant produce an
    answer for.
  • The case that Turing came up with that can never
    be solved involves giving a program itself as
    input.

8
Halting Problem
  • Lets assume were given a function
    halts(prog,input) that is supposed to tell us if
    the program prog will halt if given the input.
    The function will return True if it halts, False
    otherwise.

9
Halting Problem
  • Using the halts function the following program
    can be written that reads in a program, given as
    a filename) from the user. It then calls the
    halts function to decide if the program will halt
    given itself as input.
  • prog raw_input("Program file name ")
  • if halts(prog, prog)
  • while True
  • print "looping
  • else
  • print "done"

10
Halting Problem
  • It may not make sense to give a program itself as
    input, but that isnt important here.
  • What could happen?
  • If halts(prog,prog) returns True, that means the
    program will halt when given itself as input.
    However, in this case the program would go into
    an infinite loop. Therefore the program doesnt
    halt.
  • If halts(prog,prog) returns False, that means
    that it wouldnt halt, but in that case the
    program does halt.
  • This contradiction is unavoidable thus proving
    that the halting problem is undecidable. No
    function can always correctly decide if a program
    will halt.

11
Turing Test
  • The Turing test was formulated as a way to answer
    the question, Can machines think?
  • The basic idea is that there is a sort of judge
    who converses with a computer and a person.
    However, this is indirect. The judge writes down
    questions and the computer and the person, who
    are hidden from the judge, return typewritten
    answers. If the judge couldnt consistently
    identify which set of answers were from the
    person, than the computer could think.
  • Turing predicted that computers could pass this
    test with 30 of humans as the judge by the year
    2000.
Write a Comment
User Comments (0)
About PowerShow.com