Outline. Language Hierarchy

Similar documents
Computer Sciences Department

Theory of Computation, Homework 3 Sample Solution

Variants of Turing Machines

Limitations of Algorithmic Solvability In this Chapter we investigate the power of algorithms to solve problems Some can be solved algorithmically and

CS21 Decidability and Tractability

Theory of Languages and Automata

CISC 4090 Theory of Computation

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION

Equivalence of NTMs and TMs

ECS 120 Lesson 16 Turing Machines, Pt. 2

CSE 105 THEORY OF COMPUTATION

pp Variants of Turing Machines (Sec. 3.2)

Turing Machines. A transducer is a finite state machine (FST) whose output is a string and not just accept or reject.

Theory of Computation p.1/?? Theory of Computation p.2/?? A Turing machine can do everything that any computing

TAFL 1 (ECS-403) Unit- V. 5.1 Turing Machine. 5.2 TM as computer of Integer Function

Source of Slides: Introduction to Automata Theory, Languages, and Computation By John E. Hopcroft, Rajeev Motwani and Jeffrey D.

Lecture 18: Turing Machines

Closure Properties of CFLs; Introducing TMs. CS154 Chris Pollett Apr 9, 2007.

Introduction to Computers & Programming

Theory of Computations Spring 2016 Practice Final Exam Solutions

R10 SET a) Construct a DFA that accepts an identifier of a C programming language. b) Differentiate between NFA and DFA?

(a) R=01[((10)*+111)*+0]*1 (b) ((01+10)*00)*. [8+8] 4. (a) Find the left most and right most derivations for the word abba in the grammar

Turing Machines, continued

The Turing Machine. Unsolvable Problems. Undecidability. The Church-Turing Thesis (1936) Decision Problem. Decision Problems

Midterm Exam II CIS 341: Foundations of Computer Science II Spring 2006, day section Prof. Marvin K. Nakayama

Enumerations and Turing Machines

Decidable Problems. We examine the problems for which there is an algorithm.

CT32 COMPUTER NETWORKS DEC 2015

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2016

PDA s. and Formal Languages. Automata Theory CS 573. Outline of equivalence of PDA s and CFG s. (see Theorem 5.3)

Recursive and Recursively Enumerable Languages

Final Course Review. Reading: Chapters 1-9

Chapter 14: Pushdown Automata

Problems, Languages, Machines, Computability, Complexity

COMP 382: Reasoning about algorithms

Computability and Complexity

Theory of Computations Spring 2016 Practice Final

6.045J/18.400J: Automata, Computability and Complexity. Practice Quiz 2

CS402 - Theory of Automata Glossary By

UNIT I PART A PART B


Theory Bridge Exam Example Questions Version of June 6, 2008

CS210 THEORY OF COMPUTATION QUESTION BANK PART -A UNIT- I

14.1 Encoding for different models of computation

Skyup's Media. PART-B 2) Construct a Mealy machine which is equivalent to the Moore machine given in table.

Universal Turing Machine Chomsky Hierarchy Decidability Reducibility Uncomputable Functions Rice s Theorem Decidability Continued

Name: CS 341 Practice Final Exam. 1 a 20 b 20 c 20 d 20 e 20 f 20 g Total 207

Recursively Enumerable Languages, Turing Machines, and Decidability

T.E. (Computer Engineering) (Semester I) Examination, 2013 THEORY OF COMPUTATION (2008 Course)

Actually talking about Turing machines this time

Turing Machine Languages

University of Nevada, Las Vegas Computer Science 456/656 Fall 2016

Computation Engineering Applied Automata Theory and Logic. Ganesh Gopalakrishnan University of Utah. ^J Springer

Multiple Choice Questions

We can create PDAs with multiple stacks. At each step we look at the current state, the current input symbol, and the top of each stack.

Theory of Programming Languages COMP360

CSC-461 Exam #2 April 16, 2014

1. [5 points each] True or False. If the question is currently open, write O or Open.

CS 44 Exam #2 February 14, 2001

AUTOMATA THEORY AND COMPUTABILITY

Computability Summary

Theory of Computation

CS5371 Theory of Computation. Lecture 8: Automata Theory VI (PDA, PDA = CFG)

1. (10 points) Draw the state diagram of the DFA that recognizes the language over Σ = {0, 1}

The Big Picture. Chapter 3

I have read and understand all of the instructions below, and I will obey the Academic Honor Code.

Infinity and Uncountability. Countable Countably infinite. Enumeration

t!1; R 0! 1; R q HALT

6.045J/18.400J: Automata, Computability and Complexity Final Exam. There are two sheets of scratch paper at the end of this exam.

Theory of Computation Dr. Weiss Extra Practice Exam Solutions

QUESTION BANK. Unit 1. Introduction to Finite Automata

Does this program exist? Limits of computability. Does this program exist? A helper function. For example, if the string program is

1 Parsing (25 pts, 5 each)

