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

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

and Models of Computation

HIS LEGACY. 100 Years Turing celebration. Gordana Dodig Crnkovic, IDT Open Seminar. Computer Science and Network Department Mälardalen University

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

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

CSCC63 Worksheet Turing Machines

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

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

Introduction to Turing Machines

Chapter 8. Turing Machine (TMs)

Chapter 3: The Church-Turing Thesis

CSE 105 THEORY OF COMPUTATION

Chapter 1 Welcome Aboard

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

Turing s Thesis. Fall Costas Busch - RPI!1

Computability Theory. CS215, Lecture 6,

Lecture 14: Recursive Languages

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

Part I: Definitions and Properties

ECS 120 Lesson 15 Turing Machines, Pt. 1

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

Turing Machines Part II

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

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

Lecture 13: Turing Machine

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

CS21 Decidability and Tractability

Designing 1-tape Deterministic Turing Machines

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

CS154, Lecture 10: Rice s Theorem, Oracle Machines

Lecture 12: Mapping Reductions

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

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

Two Way Deterministic Finite Automata

Reducability. Sipser, pages

1 Unrestricted Computation

A Turing Machine. The Tape. Languages accepted by Turing Machines. Tape... Read-Write head. Context-Free n Languages. Control Unit.

CSci 311, Models of Computation Chapter 9 Turing Machines

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

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

The Church-Turing Thesis

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

Decidability: Church-Turing Thesis

1 Showing Recognizability

Theory of Computation

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

Turing Machines. Nicholas Geis. February 5, 2015

Turing Machines. Wen-Guey Tzeng Computer Science Department National Chiao Tung University

Equivalent Variations of Turing Machines

Automata Theory (2A) Young Won Lim 5/31/18

Foundations of

Theory of Computation Turing Machine and Pushdown Automata

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

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

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. Chapter 17

Introduction to Turing Machines. Reading: Chapters 8 & 9

Homework 5 Solution CSCI 2670 October 6, c) New text q 1 1##1 xq 3 ##1 x#q 5 #1 q reject. Old text. ~q 3 ##1 ~#q 5 #1

CS4026 Formal Models of Computation

A Universal Turing Machine

SCHEME FOR INTERNAL ASSESSMENT TEST 3

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

Turing Machines and Time Complexity

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

CSCI3390-Assignment 2 Solutions

Homework Assignment 6 Answers

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

Most General computer?

There are two main techniques for showing that problems are undecidable: diagonalization and reduction

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

Automata Theory - Quiz II (Solutions)

Computation Histories

Theory of Computation

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

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

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

Computability and Complexity

Theory of Computation (IX) Yijia Chen Fudan University

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

Chomsky Normal Form and TURING MACHINES. TUESDAY Feb 4

Variations of the Turing Machine

CS20a: Turing Machines (Oct 29, 2002)

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

6.5.3 An NP-complete domino game

CS 525 Proof of Theorems 3.13 and 3.15

Chapter 6: Turing Machines

CSCE 551 Final Exam, Spring 2004 Answer Key

Fundamentals of Computer Science

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

Testing Emptiness of a CFL. Testing Finiteness of a CFL. Testing Membership in a CFL. CYK Algorithm

Turing Machines. Lecture 8

CpSc 421 Homework 9 Solution

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

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

Variants of Turing Machine (intro)

Notes for Lecture Notes 2

Advanced topic: Space complexity

TURING MAHINES

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

Transcription:

Busch Complexity ectures: Turing Machines Prof. Busch - SU 1

The anguage Hierarchy a n b n c n? ww? Context-Free anguages n b n a ww egular anguages a* a *b* Prof. Busch - SU 2

a n b anguages accepted by Turing Machines n c n Context-Free anguages n b n a ww ww egular anguages a* a *b* Prof. Busch - SU 3

Tape... A Turing Machine... Control Unit ead-write head Prof. Busch - SU 4

