CSE 105 THEORY OF COMPUTATION

Similar documents
CSE 105 THEORY OF COMPUTATION

Chapter 3: The Church-Turing Thesis

CSCC63 Worksheet Turing Machines

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

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

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION

Turing Machines A Turing Machine is a 7-tuple, (Q, Σ, Γ, δ, q0, qaccept, qreject), where Q, Σ, Γ are all finite

CS21 Decidability and Tractability

1 Showing Recognizability

CSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY

The Church-Turing Thesis

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

CSE 105 THEORY OF COMPUTATION

CSE 2001: Introduction to Theory of Computation Fall Suprakash Datta

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

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

CS4026 Formal Models of Computation

Computability Theory. CS215, Lecture 6,

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

Lecture 12: Mapping Reductions

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

Turing Machines Part III

1 Unrestricted Computation

Decidability and Undecidability

CSE 105 THEORY OF COMPUTATION

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

CSE 105 THEORY OF COMPUTATION

CS 301. Lecture 18 Decidable languages. Stephen Checkoway. April 2, 2018

CSE 105 THEORY OF COMPUTATION. Spring 2018 review class

Recap DFA,NFA, DTM. Slides by Prof. Debasis Mitra, FIT.

CSE 105 THEORY OF COMPUTATION

CS154, Lecture 10: Rice s Theorem, Oracle Machines

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

CS20a: Turing Machines (Oct 29, 2002)

Most General computer?

6.045J/18.400J: Automata, Computability and Complexity. Quiz 2. March 30, Please write your name in the upper corner of each page.

Computability and Complexity

Part I: Definitions and Properties

CSE 105 THEORY OF COMPUTATION

CSE 105 Theory of Computation

Introduction to Turing Machines. Reading: Chapters 8 & 9

CS 525 Proof of Theorems 3.13 and 3.15

Mapping Reducibility. Human-aware Robotics. 2017/11/16 Chapter 5.3 in Sipser Ø Announcement:

V Honors Theory of Computation

CSE 105 THEORY OF COMPUTATION

Further discussion of Turing machines

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

CSE 105 Theory of Computation

CS20a: Turing Machines (Oct 29, 2002)

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

Exam Computability and Complexity

Decidable Languages - relationship with other classes.

Foundations of

Introduction to Turing Machines

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

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

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

Computation Histories

Busch Complexity Lectures: Turing Machines. Prof. Busch - LSU 1

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

Lecture 13: Turing Machine

Lecture 14: Recursive Languages

Theory of Computation

Turing Machines. Our most powerful model of a computer is the Turing Machine. This is an FA with an infinite tape for storage.

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

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION

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

Fundamentals of Computer Science

Complexity Theory Part I

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

TURING MAHINES

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

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

Turing Machines. Fall The Chinese University of Hong Kong. CSCI 3130: Formal languages and automata theory

ECS 120 Lesson 15 Turing Machines, Pt. 1

CSE 460: Computabilty and Formal Languages Turing Machine (TM) S. Pramanik

Automata & languages. A primer on the Theory of Computation. Laurent Vanbever. ETH Zürich (D-ITET) October,

CSCI3390-Assignment 2 Solutions

CS5371 Theory of Computation. Lecture 15: Computability VI (Post s Problem, Reducibility)

Computability Theory

SCHEME FOR INTERNAL ASSESSMENT TEST 3

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

CpSc 421 Homework 9 Solution

Turing Machines. Lecture 8

Variants of Turing Machine (intro)

Intro to Theory of Computation

Theory of Computation (IX) Yijia Chen Fudan University

A Note on Turing Machine Design

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

Pumping Lemma for CFLs

Theory of Computation - Module 4

CSE 105 THEORY OF COMPUTATION

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

CS5371 Theory of Computation. Lecture 12: Computability III (Decidable Languages relating to DFA, NFA, and CFG)

Reducability. Sipser, pages

CSE 105 THEORY OF COMPUTATION

CPSC 421: Tutorial #1

Transcription:

CSE 105 THEORY OF COMPUTATION Fall 2016 http://cseweb.ucsd.edu/classes/fa16/cse105-abc/

Today's learning goals Sipser Ch 3 Trace the computation of a Turing machine using its transition function and configurations. Recognize when a Turing machine is a decider. Describe several variants of Turing machines and informally explain why they are equally expressive. Give high-level description for TMs (recognizers and enumerators) used in constructions Prove properties of the classes of recognizable and decidable sets. State and use the Church-Turing thesis.

Turing decidable languages Context-free languages Regular languages

Formal definition of TM q reject q accept

Configurations of a TM Current state Current tape contents Current location of read/write head Start configuration on w: q 0 w Accepting configuration: u q acc v Rejecting configuration: u q rej v current state is q u q v current tape contents are uv (and then all blanks) current head location is first symbol of v Halting configuration: any configuration that is either rejecting or halting.

Transitioning between configurations q 0 w w is input, read/write head over the leftmost symbol of w u q v u' q' v' q' = δ(q, v 1 ) How does uv compare to u'v'?

