CS2303-THEORY OF COMPUTATION

Slides:



Advertisements
Similar presentations
Restricted Machines Presented by Muhannad Harrim.
Advertisements

Computing functions with Turing machines
Part VI NP-Hardness. Lecture 23 Whats NP? Hard Problems.
Turing Machines Memory = an infinitely long tape Persistent storage A read/write tape head that can move around the tape Initially, the tape contains only.
Deterministic Turing Machines
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
David Evans cs302: Theory of Computation University of Virginia Computer Science Lecture 13: Turing Machines.
Lecture 16 Deterministic Turing Machine (DTM) Finite Control tape head.
Variants of Turing machines
THE CHURCH-TURING T H E S I S “ TURING MACHINES” Pages COMPUTABILITY THEORY.
C O N T E X T - F R E E LANGUAGES ( use a grammar to describe a language) 1.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?

CS5371 Theory of Computation Lecture 10: Computability Theory I (Turing Machine)
Computability and Complexity 3-1 Turing Machine Computability and Complexity Andrei Bulatov.
Prof. Busch - LSU1 Turing Machines. Prof. Busch - LSU2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
AUTOMATA THEORY VIII.
CSE202: Introduction to Formal Languages and Automata Theory Chapter 9 The Turing Machine These class notes are based on material from our textbook, An.
 Computability Theory Turing Machines Professor MSc. Ivan A. Escobar