ONE-STACK AUTOMATA AS ACCEPTORS OF CONTEXT-FREE LANGUAGES *

6.045 Final Exam. Name: Please write your name on each page. This exam is open book, open notes.

CpSc 421 Final Solutions

Languages and Automata

From Theorem 8.5, page 223, we have that the intersection of a context-free language with a regular language is context-free. Therefore, the language

Regular Languages (14 points) Solution: Problem 1 (6 points) Minimize the following automaton M. Show that the resulting DFA is minimal.

Material from Recitation 1

CS6160 Theory of Computation Problem Set 2 Department of Computer Science, University of Virginia

QUESTION BANK. Formal Languages and Automata Theory(10CS56)

W[1]-hardness. Dániel Marx. Recent Advances in Parameterized Complexity Tel Aviv, Israel, December 3, 2017

Formal languages and computation models

SECTION A (40 marks)

Final Exam 1, CS154. April 21, 2010

TOPIC PAGE NO. UNIT-I FINITE AUTOMATA

CSCI 270: Introduction to Algorithms and Theory of Computing Fall 2017 Prof: Leonard Adleman Scribe: Joseph Bebel

CS/B.Tech/CSE/IT/EVEN/SEM-4/CS-402/ ItIauIafIaAblll~AladUnrtel1ity

Modeling Computer Insecurity

Automata Theory CS S-FR Final Review

COMP Logic for Computer Scientists. Lecture 25

(Refer Slide Time: 0:19)

Learn Smart and Grow with world

Computability via Recursive Functions

MIT Specifying Languages with Regular Expressions and Context-Free Grammars. Martin Rinard Massachusetts Institute of Technology

JNTUWORLD. Code No: R

MIT Specifying Languages with Regular Expressions and Context-Free Grammars

Computation, Computers, and Programs. Administrivia. Resources. Course texts: Kozen: Introduction to Computability Hickey: Introduction to OCaml

Transcription:

Outline Language Hierarchy Definition of Turing Machine TM Variants and Equivalence Decidability Reducibility Language Hierarchy Regular: finite memory CFG/PDA: infinite memory but in stack space TM: infinite and unrestricted memory TM Decidable/Recursive TM Recognizable/Recursively Enumerable

Outline Language Hierarchy Definition of Turing Machine TM Variants and Equivalence Decidability Reducibility Semantics of TM Not a real machine, but a model of computation Components: 1-way infinite tape: unlimited memory Store input, output, and intermediate results Infinite cells Each cell has a symbol from a finite alphabet Tape head: Point to one cell Read or write a symbol to that cell move left or right

States of a TM Initial state: Head on leftmost cell input on the tape Blank everywhere else Accept state Reject state Loop Accept or reject immediately An Example The tape changing:

Formal Definition Example of transition function: Configuration A configuration of TM: Current state Symbols on tape Head of location A formal specification of a configuration: ex: 1011 q 7 01111

