Turing Machines: An Introduction

Similar documents
3515ICT Theory of Computation Turing Machines

CS 3719 (Theory of Computation and Algorithms) Lecture 4

CS154. Turing Machines. Turing Machine. Turing Machines versus DFAs FINITE STATE CONTROL AI N P U T INFINITE TAPE. read write move.

Computability Theory

Introduction to Turing Machines

Pushdown Automata. place the input head on the leftmost input symbol. while symbol read = b and pile contains discs advance head remove disc from pile

Automata and Computability. Solutions to Exercises

Notes on Complexity Theory Last updated: August, Lecture 1

Computational Models Lecture 8, Spring 2009

CAs and Turing Machines. The Basis for Universal Computation

Turing Machines, Part I

Chapter 7 Uncomputability

(IALC, Chapters 8 and 9) Introduction to Turing s life, Turing machines, universal machines, unsolvable problems.

Pushdown automata. Informatics 2A: Lecture 9. Alex Simpson. 3 October, School of Informatics University of Edinburgh als@inf.ed.ac.

Formal Languages and Automata Theory - Regular Expressions and Finite Automata -

24 Uses of Turing Machines

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

6.080 / Great Ideas in Theoretical Computer Science Spring 2008

1 Definition of a Turing machine

Introduction to Automata Theory. Reading: Chapter 1

The Halting Problem is Undecidable

CS 301 Course Information

CSE 135: Introduction to Theory of Computation Decidability and Recognizability

Honors Class (Foundations of) Informatics. Tom Verhoeff. Department of Mathematics & Computer Science Software Engineering & Technology

THE TURING DEGREES AND THEIR LACK OF LINEAR ORDER

The Classes P and NP

Deterministic Finite Automata

Theory of Computation Chapter 2: Turing Machines

NP-Completeness and Cook s Theorem

Regular Languages and Finite State Machines

Reading 13 : Finite State Automata and Regular Expressions

Implementation of Recursively Enumerable Languages using Universal Turing Machine in JFLAP

Lecture 2: Universality

Regular Languages and Finite Automata

Properties of Stabilizing Computations

Universal Turing Machine: A Model for all Computational Problems

Universality in the theory of algorithms and computer science

Finite Automata and Formal Languages

Model 2.4 Faculty member + student

Automata and Formal Languages

Oracle Turing machines faced with the verification problem

Regular Expressions and Automata using Haskell

The P versus NP Solution

Outline 2. 1 Turing Machines. 2 Coding and Universality. 3 The Busy Beaver Problem. 4 Wolfram Prize. 5 Church-Turing Thesis.

CS5236 Advanced Automata Theory

How To Understand The Theory Of Computer Science

CSC4510 AUTOMATA 2.1 Finite Automata: Examples and D efinitions Definitions

Course Manual Automata & Complexity 2015

Lecture 36: Turing Machines [Fa 14]

1. Nondeterministically guess a solution (called a certificate) 2. Check whether the solution solves the problem (called verification)

Complexity Classes P and NP

4.6 The Primitive Recursive Functions

Computer Science Theory. From the course description:

Genetic programming with regular expressions

6.080/6.089 GITCS Feb 12, Lecture 3

Hilberts Entscheidungsproblem, the 10th Problem and Turing Machines

Turing Machines and Understanding Computational Complexity

Models of Sequential Computation

Super Turing-Machines

Increasing Interaction and Support in the Formal Languages and Automata Theory Course

Complexity of Algorithms

Overview of E0222: Automata and Computability

Finite Automata and Regular Languages

The Optimum One-Pass Strategy for Juliet

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 2

Finite Automata. Reading: Chapter 2

Math 4310 Handout - Quotient Vector Spaces

Finite Automata. Reading: Chapter 2

How To Compare A Markov Algorithm To A Turing Machine

C H A P T E R Regular Expressions regular expression

Formal Grammars and Languages

Continued Fractions and the Euclidean Algorithm

Hypercomputation: computing more than the Turing machine

SRM UNIVERSITY FACULTY OF ENGINEERING & TECHNOLOGY SCHOOL OF COMPUTING DEPARTMENT OF SOFTWARE ENGINEERING COURSE PLAN

Remarks on the computational complexity of small universal Turing machines

Basic numerical skills: EQUATIONS AND HOW TO SOLVE THEM. x + 5 = = (2-2) = = 5. x = 7-5. x + 0 = 20.

Turing Oracle Machines, Online Computing, and Three Displacements in Computability Theory

Handout #1: Mathematical Reasoning

CMPSCI 250: Introduction to Computation. Lecture #19: Regular Expressions and Their Languages David Mix Barrington 11 April 2013

Informatique Fondamentale IMA S8

COMPUTER SCIENCE STUDENTS NEED ADEQUATE MATHEMATICAL BACKGROUND

Automata on Infinite Words and Trees

Two-dimensional Languages

Simulation-Based Security with Inexhaustible Interactive Turing Machines

THEORY of COMPUTATION

Reliably computing cellular automaton, in 1-sparse noise

Wang s B machines are efficiently universal, as is Hasenjaeger s small universal electromechanical toy

