# The Turing machine model of computation

Save this PDF as:

Size: px
Start display at page:

## Transcription

1 The Turing machine model of computation For most of the remainder of the course we will study the Turing machine model of computation, named after Alan Turing ( ) who proposed the model in Turing machines are intended to provide a simple mathematical abstraction of general computations. As we study this model, it may help you to keep this thought in the back of your mind. The idea that Turing machine computations are representative of a fully general computational model is called the Church Turing thesis. Here is one statement of this thesis (although it is the idea rather than the exact choice of words that is important): Church Turing thesis: Any function that can be computed by a mechanical process can be computed by a Turing machine. This is not a mathematical statement that can be proved or disproved if you wanted to try to prove a statement along these lines, the first thing you would most likely do is look for a mathematical definition of what it means for a function to be computed by a mechanical process, and this is precisely what the Turing machine model was intended to provide. While people have actually built machines that behave like Turing machines, this is mostly a recreational activity the Turing machine model was never intended to serve as a practical device for performing computations. Rather, it was intended to provide a rigorous mathematical foundation for reasoning about computation, and it has served this purpose very well since its invention. It is worth mentioning that there are other mathematical models that play a similar role to Turing machines, as a way of formalizing the notion of computation. For instance, Alonzo Church proposed λ-calculus a short time before Turing proposed what we now call the Turing machine, and a sketch of a proof of the 1

2 CS 360 Introduction to the Theory of Computing finite state control q 4 tape tape head 0 \$ # Figure 12.1: An illustration of the three components of a Turing machine: the finite state control, the tape head, and the tape. The tape is infinite in both directions (although it appears that this Turing machine s tape was torn at both ends to fit it into the figure). equivalence of the two models appears in Turing s 1936 paper. Others, including Kurt Gödel, Stephen Kleene, and Emil Post, also contributed important ideas in the development of these notions. It is the case, however, that the Turing machine model provides a particularly clean and appealing way of formalizing computation, which is a reasons why this model is often the one that is preferred Turing machine components and definitions We will begin with an informal description of the Turing machine model before stating the formal definition. There are three components of a Turing machine: 1. The finite state control. This component is in one of a finite number of states at each instant, and is connected to the tape head component. 2. The tape head. This component scans one of the tape squares of the tape at each instant, and is connected to the finite state control. It can read and write symbols from/onto the tape, and it can move left and right along the tape. 3. The tape. This component consists of an infinite number of tape squares, each of which can store one of a finite number of tape symbols at each instant. The tape is infinite both to the left and to the right. Figure 12.1 illustrates these three components and the way they are connected. The idea is that the action of a Turing machine at each instant is determined by the state of the finite state control together with just the one symbol that is stored by the tape square that the tape head is currently reading. Thus, the action is determined by a finite number of possible alternatives: one action for each state/symbol pair. Depending on the state and the symbol being scanned, the action that the machine is to perform may involve changing the state of the finite state control, 2

3 changing the symbol on the tape square being scanned, and/or moving the tape head to the left or right. Once this action is performed, the machine will again have some state for its finite state control and will be reading some symbol on its tape, and the process continues. One may consider both deterministic and nondeterministic variants of the Turing machine model, but our main focus will be on the deterministic version of this model. We also give Turing machines an opportunity to stop the computational process and produce an output. The possibility of producing a string as an output will be discussed later, but for now we ll concentrate just on accepting or rejecting, as we did for DFAs (for instance). To do this, we require that there are two special states of the finite state control: an accept state q acc and a reject state q rej. If the machine enters one of these two states, the computation immediately stops and accepts or rejects accordingly. We do not allow the possibility that q acc and q rej are the same state these must be distinct states. When a Turing machine begins a computation, an input string is written on its tape, and every other tape square is initialized to a special blank symbol (which may not be included in the input alphabet). Naturally, we need an actual symbol to represent the blank symbol in these notes, and we will use the symbol for this purpose. More generally, we will allow the possible symbols written on the tape to include other non-input symbols in addition to the blank symbol, as it is sometimes convenient to allow this possibility. Formal definition of DTMs With the informal description of Turing machines from above in mind, we will now proceed to the formal definition. Definition A deterministic Turing machine (or DTM, for short) is a 7-tuple M = (Q, Σ, Γ, δ, q 0, q acc, q rej ), (12.1) where Q is a finite and nonempty set of states; Σ is an alphabet, called the input alphabet, which may not include the blank symbol ; Γ is an alphabet, called the tape alphabet, which must satisfy Σ { } Γ; δ is a transition function having the form δ : Q\{q acc, q rej } Γ Q Γ {, }; (12.2) q 0 Q is the initial state; and q acc, q rej Q are the accept and reject states, which satisfy q acc = q rej. The interpretation of the transition function is as follows. Suppose the DTM is currently in a state q Q, the symbol stored in the tape square being scanned by 3