The Tape... No boundaries -- infinite length... ead-write head The head moves eft or ight Prof. Busch - SU 5

...... ead-write head The head at each transition (time step): 1. eads a symbol 2. Writes a symbol 3. Moves eft or ight Prof. Busch - SU 6

Example:... a Time 0 b a c...... Time 1 a b k c... 1. eads 2. Writes a k 3. Moves eft Prof. Busch - SU 7

... Time 1 a b k c...... Time 2 a f k c... 1. eads 2. Writes b 3. Moves ight f Prof. Busch - SU 8

The Input String Input string Blank symbol... a b a c... head Head starts at the leftmost position of the input string Prof. Busch - SU 9

States & Transitions ead Write Move eft q a b, q2 1 Move ight q a b, q2 1 Prof. Busch - SU 10

Example: Time 1... a b a c... q 1 current state q a b, q2 1 Prof. Busch - SU 11

Time 1... a b a c... q 1 Time 2... a b b c... q 2 q a b, q2 1 Prof. Busch - SU 12

Example: Time 1... a b a c... q 1 Time 2... a b b c... q a b, q2 1 q 2 Prof. Busch - SU 13

Example: Time 1... a b a c... q 1 Time 2... a b b c g... q 2 g, q q2 1 Prof. Busch - SU 14

Determinism Turing Machines are deterministic Allowed Not Allowed a b, q 2 a b, q 2 q 1 q 1 b d, q 3 a d, q 3 No lambda transitions allowed Prof. Busch - SU 15

Example: Partial Transition Function... a b a c... q 1 q 1 a b, b d, q 2 q 3 Allowed: No transition for input symbol c Prof. Busch - SU 16

Halting The machine halts in a state if there is no transition to follow Prof. Busch - SU 17

Halting Example 1:... a b a c... q 1 q1 No transition from HAT!!! q 1 Prof. Busch - SU 18

Halting Example 2:... a b a c... q 1 a b, q 2 No possible transition q 1 from q1 and symbol c b d, q 3 HAT!!! Prof. Busch - SU 19

Accepting States q1 q2 Allowed q1 q2 Not Allowed Accepting states have no outgoing transitions The machine halts and accepts Prof. Busch - SU 20

Acceptance Accept Input string If machine halts in an accept state eject Input string If machine halts in a non-accept state or If machine enters an infinite loop Prof. Busch - SU 21

Observation: In order to accept an input string, it is not necessary to scan all the symbols in the string Prof. Busch - SU 22

Turing Machine Example Input alphabet Σ = { a, b} Accepts the language: a*, q 1 Prof. Busch - SU 23

Time 0 a a a, q 1 Prof. Busch - SU 24

Time 1 a a a, q 1 Prof. Busch - SU 25

Time 2 a a a, q 1 Prof. Busch - SU 26

Time 3 a a a, q 1 Prof. Busch - SU 27

Time 4 a a a q 1 Halt & Accept, q 1 Prof. Busch - SU 28

ejection Example Time 0 a b a, q 1 Prof. Busch - SU 29

Time 1 a b a No possible Transition Halt & eject, q 1 Prof. Busch - SU 30

A simpler machine for same language but for input alphabet Σ = {a } Accepts the language: a* Prof. Busch - SU 31

Time 0 a a a Halt & Accept Not necessary to scan input Prof. Busch - SU 32

Infinite oop Example A Turing machine for language a * + b( a + b) * b b,, q 1 Prof. Busch - SU 33

Time 0 a b a b b,, q 1 Prof. Busch - SU 34

Time 1 a b a b b,, q 1 Prof. Busch - SU 35

Time 2 a b a b b,, q 1 Prof. Busch - SU 36

Time 2 a b a Time 3 Time 4 Time 5 a b a a b a a b a Infinite loop Prof. Busch - SU 37

Because of the infinite loop: The accepting state cannot be reached The machine never halts The input string is rejected Prof. Busch - SU 38

