Turing machine recap. Universal Turing Machines and Undecidability. Alphabet size doesn t matter. Robustness of TM

Similar documents
1 Showing Recognizability

Turing Machines. Lecture 8

TURING MAHINES

Turing s thesis: (1930) Any computation carried out by mechanical means can be performed by a Turing Machine

Lecture Notes: The Halting Problem; Reductions

Most General computer?

Decidability. Linz 6 th, Chapter 12: Limits of Algorithmic Computation, page 309ff

Part I: Definitions and Properties

Variations of the Turing Machine

CSCI3390-Lecture 6: An Undecidable Problem

A Universal Turing Machine

Busch Complexity Lectures: Turing s Thesis. Costas Busch - LSU 1

Introduction to Turing Machines. Reading: Chapters 8 & 9

IV. Turing Machine. Yuxi Fu. BASICS, Shanghai Jiao Tong University

Decidability: Church-Turing Thesis

Decision Problems with TM s. Lecture 31: Halting Problem. Universe of discourse. Semi-decidable. Look at following sets: CSCI 81 Spring, 2012

Chapter 3: The Church-Turing Thesis

Computable Functions

A non-turing-recognizable language

6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, Class 8 Nancy Lynch

Turing Machines (TM) Deterministic Turing Machine (DTM) Nondeterministic Turing Machine (NDTM)

Computability Theory. CS215, Lecture 6,

Chapter 7 Turing Machines

CSCC63 Worksheet Turing Machines

15-251: Great Theoretical Ideas in Computer Science Fall 2016 Lecture 6 September 15, Turing & the Uncomputable

Finish K-Complexity, Start Time Complexity

CMPT 710/407 - Complexity Theory Lecture 4: Complexity Classes, Completeness, Linear Speedup, and Hierarchy Theorems

The Power of One-State Turing Machines

1 Definition of a Turing machine

Undecidability. Andreas Klappenecker. [based on slides by Prof. Welch]

CpSc 421 Homework 9 Solution

Turing Machine Recap

ECS 120 Lesson 20 The Post Correspondence Problem

1 Acceptance, Rejection, and I/O for Turing Machines

Turing Machine properties. Turing Machines. Alternate TM definitions. Alternate TM definitions. Alternate TM definitions. Alternate TM definitions

Turing Machines Part III

Turing Machines, diagonalization, the halting problem, reducibility

More Turing Machines. CS154 Chris Pollett Mar 15, 2006.

Turing s Thesis. Fall Costas Busch - RPI!1

Theory of Computation

CS 301. Lecture 18 Decidable languages. Stephen Checkoway. April 2, 2018

CSCI3390-Assignment 2 Solutions

Equivalence of TMs and Multitape TMs. Theorem 3.13 and Corollary 3.15 By: Joseph Lauman

Automata Theory CS S-12 Turing Machine Modifications

Turing Machines Part II

Computability and Complexity

CS 21 Decidability and Tractability Winter Solution Set 3

Non-emptiness Testing for TMs

Final Exam Comments. UVa - cs302: Theory of Computation Spring < Total

CS5371 Theory of Computation. Lecture 12: Computability III (Decidable Languages relating to DFA, NFA, and CFG)

More About Turing Machines. Programming Tricks Restrictions Extensions Closure Properties

CS20a: Turing Machines (Oct 29, 2002)

Decidable Languages - relationship with other classes.

CS20a: Turing Machines (Oct 29, 2002)

CSE 105 THEORY OF COMPUTATION

Opleiding Informatica

Theory of Computation

1 Reals are Uncountable

There are two main techniques for showing that problems are undecidable: diagonalization and reduction

SE 3310b Theoretical Foundations of Software Engineering. Turing Machines. Aleksander Essex

Complexity Theory Part I

16.1 Countability. CS125 Lecture 16 Fall 2014

CS151 Complexity Theory. Lecture 1 April 3, 2017