Lecture I FINITE AUTOMATA

The Prime Numbers. Definition. A prime number is a positive integer with exactly two positive divisors.

Testing LTL Formula Translation into Büchi Automata

CHAPTER 7 GENERAL PROOF SYSTEMS

Diagonalization. Ahto Buldas. Lecture 3 of Complexity Theory October 8, Slides based on S.Aurora, B.Barak. Complexity Theory: A Modern Approach.

Regular Expressions with Nested Levels of Back Referencing Form a Hierarchy

How To Understand The Relation Between Simplicity And Probability In Computer Science

A brief introduction to the theory of computation

Introduction to Theory of Computation

Computation Beyond Turing Machines

Today s Agenda. Automata and Logic. Quiz 4 Temporal Logic. Introduction Buchi Automata Linear Time Logic Summary

CS 103X: Discrete Structures Homework Assignment 3 Solutions

THE SEARCH FOR NATURAL DEFINABILITY IN THE TURING DEGREES

Transcription:

CIT 596 Theory of Computation 1 We have seen several abstract models of computing devices: Deterministic Finite Automata, Nondeterministic Finite Automata, Nondeterministic Finite Automata with ɛ-transitions, Pushdown Automata, and Deterministic Pushdown Automata. However, none of the above seem to be as powerful as a real computer, right? We now turn our attention to a much more powerful abstract model of a computing device: a Turing machine. This model is believed to do everything that a real computer can do.

CIT 596 Theory of Computation 2 A Turing machine is somewhat similar to a finite automaton, but there are important differences: 1. A Turing machine can both write on the tape and read from it. 2. The read-write head can move both to the left and to the right. 3. The tape is infinite. 4. The special states for rejecting and accepting take immediate effect.

CIT 596 Theory of Computation 3 Formally, a Turing machine is a 7-tuple, (Q,Σ,Γ, δ, q 0, q accept, q reject ), where Q is the (finite) set of states, Σ is the input alphabet such that Σ does not contain the special blank symbol, Γ is the tape alphabet such that Γ and Σ Γ, δ : Q Γ Q Γ {L, R} is the transition function, q 0 Q is the start state, q accept Q is the accept state, and q reject Q is the reject state, where q accept q reject. The heart of a Turing machine is its transition function δ, as it tells us how the machine gets from one configuration to another. A Turing machine configuration is entirely described by its current state, the current tape contents, and the current head location.

CIT 596 Theory of Computation 4 For a state q and two strings u and v over the tape alphabet Γ, we write u q v for the configuration where the current state is q, the current tape contents is uv, and the current head location is the first symbol of v. For instance, 1011 q 7 0111 represents the configuration when the tape is 10110111, the current state is q 7, and the head is currently on the second 0 of 10110111 from left to right. We say that configuration C 1 yields configuration C 2 if the Turing machine can legally go from C 1 to C 2 is a single step. This notion can be formalized via the transition function.

CIT 596 Theory of Computation 5 Let a, b, and c be symbols of Γ, let u and v be strings over Γ, and let q i and q j be any two states (not necessarily distinct) in Q. Then, we say that ua q i bv yields u q j acv if in the transition function δ(q i, b) = (q j, c, L). That handles the case where the Turing machine moves leftward. For a rightward move, we say that ua q i bv yields uac q j v if in the transition function δ(q i, b) = (q j, c, R).

CIT 596 Theory of Computation 6 A special case occurs when the head is at the left-hand end of the configuration. For the left-hand end, the configuration q i bv yields q j cv if the transition is left moving (i.e., the head does not move past the left-hand end), and it yields c q j v for the right moving transition. For the right-hand end, the configuration ua q i is equivalent to ua q i, as we assume that blanks follow the part of the tape represented in the configuration. The start configuration of a Turing machine on input w is the configuration q 0 w, which indicates that the machine is in the start state q 0 with its head at the leftmost position on the tape.

CIT 596 Theory of Computation 7 An accepting configuration is a configuration in which the state is the accept state. A rejecting configuration is a configuration in which the state is the reject state. Accepting and rejecting configurations are halting configurations and accordingly do not yield further configurations. A Turing machine M accepts input w if a sequence C 1, C 2,..., C k of configurations exists such that C 1 is the start configuration of M, C i yields C i+1, for all 1 i k 1, and C k is an accepting configuration. The set of strings that M accepts is the language of M, denoted L(M).

CIT 596 Theory of Computation 8 Let us use the blackboard to design a Turing machine that accepts the language L = {wcw w {0,1} }. Informally, our machine accepts L by executing the following algorithm: (1) Scan the tape from left to right to make sure the input string has exactly one symbol c. (2) Zig-zag across the tape to corresponding positions on either side of c to check on whether these positions contain the same symbol. If they do not, reject. Cross off symbols as they are checked to keep track of which symbols correspond. (3) When all symbols to the left of c have been crossed off, check for any remaining symbols to the right of c. If any symbols remain, reject; otherwise accept.