4 CS 360 Introduction to the Theory of Computing q 0 σ 1 σ 2 σ n Figure 12.2: The initial configuration of a DTM when run on input w = σ 1 σ 2 σ n. the tape head is σ, and it holds that δ(q, σ) = (r, τ, D) for D {, }. The action performed by the DTM is then to (i) change state to r, (ii) overwrite the contents of the tape square being scanned by the tape head with τ, and (iii) move the tape head in direction D (either left or right). In the case that the state is q acc or q rej, the transition function does not specify an action, because we assume that the DTM stops once it reaches one of these two states Turing machine computations If we have a DTM M = (Q, Σ, Γ, δ, q 0, q acc, q rej ), and we wish to consider its operation on some input string w Σ, we assume that it is started with its components initialized as illustrated in Figure That is, the input string is written on the tape, one symbol per square, with each other tape square containing the blank symbol, and with the tape head scanning the tape square immediately to the left of the first input symbol. (In the case that the input string is ε, all of the tape squares start out storing blanks.) Once the initial arrangement of the DTM is set up, the DTM begins taking steps, as determined by the transition function δ in the manner suggested above. So long as the DTM does not enter one of the two states q acc or q rej, the computation continues. If the DTM eventually enters the state q acc, it accepts the input string, and if it eventually enters the state q rej, it rejects the input string. Notice that there are three possible alternatives for a DTM M on a given input string w: 1. M accepts w. 2. M rejects w. 3. M runs forever on input w. In some cases one can design a particular DTM so that the third alternative does not occur, but in general this could be what happens (assuming that nothing external to the DTM interrupts the computation). 4

5 Representing configurations of DTMs In order to speak more precisely about Turing machines and state a formal definition concerning their behavior, we will require a bit more terminology. When we speak of a configuration of a DTM, we are speaking of a description of all of the Turing machine s components at some instant: 1. the state of the finite state control, 2. the contents of the entire tape, and 3. the tape head position on the tape. Rather than drawing pictures depicting the different parts of Turing machines, such as was done in Figure 12.2, we use the following compact notation to represent configurations. If we have a DTM M = (Q, Σ, Γ, δ, q 0, q acc, q rej ), and we wish to refer to a configuration of this DTM, we express it in the form u(q, a)v (12.3) for some state q Q, a tape symbol a Γ, and (possibly empty) strings of tape symbols u and v such that u Γ \{ }Γ and v Γ \Γ { } (12.4) (i.e., u and v are strings of tape symbols such that u does not start with a blank and v does not end with a blank). What the expression (12.3) means is that the string uav is written on the tape in consecutive squares, with all other tape squares containing the blank symbol; the state of M is q; and the tape head of M is positioned over the symbol a that occurs between u and v. For example, the configuration of the DTM in Figure 12.1 is expressed as while the configuration of the DTM in Figure 12.2 is 0\$1(q 4, 0)0# (12.5) (q 0, )w (12.6) (for w = σ 1 σ n ). When working with descriptions of configurations, it is convenient to define a few functions as follows. We define α : Γ Γ \{ }Γ and β : Γ Γ \Γ { } recursively as α(w) = w (for w Γ \{ }Γ ) α( w) = α(w) (for w Γ ) (12.7) 5

6 CS 360 Introduction to the Theory of Computing and and we define β(w) = w (for w Γ \Γ { }) β(w ) = β(w) (for w Γ ), (12.8) γ : Γ (Q Γ)Γ ( Γ \{ }Γ ) (Q Γ) ( Γ \Γ { } ) (12.9) as γ(u(q, a)v) = α(u)(q, a)β(v) (12.10) for all u, v Γ, q Q, and a Γ. This may look more complicated than it really is the function γ just throws away all blank symbols on the left-most end of u and the right-most end of v, so that a proper expression of a configuration remains. A yields relation for DTMs Now we will define a yields relation, in a similar way to what we did for contextfree grammars. This will in turn allow us to formally define acceptance and rejection for DTMs. Definition Let M = (Q, Σ, Γ, δ, q 0, q acc, q rej ) be a DTM. We define a yields relation M on pairs of expressions representing configurations as follows: 1. For every choice of p Q\{q acc, q rej }, q Q, and a, b Γ satisfying δ(p, a) = (q, b, ), (12.11) the yields relation includes these pairs for all u Γ \{ }Γ, v Γ \Γ { }, and c Γ: u(p, a)cv M γ ( ub(q, c)v) u(p, a) M γ ( ub(q, ) ) (12.12) 2. For every choice of p Q\{q acc, q rej }, q Q, and a, b Γ satisfying δ(p, a) = (q, b, ), (12.13) the yields relation includes these pairs for all u Γ \{ }Γ, v Γ \Γ { }, and c Γ: uc(p, a)v M γ ( u(q, c)bv ) (p, a)v M γ ( (q, )bv ) (12.14) 6

