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

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

The Church-Turing Thesis

Chapter 3: The Church-Turing Thesis

CS4026 Formal Models of Computation

CSE 105 THEORY OF COMPUTATION

CSCC63 Worksheet Turing Machines

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

CS21 Decidability and Tractability

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

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

Computability Theory. CS215, Lecture 6,

CSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY

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

1 Unrestricted Computation

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

Turing Machines Part II

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

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

Further discussion of Turing machines

1 Showing Recognizability

Foundations of

ECS 120 Lesson 15 Turing Machines, Pt. 1

Part I: Definitions and Properties

Homework Assignment 6 Answers

The Turing machine model of computation

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

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

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

TURING MAHINES

Lecture 14: Recursive Languages

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

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

CS154, Lecture 10: Rice s Theorem, Oracle Machines

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

CSE 105 THEORY OF COMPUTATION

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

Most General computer?

Lecture 12: Mapping Reductions

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

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

Chomsky Normal Form and TURING MACHINES. TUESDAY Feb 4

What languages are Turing-decidable? What languages are not Turing-decidable? Is there a language that isn t even Turingrecognizable?

CSCI3390-Assignment 2 Solutions

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

Introduction to Turing Machines. Reading: Chapters 8 & 9

Turing Machines Part III

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

Automata Theory CS S-12 Turing Machine Modifications

V Honors Theory of Computation

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

Introduction to Turing Machines

Variants of Turing Machine (intro)

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

CSE 105 THEORY OF COMPUTATION

Theory of Computation (IX) Yijia Chen Fudan University

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

CSE 2001: Introduction to Theory of Computation Fall Suprakash Datta

CS20a: Turing Machines (Oct 29, 2002)

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

CS5371 Theory of Computation. Lecture 14: Computability V (Prove by Reduction)

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

Turing Machines. Lecture 8

Computability and Complexity

Turing Machines. Chapter 17

Reducability. Sipser, pages

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

Equivalent Variations of Turing Machines

CSCI 2200 Foundations of Computer Science Spring 2018 Quiz 3 (May 2, 2018) SOLUTIONS

Pumping Lemma for CFLs

CSE 105 THEORY OF COMPUTATION

} Some languages are Turing-decidable A Turing Machine will halt on all inputs (either accepting or rejecting). No infinite loops.

Decidability and Undecidability

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

Computational Models - Lecture 6

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

Computation Histories

Decidability (What, stuff is unsolvable?)

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

Chapter 8. Turing Machine (TMs)

Turing Machine Variants

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

CSE 105 THEORY OF COMPUTATION

Before We Start. Turing Machines. Languages. Now our picture looks like. Theory Hall of Fame. The Turing Machine. Any questions? The $64,000 Question

Decidability. Human-aware Robotics. 2017/10/31 Chapter 4.1 in Sipser Ø Announcement:

Turing s Thesis. Fall Costas Busch - RPI!1

Computability Theory

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

Theory of Computation Turing Machine and Pushdown Automata

CS20a: Turing Machines (Oct 29, 2002)

CPSC 421: Tutorial #1

jflap demo Regular expressions Pumping lemma Turing Machines Sections 12.4 and 12.5 in the text

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

Undecidable Problems and Reducibility

Non-emptiness Testing for TMs

Decidable and undecidable languages

SCHEME FOR INTERNAL ASSESSMENT TEST 3

Turing machines and linear bounded automata

The Power of One-State Turing Machines

Midterm II : Formal Languages, Automata, and Computability

Transcription:

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 computing device than the DFA or PDA

What is a TM? control = blank symbols a b a b Control is similar to (but not the same as) DFA It has an infinite tape as memory A tape head can read and write symbols and move around the tape Initially, tape contains input string (on the leftmost end) and is blank everywhere

What is a TM? (2) Finite number of states: one for immediate accept, one for immediate reject, and others for continue Based on the current state and the tape symbol under the tape head, TM then decides the tape symbol to write on the tape, goes to the next state, and moves the tape head left or right When TM enters accept state, it accepts the input immediately; when TM enters reject state, it rejects the input immediately If it does not enter the accept or reject states, TM will run forever, and never halt

TM versus DFA Similarities: Finite set of states Differences: TM has an infinite tape and TM can both read and write on the tape Tape head can move both left and right Input string of TM is stored in tape The accept or reject states in TM take effect immediately

TM in Action Let us introduce a TM that recognizes the language B = { ww w is in {,}* } We want the TM to accept if the input is in B, and to reject otherwise What should the TM do?

