1 Turing Machines and Equivalent Models Section 13.2 The Church-Turing Thesis.

Slides:



Advertisements
Similar presentations
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
Advertisements

CS 345: Chapter 9 Algorithmic Universality and Its Robustness
Primitive Recursive Functions (Chapter 3)
October 13, 2009Theory of Computation Lecture 11: A Universal Program III 1 Coding Programs by Numbers Gödel numbers are usually very large, even for small.
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.
Markov Algorithms An Alternative Model of Computation.
::ICS 804:: Theory of Computation - Ibrahim Otieno SCI/ICT Building Rm. G15.
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
Fall 2004COMP 3351 Recursively Enumerable and Recursive Languages.
CS5371 Theory of Computation Lecture 11: Computability Theory II (TM Variants, Church-Turing Thesis)
Dr. Muhammed Al-Mulhem 1ICS ICS 535 Design and Implementation of Programming Languages Part 1 Computability (Chapter 2) ICS 535 Design and Implementation.

December 8, 2009Theory of Computation Lecture 22: Turing Machines IV 1 Turing Machines Theorem 1.1: Any partial function that can be computed by a Post-
Chapter 9 Turing Machine (TMs).
Theory of Computation. Computation Computation is a general term for any type of information processing that can be represented as an algorithm precisely.
Chapter 4: A Universal Program 1. Coding programs Example : For our programs P we have variables that are arranged in a certain order: Y 1 X 1 Z 1 X 2.
Notions of Computability Many notions of computability have been proposed, e.g. – (Type 0 a.k.a. Unrestricted or context sensitive) Grammars – Partial.
1 Section 14.2 A Hierarchy of Languages Context-Sensitive Languages A context-sensitive grammar has productions of the form xAz  xyz, where A is a nonterminal.
1 CO Games Development 2 Week 21 Turing Machines & Computability Gareth Bellaby.
1 Chapter 1 Introduction to the Theory of Computation.
MA/CSSE 474 Theory of Computation Enumerability Reduction.
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.
1 Section 13.2 The Church-Turing Thesis The Church-Turing Thesis: Anything that is intuitively computable can be be computed by a Turing machine. It is.
Mathematical Preliminaries
CS 103 Discrete Structures Lecture 13 Induction and Recursion (1)
CS 203: Introduction to Formal Languages and Automata
TM Design Macro Language D and SD MA/CSSE 474 Theory of Computation.
Strings Basic data type in computational biology A string is an ordered succession of characters or symbols from a finite set called an alphabet Sequence.
CS 3813: Introduction to Formal Languages and Automata Chapter 13 Other Models of Computation These class notes are based on material from our textbook,
Lecture 3: Count Programs, While Programs and Recursively Defined Functions 虞台文 大同大學資工所 智慧型多媒體研究室.
MA/CSSE 474 Theory of Computation Minimizing DFSMs.
CompSci 102 Discrete Math for Computer Science March 13, 2012 Prof. Rodger Slides modified from Rosen.
Recursively Enumerable and Recursive Languages
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.
1 Turing Machines - Chap 8 Turing Machines Recursive and Recursively Enumerable Languages.
Lecture 16b Turing Machines Topics: Closure Properties of Context Free Languages Cocke-Younger-Kasimi Parsing Algorithm June 23, 2015 CSCE 355 Foundations.
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 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 12 Mälardalen University 2007.
Turing Machines Sections 17.6 – The Universal Turing Machine Problem: All our machines so far are hardwired. ENIAC
CS 154 Formal Languages and Computability May 5 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
Chapter 9 Turing Machines What would happen if we change the stack in Pushdown Automata into some other storage device? Truing Machines, which maintains.
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:
FORMAL LANGUAGES, AUTOMATA, AND COMPUTABILITY * Read chapter 4 of the book for next time * Lecture9x.ppt.
MA/CSSE 474 Theory of Computation Universal Turing Machine Church-Turing Thesis (Winter 2016, these slides were also used for Day 33)
Universal Turing Machine
MA/CSSE 474 Theory of Computation Universal Turing Machine Church-Turing Thesis Delayed due dates for HWs See updated schedule page. No class meeting.
Chapters 11 and 12 Decision Problems and Undecidability.
CSE202: Introduction to Formal Languages and Automata Theory
EQUATION IN TWO VARIABLES:
Context-Free Grammars: an overview
Numerical Representation of Strings
Turing Machines 2nd 2017 Lecture 9.
CSE 105 theory of computation
Turing Machines Acceptors; Enumerators
Chapter 9 TURING MACHINES.
COSC 3340: Introduction to Theory of Computation
Turing Machines (TM) Deterministic Turing Machine (DTM)
CHAPTER 2 Context-Free Languages
Theory Of Computer Science
MA/CSSE 474 Theory of Computation
Chapter 1 Introduction to the Theory of Computation
CSE 105 theory of computation
Decidability continued….
CO Games Development 2 Week 21 Turing Machines & Computability
Turing Machines Everything is an Integer
CSE 105 theory of computation
Presentation transcript:

1 Turing Machines and Equivalent Models Section 13.2 The Church-Turing Thesis

2 The Church-Turing Thesis: Anything that is intuitively computable can be computed by a Turing machine. It is a thesis rather than a theorem because it relates the informal notion of intuitively computable to the formal notion of a Turing machine.

3 Computational Models A computational model is a characterization of a computing process that describes the form a program and describes how the instructions are executed. Example. The Turing machine computational model describes the form of TM instructions and how to execute them. Example. If X is a programming language, the X computational model describes the form of a program and how each instruction is executed.

4 Equivalence of Computational Models Two computational models are equivalent in power if they solve the same class of problems. Any piece of data for a program can be represented by a string of symbols and any string of symbols can be represented by a natural number. So even though computational models may process different kinds of data, they can still be compared with respect to how they process natural numbers. We’ll make the assumption that there is an unlimited amount of memory available. So we can represent any natural number or any finite string. Each of the following models of computation is equal in power to the TM model.

5 The Simple Programming Language This imperative programming model processes natural numbers. The language is defined as follows: –Variables have type N. –Assignment statements: X := 0; X := succ(Y); X := pred(Y). (assume pred(0) = 0) –Composition of statements: S1; S2. –while X ≠ 0 do S od. This simple language model has the same power as the Turing machine model. For input and output use the values of the variables before and after execution.

6 Example/Quiz Some Macros X := Y X := 2 Z := Z + X Z := X + Y Z := X monus Y while X < Y do S od if X ≠ 0 then S1 else S2 fi Macro Expansion X := succ(Y); X := pred(X). X := 0; X := succ(X); X := succ(X). C := X; while C ≠ 0 do Z := succ(Z); C := pred(C) od. Z := X; C := Y; while C ≠ 0 do Z := succ(Z); C := pred(C) od. Z := X; C := Y; while C ≠ 0 do Z := pred(Z); C := pred(C) od. T := Y monus X; while T ≠ 0 do S; T := Y monus X od. U := X; V := 1; while U ≠ 0 do S1; V := 0; U := 0 od; while V ≠ 0 do S2; V := 0 od. To demonstrate the power of this language, define the following macros.

7 Partial Recursive Functions This model consists of a set of functions that take natural numbers as arguments and as values. The functions are defined as follows, where x can represent zero or more arguments. –Initial functions: zero(x) = 0, succ(n) = n + 1, and projections (e.g., p2(a, b, c) = b). –Composition: e.g., ƒ(x) = h(g1(x), …, gm(x)), where h, g1, …, gm are partial recursive. –Primitive recursion: ƒ(x, 0) = h(x) (h is partial recursive) ƒ(x, succ(y)) = g(x, y, ƒ(x, y)) (g is partial recursive). –Unbounded search (minimalization): ƒ(x) = min(y, g(x, y) = 0) (g is total partial recursive). This means that ƒ(x) = y is the minimum y such that g(x, y) = 0, if such a y exists. This model for constructing functions has the same power as the Turing machine model.