Universal Turing Machine. Lecture 20

Week 2: Defining Computation

Homework. Turing Machines. Announcements. Plan for today. Now our picture looks like. Languages

Q = Set of states, IE661: Scheduling Theory (Fall 2003) Primer to Complexity Theory Satyaki Ghosh Dastidar

Friday Four Square! Today at 4:15PM, Outside Gates

CS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine)

Chapter 1 Welcome Aboard

Lecture 25: Cook s Theorem (1997) Steven Skiena. skiena

Turing Machines. The Language Hierarchy. Context-Free Languages. Regular Languages. Courtesy Costas Busch - RPI 1

The Turing Machine. Computability. The Church-Turing Thesis (1936) Theory Hall of Fame. Theory Hall of Fame. Undecidability

Theory of Computation - Module 4

Boolean circuits. Lecture Definitions

MTAT Introduction to Theoretical Computer Science

Turing Machine Variants

15-251: Great Theoretical Ideas in Computer Science Lecture 7. Turing s Legacy Continues

CS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine)

Decidability (What, stuff is unsolvable?)

A Note on Turing Machine Design

Griffith University 3130CIT Theory of Computation (Based on slides by Harald Søndergaard of The University of Melbourne) Turing Machines 9-0

Computation Histories

Reducability. Sipser, pages

From Fundamentele Informatica 1: inleverdatum 1 april 2014, 13:45 uur. A Set A of the Same Size as B or Larger Than B. A itself is not.

CSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY

Decidability (intro.)

Homework Assignment 6 Answers

CSCE 551: Chin-Tser Huang. University of South Carolina

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

Lecture 12: Mapping Reductions

Turing machines. Chapter Definition

Time-bounded computations

Lecture 1: Introduction

CSE 311: Foundations of Computing. Lecture 26: More on Limits of FSMs, Cardinality

4.2 The Halting Problem

CS4026 Formal Models of Computation

MTAT Complexity Theory October 13th-14th, Lecture 6

highlights proof by contradiction what about the real numbers?

ASSIGNMENT THREE SOLUTIONS MATH 4805 / COMP 4805 / MATH (1) (a) A transition diagram appears below for the TM specified by the 7-tuple M =

Transcription:

Turing machine recap A Turing machine TM is a tuple M = (Γ, Q, δ) where Γ: set of symbols that TM s tapes can contain. Q: possible states TM can be in. qstart: the TM starts in this state qhalt: the TM halts when this state is reached Computability and Complexity Storage for TM : A special register stores the current state. 1 input tape, 1 output tape and 1 work tape obustness of TM Alphabet size doesn t matter Many details of our TM quite arbitrary Does restricting the alphabet Γ to {0, 1,, } matter? No! If function f is computable by a TM using alphabet Γ, then it is computable in time 4 log Γ T (n) by a TM using the alphabet {0, 1,, }. Does using more work tapes make everything much faster? No! If function f is computable by a TM using k tapes, then it is computable in time 5kT (n) 2 by a TM using a single work tape. Church-Turing Hypothesis Every physically realizable computation device can be simulated by a TM. Claim If function f is computable by a TM M using alphabet Γ, then it is computable in time 4 log Γ T (n) by a TM M using the alphabet {0, 1,, }. Have to decide: How to represent each symbol of Γ using {0, 1,, }. Use binary encoding. Each symbol encoded by log Γ bits. How to simulate each step of M. ead the encoded symbol via log Γ bits. Problem: remember the bits read. Modify the transition table appropriately Lookup the (remembered) read bits in the (modified) table