TM in Action (2) Use multiple passes Starts matching corresponding chars, one on each side of To keep track of which chars are checked already, TM crosses off each char as it is examined

Snapshots of Execution () Tape head moves to right

Snapshots of Execution (2) Tape head moves to left

Snapshots of Execution (3) Tape head moves to right

Snapshots of Execution (4) Tape head moves to left

Snapshots of Execution (5) Tape head moves to right

Snapshots of Execution (6) Tape head moves to left

Snapshots of Execution (7) accept Tape head moves to right

TM (Formal Definition) A TM is a 7-tuple (Q,,,, q, q Acc, q Rej ) Q = finite set of states = finite input alphabet, where blank symbol = finite tape alphabet, where and is the transition function of the form: : Q x Q x x { L, R }, where L, R indicates whether the tape head moves left or right after the transition q is the start state q Acc = accept state, q Rej = reject state

Computation of TM Let M = (Q,,,, q, q Acc, q Rej ) be a TM First, M receives input w = w w 2 w n * on the leftmost n squares of the tape Rest of tape is blank (i.e., filled with s) Note: as, the first blank on the tape marks the end of input Once M has started, the computation proceeds according to the transition function

Computation of TM (2) (important) If M tries to move its head to the left of the leftmost end of tape, the head simply stays for that move The computation continues until M enters accept state or reject state. Otherwise, M goes on forever

Configuration of TM The configuration of a TM specifies the current state, and the current string in the tape, and the current location of the tape head When the configuration of a TM is: current state = q, current string w = uv with tape head over the first symbol of v, we write: u q v as a shorthand notation E.g., q 7 represents the configuration of TM when tape is, current state is q 7, and the tape head is over the 3 rd in the tape

Configuration of TM (2) We say a configuration C yields another configuration C if the machine can go from C to C in a single transition step E.g., if (q, b) = (q, c, R) ua q bv yields uac q v special case when off the left end: E.g., q bv yields q cv if (q, b) = (q, c, L) How to represent the start configuration?

Configuration of TM (3) More special cases: In an accepting configuration, the current state is the accept state q Acc In a rejecting configuration, the current state is the accept state q Rej These two kinds of configuration are called halting configurations and will not yield further configurations

Acceptance of TM (Formal Definition) Turing Machine M= (Q,,,, q, q Acc, q Rej ) accepts input w if a sequence of configurations C, C 2,, C k exists with C = q w i.e., this indicates C is the start configuration For i = to k-, C i yields C i+ i.e., M moves according to transition function C k is an accepting configuration i.e., M enters accept state in the end

Example of TM Let us try to describe formally a TM that recognizes { ww w in {,}* } Also, let us use the shorthand a b, L to denote current tape symbol is changed from a to b after transition, and tape head moves to L

Reject state not shown for simplicity start, R, R, R, R, R, R, R, R, R, R, R, R, R, L, L, L, L, L, L, L, L, R = accept state

Example of TM (2) Full details of TM are sometimes complicated Usually, we give high-level details instead (but must be precise for understanding) Let us describe the high-level details of a TM M 2 that recognizes the language { a i b j c k i j = k and i, j, k }

On any input string w. Scan the input and check if the string is in the form a + b + c + (rejects if not) (how?) 2. Return the head to left end of tape (how?) 3. Cross off an a. Scan right to find the first b. Zig-zag the input string, so that we match each b with each c by crossing off a b and a c each time. If not enough c, rejects 4. Restore all crossed b. Repeat Step 3 if there are a remaining (how?) 5. If all a are gone, check if all c are crossed. If yes, accepts. If no, rejects

Turing-Recognizable Language We say a TM M recognizes a language L if M accepts all strings in L Question: How about strings not in L? A language is Turing-recognizable if some TM can recognize the language Turing-recognizable language has another name: recursively enumerable language

Turing-Decidable Language If TM runs, there are three outcomes: accept, reject, or TM loops forever We say a TM M decides a language L if M accepts all strings in L and M rejects all strings not in L (M is called a decider) A language is Turing-decidable if some TM can decide the language Turing-decidable language has another name: recursively language

Quick Quiz Let L be the complement of language L Is the following true?. If L is Turing-decidable, L is Turingrecognizable 2. If L is Turing-recognizable, L is Turingdecidable 3. If L is Turing-decidable, so is L 4. If L is Turing-recognizable, so is L 5. If both L and L are Turing-recognizable, L is Turing-decidable

Next Time Multi-tape Turing Machine Non-deterministic Turing Machine (NTM)