Turing Machines Sections 17.6 – 17.7. The Universal Turing Machine Problem: All our machines so far are hardwired. ENIAC - 1945.

Slides:



Advertisements
Similar presentations
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen Department of Computer Science University of Texas-Pan American.
Advertisements

The Big Picture Chapter 3. We want to examine a given computational problem and see how difficult it is. Then we need to compare problems Problems appear.
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.
More Turing Machines Sipser 3.2 (pages ). CS 311 Fall Multitape Turing Machines Formally, we need only change the transition function to.
More Turing Machines Sipser 3.2 (pages ).
Prof. Busch - LSU1 Decidable Languages. Prof. Busch - LSU2 Recall that: A language is Turing-Acceptable if there is a Turing machine that accepts Also.
Courtesy Costas Busch - RPI1 A Universal Turing Machine.
1 Linear Bounded Automata LBAs. 2 Linear Bounded Automata are like Turing Machines with a restriction: The working space of the tape is the space of the.
Fall 2004COMP 3351 Recursively Enumerable and Recursive Languages.
1 Uncountable Sets continued Theorem: Let be an infinite countable set. The powerset of is uncountable.
Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem.
1 Decidability continued. 2 Undecidable Problems Halting Problem: Does machine halt on input ? State-entry Problem: Does machine enter state halt on input.
Fall 2005Costas Busch - RPI1 Recursively Enumerable and Recursive Languages.
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.
Prof. Busch - LSU1 Undecidable Problems (unsolvable problems)
1 Reducibility. 2 Problem is reduced to problem If we can solve problem then we can solve problem.
Universal Turing Machine
MA/CSSE 474 Theory of Computation The Halting Problem.
MA/CSSE 474 Theory of Computation More Reduction Examples Non-SD Reductions.
The Halting Problem – Undecidable Languages Lecture 31 Section 4.2 Wed, Oct 31, 2007.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 15-1 Mälardalen University 2012.
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.
MA/CSSE 474 Theory of Computation Enumerability Reduction.
Computability Construct TMs. Decidability. Preview: next class: diagonalization and Halting theorem.
A Universal Turing Machine
1 Linear Bounded Automata LBAs. 2 Linear Bounded Automata (LBAs) are the same as Turing Machines with one difference: The input string tape space is the.
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
 2005 SDU Lecture13 Reducibility — A methodology for proving un- decidability.
Computability Universal Turing Machine. Countability. Halting Problem. Homework: Show that the integers have the same cardinality (size) as the natural.
TM Design Macro Language D and SD MA/CSSE 474 Theory of Computation.
Turing -Recognizable vs. -Decidable
Lecture 17 Undecidability Topics:  TM variations  Undecidability June 25, 2015 CSCE 355 Foundations of Computation.
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.
CS 461 – Oct. 28 TM applications –Recognize a language √ –Arithmetic √ –Enumerate a set –Encode a data structure or problem to solve Two kinds of TMs –Decider:
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.
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
Recursively Enumerable and Recursive Languages. Definition: A language is recursively enumerable if some Turing machine accepts it.
MA/CSSE 474 Theory of Computation Universal Turing Machine Church-Turing Thesis Delayed due dates for HWs See updated schedule page. No class meeting.
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.
Fall 2006Costas Busch - RPI1 RE languages and Enumerators.
A Universal Turing Machine
(Universal Turing Machine)
Computing with Turing Machines
Turing Machines 2nd 2017 Lecture 9.
Turing Machines Acceptors; Enumerators
COSC 3340: Introduction to Theory of Computation
Decidability and Enumerability
Busch Complexity Lectures: Undecidable Problems (unsolvable problems)
Undecidable Problems (unsolvable problems)
Turing acceptable languages and Enumerators
Turing Machines Chapter 17.
Decidable Languages Costas Busch - LSU.
Decidability and Undecidability
Turing acceptable languages and Enumerators
MA/CSSE 474 Theory of Computation
Recall last lecture and Nondeterministic TMs
Subject Name: FORMAL LANGUAGES AND AUTOMATA THEORY
Theory of Computability
Variations: Multiple tracks Multiple tapes Non-deterministic
MA/CSSE 474 Theory of Computation
Presentation transcript:

Turing Machines Sections 17.6 – 17.7

The Universal Turing Machine Problem: All our machines so far are hardwired. ENIAC

