Sample Project: Simulation of Turing Machines by Machines with only Two Tape Symbols

Size: px
Start display at page:

Download "Sample Project: Simulation of Turing Machines by Machines with only Two Tape Symbols"

Transcription

1 Sample Project: Simulation of Turing Machines by Machines with only Two Tape Symbols The purpose of this document is to illustrate what a completed project should look like. I have chosen a problem that is not among the posted topics, but is closely related. In fact, you could use the program attached to this project as part of solution to several of the other problems, such as construction of a universal Turing machine, or simulation of Turing machines by counter programs. There is a software component to this project: the simulation described in the written report is implemented by a program that takes a Turing machine specification and converts it to a specification of an equivalent machine that has only two tape symbols. Strictly speaking the project could be completed without this part, stopping at the by-hand example given below. However, the blow-up in the number of states makes this rather tedious to carry out on all but the smallest examples, so it is very useful to have the simulation computed automatically. 1 The problem We will show that for every TM M, there is a TM M with the following properties: The tape alphabet of M, is {0, 1}. There is encoding enc : Γ {0, 1}, where Γ is the tape alphabet of M, such that M accepts w if and only if M accepts enc(w), and M rejects w if and only if M rejects enc(w). There is a slight technical difficulty with this claim: It is easy enough to encode tape symbols of M by strings of bits, but the definition of Turing machine requires 1

2 that the blank symbol not be an element of the input alphabet. We will relax this requirement. In our simulation, we will treat 0 as the blank symbol, but also allow the input of M to contain 0 s. In our simulation, this will not create a problem: The encoding of w will be easy to compute, and the property stated above will still tell us whether M accepts w. 2 How the simulation works We encode each tape symbol of M with k bits. In order that each symbol have a unique encoding, we have to choose k large enough so that the number of tape symbols of M does not exceed 2 k. We will make the convention that the blank symbol of M is encoded by k zeros, but since we are using the machine M only for decision problems, this will not really matter. Apart from that, the encoding is arbitrary. For example, suppose that the tape alphabet of M is {a, b, X, Y, }. Then we need to choose k 3. We can then use the following encoding: a 001 b 010 X 011 Y We then need to convert transitions in the specification of M into transitions of M. We can illustrate the general procedure with two examples, one for a left transition, and the other for a right transition. Suppose M contains a transition δ(q, b) = (q, a, R). The machine M will be also be in a state called q when it has to execute this transition, but it will not know that its input is b until it has read additional symbols to the right. For this purpose, we will need to introduce new states and transitions that move the reading head of M three steps to the right: δ (q, 0) = ((q, 0), 0, R), δ ((q, 0), 1) = ((q, 01), 1, R), δ ((q, 01), 0) = ((q, 010), 0, R). 2

3 The result of this first phase of transitions is that the reading head of M is now positioned just to the right of the encoding of b. (We do not know what symbol it is presently scanning.) Its state now contains both the original state q of M, and the input symbol 010 = enc(b) it was scanning. It now must move to the left four spaces and write enc(a) = 001 on the tape. (This could have been carried out more economically by making the last transition above a left transition that writes 1 on the tape, but that makes the description of the algorithm more complicated.) We then have δ (q, 010), 0) = ((q, 010, 1), 0, L). δ ((q, 010), 1) = ((q, 010, 1), 1, L). δ ((q, 010, 1), 0) = ((q, 010, 2), 1, L). δ ((q, 010, 2), 1) = ((q, 010, 3), 0, L). δ ((q, 010, 3), 0) = ((q, 010, 4), 0, L). δ ((q, 010, 4), 0) = ((q, 010, 5), 0, R). δ ((q, 010, 4), 1) = ((q, 010, 5), 1, R). Observe that of the ten transitions we wrote above, the first five and the last two do not depend at all on the transition function of M. It is only the middle three, where we write the new tape symbol enc(a), that use the information about M. The machine is now in state (q, enc(b), 5) positioned exactly where it was when we started the transition, but with 001 on the tape where 010 was present before.. We now must simulate the move to the right. This of course is accomplished by moving the head of M three symbols to the right: δ ((q, 010, 5), 0) = ((q, 010, 6), 0, R). δ ((q, 010, 5), 1) = ((q, 010, 6), 1, R). δ ((q, 010, 6), 0) = ((q, 010, 7), 0, R). δ ((q, 010, 6), 1) = ((q, 010, 7), 1, R). δ ((q, 010, 7), 0) = (q, 0, R). δ ((q, 010, 7), 1) = (q, 1, R). 3

4 Figure 1: A single transition, in this case the rightward transition pictured at left, of the original machine, is simulated by a long sequence of transitions of the twotape-symbol machine. Intermediate states are introduced to keep track of where we are in the process. 4

