Computable Functions

Similar documents
Part I: Definitions and Properties

TURING MAHINES

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

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

CSE 105 THEORY OF COMPUTATION

A Universal Turing Machine

Limits of Computability

Most General computer?

CSE 105 THEORY OF COMPUTATION

1 Showing Recognizability

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

CS20a: Turing Machines (Oct 29, 2002)

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

Computational Models Lecture 8 1

Introduction to Turing Machines

Computational Models Lecture 8 1

Turing Machines. Chapter 17

Decidability: Church-Turing Thesis

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

Large Numbers, Busy Beavers, Noncomputability and Incompleteness

Computational Models Lecture 8 1

Recap DFA,NFA, DTM. Slides by Prof. Debasis Mitra, FIT.

Computability and Complexity

CS 125 Section #10 (Un)decidability and Probability November 1, 2016

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

Theory of Computation

Introduction to Turing Machines. Reading: Chapters 8 & 9

CS20a: Turing Machines (Oct 29, 2002)

Computability Theory. CS215, Lecture 6,

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

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

Chomsky Normal Form and TURING MACHINES. TUESDAY Feb 4

Turing Machine Recap

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

Informal Statement Calculus

Notes for Lecture 3... x 4

16.1 Countability. CS125 Lecture 16 Fall 2014

Chapter 2 Algorithms and Computation

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

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

Turing Machines. Wolfgang Schreiner

} Some languages are Turing-decidable A Turing Machine will halt on all inputs (either accepting or rejecting). No infinite loops.

SD & Turing Enumerable. Lecture 33: Reductions and Undecidability. Lexicographically Enumerable. SD & Turing Enumerable

Decidability (What, stuff is unsolvable?)

CSCC63 Worksheet Turing Machines

Lecture Notes: The Halting Problem; Reductions

Lecture 13: Foundations of Math and Kolmogorov Complexity

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET

Computability and Complexity

ACS2: Decidability Decidability

Theory of Computation Turing Machine and Pushdown Automata

A non-turing-recognizable language

6.045J/18.400J: Automata, Computability and Complexity. Quiz 2. March 30, Please write your name in the upper corner of each page.

Notes for Lecture 3... x 4

Theory of Computer Science. Theory of Computer Science. D7.1 Introduction. D7.2 Turing Machines as Words. D7.3 Special Halting Problem

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

The Power of One-State Turing Machines

Theory of Computer Science

CHAPTER 5. Interactive Turing Machines

Turing Machines A Turing Machine is a 7-tuple, (Q, Σ, Γ, δ, q0, qaccept, qreject), where Q, Σ, Γ are all finite

CS21 Decidability and Tractability

Opleiding Informatica

Turing Machines. Lecture 8

V Honors Theory of Computation

4.2 The Halting Problem

DM17. Beregnelighed. Jacob Aae Mikkelsen

CSE 105 THEORY OF COMPUTATION

Theory of Computation p.1/?? Theory of Computation p.2/?? We develop examples of languages that are decidable

S 1 S 2 L S 1 L S 2 S 2 R

uring Reducibility Dept. of Computer Sc. & Engg., IIT Kharagpur 1 Turing Reducibility

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.

CS154, Lecture 12: Kolmogorov Complexity: A Universal Theory of Data Compression

Undecidability. We are not so much concerned if you are slow as when you come to a halt. (Chinese Proverb)

CSE 105 THEORY OF COMPUTATION. Spring 2018 review class

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

CSE 105 THEORY OF COMPUTATION

Turing Machines Part III

CPSC 421: Tutorial #1

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

Reducability. Sipser, pages

Midterm Exam 2 CS 341: Foundations of Computer Science II Fall 2016, face-to-face day section Prof. Marvin K. Nakayama

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

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

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

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

Computability Crib Sheet

Time Complexity (1) CSCI Spring Original Slides were written by Dr. Frederick W Maier. CSCI 2670 Time Complexity (1)

CSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY

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

Turing machine. Turing Machine Model. Turing Machines. 1. Turing Machines. Wolfgang Schreiner 2. Recognizing Languages