For two configurations: Configuration Two special cases: the leftmost cell q i bv yields q j cv for δ qi, b) = ( q q i bv yields cq j v for δ qi, b) = ( q j on the cell with blank symbol ( j, c, L) (, c, R) Configuration Initial configuration with input w: q 0 w Accepting configuration: uq accept v Rejecting configuration: uq reject v uq accept v and uq reject v do not yield any other configurations Immediate effect of accepting/rejecting Halting configurations For a TM M, a string w L(M ) if there is a sequence of configurations C 1,C 2, C k such that: C 1 =q 0 w C i yields C i+1 for C k = uq accept v,

Languages Turing-recognizable Languages: * For a L Γ, exists a M such that M recognizes L Recognize means accept, reject, or loop Turing-decidable languages: * For a L Γ, exists a M such that M decides L Decide means halting: either accept or reject Turing-decidable Turing-recognizable Halting Problem is Turing-recognizable, but not decidable. Not all languages are Turing-recognizable There are some languages cannot be recognized by a TM. Complement of Halting problem is Turing-unrecognizable An example Semantical description: For an input string w: { sweep left to the right along the tape, crossing off every other 0 if tape contains single 0 { return accepted;} elseif tape contains odd number and more than one of 0s { return (rejected);} else go back to leftmost cell; } Formal description:

Outline Language Hierarchy Definition of Turing Machine TM Variants and Equivalence Decidability Reducibility TM Variants Multitape TM Nondeterministic TM Enumerators Equivalence:All have same power Recognize the same class of languages Can be simulated by an ordinary TM

Simple variant They are equivalent in recognizing language: They can be simulated by original the TM The difference is not significant Multitape TM A multitape TM is identical to ordinary TM except: k tapes, where k 1 Each tap has its own head

Multitape TM Theorem: each multitape TM has an equivalent single tape TM Put # in a single tape for demarcation of original k tapes. Each movement of M is simulated by a series movement of S on each segment. For a right-move on the rightmost cell of ith tape in M, S write blank symbol in (i+1)th #, and right-shifts all symbols after that one cell. Nondeterministic TM A nondeterministic TM is identical to an ordinary TM except: At any point the head has several possibilities to read/write/move. In deterministic TM, a computation is a single path with sequence of configurations. In nondeterministic TM, a computation is a tree or a directed acyclic graph. A NTM accepts an input string if there exists a path leading to an accept state. If all paths lead to reject state, then this input is rejected.

NTM A computation single path and multi-path in a tree: Nodeterminism Is nondeterministic model always equivalent to a deterministic model? Yes, for FA No, for PDA Some CFL cannot be recognized by any DPDA. Yes, for TM!

NTM Theorem: Every NTM has an equivalent DTM. (root) 1 2... 11 12 13 21 22 23 121 122 123 For a computing tree of a NTM N with an input w, simulated with a 3-tape DTM M: 1st tape: input w 2nd tape: tape of a computing path with N 3rd tape: node address (finite) Enumerator Semantically, an enumerator is a TM with an attached printer. Every time the TM wants to add a string to its output list, it sends the string to the printer. The language enumerated by an enumerator E is the collection of all the strings that E eventually prints out.

Enumerator Theorem: A language is Turing-recognizable iff some enumerator enumerates it. For a language, if E enumerates it, then construct a TM M works as: Run E. Every time that E outputs a string, compare it with input w. If w appears in the output of E, accept. For a language recognized by a TM M, construct E such that: Run M for i steps on each input, s1, s2,, si. If any computations accept, print out the corresponding sj. Repeat the above two steps with all possible inputs An enumerator can be regarded as a 2-tape TM. Write accepted list on the 2 nd tape. Other Variants Write-twice TM Each cell on tape can only be written twice Write-once TM Each cell on tape can only be written once TM with doubly infinite tape Two-way infinite tape Universal TM A TM that takes input of description of another TM.

Thesis Church-Turing Thesis: Any algorithm can be expressed as a TM Formally defines an algorithm: Extended Church-Turing Thesis: Any polynomial-time algorithm can be expressed as a TM that operates in polynomial time. A polynomial-time algorithm: number of element operations is a polynomial function of input length. A polynomial-time TM: number of state transition is a polynomial function of input length. Describing TM Formal description specifying Turing machine s states, transition function, and so on. Implementation description using natural language to describe the way that the Turing machine moves its head and the way that it stores data on its tape. High-level description using natural language describe an algorithm, ignoring the implementation model.

Outline Language Hierarchy Definition of Turing Machine TM Variants and Equivalence Decidability Reducibility Solvable: Solvability an algorithm to solve it, a TM decides it. Unsolvable: not algorithm to solve it no TM can decide it.

Decidable Language Acceptance problem: Whether a particular DFA B accepts a given input string w. Membership problem: Another way to say: whether <B,w> is a member of A DFA. Theorem: A DFA is a decidable language. Decidable Language Theorem: A NFA is a decidable language.

Decidable Language Theorem: A REX is a decidable language. Decidable Language Emptiness test problem: Whether the language of a particular DFA is empty. Theorem: E DFA is a decidable language.

Decidable Language Equivalence problem: Test whether two DFAs recognize the same language. Theorem: EQ DFA is a decidable language. Other Problems A CFG is decidable. E CFG is decidable. EQ CFG is undecidable. CFG is not closed in intersection and complementation. A TM is undecidable. Halting problem E TM is undecidable. EQ TM is undecidable.

Halting Problem Theorem: A TM is Turing-recognizable. U is an example of universal TM. U keeps looping if M neither accepts or rejects. Halting Problem Theorem: A TM is undecidable. Can be proved by recursive theorem.

Unrecognizable Theorem: There are languages that cannot recognized by any TM. The set of TMs are countable Number of transition functions is countable. The set of languages is uncountable. Diagonalization method to prove this Countable and Uncountable Two infinite sets A and B are the same size if there is a correspondence from A to B. A correspondence is a one-to-one and onto function: one-to-one: whenever Onto: A set is countable if either it is finite or it has the same size as N ={1,2,3 }; otherwise it is uncountable.

Countable Set of position rational numbers is countable: Uncountable Set of real numbers R is uncountable:

Uncountable The set of all languages over an alphabet is uncountable. Think that a real number is a string over alphabet of {., 0,1,2,3,4,5,6,7,8,9} Similar diagonalization way to prove with general alphabet Theorem: A language is decidable iff both it and its complement language are Turing-recognizable. If A is decided by M 1, then : M 2 = on input w: 1. Run M 1 on w. 2. If M 1 rejects, accept; if M 1 accepts, reject. M 2 decides A If A and A are Turing-recognizable:

Theorem: is not Turing-recognizable If is Turing-recognizable, and A TM is Turing-recognizable, then A TM must be decidable. contradiction! Outline Language Hierarchy Definition of Turing Machine TM Variants and Equivalence Decidability Reducibility

Reducibility Semantics Reduce A TM to HALT TM PCP Problem Mapping Reducibility