5 These six transitions depend on the transition function of M, but only for the last little piece the rightward move of the head. If the original transition in M had been a leftward move, all of these transitions would also be moves to the left. The simulation is illustrated in the accompanying diagram. Here, in summary, is the algorithm for construction the transition table of the new machine: 1. For each state q of M other than the accept and reject states, and each bit string v with 0 v k, we introduce a new state (q, v), and if v < k, new transitions δ ((q, v), b) = ((q, vb), b, R). Observe that we are including the state (q, ɛ), which we identify with q. 2. For each state q of M and each tape symbol γ, we look to see if there is a transition of the form δ(q, γ) = (q, γ, D). If there is, we set w = enc(γ), w = enc(γ ), and introduce the following new states: (q, w, j), for 1 j 2k + 1, and the following new transitions: (a) δ ((q, w), b) = ((q, w, 1), b, L), for b {0, 1}. (b) If 1 i k, δ ((q, w, i), b) = ((q, w, i + 1), b, L), (c) where b is the (k i + 1) th bit of w, and b is the (k i + 1) th bit of w. δ ((q, w, k + 1), b) = ((q, w, k + 2), b, R), for b {0, 1}. (d) For k + 2 j 2k, δ ((q, w, j), b) = ((q, w, j), b, D), for b {0, 1}, D {L, R}. (e) δ ((q, w, 2k + 1), b) = ((q, ɛ), b, D), for b {0, 1}, D {L, R}. 5

6 3 Example Because of the large increase in the number of states, we need to use a very small machine to illustrate the algorithm by hand. Below is the specification of a Turing machine that reads a string of a s and b s, accepting if and only if the last letter is a. 0 a 0 a R 0 b 0 b R 0 B 1 B L 1 a -1 a R The tape alphabet is {, a, b}. We can thus choose k = 1, and encode these three symbols by 00, 01, 10, respectively. (These are the binary encodings of 0,1 and 2.) There are two states apart from the accepting state, and the algorithm requires that for each of these states, q, and for each w {ɛ, 0, 1, 00, 01, 10, 11}, a new state (q, w). Now in fact we will never need the value w = 11, so this will result in twelve states of the given form. Additionally, each of the four transitions results in 2k + 1 = 5 new states, so there will be 32 states in all. Since there are only two input letters, that is a total of 64 transitions. We will adopt a scheme for numbering the states of the new machine: This will be a 3-digit number, where the leading digit (0 or 1) represents the state q of the original machine, the six possible values of w are represented in the second digit as 0,1,2,3,4,5 (for ɛ, 0, 1, 00, 01, 10 respectively) and the the third digit is either 0, 1, 2, 3, 4 or 5. With this scheme, the initial state is still 0. Let s work first on the transitions that don t depend on the transition table of M. Associated with state 0 we have R R R R R Similarly, with state 1 we have R R R R R 6

7 We now introduce the new transitions derived from the transition 0 a 0 a R The pair (0, a) gives rise to the state (0, 01), which we encode as 40. So we get L L The process of rewriting the symbol 1, then the 0, on the leftward scan is L L and then of advancing right is R R R R R R We will repeat these patterns with the states 30-35, 50-55, and We can assemble these all into a single file and execute it with the Turing machine simulator. Before we do that, however, we need to take care about the blurring of the distinction between the input symbol 0 and the blank. To have this work properly with the simulator we would either have to tweak the simulator itself, or change all the zeros in the new specification to B. If you were completing this project and not including computer code, you would work through the rest of this small example and demonstrate it with the Turing machine simulator. Here, rather than continue with the example, we will demonstrate a program that carries this out automatically. 4 Efficiency of the simulation If the original machine M has m states, and t tape symbols, then the length of the encoding of a tape symbol is k bits, where k = log 2 t. There will be roughly 2t strings of length less than or equal to k, and thus the new machine will have 2mt states of the form (q, w). In addition, there are not more than mt transitions in 7

8 the specification of M, and each transition gives rise to 2k + 1 states of the form (q, w, j). So the total number of states of the new machine is not more than (2k + 3)mt. Another way to think of it is this: The total number of transitions of the original machine is mt, and the total number of transitions of the new machine is twice the number of states, so at worst, the size of the specification is multiplied by a factor of 4k + 6. Even if the number of tape symbols of the original machine is relatively large, say 100, the blowup in the size of the specification is only 34. Bad news if you are doing it by hand, but not very onerous for an automatic solution. Similarly, each transition of the new machine requires that we scan rightward k cells, leftward k + 1 cells, rightward 1 cell, and finally right- or leftward k cells, so we need 3k + 2 steps to simulate a step of the original machine. Again, this is not a particularly large blowup in time, and unlike the simulation of a two-tape machine by a one-tape machine, it is independent of the input size. 5 Implementation Attached to this document is a Python program that implements the algorithm described in the preceding sections. It contains several functions. The first, called create encoding, takes the name of a Turing Machine specification file as an argument. This function returns a triple (d,s,u). The first component is a representation of the state-transition function of the Turing machine this is simply lifted from the code for the Turing machine simulator. The second component gives the encoding of the tape symbols of the machine as bit strings. The third is the set of states of the original machine. The second function, called write new machine takes these same three components as arguments, and writes the specification file, called newoutfile.tm, that results from application of the algorithm above. The method of encoding the new states as integers is slightly different from the one described in the example above, and is described in detail in the comments to the program. The tape alphabet of this new machine is represented in both the specification file and the printed output as {1, B}. However, if you use the simulator to test it, you need to specify the internal blank symbols as space characters. Here is an example. We will apply our construction to the file equalasbs.tm, which decides whether the input string contains an equal number of a s and b s. Here is a run of the original machine on a short rejected input: 8