8 Example The predecessor and monus functions are partial recursive as follows: –pred(0) = 0 –pred(succ(y)) = y, which can be written in the form p1(y, pred(y)). –monus(x, 0) = x –monus(x, succ(y)) = pred(monus(x, y)), which can be written pred(p3(x, y, monus(x, y))).

9 Quiz Show that pred(monus(x, y)) = monus(pred(x), y)). Proof: The equation is true if x = 0 or y = 0. So assume x > 0 and y > 0. Then we have: –pred(monus(x, y)) = if x > y then x – y – 1 else 0 –monus(pred(x), y)) = if x – 1 > y then x – 1 – y else 0. Although x > y and x – 1 > y are different, the if- then-else values are equal. QED.

10 Quiz Let p and q be partial recursive with p(x), q(x) ∊ {0, 1}, for false and true. Show that the logical operations p(x) Λ q(x), ¬ p(x), and p(x) V q(x), are partial recursive functions. Solutions: p(x) Λ q(x) = p(x)q(x) ¬ p(x) = monus(1, p(x)) p(x) V q(x) = p(x) + monus(1, p(x))q(x).

11 Examples Unbounded Search, Minimalization ƒ(x) = min(y, xy = 0) defines ƒ(x) = 0. ƒ(x) = min(y, x + y = 0) defines ƒ(x) = if x = 0 then 0 else undefined. ƒ(x) = min(y, monus(x, y) = 0) defines ƒ(x) = x. ƒ(x) = min(y, monus(y, x) = 0) defines ƒ(x) = 0. ƒ(x, y) = min(z, monus(x + z, y) = 0) defines ƒ(x, y) = if x ≤ y then 0 else undefined

12 Example/Quiz For y ≠ 0, let ƒ(x, y) = min(z, monus(x, yz) = 0). What function does ƒ compute? Answer: ƒ(x, y) = ⌈ x / y ⌉. To see this, notice that the definition ƒ(x, y) = min(z, monus(x, yz) = 0) means that ƒ(x, y) = z is the smallest natural number such that monus(x, yz) = 0. The definition of monus tells us that monus(x, yz) = 0 means that x ≤ yz. So z is the smallest natural number such that x ≤ yz. In other words, we have y(z – 1) < x ≤ yz. Divide by y to obtain z – 1 < x/y ≤ z. Therefore z = ⌈ x / y ⌉.

13 Markov Algorithms This model processes strings. An algorithm consists of a finite, ordered, sequence of productions of the form x → y, where x, y ∊ A* for some alphabet A. Any production can be suffixed with (halt) although this is not required. Execution Given an input string w ∊ A*, perform the following execution step repeatedly. –Scan the productions x → y sequentially to see whether x occurs as a substring of w. If so, –replace the leftmost occurrence of x in w by y and reset w to this string. Otherwise halt. –If the x → y is labeled with (halt), then halt. Assumption: w = Λw. So a production of the form Λ → y would transform w to yw. The Markov algorithm model has the same power as the Turing machine model.