Language of a TM Sipser p. 144 L(M) = { w M accepts w} = { w there is a sequence of configurations of M where C 1 is start configuration of M on input w, each C i yields C i+1 and C k is accepting configuration} "The language of M" "The language recognized by M"

Deciders and recognizers Sipser p. 144 Defs 3.5 and 3.6 L is Turing-recognizable if some Turing machine recognizes it. M is a decider TM if it halts on all inputs. L is Turing-decidable if some Turing machine that is a decider recognizes it.

An example L = { w#w w is in {0,1} * } We already know that L is not regular not context-free We will prove that L is Turing-decidable and therefore also Turing-recognizable

An example L = { w#w w is in {0,1} * } Idea for Turing machine Zig-zag across tape to corresponding positions on either side of '#' to check whether these positions agree. If they do not, or if there is no '#', reject. If they do, cross them off. Once all symbols to the left of the '#' are crossed off, check for any symbols to the right of '#': if there are any, reject; if there aren't, accept.

Is this machine a decider? An example A. Yes, because it reads the input string exactly once. B. Yes, because it will halt (and either accept or reject) no matter L = what { w#w the input w is in is. {0,1} * } C. No, because it sometimes rejects the input string. D. No, because it will go in an infinite loop if there's no '#'. Idea for Turing E. machine I don't know. Zig-zag across tape to corresponding positions on either side of '#' to check whether these positions agree. If they do not, or if there is no '#', reject. If they do, cross them off. Once all symbols to the left of the '#' are crossed off, check for any symbols to the right of '#': if there are any, reject; if there aren't, accept.

Idea for Turing machine Zig-zag across tape to corresponding positions on either side of '#' to check whether these positions agree. If they do not, or if there is no '#', reject. If they do, cross them off. Once all symbols to the left of the '#' are crossed off, check for any symbols to the right of '#': if there are any, reject; if there aren't, accept. 0?,? q 1 1?,? #?,??,?

Q = Σ = Γ = *Some transitions omitted for readability* Fig 3.10 in Sipser

Describing TMs Sipser p. 159 Formal definition: set of states, input alphabet, tape alphabet, transition function, state state, accept state, reject state. Implementation-level definition: English prose to describe Turing machine head movements relative to contents of tape. High-level desciption: Description of algorithm, without implementation details of machine. As part of this description, can "call" and run another TM as a subroutine.

Deciding vs. recognizing "If the input string is finite, then at some point, the TM has to be able to finish reading it. Therefore, infinite looping can only happen when the input takes up the whole TM tape (which is infinitely long)." A. True B. False C. I don't know.

An example Which of the following is an implementation-level description of a TM which decides the empty set? M = "On input w: A. reject." B. sweep left across the tape until find a non-blank symbol. Then, reject." C. sweep right across the tape until find a non-blank symbol. Then, reject." D. If the first tape symbol is blank, accept. Otherwise, reject." E. I don't know.

Closure Theorem: The class of decidable languages over fixed alphabet Σ is closed under union. Proof: Let WTS

Closure Theorem: The class of decidable languages over fixed alphabet Σ is closed under union. Proof: Let L 1 and L 2 be languages and suppose M 1 and M 2 are TMs deciding these languages. We will define a new TM, M, via a high-level description. We will then show that L(M) = L 1 U L 2

Closure Theorem: The class of decidable languages over fixed alphabet Σ is closed under union. Proof: Let L 1 and L 2 be languages and suppose M 1 and M 2 are TMs deciding these languages. Construct the TM M as "On input w, 1. Run M 1 on input w. If M 1 accepts w, accept. Otherwise, go to 2. 2. Run M 2 on input w. If M 2 accepts w, accept. Otherwise, reject." Proof of correctness soon, but first

Could the same construction give us a proof that the class of Closure recognizable languages is closed under union? A. Yes, just replace M 1 and M 2 by TMs (instead of deciders) Theorem: B. The Yes, class but need of decidable to consider languages the case of over M 1, Mfixed 2 rejecting w. alphabet C. Σ No, is closed but a different under union. construction will work. D. No, the class of recognizable languages is not closed under U. E. I don't know. Proof: Let L 1 and L 2 be languages and suppose M 1 and M 2 are TMs deciding these languages. Construct the TM M as "On input w, 1. Run M 1 on input w. If M 1 accepts w, accept. Otherwise, go to 2. 2. Run M 2 on input w. If M 2 accepts w, accept. Otherwise, reject."

Closure Theorem: The class of decidable languages over fixed alphabet Σ is closed under union. Proof: Let L 1 and L 2 be languages and suppose M 1 and M 2 are TMs deciding these languages. Construct the TM M as "On input w, 1. Run M 1 on input w. If M 1 accepts w, accept. Otherwise, go to 2. 2. Run M 2 on input w. If M 2 accepts w, accept. Otherwise, reject." Correctness of construction: WTS L(M) = L 1 U L 2 and M is a decider.

Variants of TMs Scratch work, copy input, Multiple tapes Parallel computation Nondeterminism Printing vs. accepting Enumerators More flexible transition function Can "stay put" Can "get stuck" lots of examples in exercises to Chapter 3