9 >>> tm.runtm( equalasbs, bab ) 1. state: 0 b a b 2. state: 1 c a b 3. state: 3 c c b 4. state: 3 B c c b 5. state: 0 c c b 6. state: 0 c c b 7. state: 0 c c b 8. state: 1 c c c B 9. state: -2 c c c B reject 9 steps c c c Here is the start of the same computation, performed with the machine that has two tape symbols: >>> (d,s,u)=create_encoding( equalasbs ) >>> print s { a : 10, : 00, c : 01, b : 11 } >>> write_new_machine(d,s,u) 9

10 The specification files equalasbs.tm and newoutfile.tm are attached to this project. The resulting Turing machine If we now want to run the new machine on the input bab we need to compute the encoding of the input. This is , but it has to be fed to the machine as >>> tm.runtm( newoutfile, ) 1. state: B state: B state: B 1 1 The computation continues for 64 steps, and ends with the rejection of the input. To turn this into a more useful tool, the program was revised so that rather than writing the new specification file, it creates the specification of the new machine internally. The code from the original simulator was tweaked so that in this new program, you can specify the input in the original alphabet, and see the run of the two-symbol machine, with the bits displayed as 0s an 1s, and gathered in groups of k bits, where k is the number of bits used to encode each tape symbol of M. To do this, I added a new function create tm to create the internal representation, and revised versions of runtm and display configuration from the original Turing machine simulator. Here is the same computation in this new setting: >>> run2symtm( equalasbs, bab ) state: state:

11 state: state: state: state: state: state: state: state: state:

12 12. state: state: state: state: state: state: state: state: state: state:

13 state: state: state: state: state: state: state: state: state:

14 31. state: state: state: state: state: state: state: state: state: state: 37 14

15 0 41. state: state: state: state: state: state: state: state: state:

16 50. state: state: state: state: state: state: state: state: state: state:

17 state: state: state: state: state: reject 64 steps 17

CSCI3390-Assignment 2 Solutions

CSCI3390-Assignment 2 Solutions CSCI3390-Assignment 2 Solutions due February 3, 2016 1 TMs for Deciding Languages Write the specification of a Turing machine recognizing one of the following three languages. Do one of these problems.

More information

Introduction to Turing Machines. Reading: Chapters 8 & 9

Introduction to Turing Machines. Reading: Chapters 8 & 9 Introduction to Turing Machines Reading: Chapters 8 & 9 1 Turing Machines (TM) Generalize the class of CFLs: Recursively Enumerable Languages Recursive Languages Context-Free Languages Regular Languages

More information

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

Q = Set of states, IE661: Scheduling Theory (Fall 2003) Primer to Complexity Theory Satyaki Ghosh Dastidar IE661: Scheduling Theory (Fall 2003) Primer to Complexity Theory Satyaki Ghosh Dastidar Turing Machine A Turing machine is an abstract representation of a computing device. It consists of a read/write

More information

Part I: Definitions and Properties

Part I: Definitions and Properties Turing Machines Part I: Definitions and Properties Finite State Automata Deterministic Automata (DFSA) M = {Q, Σ, δ, q 0, F} -- Σ = Symbols -- Q = States -- q 0 = Initial State -- F = Accepting States

More information

Lecture notes on Turing machines

Lecture notes on Turing machines Lecture notes on Turing machines Ivano Ciardelli 1 Introduction Turing machines, introduced by Alan Turing in 1936, are one of the earliest and perhaps the best known model of computation. The importance

More information

Theory of Computation

Theory of Computation Theory of Computation Unit 4-6: Turing Machines and Computability Decidability and Encoding Turing Machines Complexity and NP Completeness Syedur Rahman syedurrahman@gmail.com Turing Machines Q The set

More information

Turing Machines. Lecture 8

Turing Machines. Lecture 8 Turing Machines Lecture 8 1 Course Trajectory We will see algorithms, what can be done. But what cannot be done? 2 Computation Problem: To compute a function F that maps each input (a string) to an output

More information

Turing Machines. Nicholas Geis. February 5, 2015

Turing Machines. Nicholas Geis. February 5, 2015 Turing Machines Nicholas Geis February 5, 2015 Disclaimer: This portion of the notes does not talk about Cellular Automata or Dynamical Systems, it talks about turing machines, however this will lay the

More information

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

Turing Machines (TM) Deterministic Turing Machine (DTM) Nondeterministic Turing Machine (NDTM) Turing Machines (TM) Deterministic Turing Machine (DTM) Nondeterministic Turing Machine (NDTM) 1 Deterministic Turing Machine (DTM).. B B 0 1 1 0 0 B B.. Finite Control Two-way, infinite tape, broken into

More information

CSCC63 Worksheet Turing Machines