7 In addition, we let M denote the reflexive, transitive closure of M. That is, we have u(p, a)v M y(q, b)z (12.15) if and only if there exists an integer m 1, strings w 1,..., w m, x 1,..., x m Γ, symbols c 1,..., c m Γ, and states r 1,..., r m Q such that u(p, a)v = w 1 (r 1, c 1 )x 1, y(q, b)v = w m (r m, c m )x m, and for all k {1,..., m 1}. w k (r k, c k )x k M w k+1 (r k+1, c k+1 )x k+1 (12.16) That definition looks a bit technical, but it is actually very simple whenever we have u(p, a)v M y(q, b)z (12.17) it means that by running M for one step we move from the configuration represented by u(p, a)v to the configuration represented by y(q, b)z; and whenever we have u(p, a)v M y(q, b)z (12.18) it means that by running M for some number of steps, possibly zero steps, we will move from the configuration represented by u(p, a)v to the configuration represented by y(q, b)z. Acceptance and rejection for DTMs Finally, we can write down a definition for acceptance and rejection by a DTM, using the relation M we just defined. Definition Let M = (Q, Σ, Γ, δ, q 0, q acc, q rej ) be a DTM and let w Σ be a string. If there exist strings u, v Γ and a symbol a Γ such that (q init, )w M u(q acc, a)v, (12.19) then M accepts w. If there exist strings u, v Γ and a symbol a Γ such that (q init, )w M u(q rej, a)v, (12.20) then M rejects w. If neither of these conditions hold, then M runs forever on input w. In words, if we start out in the initial configuration of a DTM M on an input w and start it running, we accept if we eventually hit the accept state, we reject if we eventually hit the reject state, and we run forever if neither of these two possibilities holds. 7

8 CS 360 Introduction to the Theory of Computing Similar to what we have done for DFAs, NFAs, CFGs, and PDAs, we write L(M) to denote the language of all strings that are accepted by a DTM M. In the case of DTMs, the language L(M) doesn t really tell the whole story a string w L(M) might either be rejected or it may cause M to run forever but the notation is useful nevertheless. Decidable and Turing-recognizable languages It has been a lecture filled with definitions, but we still need to discuss two more. All of the definitions are important, but these are particularly important because they introduce concepts that we will be discussing for the next several lectures. Definition Let Σ be an alphabet and let A Σ be a language. 1. The language A is Turing recognizable if there exists a DTM M for which it holds that A = L(M). 2. The language A is decidable if there exists a DTM M that satisfies two conditions: (i) A = L(M), and (ii) M never runs forever (i.e., it either accepts or rejects each input string w Σ ). It is evident from the definition that every decidable language is also Turing recognizable we ve added an additional condition on the DTM M for the case of decidability. We will see later that the other containment does not hold: there are languages that are Turing recognizable but not decidable. Understanding which languages are decidable, which are Turing recognizable but not decidable, and what relationships hold among the two classes will occupy us for several lectures, and we ll see many interesting results and ideas about computation along the way. From time to time you may hear about these concepts by different names. Sometimes the term recursive is used in place of decidable and recursively enumerable is used in place of Turing recognizable. These are historical terms based on different, but equivalent, ways of defining these classes of languages A simple example of a Turing machine Let us now see an example of a DTM. For this first example, we will describe the DTM using a state diagram. The syntax is a bit different, but the idea is similar to state diagrams for DFAs. In the DTM case, we represent the property that the transition function satisfies δ(p, a) = (q, b, ) with a transition of the form p a, b q 8

9 0, 0 1, 1 0, q 1 q 2, 1, 1 q acc, q rej 0, 0,, q 0 1, q 3 0, 0 1, 1 Figure 12.3: A DTM M for the language {0 n 1 n : n N}. and similarly we represent the property that δ(p, a) = (q, b, ) with a transition of the form p a, b q The state diagram for the example is given in Figure The DTM M described by this diagram is for the language A = { 0 n 1 n : n N }. (12.21) To be more precise, M accepts every string in A and rejects every string in A, and therefore the language A is decidable. The specific way that the DTM M works can be summarized as follows. The DTM M starts out with its tape head scanning the blank symbol immediately to the left of its input. It moves the tape head right, and if it sees a 1 it rejects: the input string must not be of the form 0 n 1 n if this happens. On the other hand, if it 9

