Turing Machines and the Halting Problem This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. To.

Slides:



Advertisements
Similar presentations
Turing Machines Memory = an infinitely long tape Persistent storage A read/write tape head that can move around the tape Initially, the tape contains only.
Advertisements

CS 345: Chapter 9 Algorithmic Universality and Its Robustness
THE CHURCH-TURING T H E S I S “ TURING MACHINES” Pages COMPUTABILITY THEORY.
Foundations of (Theoretical) Computer Science Chapter 3 Lecture Notes (Section 3.2: Variants of Turing Machines) David Martin With.
Computability and Complexity 4-1 Existence of Undecidable Problems Computability and Complexity Andrei Bulatov.
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture15: Reductions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture12: Reductions Prof. Amos Israeli.
Courtesy Costas Busch - RPI1 A Universal Turing Machine.
Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem.
Foundations of (Theoretical) Computer Science
Homework #9 Solutions.
CS5371 Theory of Computation Lecture 10: Computability Theory I (Turing Machine)
1 Foundations of Software Design Fall 2002 Marti Hearst Lecture 29: Computability, Turing Machines, Can Computers Think?
Fall 2004COMP 3351 A Universal Turing Machine. Fall 2004COMP 3352 Turing Machines are “hardwired” they execute only one program A limitation of Turing.
Courtesy Costas Busch - RPI1 Reducibility. Courtesy Costas Busch - RPI2 Problem is reduced to problem If we can solve problem then we can solve problem.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 18 Instructor: Paul Beame.
1 Reducibility. 2 Problem is reduced to problem If we can solve problem then we can solve problem.
Theory of Computation. Computation Computation is a general term for any type of information processing that can be represented as an algorithm precisely.
1 Turing Machines. 2 A Turing Machine Tape Read-Write head Control Unit.
Grammars This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. To view a copy of this license, visit.
Algorithms: Selected Exercises Goals Introduce the concept & basic properties of an algorithm.
More Theory of Computing
Complexity and Computability Theory I Lecture #13 Instructor: Rina Zviel-Girshin Lea Epstein Yael Moses.
 Computability Theory Turing Machines Professor MSc. Ivan A. Escobar
1 CO Games Development 2 Week 21 Turing Machines & Computability Gareth Bellaby.
Introduction to CS Theory Lecture 15 –Turing Machines Piotr Faliszewski
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 The Halting Problem and Decidability How powerful is a TM? Any program in a high level language can be simulated by a TM. Any algorithmic procedure carried.
Halting Problem Introduction to Computing Science and Programming I.
Turing Machines. Intro to Turing Machines A Turing Machine (TM) has finite-state control (like PDA), and an infinite read-write tape. The tape serves.
THE CHURCH-TURING T H E S I S “ TURING MACHINES” Part 1 – Pages COMPUTABILITY THEORY.
Regular Expressions This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. To view a copy of this.
Finite State Machines This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. To view a copy of this.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
Computability Universal Turing Machine. Countability. Halting Problem. Homework: Show that the integers have the same cardinality (size) as the natural.
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.
1 Turing machines Chapter 4, Smith and Kimber. A Turing machine is an abstraction of a human “computer”. Consists of - control, in the form of states -
Lecture 17 Undecidability Topics:  TM variations  Undecidability June 25, 2015 CSCE 355 Foundations of Computation.
Fundamentals of Informatics Lecture 12 The Halting Problem Bas Luttik.
1 Section 13.1 Turing Machines A Turing machine (TM) is a simple computer that has an infinite amount of storage in the form of cells on an infinite tape.
1 Turing Machines and Equivalent Models Section 13.1 Turing Machines.
Overview of the theory of computation Episode 3 0 Turing machines The traditional concepts of computability, decidability and recursive enumerability.
Lecture 24UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 24.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 3 The Church-Turing Thesis Contents Turing Machines definitions, examples,
1 Introduction to Turing Machines
1 Chapter 9 Undecidability  Turing Machines Coded as Binary Strings  Universal Turing machine  Diagonalizing over Turing Machines  Problems as Languages.
Undecidability and The Halting Problem
CS 154 Formal Languages and Computability April 12 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
Turing Machines. The next level of Machine… PDAs improved on FSAs by adding memory. We make the memory more flexible to do more complicated tasks.
The Church-Turing Thesis Chapter Are We Done? FSM  PDA  Turing machine Is this the end of the line? There are still problems we cannot solve:
Recursively Enumerable and Recursive Languages. Definition: A language is recursively enumerable if some Turing machine accepts it.
1 A Universal Turing Machine. 2 Turing Machines are “hardwired” they execute only one program A limitation of Turing Machines: Real Computers are re-programmable.
CSE202: Introduction to Formal Languages and Automata Theory
Introduction to Computing Science and Programming I
CSE 105 theory of computation
LIMITS OF ALGORITHMIC COMPUTATION
CSE 105 theory of computation
Computable Problems.
COSC 3340: Introduction to Theory of Computation
Theory of Computation Turing Machines.
Recall last lecture and Nondeterministic TMs
P.V.G’s College of Engineering, Nashik
CSE 105 theory of computation
The Church-Turing Thesis and Turing-completeness
CO Games Development 2 Week 21 Turing Machines & Computability
CSE 105 theory of computation
Presentation transcript:

Turing Machines and the Halting Problem This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. To view a copy of this license, visit sa/3.0/ or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.

Outline and Objectives Outline Motivation Turing Machine – Definition – Examples Halting Problem Learning Objectives Discuss the concept of a Turing Machine and tie to stored program concept and FSM Explain the Halting problem and its result

???????? What are the limits of algorithm problem solving and solutions? Do you think there are formulated problems that cannot be solved algorithmically? What would a problem like this look like?

Turing Machine A Turing Machine is an abstract computational model that … -operates on an infinite, bi-directional tape -reads/writes a symbol to the tape -keeps track of a state and jumps from one finite state to another based on the current state and input

Turing Machine Mathematically, a Turing Machine can be defined as a function f f: Q x S -> S x {L,R} x Q where S = {0,1,…} // finite set of symbols Q = {A,B,C,…H,} // finite set of states L,R // direction to move tape (Sipser, 140)

Turing Machine Or… A TM reads a value from the tape… transitions to a new state based on the value read and current state… moves the position of the tape… and possibly writes to the tape.

Turing Machine Two of the states are of particular interest… Initial state (e.g., A) – where the machine starts Halt state (e.g., H) – upon entering this state the machine stops execution (i.e., halts) Initially, the position of the tape is located at the leftmost character and blanks are interpreted as ‘0’.

Turing Machine What differentiates one Turing Machine from another is primarily … … the function f (i.e., transition function) The symbols and states play a role as well.

TM Notation for Graphs state halt state read/write/head direction read/head direction

TRUE/FALSE Example Assume TRUE = “11” and FALSE = “1”. We want to create a TM W such if the tape contains true when started, the machine does not stop. If the tape contains FALSE, then W will halt. We need to specify S, Q, and f.

TRUE/FALSE Example

Specification for TM W S={A,B,C,H} Q={0,1} // A blank is interpreted as 0 f: f(Q,S)01 A (start)---1BR B0HR1CR C0CR1CR H (halt)---

COPY Example Activity: Create a TM to copy a string of 1’s on the Tape. Assume the input is a block of 1’s. The TM should make a copy of the 1’s separated by a 0 and then halt Mark current 1 with an X’s and copy across, replacing second 0 with 1.

Specification for TM C S={A,B,C,D,E,H} Q={0,1,x} f: f(Q,S)01X A (start)0HRXBR-- B0CR1BR-- C1DL1CR-- D0DL1DL1ER E0HRXBR-- H (halt)--

COPY Example

Turing Machine youtube.com/watch?v=cYw2ewoO6c4

Turing Machine How to relate a Turing Machine to modern computing? Tape -> Storage (RAM or Disk) Function -> Program Significant in that it was first described by Alan Turing in 1937…

Universal Turing Machine (UTM) The idea is to encode a Turing Machine (t) on the tape and follow it by the input (n) to the TM Then the UTM would read the TM and execute it. What key concept does this resemble? STORED PROGRAM CONCEPT (Sipser, 174)

Computability TMs are quite powerful… computable numbers – a number is TM computable if a TM can calculate a number to arbitrary precision starting from a black tape computable functions – a function that determines a TRUE/FALSE statement about computable arguments is a TM computable function.

Halting Problem It is of interest to know if a TM will halt for a particular input… We would like a TM which will compute a function h(t,n) that which returns - TRUE if TM t halts when started with n - FALSE otherwise

Halting Problem T HE HALTING PROBLEM IS NOT COMPUTABLE !!! Proof by Contraction: Assume that we have such a TM H. Join H and C* (the copy TM) such that the halt state of C is the start state of H. This TM will determine if a machine whose encoding is t, halts when given t as an input.

Halting Problem To the halt state of H, add the TM W which goes to into an infinite set of transitions if its input is TRUE and halts if its input is FALSE. Call the final TM M. M halts if the TM with encoding t does not halt on an tape which initially contains t. Otherwise it does not halt. Consider running M on itself. This is a contradiction! (Sipser, 174)

Halting Problem There are two possibilities… i.M halts on its encoding t (ie, H(t,t) is TRUE), but then M(t) should not halt by definition. ii.M does not halt on its encoding t (ie, H(t,t) is FALSE), but then M(t) should halt by definition. Either way there is a contradiction. Our initial assumption about the existence of H is false.

Consequences of the Halting Problem Not everything is computable… we can’t write a program which checks if it will stop software verification

References  Sipser M: Introduction to the theory of computation. 2nd ed. Boston: Thomson Course Technology; 2006.