Introduction to Computing Science and Programming I

Slides:



Advertisements
Similar presentations
Lecture Ref. handout page
Advertisements

Chapter 11: Models of Computation
Lecture 19. Reduction: More Undecidable problems
CS 461 – Nov. 9 Chomsky hierarchy of language classes –Review –Let’s find a language outside the TM world! –Hints: languages and TM are countable, but.
Programming Languages Wrap-up. Your Toolkit Object-oriented Imperative Functional Logic.
David Evans CS200: Computer Science University of Virginia Computer Science Class 27: Modeling Computation.
Computability & Complexity. Scenario I can’t write this program because I’m too dumb.
Nathan Brunelle Department of Computer Science University of Virginia Theory of Computation CS3102 – Spring 2014 A tale.
1 Section 14.1 Computability Some problems cannot be solved by any machine/algorithm. To prove such statements we need to effectively describe all possible.
Prof. Busch - LSU1 Decidable Languages. Prof. Busch - LSU2 Recall that: A language is Turing-Acceptable if there is a Turing machine that accepts Also.
Fall 2004COMP 3351 The Chomsky Hierarchy. Fall 2004COMP 3352 Non-recursively enumerable Recursively-enumerable Recursive Context-sensitive Context-free.
1 Foundations of Software Design Fall 2002 Marti Hearst Lecture 29: Computability, Turing Machines, Can Computers Think?
Turing Machines CS 105: Introduction to Computer Science.
1 Reducibility. 2 Problem is reduced to problem If we can solve problem then we can solve problem.
Halting Problem. Background - Halting Problem Common error: Program goes into an infinite loop. Wouldn’t it be nice to have a tool that would warn us.
Theory of Computation. Computation Computation is a general term for any type of information processing that can be represented as an algorithm precisely.
Turing Machines Chapter Plan Turing Machines(TMs) – Alan Turing Church-Turing Thesis – Definitions Computation Configuration Recognizable vs. Decidable.
Cs3102: Theory of Computation Class 18: Proving Undecidability Spring 2010 University of Virginia David Evans.
CSE 311 Foundations of Computing I Lecture 30 Computability: Other Undecidable Problems Autumn 2012 CSE 3111.
1 CO Games Development 2 Week 21 Turing Machines & Computability Gareth Bellaby.
Unsolvability and Infeasibility. Computability (Solvable) A problem is computable if it is possible to write a computer program to solve it. Can all problems.
1 Turing Machines There are languages that are not context-free. What can we say about the most powerful automata and the limits of computation?. Alan.
Great Theoretical Ideas in Computer Science about AWESOME Some Generating Functions Probability Infinity Computability With Alan! (not Turing) Mind-
Halting Problem Introduction to Computing Science and Programming I.
CSE 311 Foundations of Computing I Lecture 26 Computability: Turing machines, Undecidability of the Halting Problem Spring
CSE 311 Foundations of Computing I Lecture 29 Computability: Turing machines, Undecidability of the Halting Problem Autumn 2012 CSE 3111.
©Brooks/Cole, 2003 Chapter 17 Theory of Computation.
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
Complexity & Computability. Limitations of computer science  Major reasons useful calculations cannot be done:  execution time of program is too long.
Computation Motivating questions: What does “computation” mean? What are the similarities and differences between computation in computers and in natural.
Powerpoint Templates Page 1 Powerpoint Templates Impossible Math Problems (or should we say, undecidable) Math Club 4/16/2012.
CSE 311 Foundations of Computing I Lecture 28 Computability: Other Undecidable Problems Autumn 2011 CSE 3111.
Chapter 12 Theory of Computation Introduction to CS 1 st Semester, 2014 Sanghyun Park.
Computability. Turing Machines Read input letter & tape letter, write tape letter, move left or right.
Costas Busch - RPI1 Decidability. Costas Busch - RPI2 Another famous undecidable problem: The halting problem.
1 Recursively Enumerable and Recursive Languages.
Recursively Enumerable and Recursive Languages. Definition: A language is recursively enumerable if some Turing machine accepts it.
Decidability.
Fall 2013 Lecture 27: Turing machines and decidability CSE 311: Foundations of Computing.
Modeling Arithmetic, Computation, and Languages Mathematical Structures for Computer Science Chapter 8 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesTuring.
The Acceptance Problem for TMs
CS 461 – Nov. 2 Sets Prepare for ATM finite vs. infinite Infinite sets
The Halting Problem.
Linear Bounded Automata LBAs
CSE 311 Foundations of Computing I
Undecidable Problems Costas Busch - LSU.
Turing Machines Acceptors; Enumerators
Computable Problems.
Chapter 9 TURING MACHINES.
A Balanced Introduction to Computer Science David Reed, Creighton University ©2005 Pearson Prentice Hall ISBN X Chapter 13 (Reed) - Conditional.
Busch Complexity Lectures: Undecidable Problems (unsolvable problems)
Chapter 3: The CHURCH-Turing thesis
Jaya Krishna, M.Tech, Assistant Professor
CSE 105 theory of computation
CSE 311 Foundations of Computing I
Theory of Computation Turing Machines.
Decidable Languages Costas Busch - LSU.
Halting Problem.
Formal Languages, Automata and Models of Computation
Class 24: Computability Halting Problems Hockey Team Logo
Class 34: Models of Computation CS200: Computer Science
Impossible problems.
Instructor: Aaron Roth
Class 26: Modeling Computing CS150: Computer Science
CSE 311: Foundations of Computing
A Balanced Introduction to Computer Science David Reed, Creighton University ©2005 Pearson Prentice Hall ISBN X Chapter 13 (Reed) - Conditional.
CSE 105 theory of computation
Algorithms CSCI 235, Spring 2019 Lecture 37 The Halting Problem
CO Games Development 2 Week 21 Turing Machines & Computability
Lecture 23: Computability CS200: Computer Science
Presentation transcript:

Introduction to Computing Science and Programming I Halting Problem Introduction to Computing Science and Programming I

Alan Turing Alan Turing 1912-1954 “Father” of modern computing science 1936 Turing Machine Church-Turing thesis Halting Problem 1950: Turing Test

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

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.

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.

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 doesn’t halt, guess that it won’t halt. However, you wouldn’t know if the program would eventually halt.

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 can’t produce an answer for. The case that Turing came up with that can never be solved involves giving a program itself as input.

Halting Problem Let’s assume we’re 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.

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"

Halting Problem It may not make sense to give a program itself as input, but that isn’t 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 doesn’t halt. If halts(prog,prog) returns False, that means that it wouldn’t 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.

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 couldn’t 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.