10 CS 360 Introduction to the Theory of Computing sees another blank symbol, it accepts: the input must be the empty string, which corresponds to the n = 0 case in the description of A. Otherwise, it must have seen the symbol 0, and in this case the 0 is erased (meaning that it replaces it with the blank symbol), the tape head repeatedly moves right until a blank is found, and then it moves one square back to the left. If a 1 is not found at this location the DTM rejects: there weren t enough 1s at the right end of the string. Otherwise, if a 1 is found, it is erased, and the tape head moves all the way back to the left, where we essentially recurse on a slightly shorter string. Of course, the summary just suggested doesn t tell you precisely how the DTM works but if you didn t already have the state diagram from Figure 12.3, the summary would probably be enough to give you a good idea for how to come up with the state diagram (or perhaps a slightly different one operating in a similar way). In fact, an even higher-level summary would probably be enough. For instance, we could describe the functioning of the DTM M as follows: 1. Accept if the input is the empty string. 2. Check that the left-most non-blank symbol on the tape is a 0 and that the rightmost non-blank symbol is a 1. Reject if this is not the case, and otherwise erase these symbols and goto 1. There will, of course, be several specific ways to implement this algorithm with a DTM, with the DTM M from Figure 12.3 being one of them. Back to the Church Turing thesis The example of a DTM above was very simple, which makes it atypical. The DTMs we will be most interested in will almost always be much more complicated so complicated, in fact, that the idea of representing them by state diagrams would be absurd. The reality is that state diagrams turn out to be almost totally useless for describing DTMs, and so we will almost never refer to them; this would be quite similar to describing complex programs using machine code. The more typical way to describe DTMs will be in terms of algorithms, typically expressed in the form of pseudo-code or high-level descriptions like we did at the end of our first example above. As you build your understanding of how DTMs work and what they can do, you ll gain more confidence that these sorts of highlevel descriptions actually could be implemented by DTMs. It may take some time for you to convince yourself of this, but perhaps your experience as programmers will help you already know that very complex algorithms can be implemented through very primitive low-level instructions carried out by a computer, and the situation is similar for Turing machines. 10

11 This is connected to the idea that the Church Turing thesis suggests. If you can implement an algorithm using your favorite programming language, then with enough motivation and stamina you could also implement the same algorithm on a Turing machine. (Of course we are talking about algorithms that take an input string and produce an output, not interactive, multi-media applications or things like this.) We will continue discussing this idea in the next couple of lectures. 11

### 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

### 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

### 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

### Nondeterministic finite automata

Lecture 3 Nondeterministic finite automata This lecture is focused on the nondeterministic finite automata (NFA) model and its relationship to the DFA model. Nondeterminism is an important concept in the

### 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

### Turing Machines (TM) The Turing machine is the ultimate model of computation.

TURING MACHINES Turing Machines (TM) The Turing machine is the ultimate model of computation. Alan Turing (92 954), British mathematician/engineer and one of the most influential scientists of the last

### Undecidable Problems and Reducibility

University of Georgia Fall 2014 Reducibility We show a problem decidable/undecidable by reducing it to another problem. One type of reduction: mapping reduction. Definition Let A, B be languages over Σ.

### FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

15-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY Chomsky Normal Form and TURING MACHINES TUESDAY Feb 4 CHOMSKY NORMAL FORM A context-free grammar is in Chomsky normal form if every rule is of the form:

### 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

### 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.

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

CSCE 551: Theory of Computation Chin-Tser Huang huangct@cse.sc.edu University of South Carolina Church-Turing Thesis The definition of the algorithm came in the 1936 papers of Alonzo Church h and Alan

### Chomsky Normal Form and TURING MACHINES. TUESDAY Feb 4

Chomsky Normal Form and TURING MACHINES TUESDAY Feb 4 CHOMSKY NORMAL FORM A context-free grammar is in Chomsky normal form if every rule is of the form: A BC A a S ε B and C aren t start variables a is

### 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

### Turing Machines Part II

Turing Machines Part II Problem Set Set Five Five due due in in the the box box up up front front using using a late late day. day. Hello Hello Condensed Slide Slide Readers! Readers! This This lecture

### Variants of Turing Machine (intro)

CHAPTER 3 The Church-Turing Thesis Contents Turing Machines definitions, examples, Turing-recognizable and Turing-decidable languages Variants of Turing Machine Multi-tape Turing machines, non-deterministic