The Universal Turing Machine Problem: All our machines so far are hardwired. Question: Can we build a programmable TM that accepts as input: program input string executes the program, and outputs: output string

The Universal Turing Machine Yes, it’s called the Universal Turing Machine. To define the Universal Turing Machine U we need to: 1. Define an encoding operation for TMs. 2. Describe the operation of U given input, the encoding of: ● a TM M, and ● an input string w.

Encoding a Turing Machine M We need to describe M = (K, , , , s, H) as a string: The states The tape alphabet The transitions

Encoding the States Let i be  log 2 (|K|) . Number the states from 0 to |K|-1 in binary:  Number s, the start state, 0.  Number the others in any order. If t is the binary number assigned to state t, then:  If t is the halting state y, assign it the string y t.  If t is the halting state n, assign it the string n t.  If t is any other state, assign it the string q t.

Example of Encoding the States Suppose M has 9 states. i = 4 s = q0000, Remaining states (where y is 3 and n is 4): q0001, q0010, y0011, n0100, q0101, q0110, q0111, q1000

Encoding a Turing Machine M, Continued The tape alphabet: a y : y  { 0, 1 } +, |y| = j, and j is the smallest integer such that 2 j  |  |. Example:  = { , a, b, c }. j = 2.  = a00 a = a01 b = a10 c = a11

The transitions: (state, input, state, output, move) Example: ( q000, a000, q110, a000,  ) Specify s as q000. Specify H. Encoding a Turing Machine M, Continued

We will treat this as a special case: A Special Case

An Encoding Example Consider M = ({s, q, h}, { a, b, c }, { , a, b, c }, , s, {h}): = ( q00,a00,q01,a00,  ), ( q00,a01,q00,a10,  ), ( q00,a10,q01,a01,  ), ( q00,a11,q01,a10,  ), ( q01,a00,q00,a01,  ), ( q01,a01,q01,a10,  ), ( q01,a10,q01,a11,  ), ( q01,a11,q11,a01,  ) statesymbol  s  (q, ,   ) s a (s,b,)(s,b,) s b (q, a,  ) s c (q, b,  ) q  (s, a,   ) q a (q,b,)(q,b,) q b (q, b,  ) q c (h, a,  ) state/symbolrepresentation s q00 q q01 h q10  a00 aa01 ba10 ca11

Enumerating Turing Machines Theorem: There exists an infinite lexicographic enumeration of: (a) All syntactically valid TMs. (b) All syntactically valid TMs with specific input alphabet . (c) All syntactically valid TMs with specific input alphabet  and specific tape alphabet .

Enumerating Turing Machines Proof: Fix  = { (, ), a, q, y, n, 0, 1, comma, ,  }, ordered as listed. Then: 1. Lexicographically enumerate the strings in  *. 2. As each string s is generated, check to see whether it is a syntactically valid Turing machine description. If it is, output it. To restrict the enumeration to symbols in sets  and , check, in step 2, that only alphabets of the appropriate sizes are allowed. We can now talk about the i th Turing machine.

Another Win of Encoding One big win of defining a way to encode any Turing machine M: ● We can talk about operations on programs (TMs).

Example of a Transforming TM T: Input: a TM M 1 that reads its input tape and performs some operation P on it. Output: a TMM 2 that performs P on an empty input tape.

Encoding Multiple Inputs Let: mean a single string that encodes the sequence of individual values: x 1, x 2, …x n.

On input, U must: ● Halt iff M halts on w. ● If M is a deciding or semideciding machine, then: ● If M accepts, accept. ● If M rejects, reject. ● If M computes a function, then U( ) must equal M(w). The Specification of the Universal TM

U will use 3 tapes: ● Tape 1: M’s tape. ● Tape 2:, the “program” that U is running. ● Tape 3: M’s state. How U Works

The Universal TM Initialization of U: 1. Copy onto tape Look at, figure out what i is, and write the encoding of state s on tape 3. After initialization:

The Operation of U Simulate the steps of M : 1. Until M would halt do: 1.1 Scan tape 2 for a quintuple that matches the current state, input pair. 1.2 Perform the associated action, by changing tapes 1 and 3. If necessary, extend the tape. 1.3 If no matching quintuple found, halt. Else loop. 2. Report the same result M would report. How long does U take?

If A Universal Machine is Such a Good Idea … Could we define a Universal Finite State Machine? Such a FSM would accept the language: L = { : F is a FSM, and w  L(F) }