emembering bits read Problem: How to remember the bits read? q i q j q q 0 q 01 q 010 0 q 0 0 1 q 01 1 0 q 010 0 0 q 0100 0 q 1 q 0100 1 Total time required n x y i b j 3 y 0 1 0 0 1 b What is the number of states in M? Each line in the transition table of M creates 4 log Γ states. log Γ steps to read the symbol encoding. log Γ steps to go back to the start of the symbol encoding. log Γ steps to write the new symbol encoding. 2 log Γ in case the tape-head moves to the left. What is the size of the transition table? Q Γ Total number of states required: Q Γ 4 log Γ. Each step of M requires 5 log Γ steps of M. Total time taken: 5 log Γ T (n) steps. Lets say that i 01001 and j 01010. Then, Q Γ Q Γ {L, S, } q 0 q0 0 q0 1 q01 1 q01 0 q010 0 q010 0 q0100 0 q0100 1 qb1.01001 1 L qb1.01001 qb2.01001 L qb2.01001 qb3.01001 L qb3.01001 qb4.01001 L qb4.01001 qw1.01001 S qw1.01001 qw2.01001 0 qw2.01001 qw3.01001 1 qw3.01001 qw4.01001 0 qw4.01001 qw5.01001 1 qw5.01001 q 0 Note: need to move back 2 log Γ steps as well! More work tapes do not make much difference Claim If a function f is computable by a TM M using k tapes, then its computable in time 5kT (n) 2 by a TM using a single work tape. Proof Lets consider that a TM M computes the function f and has k tapes (plus additional input and output tapes) Next we consider a single work tape Turing machine ˆM ˆM encodes the k tapes of M on a single tape by using locations 1, k + 1, 2k + 1,... to encode the first tape, locations 2, k + 2, 2k + 2,... to encode the second tape etc. For every symbol a in M s alphabet, ˆM will contain both the symbol a and the symbol â. In the encoding of each tape, exactly one symbol will be of the ˆ type, indicating that the corresponding head of M is positioned in that location.

More work tapes do not make much difference Universal Turing Machines Proof Cont d To simulate one step of M, the machine makes two passes of its work tape: first it traverses the tape in the left-to-right direction and records (via additional states) the k symbols of the form â Then ˆM uses M s transition function to determine the new state, symbols, and head movements and sweeps the tape back in the right-to-left direction to update the encoding accordingly. ˆM will never reach more than location kt (n) of its work tape, meaning that for each of the at most T (n) steps of M, ˆM performs at most 5kT (n) work (sweeping back and forth requires about 2T (n) steps, and some additional steps needed for updating head movement and book keeping). So far, constructed Turing machines for a specific task. a primitive computer that only performs one task. Not very useful, since there are many things we want to do. Question: does there exist a TM that does many things? In other words, given a program P and an input x for P, run P on x. Note that a program is just an algorithm for doing something, i.e., its a Turing machine. So...given any TM M and x, does there exist a TM UTM that will run M on x How to give M to UTM? Since M is a machine. How does one give a machine to a machine? How can there be a fixed machine UTM that will run any other TM? What is a Turing machine really The Algorithm for TM How does one give a machine to a machine? Observe that the TM s are not all that different Can assume all have 1 input tape, 1 output tape, 1 work tape. Can assume Γ = {0, 1,, } The only thing different between different Turing machines is the transition table But the transition table can be written up as a string of bits! Mα: TM represented by string of bits α M {0, 1} : string of bits representing M So UTM takes α and x, and simulates Mα on x. How can there be a fixed machine UTM that will run any other TM? According to Church-Turing hypothesis, any algorithm can be turned into a TM. Clever idea: unning a TM is also just an algorithm! For example, we ran the TM for PAL(x) by hand. We just have to follow some rules, i.e., there is a simple algorithm for running a TM : ead a symbol of x. Scan the transition table to find a rule which applies. Apply this rule to write new symbol and move the tape head. So we just have to design a TM that can run the above algorithm.