14 Examples Example. The Markov algorithm consisting of the single production a → Λ will delete all a’s from any string. Example. A more instructive Markov algorithm to delete all a’s from any string over {a, b} can be written as the following sequence of productions (# is an extra symbol). 1. #a → # 2. #b → b# 3. # → Λ (halt) 4. Λ → #. An example trace: abab (input) #abab (by 4) #bab (by 1) b#ab (by 2) b#b (by 1) bb# (by 2) bb (by 3, halt).

15 Quiz Find a Markov algorithm to replace each a with aa in strings over {a, b}. Answer. Modify the previous example: 1. #a → aa# 2. #b → b# 3. # → Λ (halt) 4. Λ → #.

16 Example/Quiz Find a Markov algorithm to delete the rightmost b from strings over {a, b}. Solution: 1. #a → a# 2. #b → b# 3. # → Λ (halt) → Λ (halt) 7. Λ → #.

17 Example/Quiz Find a Markov algorithm to implement succ(x), where x is a natural number represented in binary. Assume no leading zeros (except 0 itself). Solution: 1. #0 → 0# 2. #1 → 1# 3. 0# → 1 (halt) 4. 1# → 1 (halt) → 1 (halt) 8. Λ → #.

18 Post Algorithms This model processes strings. An algorithm consists of a finite set of productions of the form s → t where s and t are strings over the union of an input alphabet A with a set of variables and other symbols. Restriction: If a variable X occurs in t then X occurs in s. A production can be suffixed with (halt) although this is not required. Execution Given an input string w ∊ A*, perform the following execution step repeatedly. –Find a production x → y such that w matches x. –If so, use the match and y to construct a new string w. Otherwise halt. –If the x → y is labeled with (halt), then halt. Assumption: A variable may match Λ.

19 Examples Example. If the input string is 1, then 1 matches 1X. So a production like 1X → 1X0 would transform 1 into 10. The Post algorithm model has the same power as the Turing machine model. Example. A Post algorithm with the single production XaY → XY will delete all a’s from any string. Notice the nondeterminism.

20 Example A Post algorithm to replace each a with aa in strings over {a, b}. Solution: 1. aX 2. bX 3. X#aY → Xaa#Y 4. X#bY → Xb#Y → X (halt).

21 Example A Post algorithm to delete the rightmost b from any string over {a, b}. Solution: 1. Xb → X (halt) 2. Xa → 3. Xa#Y → X#aY 4. → XY (halt) 5. → X (halt).

22 Example/Quiz Find a Post algorithm to implement succ(x), where x is a natural number represented in binary. Assume no leading zeros (except 0 itself). Solution: 1. X0 → X1 (halt) 2. X1 → X#0# 3. X1#Y# → X#0Y# 4. X0#Y# → X1Y (halt) 5. #Y# → 1Y (halt).

23 Post Systems This model generates a set of strings from axioms (a given set of strings) and inference rules (a given set of productions that map strings to strings by matching). Execution: Match the left side of a production with an axiom string or a string that has already been constructed. Then use the match and the right side to construct a new string.

24 Example A Post system to generate the binary representations of natural numbers: –Axioms: 0, 1 –Inference Rules: 1X → 1X0 1X → 1X1. The system generates the set {0, 1, 10, 11, 100, 101, 110, 111, … }.

25 Quizzes Quiz. Find a Post system to generate {a}*. Solution: –Axiom: Λ –Inference rule: X → aX. Quiz. Find a Post system to generate the set {a n b n c n | n ∊ N}. One of Many Solutions: –Axioms: Λ, abc –Inference rule: aXbcY→ aaXbbccY.

26 Post system and Turing machine The Post system model has the same power as the Turing machine model in the following sense: A function ƒ : A* → A* is Post-computable if there is a Post system to compute the function as a set of ordered pairs in the form {x#ƒ(x) | x ∊ A*}. Post-computable functions coincide with Turing-computable functions.

27 Example/Quiz Generate the function ƒ : {a}* → {a}* where ƒ(a n ) = a 2n. Solution: –Axiom: Λ#Λ –Inference rule: X#Y → Xa#Yaa (or the simpler X → aXaa) This system generates the set {Λ#Λ, a#aa, aa#aaaa, …, a n #a 2n, … }.

28 Example/Quiz Generate the function ƒ : N → N defined by ƒ(n) = n 2, where n is represented as a string over {a} of length n. A Solution: –Axiom: Λ#Λ –Inference rule: X#Y → Xa#YXXa. Proof: –In terms of natural numbers, from the pair n#n 2 we must construct (n + 1)#(n + 1) 2. –We can write (n + 1) 2 = n 2 + 2n + 1 = n 2 + n + n + 1. –So from n#n 2 we must get (n + 1)#(n 2 + n + n + 1). –In terms of strings over {a}, we transform X#Y into Xa#YXXa. QED.

29 The End of Chapter 13 Section 2