Theory of Computation - Module 4

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

CSCI3390-Lecture 6: An Undecidable Problem

1 Computational Problems

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

What languages are Turing-decidable? What languages are not Turing-decidable? Is there a language that isn t even Turingrecognizable?

CSCI 2200 Foundations of Computer Science Spring 2018 Quiz 3 (May 2, 2018) SOLUTIONS

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

Lecture 12: Mapping Reductions

Transcription:

Computable Functions

Part I: Non Computable Functions

Computable and Partially Computable Functions Computable Function Exists a Turing Machine M -- M Halts on All Input -- M(x) = f (x) Partially Computable Function Exists a Turing Machine M -- M Does Not Halt on All Input -- If M Halts on x, then M(x) = f (x)

Examples Computable f (n) = n +1 Simple Turing Machine in Unary Partially Computable steps(< M,w >) = # operations performed by M on w before M Halts Simple Turing Machine -- Run M on w -- Count Operations Not Computable -- Otherwise Could Solve Halting Problem

Non Partially Computable Functions # Turing Machines is Countable # Turing Machines with N States = # Transition Functions Transition Functions = 5-tuples (State, Symbol, State, Symbol, L/R) # Turing Machines with N States = 2 Q 2 Σ 2 States Countable Union of Countable Sets is Countable Symbols # Functions N [0,1] is Uncountable # Functions N [0,1] = # Subsets of N # Subset of N = P(N) -- Uncountable Most Functions are Not Partially Computable

Busy Beaver Problems Problems S(n) = Maximum number of operations a Turing Machine with n states can perform on a Blank tape and then Halt Σ(n) = Maximum number of 1 s that a Turing Machine with n states can write on a Blank tape and then Halt.

Theorem 1: There is no Turing Machine B that computes S(n). Proof: Suppose such a Turing Machine B did exist. Let M be a Turing Machine with n States. To Determine if M Halts on ε, Build the following Turing Machine: Using B, Compute S(n) Run M on ε If M Halts before S(n)+1 Steps, Accept Otherwise Reject This Turing Machine Decides H ε = {< M > M Halts on ε} But H ε is Undecidable. Hence B Cannot Exist.

Theorem 2: There is no Turing Machine B that computes Σ(n) (in binary). Proof: Suppose such a machine B did exist. Let B n be the Turing Machine with n states that starts with a blank tape, writes Σ(n) 1 s, and Halts. Now define two new machines: A -- writes n in binary on a blank tape C -- converts binary to unary Then A log(n) (print 1, move to right, go to next state) C = constant (there is an algorithm for converting binary to unary) B = constant So the machine ABC takes a blank tape and writes n 1 s on the tape. But for large n, we have A BC < B n = n Contradiction. Hence B cannot exist.

Busy Beaver Values B(1) = 1 B(2) = 4 B(3) = 6 B(4) = 13 B(5) 4098 Observation B(n) O( f ) for any computable function f f ( B(n) ) < B(n +1) for all computable f for arbitrary many values of n

Busy Beaver and the Halting Problem Algorithm for Busy Beaver 1. Build all Turing machines with n states -- finite number of lists of 5-tuples 2. Run each machine on a blank tape -- universal Turing machine 3. Take the maximum value of 1 s Observation Algorithm Fails because some Turing machines do not Halt Algorithm would work only if we could solve the Halting Problem

Part II: Self Description and Recursion

Theorem: Min is Not Semi-Decidable. Proof: Min is Semi-Decidable Can Enumerate Min To show Min is not Semi-Decidable: First build M # To Run M # on any String w 1. Construct a Description < M # > of M # (Chapter 25) 2. Find a Turing Machine M in the List for Min with < M > > < M # >. 3. Compute M (w). Then 4. M in the List for Min M is a Minimal Machine 5. M # (w) = M (w) M # is equivalent to M 6. < M # > < < M > M NOT a Minimal Machine CONTRADICTION