Universal Turing Machine Simulating M α Storage: T1: input tape containing α, x. T2: output tape Three work tapes: T3 contains the current state of Mα T4 is used the same way as Mα s work-tape. T5 contains the transition function. Transition function of UTM: Scan T5 to find a match of the state with T3 Scan T5 to find a match of symbol with T1 and T4. Copy new state to T3 Copy new symbol to T4 and move heads of T1 and T3. Some Quotes Uncomputable functions If we were so clever that we could understand our brain, our brain would be so complex that we couldn t understand it. It seemed unworthy of a grown man to spend his time on such trivialities, but what was I to do? Bertrand ussell. f is computable by a TM M if M(x) = f (x) x It would seem that any function f : {0, 1} {0, 1} can be computed by a Turing machine. We don t care how much time is taken So just spend as much time till the computation of the function finishes. Uncomputable functions exist There exists UC : {0, 1} {0, 1} not computable by any TM. HALT(P, x): Given program P and x, does P halt on x? Halting function HALT is not computable by any TM.

Uncomputable functions exist HALT Uncomputable functions exist There exists UC : {0, 1} {0, 1} not computable by any TM. Proof. Define the function UC as follows: UC(α) = 0 if Mα(α) = 1 UC(α) = 1 if Mα(α) = 0 or Mα doesn t halt on input α. Claim: There is no TM that computes UC. For contradiction, assume M computes UC( ) M always halts at {0, 1}. What is M( M ) = UC( M )? M( M ) = 0 = UC( M ) = 0 if M M ( M ) = 1 M( M ) = 1 = UC( M ) = 1 if M M ( M ) = 0 Halting function HALT is not computable by any TM Proof. Again, assume a TM MH computes HALT We show how to use MH to compute UC a contradiction. On input α, run MH(α, α). If MH(α, α) says that Mα(α) doesn t halt Then know that UC(α) = 1. If MH(α, α) says that Mα(α) does halt Simply run Mα on α, since we know it ll halt! If Mα(α) = 1, know that UC(α) = 0 If Mα(α) = 0, know that UC(α) = 1 The Halting problem spawns more problems Uncountable Sets and Uncomputable functions Using reductions, can show many problems to be undecidable Goal: show that the problem A is undecidable Establish that, if there were an algorithm for problem A, then there would be an algorithm for HALT HALT doesn t have an algorithm, hence so doesn t A Claim: This is undecidable: {M: M halts on all inputs} educe HALT to this problem Given M; x construct the following machine M : M (y) = M(x) if y = x, M (y) = 0 otherwise M halts on all inputs if and only if M halts on x Correspondence between two problems Just like as they are some sets which are uncountable i.e there does not exist a one-to-one correspondence between them and the set of natural numbers, similarly there are some functions which are uncomputable. We will create a correspondence between the two problems To achieve this we make use of the following well known result of set theory.

Uncountable Sets and Uncomputable Functions Uncountable Sets and Uncomputable Functions Claim There does not exist any bijection between an infinite set and its power set Proof Consider an infinite set S and its corresponding power set P We show a contradiction if bijection f : S P Let i be any element of S and A be any element of P If bijection exists, every i S is mapped to unique A P and vice versa Consider the following set A P: A = {i S : i / f (i)} A : All i which are not present in the set f (i) Proof Cont d Now lets look at A more closely Since f is a bijection, j such that f (j) = A Here is the fatal question: Is j A? What if the answer is Yes : If j A, then by definition of A, j maps to a set which does not contain j Contradiction! What if the answer is No : If j / A, then j is mapping to a set (A ) which doesn t contain j. So by definition of A, j should be in A. Contradiction! Uncountable Sets and Uncomputable functions Claim: Uncomputable functions exist Consider each element of the infinite set to be a bit string. We know that a Turing Machine can be represented by a string. So each string represents a Turing Machine Then each element in the power set corresponds to a set of strings. We know that a language is just a set of strings, so we can represent each element of the power set by some language Since there are some subsets (elements of the power set) which map to no element in the set, there exist some languages for which there is no Turing Machine Which proves that there are certain functions which are uncomputable