### Turing machines and linear bounded automata

and linear bounded automata Informatics 2A: Lecture 29 John Longley School of Informatics University of Edinburgh jrl@inf.ed.ac.uk 25 November, 2011 1 / 13 1 The Chomsky hierarchy: summary 2 3 4 2 / 13

### An example of a decidable language that is not a CFL Implementation-level description of a TM State diagram of TM

Turing Machines Review An example of a decidable language that is not a CFL Implementation-level description of a TM State diagram of TM Varieties of TMs Multi-Tape TMs Nondeterministic TMs String Enumerators

### Turing Machines Part Two

Turing Machines Part Two Recap from Last Time Our First Turing Machine q acc a start q 0 q 1 a This This is is the the Turing Turing machine s machine s finiteisttiteiconntont. finiteisttiteiconntont.

### Turing Machines Part II

Turing Machines Part II Hello Hello Condensed Slide Slide Readers! Readers! This This lecture lecture is is almost almost entirely entirely animations that that show show how how each each Turing Turing

### Computational Models - Lecture 6

Computational Models - Lecture 6 Turing Machines Alternative Models of Computers Multitape TMs, RAMs, Non Deterministic TMs The Church-Turing Thesis The language classes R = RE core David Hilbert s Tenth

### Turing Machines Part III

Turing Machines Part III Announcements Problem Set 6 due now. Problem Set 7 out, due Monday, March 4. Play around with Turing machines, their powers, and their limits. Some problems require Wednesday's

### 1 Deterministic Turing Machines

Time and Space Classes Exposition by William Gasarch 1 Deterministic Turing Machines Turing machines are a model of computation. It is believed that anything that can be computed can be computed by a Turing

### More About Turing Machines. Programming Tricks Restrictions Extensions Closure Properties

More About Turing Machines Programming Tricks Restrictions Extensions Closure Properties 1 Overview At first, the TM doesn t look very powerful. Can it really do anything a computer can? We ll discuss

### Decidability and Undecidability

Decidability and Undecidability Major Ideas from Last Time Every TM can be converted into a string representation of itself. The encoding of M is denoted M. The universal Turing machine U TM accepts an

### Lecture 3: Nondeterministic Finite Automata

Lecture 3: Nondeterministic Finite Automata September 5, 206 CS 00 Theory of Computation As a recap of last lecture, recall that a deterministic finite automaton (DFA) consists of (Q, Σ, δ, q 0, F ) where

### FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

15-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY REVIEW for MIDTERM 1 THURSDAY Feb 6 Midterm 1 will cover everything we have seen so far The PROBLEMS will be from Sipser, Chapters 1, 2, 3 It will be

### 7.1 The Origin of Computer Science

CS125 Lecture 7 Fall 2016 7.1 The Origin of Computer Science Alan Mathison Turing (1912 1954) turing.jpg 170!201 pixels On Computable Numbers, with an Application to the Entscheidungsproblem 1936 1936:

### Announcements. Problem Set 6 due next Monday, February 25, at 12:50PM. Midterm graded, will be returned at end of lecture.

Turing Machines Hello Hello Condensed Slide Slide Readers! Readers! This This lecture lecture is is almost almost entirely entirely animations that that show show how how each each Turing Turing machine

### Chapter 2: Finite Automata

Chapter 2: Finite Automata 2.1 States, State Diagrams, and Transitions Finite automaton is the simplest acceptor or recognizer for language specification. It is also the simplest model of a computer. A

### 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

### TAKE-HOME: OUT 02/21 NOON, DUE 02/25 NOON

CSE 555 MIDTERM EXAMINATION SOLUTIONS TAKE-HOME: OUT 02/21 NOON, DUE 02/25 NOON The completed test is to be submitted electronically to colbourn@asu.edu before the deadline, or time-stamped by the main

### Context-free grammars and languages

Context-free grammars and languages The next class of languages we will study in the course is the class of context-free languages. They are defined by the notion of a context-free grammar, or a CFG for

### 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

### Turing Machine Variants

CS311 Computational Structures Turing Machine Variants Lecture 12 Andrew Black Andrew Tolmach 1 The Church-Turing Thesis The problems that can be decided by an algorithm are exactly those that can be decided

### 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

### Theory of computation: initial remarks (Chapter 11)

Theory of computation: initial remarks (Chapter 11) For many purposes, computation is elegantly modeled with simple mathematical objects: Turing machines, finite automata, pushdown automata, and such.

### Computability Theory