Self Description and Recursion Problem Construct a Turing Machine M that: 1. Writes a Description of M 2. Performs some Operations W Observations 1.. We need to know M to write a Description of M 2. But the Definition of M, Depends on M!

Attempts at Self Description Construction of M -- First Try 1. Write <W> 2. Perform W No! This Machine Describes W, not M Construction of M -- Second Try 1. Write <W >,W 2. Perform W No! This Machine Describes the Machine that Writes a Description of the Machine that Writes a Description of W and Performs W. Does NOT Describe M

Solution: Part I The Turing Machine B On Tape #2, Write a Description of the Turing Machine A that Writes the Symbols Already on Tape #1. -- Tape #1: s 1s 2 s n -- Tape #2: s 1Rs 2 R s n R Copy the Contents of Tape #2 in Front of the Contents of Tape #1. -- Tape #1: s 1 Rs 2 R s n Rs 1 s n Observations -- The Output of B Depends on the Content of Tape #1 -- The Program for B is Independent of the Contents of Tape #1 -- The Description of B is Independent of the Contents of Tape #1.

Solution: Part II The Turing Machine A Write < B,W > on Tape #1 Observations -- The Program for A Depends Only on W; B is Fixed -- The Description of A Depends Only on W. The Solution Write <A>, <B>, <W> Perform W

Analysis of Solution Analysis of A, B, W A: Writes <B>, <W> B: Writes <A> in front of <B>, <W> Writes <A>, <B>, <W> W: Perform W. Conclusion A, B, W Writes a Description of A, B, W Performs W

Virus Virus Program Write a Description of the Virus Program For Each Address in the Address Book -- Mail a Description of the Virus Program to the Address -- Perform Some Malicious Operations

The Recursion Theorem Let T be a Turing Machine that Computes a Partially Computable Function t(a,b) = T (a,b). Then there is a Turing Machine R that Computes a Partially Computable Function r(x) = T (< R >, x). Proof: Description of R(x): Write a Description < R > of R Perform r(x) = T (< R >, x)

The Fixed Point Theorem Let S = {< M > M is a Turing Machine} f :S S be a Computable Function Then there exists a Turing Machine F such that f (< F >) = < G > F G (F and G Behave the Same on All Inputs) Proof: Description of F( x): Write < F > = a Description of F Compute < G > = M f (< F >) = f (< F >) -- M f = Turing Machine that Computes f Run G on x

Symbols for Encoding Turing Machines Eleven Symbols q y Meaning Non-Halting State Accepting Stare n a L R Rejecting State String Move Left Move Right ( Grouping for Transition Functions ) Grouping for Transition Functions, Separator for Transition Functions 0 Symbol for Encoding States and String 1 Symbol for Encoding States and Strings

Godel Numbering for Special Symbols Symbol Godel Number q 0000 y 0001 n 0010 a 0011 L 0100 R 0101 ( 0110 ) 0111, 1000

Godel Numbering for Turing Machines Godel Function Godel :Turing Machine N -- < M > = Encoding of M = Encoding of Transition Functions -- < M > = Long Binary String (Use Godel Numbering for Special Symbols) Godel(M ) = Number Represented by Long Binary String Encoding < M > < M > < N > Godel(M ) Godel(N)

Godel Numbering for Partially Computable Functions Godel Function Godel : Partially Computable Functions N -- F = Partially Computable Function -- M F = Turing Machine with Lowest Godel Number that Computes F Godel(F) = Godel(M F ) ϕ k = Partially Computable Function with Godel Number k

The s m n Theorem Let k = Godel Number of a Partially Computable Function with m + n arguments. Then there Exists a Computable Function s m, n such that 1. j = s m,n (k,u 1,,u n ) is the Godel Number of a Partially Computable Function 2. ϕ j (y 1,, y n ) = ϕ k (u 1,,u n, y 1, y n ) Proof: Define Turing Machine M m,n to Compute s m, n : M m,n (k,u 1,,u m ): Construct M j (w): -- Write u 1,,u m to the Left of w -- Move Head to Left of u 1 -- Apply ϕ k Return j