Pushdown Automata (PDAs)
Introduction to CS Theory Lecture 15 –Turing Machines Piotr Faliszewski
Turing Machines Chapter 17. Languages and Machines SD D Context-Free Languages Regular Languages reg exps FSMs cfgs PDAs unrestricted grammars Turing.
1 More About Turing Machines “Programming Tricks” Restrictions Extensions Closure Properties.
THE CHURCH-TURING T H E S I S “ TURING MACHINES” Part 1 – Pages COMPUTABILITY THEORY.
1 Turing Machines Reading: Chapter 8. 2 Turing Machines are… Very powerful (abstract) machines that could simulate any modern day computer (although very,
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 3 The Church-Turing Thesis Contents Turing Machines definitions, examples,
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
TM Design Macro Language D and SD MA/CSSE 474 Theory of Computation.
Turing Machines Lecture 26 Naveen Z Quazilbash. Overview Introduction Turing Machine Notation Turing Machine Formal Notation Transition Function Instantaneous.
1 Section 13.1 Turing Machines A Turing machine (TM) is a simple computer that has an infinite amount of storage in the form of cells on an infinite tape.
1 Turing Machines and Equivalent Models Section 13.1 Turing Machines.
Overview of the theory of computation Episode 3 0 Turing machines The traditional concepts of computability, decidability and recursive enumerability.
1 Turing Machines - Chap 8 Turing Machines Recursive and Recursively Enumerable Languages.
Lecture 16b Turing Machines Topics: Closure Properties of Context Free Languages Cocke-Younger-Kasimi Parsing Algorithm June 23, 2015 CSCE 355 Foundations.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 3 The Church-Turing Thesis Contents Turing Machines definitions, examples,
1 Introduction to Turing Machines
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 12 Mälardalen University 2007.
1 8.4 Extensions to the Basic TM Extended TM’s to be studied: Multitape Turing machine Nondeterministic Turing machine The above extensions make no increase.
1 Unit – 5 : STATE MACHINES Syllabus: Languages and Grammars – Finite State Machines State machines and languages – Turing Machines – Computational Complexity.
Turing Machines CS 130 Theory of Computation HMU Textbook: Chap 8.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Universal Turing Machine
CS6800 Advance Theory of Computation Spring 2016 Nasser Alsaedi
Cpt S 317: Spring 2009 Reading: Chapter 8
Finite Automata.
8. Introduction to Turing Machines
Theory of Computation Pushdown Automata pda Lecture #10.
Part VI NP-Hardness.
Busch Complexity Lectures: Turing Machines
Turing Machines.
Pushdown Automata PDAs
PUSHDOWN AUTOMATA. PUSHDOWN AUTOMATA Hierarchy of languages Regular Languages  Finite State Machines, Regular Expression Context Free Languages 
Chapter 7 PUSHDOWN AUTOMATA.
(Universal Turing Machine)
Cpt S 317: Spring 2009 Reading: Chapter 8
COSC 3340: Introduction to Theory of Computation
Turing Machines 2nd 2017 Lecture 9.
Post Machine.
Turing Machines Acceptors; Enumerators
Chapter 9 TURING MACHINES.
Jaya Krishna, M.Tech, Assistant Professor
Jaya Krishna, M.Tech, Assistant Professor
Turing Machines (TM) Deterministic Turing Machine (DTM)
8. Introduction to Turing Machines
Pushdown automata a_introduction.htm.
MA/CSSE 474 Theory of Computation
CS6382 Theory of Computation
Turing Machines Everything is an Integer
Presentation transcript:

CS2303-THEORY OF COMPUTATION www.nskinfo.com && www.nsksofttch.com Department of nskinfo-i education CS2303-THEORY OF COMPUTATION TURING MACHINE

TURING MACHINE

Introduction Turing machine is a modified version of the PDA and it is much more powerful than PDA. Instead of using stack as in PDA ,the TM uses the tape to store the symbols. The TM is a generalized machine which can recognize all types of languages like the type 3 grammar to the type 0 grammar.

Turing Machine Model …... a1 a2 a3 …. b ….. Control unit Tape Read-write head Control unit

TM is a finite automaton Components are: 1.Tape: which is used to store information and is divide into cells. 2.Read-Write Head: read or write into the location it is pointing to. 3.Control Unit: the reading from or writing into tape is controlled by this unit consulting the transition table.

Transition Table δ Tape Symbols(Γ) states a b X Y B q0 - q1 q2 q3 q4 (q1,X,R) - (q3,Y,R) q1 (q1,a,R) (q2,Y,R) (q1,Y,R) q2 (q2,a,L) (q0,X,R) (q2,Y,L) q3 (q4,B,R) q4

Definition: The Turing Machine M=(Q,Σ,Γ,δ,q0,B,F) Q is set of finite states Σ is set of input alphabets Γ is set of tape symbols δ is transition function q0 is the start state B is a special symbol indicating blank character F is the set of all final states

Instantaneous Description Unlike the id described in PDA, in TM ,the id is defined on the whole string (not on the string to be scanned) and the current state of the machine. An id of TM is a string αqβ,where q is the current state,αβ is the string made from tape symbols. Initial id :qαβ Final id :αβqB

The formal definition of ‘move’ for TM is : Let M=(Q,∑,Γ,δ,q₀,B,F)be a TM. Let the ID of M be a₁a₂a₃. . . ak-1qakak+1. . .an where aj ε Г for 1≤j≤n, qεQ is the current state and ak as the next symbol to be scanned. If there is a transition δ(q,ak)=(p,b,R) then the move of machine M will be a₁a₂a₃..ak-1qakak+1..an|-* a₁a₂a₃..ak-1b p ak+1..a If there is a transition δ(q,ak)=(p,b,L) then move of machine M will be a₁a₂a₃..ak-1qakak+1..an|-* a₁a₂a₃.. p ak-lbak+1..an

Acceptance of a language by TM Let M=(Q,∑,Γ,δ,q₀,B,F)be a TM. The language L(M) accepted by M is defined as: L(M)={w|q₀w|-*α₁pα₂ where wε∑*,pεF and α₁,α₂εΓ*} where q₀w is the initial ID and α₁pα₂ is the final ID. The set of all those words w in ∑* which causes M to move from start state q₀ to the final state p. A language is said to be recursively enumerable, if it is accepted by a TM.

Construction of Turing Machine Eg: Construct a turing machine to accept the language L={0ⁿ1ⁿ|n≥1}. Ans: The language accepted by TM should have n number of 0’s followed by n number of 1’s. General procedure: Let q₀ be the start state and let the read-write head points to the first symbol of the string to be scanned.

The steps which should be followed to solve the example are: Replace the left most 0 by X and change the state to q₁ and then move the read- write head towards right. This is because, after a zero is replaced , we have to replace to the corresponding 1 so that number of zeroes matches with number of 1’s. Search for the leftmost 1 and replace it by the symbol Y and move towards left (so as to obtain the leftmost 0 again).Steps 1 and 2 are repeated.

Transition Diagram The transitions are represented as follows: δ(q₀, 0)= (q₁, X, R) δ (q₁, 0)= (q₁, 0, R) δ (q₁, Y)= (q₁, Y, R) δ (q₁, 1)= (q₂, Y, L) δ (q₂, Y)= (q₂, Y, L) δ (q₂, 0)= (q₂, 0, L) δ (q₂, X)= (q₀, X, R) δ (q₀, Y)= (q₃, Y, R) δ (q₃, Y)= (q₃, Y, R) δ (q₃, B)= (q₄, B, R) Transition Diagram

Transducers A transducer accepts some input and transform that input into the desired output. The transducer for a Turing machine is a function f defined by f(w)=w' w is input before computation & w' is output after computation such that q₀w |-* qf w' for qf ε F

transducers contd… Let M=(Q,Σ,δ,q₀,B,F) be a Turing Machine. The function f is Turing computable if and only if q₀w |-* qf w' for qf ε F and w ε Γ* The arithmetic operations such as addition, subtraction etc., including the common mathematical functions are Turing computable.

Programming techniques for Turing Machine More complex operations can be achieved using Turing Machines. The “interospective” ability of both TM and computer programs is what enables us to prove problems undecidable.

Storage in the State We use finite control to hold a finite amount of data state storage q- control state A,B,C- data elements The state of the machine is thought of as a tuple [q,A,B,C] q A B C

Multiple Tracks Another useful “trick” is to think of the tape of a TM as composed of several tracks. Each track can hold one symbol and the tape alphabet of the TM consists of tuples, with one component for each “track”. A multitrack Turing Machine is a specific type of Multi-tape Turing Machine.

Subroutines It helps to think of TM as built from a collection of interacting components or “subroutines”. This set of states includes start state & another temporary state. The “call” of a subroutine occurs when there is a transition to its initial state.

Restricted Turing machines We can have so many variations of Standard Turing machines. Imposing certain restrictions on TM

1.Turing machine with semi-infinite tape In the standard turing machine,there was no boundary specified for the left side as well as right side of the tape. In this type, we restrict the read/write head to move only in one direction. From the fig it is clear that,there are no cells to the left hand side of initial head position. . . . . . . .

Multi-stack machines Generalizations of the PDAs TMs can accept languages that are not accepted by any PDA with one stack. A k-stack machine is a deterministic PDA with k stacks. It obtains its input from an input source rather than having the input placed in a tape. It has a finite control, which is in one of a finite set of states. It has a finite stack alphabet, which it uses for all its stacks.

Multi-stack machines Finite Control Input Accept/reject Stack 1

A move of a multistack machine is based on:1 A move of a multistack machine is based on:1.The state of the finite control 2.The input symbol read, which is chosen from the finite input alphabet 3.The top stack symbol on each stack In one move: a multistack machine can change to a new state q є Q and replace the top symbol of each stack with a string of zero or more stack symbols X є Γ*.

Counter machines Can be thought in one of two ways. Same structure as multistack machine. Each stack in the machine is replaced by a counter. Counter hold any nonnegative integer. The move of a machine depends on the 1.current state 2.current input symbol 3.if one of the value of the counter is zero

Also be regarded as a restricted multistack machine. Only two stack symbols say Z0 and X Z0 is initially on each stack May replace Z0 only by a string of the form XiZ0 for some i ≥ 0 Replace X only by Xi for some i ≥ 0. That is, Z0 appears only on the bottom of each stack and all other symbols, if any, are X.

Thank you