Computability Theory Cristian S. Calude and Nicholas J. Hay May June 2009 Computability Theory 1 / 155 1 Register machines 2 Church-Turing thesis 3 Decidability 4 Reducibility 5 A definition of 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 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

### Computability Theory

Computability Theory Cristian S. Calude May 2012 Computability Theory 1 / 1 Bibliography M. Sipser. Introduction to the Theory of Computation, PWS 1997. (textbook) Computability Theory 2 / 1 Supplementary

### Theory of computation: initial remarks (Chapter 11)

Theory of computation: initial remarks (Chapter 11) For many purposes, computation is elegantly modeled with simple mathematical objects: Turing machines, finite automata, pushdown automata, and such.

### 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

### Lecture 13: Foundations of Math and Kolmogorov Complexity

6.045 Lecture 13: Foundations of Math and Kolmogorov Complexity 1 Self-Reference and the Recursion Theorem 2 Lemma: There is a computable function q : Σ* Σ* such that for every string w, q(w) is the description

### Uses of finite automata

Chapter 2 :Finite Automata 2.1 Finite Automata Automata are computational devices to solve language recognition problems. Language recognition problem is to determine whether a word belongs to a language.

### (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

### Lecture 17: Language Recognition

Lecture 17: Language Recognition Finite State Automata Deterministic and Non-Deterministic Finite Automata Regular Expressions Push-Down Automata Turing Machines Modeling Computation When attempting to

### Chapter 1 - Time and Space Complexity. deterministic and non-deterministic Turing machine time and space complexity classes P, NP, PSPACE, NPSPACE