CIT 596 Theory of Computation 9 Our Turing machine has 16 states, one of which is the accept state and another one is the reject state. The input alphabet is Σ = {0,1, c}. The tape alphabet is Γ = {0,1, c, X, }. We write the symbol X on the tape to represent the action of crossing off an input symbol. Let us use the black board to draw a diagram for our Turing machine.

CIT 596 Theory of Computation 10 We say that a language is recursively enumerable if it is accepted by some Turing machine. For instance, the language L = {wcw w {0,1} } is recursively enumerable. When a Turing machine starts, there are three possible outcomes: The machine may accept, reject, or loop. By loop, we mean that the machine simply does not halt. A Turing machine can fail to accept an input string by entering the q reject state and rejecting, or by looping. Sometimes, distinguishing a machine that is looping from one that is merely taking a long time is difficult. For this reason, we prefer Turing machines that always halts, i.e., never loops.

CIT 596 Theory of Computation 11 Turing machines that halts on all input strings are called deciders, as they always make a decision to accept or reject. A decider that recognizes some language is said to decide that language. We say that a language is recursive if there exists a Turing machine to decide the language. For instance, the language L = {wcw w {0,1} } is recursive. Note that every recursive language is also recursively enumerable, but a recursively enumerable language is not necessarily a recursive language.

CIT 596 Theory of Computation 12 The following languages are all recursive languages (go ahead and try to design deciders for them): {a n n is a perfect square} {ww w {0,1} } {a n n is a power of 2} {x {a, b, c} x a = x b = x c }

CIT 596 Theory of Computation 13 Recall that all the languages in the previous slides are not context-free languages. You can use the contrapositive of the Pumping Lemma to show this fact. Actually, we have the following: Every regular language is a context-free language, but a context-free language may not be regular. Every context-free language is a recursive language, but a recursive language may not be context-free. Every recursive language is a recursively enumerable language, but a recursively enumerable language may not be recursive.

CIT 596 Theory of Computation 14 In 1900, mathematician David Hilbert enumerated 23 mathematical problems he considered challenges for the coming century. The tenth problem is his list concerned algorithms: Given a polynomial, find an algorithm for determining whether the polynomial has an integral root. In the way Hilbert phrased the above problem, he explicitly asked that an algorithm be devised. As we now know, no algorithm exists for this task if the polynomial is defined on several variables. That is, the above problem is algorithmically unsolvable. However, mathematicians of that period could not come to this conclusion with their intuitive notion of algorithm. Why?

CIT 596 Theory of Computation 15 Although our intuitive notion of an algorithm is enough to devise solutions for certain problems (the ones a computer can solve), it is useless for showing that no algorithm exists for a particular task, as our intuitive notion is not a formal one. So, proving that an algorithm does not exist required having a clear definition of algorithm. Such a definition was simultaneously given in 1936 by Alonzo Church and Alan Turing. Church used a notational system called the λ-calculus to precisely define algorithms. Turing did it with his machines.

CIT 596 Theory of Computation 16 This connection between the informal notion of algorithm and the precise definition is known as the the Church-Turing thesis. More precisely, Turing proposed to adopt the Turing machine that halts on all inputs as the precise formal notion corresponding to our intuitive notion of an algorithm. Note that the Church-Turing thesis is not a theorem, but a thesis, as it asserts that a certain informal concept (algorithm) corresponds to a certain mathematical object (Turing machine). Not being a mathematical statement, the Church-Turing thesis cannot be proved! What are the implications of this fact? Well, it is in principle possible that the Church-Turing thesis can be disproved.

CIT 596 Theory of Computation 17 To disprove the Church-Turing thesis, it suffices to come up with an alternative model of computation that is provably capable of carrying out computations that cannot be carried out by any Turing machine. It turns out that no one believes this is likely. Having said that, let us assume that the Church-Turing thesis holds. We are not the only ones, I guarantee! Adopting such a precise notion of an algorithm enables us to formally prove that certain problems cannot be solved by any algorithm. Such problems are said to be undecidable or unsolvable. The tenth problem proposed by Hilbert was shown to be undecidable by Yuri Matijasevič in 1970.

CIT 596 Theory of Computation 18 To be more precise and consistent with our introductory lecture, let D be the language D = {p p is a polynomial in several variables with an integral root}. Here, we view D as the language consisting of all polynomials in several variables with an integral root. So, the decision problem of determining whether a given polynomial p with several variables has an integral root (a decision problem) is equivalent to the problem of determining whether p belongs to D. Matijasevič showed that there is no decider for D. That is, the language D is not a recursive language. In constrast, we can show that D is recursively enumerable. That is, we can devise a Turing machine M that accepts D, but M may never halt on an input p that does not belong to D.

CIT 596 Theory of Computation 19 Since Turing machines can only deal with decision problems, you may find very strange the fact that a Turing machine is a formal counterpart of our intuitive notion of an algorithm, as many computational problems are not decision problems. Well, keep in mind that every computational problem is either equivalent to a decision problem or is at least as hard as some decision problem. So, the restriction to decision problems is not a problem. Besides helping us understand what we can or cannot do with computers, Turing machines can also be used to formally define the complexity of an algorithm. You can find much more about computatbility and complexity theory in graduate courses at CIS (see CIS 511 and CIS 502).