CSCC63 Worksheet Turing Machines 1 An Example CSCC63 Worksheet Turing Machines Goal. Design a turing machine, M that accepts only strings of the form {w#w w {0, 1} }. Idea. Describe in words how the machine would work. Read first symbol

More information

Chapter 3: The Church-Turing Thesis

Chapter 3: The Church-Turing Thesis Chapter 3: The Church-Turing Thesis 1 Turing Machine (TM) Control... Bi-direction Read/Write Turing machine is a much more powerful model, proposed by Alan Turing in 1936. 2 Church/Turing Thesis Anything

More information

The tape of M. Figure 3: Simulation of a Turing machine with doubly infinite tape

The tape of M. Figure 3: Simulation of a Turing machine with doubly infinite tape UG3 Computability and Intractability (2009-2010): Note 4 4. Bells and whistles. In defining a formal model of computation we inevitably make a number of essentially arbitrary design decisions. These decisions

More information

Universal Turing Machine. Lecture 20

Universal Turing Machine. Lecture 20 Universal Turing Machine Lecture 20 1 Turing Machine move the head left or right by one cell read write sequentially accessed infinite memory finite memory (state) next-action look-up table Variants don

More information

Automata Theory CS S-12 Turing Machine Modifications

Automata Theory CS S-12 Turing Machine Modifications Automata Theory CS411-2015S-12 Turing Machine Modifications David Galles Department of Computer Science University of San Francisco 12-0: Extending Turing Machines When we added a stack to NFA to get a

More information

Theory of Computation

Theory of Computation Theory of Computation Lecture #2 Sarmad Abbasi Virtual University Sarmad Abbasi (Virtual University) Theory of Computation 1 / 1 Lecture 2: Overview Recall some basic definitions from Automata Theory.

More information

MACHINE COMPUTING. the limitations

MACHINE COMPUTING. the limitations MACHINE COMPUTING the limitations human computing stealing brain cycles of the masses word recognition: to digitize all printed writing language education: to translate web content games with a purpose

More information

CSCI3390-Lecture 6: An Undecidable Problem

CSCI3390-Lecture 6: An Undecidable Problem CSCI3390-Lecture 6: An Undecidable Problem September 21, 2018 1 Summary The language L T M recognized by the universal Turing machine is not decidable. Thus there is no algorithm that determines, yes or

More information

Lecture 12: Mapping Reductions

Lecture 12: Mapping Reductions Lecture 12: Mapping Reductions October 18, 2016 CS 1010 Theory of Computation Topics Covered 1. The Language EQ T M 2. Mapping Reducibility 3. The Post Correspondence Problem 1 The Language EQ T M The

More information

1 Showing Recognizability

1 Showing Recognizability CSCC63 Worksheet Recognizability and Decidability 1 1 Showing Recognizability 1.1 An Example - take 1 Let Σ be an alphabet. L = { M M is a T M and L(M) }, i.e., that M accepts some string from Σ. Prove

More information

Advanced topic: Space complexity

Advanced topic: Space complexity Advanced topic: Space complexity CSCI 3130 Formal Languages and Automata Theory Siu On CHAN Chinese University of Hong Kong Fall 2016 1/28 Review: time complexity We have looked at how long it takes to

More information

CS 21 Decidability and Tractability Winter Solution Set 3

CS 21 Decidability and Tractability Winter Solution Set 3 CS 21 Decidability and Tractability Winter 2018 Posted: January 31 Solution Set 3 If you have not yet turned in the Problem Set, you should not consult these solutions. 1. (a) A 2-NPDA is a 7-tuple (Q,,

More information

M. Smith. 6 September 2016 / GSAC

M. Smith. 6 September 2016 / GSAC , Complexity, and Department of Mathematics University of Utah 6 September 2016 / GSAC Outline 1 2 3 4 Outline 1 2 3 4 Motivation The clock puzzle is an infamous part of the video game XIII-2 (2011). Most

More information

Solution to CS375 Homework Assignment 11 (40 points) Due date: 4/26/2017

Solution to CS375 Homework Assignment 11 (40 points) Due date: 4/26/2017 Solution to CS375 Homework Assignment 11 (40 points) Due date: 4/26/2017 1. Find a Greibach normal form for the following given grammar. (10 points) S bab A BAa a B bb Ʌ Solution: (1) Since S does not

More information

Harvard CS 121 and CSCI E-121 Lecture 14: Turing Machines and the Church Turing Thesis

Harvard CS 121 and CSCI E-121 Lecture 14: Turing Machines and the Church Turing Thesis Harvard CS 121 and CSCI E-121 Lecture 14: Turing Machines and the Church Turing Thesis Harry Lewis October 22, 2013 Reading: Sipser, 3.2, 3.3. The Basic Turing Machine The Basic Turing Machine a a b a

More information

CSE 200 Lecture Notes Turing machine vs. RAM machine vs. circuits

CSE 200 Lecture Notes Turing machine vs. RAM machine vs. circuits CSE 200 Lecture Notes Turing machine vs. RAM machine vs. circuits Chris Calabro January 13, 2016 1 RAM model There are many possible, roughly equivalent RAM models. Below we will define one in the fashion

More information

CpSc 421 Homework 9 Solution

CpSc 421 Homework 9 Solution CpSc 421 Homework 9 Solution Attempt any three of the six problems below. The homework is graded on a scale of 100 points, even though you can attempt fewer or more points than that. Your recorded grade

More information

Theory of Computation

Theory of Computation Theory of Computation Dr. Sarmad Abbasi Dr. Sarmad Abbasi () Theory of Computation 1 / 33 Lecture 20: Overview Incompressible strings Minimal Length Descriptions Descriptive Complexity Dr. Sarmad Abbasi

More information

A Universal Turing Machine

A Universal Turing Machine A Universal Turing Machine A limitation of Turing Machines: Turing Machines are hardwired they execute only one program Real Computers are re-programmable Solution: Universal Turing Machine Attributes:

More information

Turing Machines Part II

Turing Machines Part II Turing Machines Part II COMP2600 Formal Methods for Software Engineering Katya Lebedeva Australian National University Semester 2, 2016 Slides created by Katya Lebedeva COMP 2600 Turing Machines 1 Why

More information

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

More Turing Machines. CS154 Chris Pollett Mar 15, 2006. More Turing Machines CS154 Chris Pollett Mar 15, 2006. Outline Multitape Turing Machines Nondeterministic Turing Machines Enumerators Introduction There have been many different proposals for what it means

More information

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

Decision Problems with TM s. Lecture 31: Halting Problem. Universe of discourse. Semi-decidable. Look at following sets: CSCI 81 Spring, 2012 Decision Problems with TM s Look at following sets: Lecture 31: Halting Problem CSCI 81 Spring, 2012 Kim Bruce A TM = { M,w M is a TM and w L(M)} H TM = { M,w M is a TM which halts on input w} TOTAL TM

More information

Theory of Computation Lecture Notes. Problems and Algorithms. Class Information

Theory of Computation Lecture Notes. Problems and Algorithms. Class Information Theory of Computation Lecture Notes Prof. Yuh-Dauh Lyuu Dept. Computer Science & Information Engineering and Department of Finance National Taiwan University Problems and Algorithms c 2004 Prof. Yuh-Dauh

More information

Languages, regular languages, finite automata

Languages, regular languages, finite automata Notes on Computer Theory Last updated: January, 2018 Languages, regular languages, finite automata Content largely taken from Richards [1] and Sipser [2] 1 Languages An alphabet is a finite set of characters,

More information

TURING MAHINES

TURING MAHINES 15-453 TURING MAHINES TURING MACHINE FINITE STATE q 10 CONTROL AI N P U T INFINITE TAPE read write move 0 0, R, R q accept, R q reject 0 0, R 0 0, R, L read write move 0 0, R, R q accept, R 0 0, R 0 0,

More information

9 Nondeterministic Turing Machines

9 Nondeterministic Turing Machines Caveat lector: This is the zeroth (draft) edition of this lecture note. In particular, some topics still need to be written. Please send bug reports and suggestions to jeffe@illinois.edu. If first you

More information

(a) Definition of TMs. First Problem of URMs

(a) Definition of TMs. First Problem of URMs Sec. 4: Turing Machines First Problem of URMs (a) Definition of the Turing Machine. (b) URM computable functions are Turing computable. (c) Undecidability of the Turing Halting Problem That incrementing

More information

ECS 120 Lesson 15 Turing Machines, Pt. 1

ECS 120 Lesson 15 Turing Machines, Pt. 1 ECS 120 Lesson 15 Turing Machines, Pt. 1 Oliver Kreylos Wednesday, May 2nd, 2001 Before we can start investigating the really interesting problems in theoretical computer science, we have to introduce

More information

Theory of Computation

Theory of Computation Theory of Computation Lecture #6 Sarmad Abbasi Virtual University Sarmad Abbasi (Virtual University) Theory of Computation 1 / 39 Lecture 6: Overview Prove the equivalence of enumerators and TMs. Dovetailing

More information

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

CMPT 710/407 - Complexity Theory Lecture 4: Complexity Classes, Completeness, Linear Speedup, and Hierarchy Theorems CMPT 710/407 - Complexity Theory Lecture 4: Complexity Classes, Completeness, Linear Speedup, and Hierarchy Theorems Valentine Kabanets September 13, 2007 1 Complexity Classes Unless explicitly stated,

More information

,

, Kolmogorov Complexity Carleton College, CS 254, Fall 2013, Prof. Joshua R. Davis based on Sipser, Introduction to the Theory of Computation 1. Introduction Kolmogorov complexity is a theory of lossless

More information

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

Griffith University 3130CIT Theory of Computation (Based on slides by Harald Søndergaard of The University of Melbourne) Turing Machines 9-0 Griffith University 3130CIT Theory of Computation (Based on slides by Harald Søndergaard of The University of Melbourne) Turing Machines 9-0 Turing Machines Now for a machine model of much greater power.

More information

Most General computer?

Most General computer? Turing Machines Most General computer? DFAs are simple model of computation. Accept only the regular languages. Is there a kind of computer that can accept any language, or compute any function? Recall

More information

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

CS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine) CS537 Theory of Computation Lecture : Computability Theory I (Turing Machine) Objectives Introduce the Turing Machine (TM) Proposed by Alan Turing in 936 finite-state control + infinitely long tape A stronger

More information

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

Turing Machine properties. Turing Machines. Alternate TM definitions. Alternate TM definitions. Alternate TM definitions. Alternate TM definitions Turing Machine properties Turing Machines TM Variants and the Universal TM There are many ways to skin a cat And many ways to define a TM The book s Standard Turing Machines Tape unbounded on both sides

More information

Ph219/CS219 Problem Set 3

Ph219/CS219 Problem Set 3 Ph19/CS19 Problem Set 3 Solutions by Hui Khoon Ng December 3, 006 (KSV: Kitaev, Shen, Vyalyi, Classical and Quantum Computation) 3.1 The O(...) notation We can do this problem easily just by knowing the

More information

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

6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, Class 8 Nancy Lynch 6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, 2010 Class 8 Nancy Lynch Today More undecidable problems: About Turing machines: Emptiness, etc. About

More information

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

Equivalence of TMs and Multitape TMs. Theorem 3.13 and Corollary 3.15 By: Joseph Lauman Equivalence of TMs and Multitape TMs Theorem 3.13 and Corollary 3.15 By: Joseph Lauman Turing Machines First proposed by Alan Turing in 1936 Similar to finite automaton, but with an unlimited and unrestricted

More information

Computational complexity

Computational complexity COMS11700 Computational complexity Department of Computer Science, University of Bristol Bristol, UK 2 May 2014 COMS11700: Computational complexity Slide 1/23 Introduction If we can prove that a language

More information

ECS 120 Lesson 20 The Post Correspondence Problem

ECS 120 Lesson 20 The Post Correspondence Problem ECS 120 Lesson 20 The Post Correspondence Problem Oliver Kreylos Wednesday, May 16th, 2001 Today we will continue yesterday s discussion of reduction techniques by looking at another common strategy, reduction

More information

Introduction to Languages and Computation

Introduction to Languages and Computation Introduction to Languages and Computation George Voutsadakis 1 1 Mathematics and Computer Science Lake Superior State University LSSU Math 400 George Voutsadakis (LSSU) Languages and Computation July 2014

More information

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

IV. Turing Machine. Yuxi Fu. BASICS, Shanghai Jiao Tong University IV. Turing Machine Yuxi Fu BASICS, Shanghai Jiao Tong University Alan Turing Alan Turing (23Jun.1912-7Jun.1954), an English student of Church, introduced a machine model for effective calculation in On

More information

Notes for Lecture 3... x 4

Notes for Lecture 3... x 4 Stanford University CS254: Computational Complexity Notes 3 Luca Trevisan January 18, 2012 Notes for Lecture 3 In this lecture we introduce the computational model of boolean circuits and prove that polynomial

More information

Week 2: Defining Computation

Week 2: Defining Computation Computational Complexity Theory Summer HSSP 2018 Week 2: Defining Computation Dylan Hendrickson MIT Educational Studies Program 2.1 Turing Machines Turing machines provide a simple, clearly defined way

More information

Turing machines Finite automaton no storage Pushdown automaton storage is a stack What if we give the automaton a more flexible storage?

Turing machines Finite automaton no storage Pushdown automaton storage is a stack What if we give the automaton a more flexible storage? Turing machines Finite automaton no storage Pushdown automaton storage is a stack What if we give the automaton a more flexible storage? What is the most powerful of automata? In this lecture we will introduce

More information

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

Homework. Turing Machines. Announcements. Plan for today. Now our picture looks like. Languages Homework s TM Variants and the Universal TM Homework #6 returned Homework #7 due today Homework #8 (the LAST homework!) Page 262 -- Exercise 10 (build with JFLAP) Page 270 -- Exercise 2 Page 282 -- Exercise

More information

Space Complexity. The space complexity of a program is how much memory it uses.

Space Complexity. The space complexity of a program is how much memory it uses. Space Complexity The space complexity of a program is how much memory it uses. Measuring Space When we compute the space used by a TM, we do not count the input (think of input as readonly). We say that

More information

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska LECTURE 13 CHAPTER 4 TURING MACHINES 1. The definition of Turing machine 2. Computing with Turing machines 3. Extensions of Turing

More information

Boolean circuits. Lecture Definitions

Boolean circuits. Lecture Definitions Lecture 20 Boolean circuits In this lecture we will discuss the Boolean circuit model of computation and its connection to the Turing machine model. Although the Boolean circuit model is fundamentally

More information

15.1 Proof of the Cook-Levin Theorem: SAT is NP-complete

15.1 Proof of the Cook-Levin Theorem: SAT is NP-complete CS125 Lecture 15 Fall 2016 15.1 Proof of the Cook-Levin Theorem: SAT is NP-complete Already know SAT NP, so only need to show SAT is NP-hard. Let L be any language in NP. Let M be a NTM that decides L

More information

CS4026 Formal Models of Computation

CS4026 Formal Models of Computation CS4026 Formal Models of Computation Turing Machines Turing Machines Abstract but accurate model of computers Proposed by Alan Turing in 1936 There weren t computers back then! Turing s motivation: find

More information

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

Theory of Computer Science. Theory of Computer Science. D7.1 Introduction. D7.2 Turing Machines as Words. D7.3 Special Halting Problem Theory of Computer Science May 2, 2018 D7. Halting Problem and Reductions Theory of Computer Science D7. Halting Problem and Reductions Gabriele Röger University of Basel May 2, 2018 D7.1 Introduction

More information

Halting and Equivalence of Program Schemes in Models of Arbitrary Theories

Halting and Equivalence of Program Schemes in Models of Arbitrary Theories Halting and Equivalence of Program Schemes in Models of Arbitrary Theories Dexter Kozen Cornell University, Ithaca, New York 14853-7501, USA, kozen@cs.cornell.edu, http://www.cs.cornell.edu/~kozen In Honor

More information

where Q is a finite set of states

where Q is a finite set of states Space Complexity So far most of our theoretical investigation on the performances of the various algorithms considered has focused on time. Another important dynamic complexity measure that can be associated

More information

Further discussion of Turing machines

Further discussion of Turing machines Further discussion of Turing machines In this lecture we will discuss various aspects of decidable and Turing-recognizable languages that were not mentioned in previous lectures. In particular, we will

More information

Homework Assignment 6 Answers

Homework Assignment 6 Answers Homework Assignment 6 Answers CSCI 2670 Introduction to Theory of Computing, Fall 2016 December 2, 2016 This homework assignment is about Turing machines, decidable languages, Turing recognizable languages,

More information

A non-turing-recognizable language

A non-turing-recognizable language CS 360: Introduction to the Theory of Computing John Watrous, University of Waterloo A non-turing-recognizable language 1 OVERVIEW Thus far in the course we have seen many examples of decidable languages

More information

COMPUTATIONAL COMPLEXITY

COMPUTATIONAL COMPLEXITY ATHEATICS: CONCEPTS, AND FOUNDATIONS Vol. III - Computational Complexity - Osamu Watanabe COPUTATIONAL COPLEXITY Osamu Watanabe Tokyo Institute of Technology, Tokyo, Japan Keywords: {deterministic, randomized,

More information

The Turing Machine. CSE 211 (Theory of Computation) The Turing Machine continued. Turing Machines

The Turing Machine. CSE 211 (Theory of Computation) The Turing Machine continued. Turing Machines The Turing Machine Turing Machines Professor Department of Computer Science and Engineering Bangladesh University of Engineering and Technology Dhaka-1000, Bangladesh The Turing machine is essentially

More information

Undecidability COMS Ashley Montanaro 4 April Department of Computer Science, University of Bristol Bristol, UK

Undecidability COMS Ashley Montanaro 4 April Department of Computer Science, University of Bristol Bristol, UK COMS11700 Undecidability Department of Computer Science, University of Bristol Bristol, UK 4 April 2014 COMS11700: Undecidability Slide 1/29 Decidability We are particularly interested in Turing machines

More information

Complexity Theory Part I

Complexity Theory Part I Complexity Theory Part I Problem Problem Set Set 77 due due right right now now using using a late late period period The Limits of Computability EQ TM EQ TM co-re R RE L D ADD L D HALT A TM HALT A TM

More information

Chapter 7 Turing Machines

Chapter 7 Turing Machines Chapter 7 Turing Machines Copyright 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 A General Model of Computation Both finite automata and pushdown automata are

More information

Turing Machines. 22c:135 Theory of Computation. Tape of a Turing Machine (TM) TM versus FA, PDA

Turing Machines. 22c:135 Theory of Computation. Tape of a Turing Machine (TM) TM versus FA, PDA Turing Machines A Turing machine is similar to a finite automaton with supply of unlimited memory. A Turing machine can do everything that any computing device can do. There exist problems that even a

More information

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

Lecture 25: Cook s Theorem (1997) Steven Skiena.   skiena Lecture 25: Cook s Theorem (1997) Steven Skiena Department of Computer Science State University of New York Stony Brook, NY 11794 4400 http://www.cs.sunysb.edu/ skiena Prove that Hamiltonian Path is NP

More information

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

1 Acceptance, Rejection, and I/O for Turing Machines 1 Acceptance, Rejection, and I/O for Turing Machines Definition 1.1 (Initial Configuration) If M = (K,Σ,δ,s,H) is a Turing machine and w (Σ {, }) then the initial configuration of M on input w is (s, w).

More information

UNIT-VIII COMPUTABILITY THEORY

UNIT-VIII COMPUTABILITY THEORY CONTEXT SENSITIVE LANGUAGE UNIT-VIII COMPUTABILITY THEORY A Context Sensitive Grammar is a 4-tuple, G = (N, Σ P, S) where: N Set of non terminal symbols Σ Set of terminal symbols S Start symbol of the

More information

Computability Crib Sheet

Computability Crib Sheet Computer Science and Engineering, UCSD Winter 10 CSE 200: Computability and Complexity Instructor: Mihir Bellare Computability Crib Sheet January 3, 2010 Computability Crib Sheet This is a quick reference

More information

CSCI3390-Lecture 14: The class NP

CSCI3390-Lecture 14: The class NP CSCI3390-Lecture 14: The class NP 1 Problems and Witnesses All of the decision problems described below have the form: Is there a solution to X? where X is the given problem instance. If the instance is

More information

Turing machines COMS Ashley Montanaro 21 March Department of Computer Science, University of Bristol Bristol, UK

Turing machines COMS Ashley Montanaro 21 March Department of Computer Science, University of Bristol Bristol, UK COMS11700 Turing machines Department of Computer Science, University of Bristol Bristol, UK 21 March 2014 COMS11700: Turing machines Slide 1/15 Introduction We have seen two models of computation: finite

More information

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

Turing machine recap. Universal Turing Machines and Undecidability. Alphabet size doesn t matter. Robustness of TM 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

More information

Time-bounded computations

Time-bounded computations Lecture 18 Time-bounded computations We now begin the final part of the course, which is on complexity theory. We ll have time to only scratch the surface complexity theory is a rich subject, and many

More information

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

CS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine) CS537 Theory of Computation Lecture : Computability Theory I (Turing Machine) Objectives Introduce the Turing Machine (TM)? Proposed by Alan Turing in 936 finite-state control + infinitely long tape A

More information

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

Turing Machines. The Language Hierarchy. Context-Free Languages. Regular Languages. Courtesy Costas Busch - RPI 1 Turing Machines a n b n c The anguage Hierarchy n? ww? Context-Free anguages a n b n egular anguages a * a *b* ww Courtesy Costas Busch - PI a n b n c n Turing Machines anguages accepted by Turing Machines

More information

Theory of Computation

Theory of Computation Theory of Computation Dr. Sarmad Abbasi Dr. Sarmad Abbasi () Theory of Computation / Lecture 3: Overview Decidability of Logical Theories Presburger arithmetic Decidability of Presburger Arithmetic Dr.

More information

Final Exam Version A December 16, 2014 Name: NetID: Section: # Total Score

Final Exam Version A December 16, 2014 Name: NetID: Section: # Total Score CS 374 : Algorithms and Models of Computation, Fall 2014 Final Exam Version A December 16, 2014 Name: NetID: Section: 1 2 3 # 1 2 3 4 5 6 Total Score Max 20 10 10 10 10 10 70 Grader Don t panic! Please

More information

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

ASSIGNMENT THREE SOLUTIONS MATH 4805 / COMP 4805 / MATH (1) (a) A transition diagram appears below for the TM specified by the 7-tuple M = ASSIGNMENT THREE SOLUTIONS MATH 4805 / COMP 4805 / MATH 5605 (1) (a) A transition diagram appears below for the TM specified by the 7-tuple M = ({q, q 0, q 1, q 2, q 01, q 02, q 12, q 012, r, f, z}, {0,

More information

Foundations of

Foundations of 91.304 Foundations of (Theoretical) Computer Science Chapter 3 Lecture Notes (Section 3.2: Variants of Turing Machines) David Martin dm@cs.uml.edu With some modifications by Prof. Karen Daniels, Fall 2012

More information

Theory of Computation Lecture Notes

Theory of Computation Lecture Notes Theory of Computation Lecture Notes Prof. Yuh-Dauh Lyuu Dept. Computer Science & Information Engineering and Department of Finance National Taiwan University c 2008 Prof. Yuh-Dauh Lyuu, National Taiwan

More information

Final Exam (Version B) December 16, 2014 Name: NetID: Section: 1 2 3

Final Exam (Version B) December 16, 2014 Name: NetID: Section: 1 2 3 CS 374 : Algorithms and Models of Computation, Fall 2014 Final Exam (Version B) December 16, 2014 Name: NetID: Section: 1 2 3 # 1 2 3 4 5 6 Total Score Max 20 10 10 10 10 10 70 Grader Don t panic! Please

More information

CS3719 Theory of Computation and Algorithms

CS3719 Theory of Computation and Algorithms CS3719 Theory of Computation and Algorithms Any mechanically (automatically) discretely computation of problem solving contains at least three components: - problem description - computational tool - analysis

More information

an efficient procedure for the decision problem. We illustrate this phenomenon for the Satisfiability problem.

an efficient procedure for the decision problem. We illustrate this phenomenon for the Satisfiability problem. 1 More on NP In this set of lecture notes, we examine the class NP in more detail. We give a characterization of NP which justifies the guess and verify paradigm, and study the complexity of solving search

More information

3 Probabilistic Turing Machines

3 Probabilistic Turing Machines CS 252 - Probabilistic Turing Machines (Algorithms) Additional Reading 3 and Homework problems 3 Probabilistic Turing Machines When we talked about computability, we found that nondeterminism was sometimes

More information

4.2 The Halting Problem

4.2 The Halting Problem 172 4.2 The Halting Problem The technique of diagonalization was discovered in 1873 by Georg Cantor who was concerned with the problem of measuring the sizes of infinite sets For finite sets we can simply

More information

Computability Theory. CS215, Lecture 6,

Computability Theory. CS215, Lecture 6, Computability Theory CS215, Lecture 6, 2000 1 The Birth of Turing Machines At the end of the 19th century, Gottlob Frege conjectured that mathematics could be built from fundamental logic In 1900 David

More information

An Algebraic Characterization of the Halting Probability

An Algebraic Characterization of the Halting Probability CDMTCS Research Report Series An Algebraic Characterization of the Halting Probability Gregory Chaitin IBM T. J. Watson Research Center, USA CDMTCS-305 April 2007 Centre for Discrete Mathematics and Theoretical

More information

Chapter 8. Turing Machine (TMs)

Chapter 8. Turing Machine (TMs) Chapter 8 Turing Machine (TMs) Turing Machines (TMs) Accepts the languages that can be generated by unrestricted (phrase-structured) grammars No computational machine (i.e., computational language recognition

More information

Turing Machines and the Church-Turing Thesis

Turing Machines and the Church-Turing Thesis CSE2001, Fall 2006 1 Turing Machines and the Church-Turing Thesis Today our goal is to show that Turing Machines are powerful enough to model digital computers, and to see discuss some evidence for the

More information

6.5.3 An NP-complete domino game

6.5.3 An NP-complete domino game 26 Chapter 6. Complexity Theory 3SAT NP. We know from Theorem 6.5.7 that this is true. A P 3SAT, for every language A NP. Hence, we have to show this for languages A such as kcolor, HC, SOS, NPrim, KS,

More information

Non-emptiness Testing for TMs

Non-emptiness Testing for TMs 180 5. Reducibility The proof of unsolvability of the halting problem is an example of a reduction: a way of converting problem A to problem B in such a way that a solution to problem B can be used to

More information

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

6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, Class 10 Nancy Lynch 6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, 2010 Class 10 Nancy Lynch Today Final topic in computability theory: Self-Reference and the Recursion

More information

2 Plain Kolmogorov Complexity

2 Plain Kolmogorov Complexity 2 Plain Kolmogorov Complexity In this section, we introduce plain Kolmogorov Complexity, prove the invariance theorem - that is, the complexity of a string does not depend crucially on the particular model

More information