Chapter 1 - Time and Space Complexity deterministic and non-deterministic Turing machine time and space complexity classes P, NP, PSPACE, NPSPACE 1 / 41 Deterministic Turing machines Definition 1.1 A (deterministic

### 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.

### Chapter 6: Turing Machines

Chapter 6: Turing Machines 6.1 The Turing Machine Definition A deterministic Turing machine (DTM) M is specified by a sextuple (Q, Σ, Γ, δ, s, f), where Q is a finite set of states; Σ is an alphabet of

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

UVa - cs302: Theory of Computation Spring 2008 Final Exam Comments < 50 50 59 60 69 70 79 80 89 90 94 95-102 Total 2 6 8 22 16 16 12 Problem 1: Short Answers. (20) For each question, provide a correct,

### Automata and Computability. Solutions to Exercises

Automata and Computability Solutions to Exercises Spring 27 Alexis Maciel Department of Computer Science Clarkson University Copyright c 27 Alexis Maciel ii Contents Preface vii Introduction 2 Finite Automata

### UNIT-VI PUSHDOWN AUTOMATA

Syllabus R09 Regulation UNIT-VI PUSHDOWN AUTOMATA The context free languages have a type of automaton that defined them. This automaton, called a pushdown automaton, is an extension of the nondeterministic

### DM17. Beregnelighed. Jacob Aae Mikkelsen

DM17 Beregnelighed Jacob Aae Mikkelsen January 12, 2007 CONTENTS Contents 1 Introduction 2 1.1 Operations with languages...................... 2 2 Finite Automata 3 2.1 Regular expressions/languages....................

### Homework 8. a b b a b a b. two-way, read/write

Homework 8 309 Homework 8 1. Describe a TM that accepts the set {a n n is a power of 2}. Your description should be at the level of the descriptions in Lecture 29 of the TM that accepts {ww w Σ } and the

### Introduction to the Theory of Computation. Automata 1VO + 1PS. Lecturer: Dr. Ana Sokolova.

Introduction to the Theory of Computation Automata 1VO + 1PS Lecturer: Dr. Ana Sokolova http://cs.uni-salzburg.at/~anas/ Setup and Dates Lectures and Instructions 23.10. 3.11. 17.11. 24.11. 1.12. 11.12.

### Turing machines and computable functions

Turing machines and computable functions In this chapter we address the question: how can we define the class of discrete functions that are computable? Probably, most of you are familiar with a few programming

### Clarifications from last time. This Lecture. Last Lecture. CMSC 330: Organization of Programming Languages. Finite Automata.

CMSC 330: Organization of Programming Languages Last Lecture Languages Sets of strings Operations on languages Finite Automata Regular expressions Constants Operators Precedence CMSC 330 2 Clarifications

### CS243, Logic and Computation Nondeterministic finite automata

CS243, Prof. Alvarez NONDETERMINISTIC FINITE AUTOMATA (NFA) Prof. Sergio A. Alvarez http://www.cs.bc.edu/ alvarez/ Maloney Hall, room 569 alvarez@cs.bc.edu Computer Science Department voice: (67) 552-4333

### Theory of Computation

Thomas Zeugmann Hokkaido University Laboratory for Algorithmics http://www-alg.ist.hokudai.ac.jp/ thomas/toc/ Lecture 3: Finite State Automata Motivation In the previous lecture we learned how to formalize

### CS 361 Meeting 26 11/10/17

CS 361 Meeting 26 11/10/17 1. Homework 8 due Announcements A Recognizable, but Undecidable Language 1. Last class, I presented a brief, somewhat inscrutable proof that the language A BT M = { M w M is

### 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

### Decidability. William Chan

Decidability William Chan Preface : In 1928, David Hilbert gave a challenge known as the Entscheidungsproblem, which is German for Decision Problem. Hilbert s problem asked for some purely mechanical procedure

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

Busch Complexity Lectures: Turing s Thesis Costas Busch - LSU 1 Turing s thesis (1930): Any computation carried out by mechanical means can be performed by a Turing Machine Costas Busch - LSU 2 Algorithm:

### 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

### 1 More finite deterministic automata

CS 125 Section #6 Finite automata October 18, 2016 1 More finite deterministic automata Exercise. Consider the following game with two players: Repeatedly flip a coin. On heads, player 1 gets a point.

### 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

### CS154, Lecture 10: Rice s Theorem, Oracle Machines

CS154, Lecture 10: Rice s Theorem, Oracle Machines Moral: Analyzing Programs is Really, Really Hard But can we more easily tell when some program analysis problem is undecidable? Problem 1 Undecidable

### Harvard CS 121 and CSCI E-207 Lecture 10: CFLs: PDAs, Closure Properties, and Non-CFLs

Harvard CS 121 and CSCI E-207 Lecture 10: CFLs: PDAs, Closure Properties, and Non-CFLs Harry Lewis October 8, 2013 Reading: Sipser, pp. 119-128. Pushdown Automata (review) Pushdown Automata = Finite automaton

### Deterministic Finite Automata. Non deterministic finite automata. Non-Deterministic Finite Automata (NFA) Non-Deterministic Finite Automata (NFA)

Deterministic Finite Automata Non deterministic finite automata Automata we ve been dealing with have been deterministic For every state and every alphabet symbol there is exactly one move that the machine

### ECS 120: Theory of Computation UC Davis Phillip Rogaway February 16, Midterm Exam

ECS 120: Theory of Computation Handout MT UC Davis Phillip Rogaway February 16, 2012 Midterm Exam Instructions: The exam has six pages, including this cover page, printed out two-sided (no more wasted

### Verifying whether One-Tape Turing Machines Run in Linear Time

Electronic Colloquium on Computational Complexity, Report No. 36 (2015) Verifying whether One-Tape Turing Machines Run in Linear Time David Gajser IMFM, Jadranska 19, 1000 Ljubljana, Slovenija david.gajser@fmf.uni-lj.si

### Lecture 23 : Nondeterministic Finite Automata DRAFT Connection between Regular Expressions and Finite Automata

CS/Math 24: Introduction to Discrete Mathematics 4/2/2 Lecture 23 : Nondeterministic Finite Automata Instructor: Dieter van Melkebeek Scribe: Dalibor Zelený DRAFT Last time we designed finite state automata

### cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska LECTURE 6 CHAPTER 2 FINITE AUTOMATA 2. Nondeterministic Finite Automata NFA 3. Finite Automata and Regular Expressions 4. Languages

### Introduction to the Theory of Computation. Automata 1VO + 1PS. Lecturer: Dr. Ana Sokolova.

Introduction to the Theory of Computation Automata 1VO + 1PS Lecturer: Dr. Ana Sokolova http://cs.uni-salzburg.at/~anas/ Setup and Dates Lectures Tuesday 10:45 pm - 12:15 pm Instructions Tuesday 12:30

### 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

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

Turing s thesis: (1930) Any computation carried out by mechanical means can be performed by a Turing Machine There is no known model of computation more powerful than Turing Machines Definition of Algorithm:

### 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

### Lecture 23: Rice Theorem and Turing machine behavior properties 21 April 2009

CS 373: Theory of Computation Sariel Har-Peled and Madhusudan Parthasarathy Lecture 23: Rice Theorem and Turing machine behavior properties 21 April 2009 This lecture covers Rice s theorem, as well as

### CSE 211. Pushdown Automata. CSE 211 (Theory of Computation) Atif Hasan Rahman

CSE 211 Pushdown Automata CSE 211 (Theory of Computation) Atif Hasan Rahman Lecturer Department of Computer Science and Engineering Bangladesh University of Engineering & Technology Adapted from slides

### Languages. Non deterministic finite automata with ε transitions. First there was the DFA. Finite Automata. Non-Deterministic Finite Automata (NFA)

Languages Non deterministic finite automata with ε transitions Recall What is a language? What is a class of languages? Finite Automata Consists of A set of states (Q) A start state (q o ) A set of accepting

### 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

### Theory of Computation

Theory of Computation Lecture #10 Sarmad Abbasi Virtual University Sarmad Abbasi (Virtual University) Theory of Computation 1 / 43 Lecture 10: Overview Linear Bounded Automata Acceptance Problem for LBAs

### COMP-330 Theory of Computation. Fall Prof. Claude Crépeau. Lecture 1 : Introduction

COMP-330 Theory of Computation Fall 2017 -- Prof. Claude Crépeau Lecture 1 : Introduction COMP 330 Fall 2017: Lectures Schedule 1-2. Introduction 1.5. Some basic mathematics 2-3. Deterministic finite automata

### 10. Finite Automata and Turing Machines

. Finite Automata and Turing Machines Frank Stephan March 2, 24 Introduction Alan Turing s th Birthday Alan Turing was a completely original thinker who shaped the modern world, but many people have never

### How to Pop a Deep PDA Matters

How to Pop a Deep PDA Matters Peter Leupold Department of Mathematics, Faculty of Science Kyoto Sangyo University Kyoto 603-8555, Japan email:leupold@cc.kyoto-su.ac.jp Abstract Deep PDA are push-down automata

### Accept or reject. Stack

Pushdown Automata CS351 Just as a DFA was equivalent to a regular expression, we have a similar analogy for the context-free grammar. A pushdown automata (PDA) is equivalent in power to contextfree grammars.

### 17.1 The Halting Problem

CS125 Lecture 17 Fall 2016 17.1 The Halting Problem Consider the HALTING PROBLEM (HALT TM ): Given a TM M and w, does M halt on input w? Theorem 17.1 HALT TM is undecidable. Suppose HALT TM = { M,w : M

### Introduction to Computability

Chapter 2 Introduction to Computability This subject is primarily concerned with the limitations of computing. As one of the highlights of this study, we will learn several specific problems that computers

### State Machines. Example FSM: Roboant

page 1 State Machines 1) State Machine Design 2) How can we improve on FSMs? 3) Turing Machines 4) Computability Oh genie, will you now tell me what it means to compute? Doctor, I think you ve built a

