Homework 8 Solutions #1 True or False a) Regular languages are recursive b) Context free languages are recursively enumerable (r.e.) c) Recursive languages.

Slides:



Advertisements
Similar presentations
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.
Advertisements

Lecture 16 Deterministic Turing Machine (DTM) Finite Control tape head.
Variants of Turing machines
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Reducibility Sipser 5.1 (pages ). CS 311 Fall Reducibility.
Fall 2004COMP 3351 Recursively Enumerable and Recursive Languages.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Recursively Enumerable and Recursive Languages
Fall 2004COMP 3351 Turing Machines. Fall 2004COMP 3352 The Language Hierarchy Regular Languages Context-Free Languages ? ?
1 Uncountable Sets continued Theorem: Let be an infinite countable set. The powerset of is uncountable.
CS 310 – Fall 2006 Pacific University CS310 Turing Machines Section 3.1 November 6, 2006.
Courtesy Costas Busch - RPI1 Turing Machines. Courtesy Costas Busch - RPI2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Computation Theory Introduction to Turing Machine.
Turing Machines.
Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem.
Homework #9 Solutions.
CS5371 Theory of Computation Lecture 10: Computability Theory I (Turing Machine)
Costas Busch - RPI1 Turing Machines. Costas Busch - RPI2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Courtesy Costas Busch - RPI1 Reducibility. Courtesy Costas Busch - RPI2 Problem is reduced to problem If we can solve problem then we can solve problem.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Prof. Busch - LSU1 Turing Machines. Prof. Busch - LSU2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
1 Reducibility. 2 Problem is reduced to problem If we can solve problem then we can solve problem.
Chapter 9 Turing Machine (TMs).
1 Turing Machines. 2 A Turing Machine Tape Read-Write head Control Unit.
Turing Machines A more powerful computation model than a PDA ?
Context-Free Languages Regular Languages Violates Pumping Lemma For RLs Violates Pumping Lemma For CFLs Described by CFG, PDA 0n1n0n1n 0n1n2n0n1n2n Described.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen Department of Computer Science University of Texas-Pan American.
1 Undecidability Reading: Chapter 8 & 9. 2 Decidability vs. Undecidability There are two types of TMs (based on halting): (Recursive) TMs that always.
Turing Machines – Decidability Lecture 25 Section 3.1 Fri, Oct 19, 2007.
Computability Construct TMs. Decidability. Preview: next class: diagonalization and Halting theorem.
Recursively Enumerable and Recursive Languages
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.
1 Turing Machines - Chap 8 Turing Machines Recursive and Recursively Enumerable Languages.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Decidability Decidable/Undecidable problems. Jaruloj Chongstitvatana Decidability2 Accepting: Definition Let T = (Q, , , , s) be a TM. T accepts.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 12 Mälardalen University 2007.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
CS 3240 – Chapter 9.  Turing Machines  From Alan Turing, 1936  Turns out to be the LAST machine  The only machine you'll ever need  The Church-Turing.
Turing Machines CS 130 Theory of Computation HMU Textbook: Chap 8.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
FORMAL LANGUAGES, AUTOMATA, AND COMPUTABILITY * Read chapter 4 of the book for next time * Lecture9x.ppt.
CS 154 Formal Languages and Computability April 7 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
1 Recursively Enumerable and Recursive Languages.
Chapters 11 and 12 Decision Problems and Undecidability.
Recursively Enumerable Languages
Recursively Enumerable and Recursive Languages
CSCI 2670 Introduction to Theory of Computing
Busch Complexity Lectures: Turing Machines
COSC 3340: Introduction to Theory of Computation
Linear Bounded Automata LBAs
Turing Machines.
CS21 Decidability and Tractability
Cpt S 317: Spring 2009 Reading: Chapter 8
COSC 3340: Introduction to Theory of Computation
Turing Machines 2nd 2017 Lecture 9.
CSE 105 theory of computation
Turing Machines Acceptors; Enumerators
CS154, Lecture 10: Rice’s Theorem, Oracle Machines
CS154, Lecture 10: Rice’s Theorem, Oracle Machines
The Off-Line Machine Input File read-only (once) Input string
CS21 Decidability and Tractability
COSC 3340: Introduction to Theory of Computation
Decidability and Tractability
CSE 105 theory of computation
Decidability continued….
Variants of Turing machines
CSE 105 theory of computation
Presentation transcript:

Homework 8 Solutions

#1 True or False a) Regular languages are recursive b) Context free languages are recursively enumerable (r.e.) c) Recursive languages are r.e d) R.e. languages are recursive TRUE FALSE

#2. a) Show computations with and 101 on the following Turing Machine 101 q 0 ├101 ├ q dead end! ├X0q ├X00q ├X0q 2 0Y11 ├Xq 2 00Y11 ├q 2 X00Y11 ├Xq 0 00Y11 ├XXq 1 0Y11 ├XX0q 1 Y11 ├XX0Yq 1 11 ├XX0q 2 YY1 ├XXq 2 0YY1 ├Xq 2 X0YY1 ├XXq 0 0YY1 Continued above ├XXXq1YY1 ├XXXYq1Y1 ├XXXYYq11 ├XXXYq2YY ├XXXq2YYY ├XXq2XYYY ├XXXq0YYY ├XXXYq3YY XXXYYq3Y XXXYYYq3 XXXYYYBq4 halt q4 is a final state b) What is L(M) (you’ll have to guess) q 0 ├000111… ├ q … ├Xq “Looks like” {0n1n | n > 0}

#3. Construct a Turing Machine to compute {w w R | w  {0,1}* a) Show pseudo-code that describes how the TM operates If symbol is 0 write X enter a “branch” that iterates to the 1st Blank,X,Y if last symbol is 0 go back to the beginning, repeat (Similar for 1) (Accept if read X or Y at 1st step)

3b) Create the actual transitions

Show your TM processing (i) 1001, (ii) 101 and (iii) 110 q 0 ├1001  ├q  ├ Yq  ├Y0q 4 01  ├Y00q 4 1  ├Y001q 4  ├Y00q 5 1  ├Y0q 6 0Y  ├Yq 6 00Y  ├q 6 Y00Y  ├Yq 0 00Y  ├YXq 1 0Y  ├YX0q 1 Y  ├YXq 2 0Y  ├Yq 3 XXY  ├YXq 0 XY  ├Yq 7 XXY  ├q 7 YXXY  q 7 ├YXXY accept q 0 ├101  ├q  ├ Yq 4 01  ├Y0q 4 1  ├Y01q 4  ├Y0q 5 1  ├Yq 6 0Y  ├q 6 Y0Y  ├Yq 0 0Y  ├YXq 1 Y  ├Yq 2 XY reject 110 is similar (it is rejected)

#4. Show that r.e. languages are closed under union and intersection. union Assume L 1 and L 2 are recursively enumerable. We can consider two single tape machines M 1 and M 2, which accept L 1 and L 1 respectively. We define M as a single tape TM with three tracks. Track 1 will hold the input. M will simulate M 1 using track 2. If M 1 halts in an accepting configuration then M accepts; otherwise M moves the tape head back to the left end and starts simulating M 2 on track 3. If M 2 accepts the input string then the string is accepted by M. intersection Assume L 1 and L 2 are recursively enumerable. We can consider two single tape machines M 1 and M 2, which accept L 1 and L 1 respectively. We define M as a single tape TM with three tracks. Track 1 will hold the input. M will simulates M 1 using track 2. If M 1 halts in an accepting configuration M moves the tape head back to the left end and starts simulating M 2 on track 3. If M 2 also accepts the input string then the string is accepted by M.