Another Turing Machine Example n n Turing machine for the language { a b } n 1 q 4, q 3 a x, q0 1 b y, q q2 x x, Prof. Busch - SU 39

Basic Idea: Match a s with b s: epeat: replace leftmost a with x find leftmost b and replace it with y Until there are no more a s or b s If there is a remaining a or b reject Prof. Busch - SU 40

Time 0 a a b b q 4, q 3 a x, q0 1 b y, q q2 x x, Prof. Busch - SU 41

Time 1 x a b b q 1 q 4, q 3 a x, q0 1 b y, q q2 x x, Prof. Busch - SU 42

Time 2 x a b b q 1 q 4, q 3 a x, q0 1 b y, q q2 x x, Prof. Busch - SU 43

Time 3 x a y b q 2 q 4, q 3 a x, q0 1 b y, q q2 x x, Prof. Busch - SU 44

Time 4 x a y b q 2 q 4, q 3 a x, q0 1 b y, q q2 x x, Prof. Busch - SU 45

Time 5 x a y b q 4, q 3 a x, q0 1 b y, q q2 x x, Prof. Busch - SU 46

Time 6 x x y b q 1 q 4, q 3 a x, q0 1 b y, q q2 x x, Prof. Busch - SU 47

Time 7 x x y b q 1 q 4, q 3 a x, q0 1 b y, q q2 x x, Prof. Busch - SU 48

Time 8 x x y y q 2 q 4, q 3 a x, q0 1 b y, q q2 x x, Prof. Busch - SU 49

Time 9 x x y y q 2 q 4, q 3 a x, q0 1 b y, q q2 x x, Prof. Busch - SU 50

Time 10 x x y y q 4, q 3 a x, q0 1 b y, q q2 x x, Prof. Busch - SU 51

Time 11 x x y y q 3 q 4, q 3 a x, q0 1 b y, q q2 x x, Prof. Busch - SU 52

Time 12 x x y y q 3 q 4, q 3 a x, q0 1 b y, q q2 x x, Prof. Busch - SU 53

Time 13 x x y y q 4 Halt & Accept q 4, q 3 a x, q0 1 b y, q q2 x x, Prof. Busch - SU 54

Observation: If we modify the machine for the language n n { a b } we can easily construct a machine for the language { a b c } n n n Prof. Busch - SU 55

Formal Definitions for Turing Machines Prof. Busch - SU 56

Transition Function q a b, q2 1 δ ( 2 q 1, a) = ( q, b, ) Prof. Busch - SU 57

Transition Function q c d, q2 1 δ ( 2 q 1, c) = ( q, d, ) Prof. Busch - SU 58

Turing Machine: States Input alphabet Tape alphabet M = ( Q, Σ, Γ, δ, q0,, F) Transition function Initial state Accept states blank Prof. Busch - SU 59

Configuration c a b a q 1 Instantaneous description: ca q 1 ba Prof. Busch - SU 60

Time 4 Time 5 x a y b x a y b q 2 A Move: q2 xayb x q0 ayb (yields in one mode) Prof. Busch - SU 61

Time 4 Time 5 x a y b x a y b q 2 Time 6 Time 7 x x y b x x y b q 1 A computation q 2 xayb x q0 ayb xx q1 yb xxy q 1 q 1 b Prof. Busch - SU 62

q 2 xayb x q0 ayb xx q1 yb xxy q 1 b Equivalent notation: q2 xayb xxy q1 b Prof. Busch - SU 63

Initial configuration: w Input string w a a b b Prof. Busch - SU 64

The Accepted anguage For any Turing Machine M ( M ) = { w : q0 w x1 q f x 2 } Initial state Accept state Prof. Busch - SU 65

If a language by a Turing machine then we say that is accepted M is: Turing ecognizable Other names used: Turing Acceptable ecursively Enumerable Prof. Busch - SU 66