### KOLMOGOROV COMPLEXITY AND ALGORITHMIC RANDOMNESS

KOLMOGOROV COMPLEXITY AND ALGORITHMIC RANDOMNESS HENRY STEINITZ Abstract. This paper aims to provide a minimal introduction to algorithmic randomness. In particular, we cover the equivalent 1-randomness

17 Advanced Undecidability Proofs In this chapter, we will discuss Rice s Theorem in Section 17.1, and the computational history method in Section 17.3. As discussed in Chapter 16, these are two additional

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

The Turing Machine Computability Motivating idea Build a theoretical a human computer Likened to a human with a paper and pencil that can solve problems in an algorithmic way The theoretical provides a

### 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,,

### Theory of Computation

Theory of Computation (Feodor F. Dragan) Department of Computer Science Kent State University Spring, 2018 Theory of Computation, Feodor F. Dragan, Kent State University 1 Before we go into details, what

### Lecture 14: Recursive Languages

Lecture 14: Recursive Languages Instructor: Ketan Mulmuley Scriber: Yuan Li February 24, 2015 1 Recursive Languages Definition 1.1. A language L Σ is called recursively enumerable (r. e.) or computably

### CSC173 Workshop: 13 Sept. Notes

CSC173 Workshop: 13 Sept. Notes Frank Ferraro Department of Computer Science University of Rochester September 14, 2010 1 Regular Languages and Equivalent Forms A language can be thought of a set L of

### Automata and Computability

Automata and Computability Fall 207 Alexis Maciel Department of Computer Science Clarkson University Copyright c 207 Alexis Maciel ii Contents Preface vii Introduction 2 Finite Automata 5 2. Turing Machines...............................

### 16.1 Countability. CS125 Lecture 16 Fall 2014

CS125 Lecture 16 Fall 2014 16.1 Countability Proving the non-existence of algorithms for computational problems can be very difficult. Indeed, we do not know how to prove P NP. So a natural question is

### P systems based on tag operations

Computer Science Journal of Moldova, vol.20, no.3(60), 2012 P systems based on tag operations Yurii Rogozhin Sergey Verlan Abstract In this article we introduce P systems using Post s tag operation on