Midterm Exam 2 CS 341: Foundations of Computer Science II Fall 2018, face-to-face day section Prof. Marvin K. Nakayama

Similar documents
Midterm Exam 2 CS 341: Foundations of Computer Science II Fall 2016, face-to-face day section Prof. Marvin K. Nakayama

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

Name: Student ID: Instructions:

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

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

Theory of Computation (IX) Yijia Chen Fudan University

V Honors Theory of Computation

CSE 105 THEORY OF COMPUTATION

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

1 Showing Recognizability

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

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET

CSE 105 THEORY OF COMPUTATION

Computability and Complexity

Exam Computability and Complexity

CpSc 421 Final Exam December 15, 2006

Decidability (What, stuff is unsolvable?)

ECS 120: Theory of Computation UC Davis Phillip Rogaway February 16, Midterm Exam

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

Intro to Theory of Computation

TURING MAHINES

Decidability (intro.)

ACS2: Decidability Decidability

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

Reducability. Sipser, pages

Turing Machines Part III

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

Student#: CISC-462 Exam, December XY, 2017 Page 1 of 12

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

Computability Theory

Computability Theory. CS215, Lecture 6,

CSCE 551 Final Exam, Spring 2004 Answer Key

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

Mapping Reducibility. Human-aware Robotics. 2017/11/16 Chapter 5.3 in Sipser Ø Announcement:

CSE 105 THEORY OF COMPUTATION

Midterm II : Formal Languages, Automata, and Computability

Homework Assignment 6 Answers

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

Intro to Theory of Computation

TAKE-HOME: OUT 02/21 NOON, DUE 02/25 NOON

A non-turing-recognizable language

CSE 105 THEORY OF COMPUTATION. Spring 2018 review class

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Final exam study sheet for CS3719 Turing machines and decidability.

3130CIT Theory of Computation

CS 154, Lecture 2: Finite Automata, Closure Properties Nondeterminism,

COMP/MATH 300 Topics for Spring 2017 June 5, Review and Regular Languages

Computability Theory

CSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY

Computation Histories

Undecidability COMS Ashley Montanaro 4 April Department of Computer Science, University of Bristol Bristol, UK

CS20a: Turing Machines (Oct 29, 2002)

Undecidable Problems and Reducibility

Theory Bridge Exam Example Questions

Chap. 4,5 Review. Algorithms created in proofs from prior chapters

CPSC 421: Tutorial #1

Part I: Definitions and Properties

UNIT-VIII COMPUTABILITY THEORY

acs-07: Decidability Decidability Andreas Karwath und Malte Helmert Informatik Theorie II (A) WS2009/10

CS 311 Sample Final Examination

Lecture 12: Mapping Reductions

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Decidable and undecidable languages

CS154, Lecture 10: Rice s Theorem, Oracle Machines

Foundations of

Introduction to Turing Machines. Reading: Chapters 8 & 9

Theory of Computation

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

Chapter 3: The Church-Turing Thesis

CSE 105 THEORY OF COMPUTATION

CpSc 421 Homework 9 Solution

CSCE 551 Final Exam, April 28, 2016 Answer Key

DM17. Beregnelighed. Jacob Aae Mikkelsen

Please give details of your answer. A direct answer without explanation is not counted.

CISC4090: Theory of Computation

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

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

Computability and Complexity

Chomsky Normal Form and TURING MACHINES. TUESDAY Feb 4

4.2 The Halting Problem

Closure under the Regular Operations

Non-emptiness Testing for TMs

Theory of Computation p.1/?? Theory of Computation p.2/?? We develop examples of languages that are decidable

Final Exam Comments. UVa - cs302: Theory of Computation Spring < Total

COMP-330 Theory of Computation. Fall Prof. Claude Crépeau. Lec. 16 : Turing Machines

CSCC63 Worksheet Turing Machines

Decidable Languages - relationship with other classes.

CS20a: Turing Machines (Oct 29, 2002)

Decidability. Overview. Preliminaries to Halting Problem. Decidable Problems of Regular Languages. Decidable Problems of Context-Free Languages

Introduction to Languages and Computation

CSE 105 THEORY OF COMPUTATION

Theory of Computation Turing Machine and Pushdown Automata

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

Variants of Turing Machine (intro)

6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, Class 8 Nancy Lynch

Theory of computation: initial remarks (Chapter 11)

CSE 105 THEORY OF COMPUTATION

6.045 Final Exam Solutions

HKN CS/ECE 374 Midterm 1 Review. Nathan Bleier and Mahir Morshed

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

Transcription:

Midterm Exam 2 CS 341: Foundations of Computer Science II Fall 2018, face-to-face day section Prof. Marvin K. Nakayama Print family (or last) name: Print given (or first) name: I have read and understand all of the instructions below, and I will obey the University Policy on Academic Integrity. Signature and Date: This exam has 9 pages in total, numbered 1 to 9. Make sure your exam has all the pages. This exam will be 1 hour and 20 minutes in length. This is a closed-book, closed-note exam. Electronic devices (e.g., cellphone, smart watch, calculator) are not allowed. For all problems, follow these instructions: 1. Give only your answers in the spaces provided. I will only grade what you put in the answer space, and I will take off points for any scratch work in the answer space. Use the scratch-work area or the backs of the sheets to work out your answers before filling in the answer space. 2. DFA stands for deterministic finite automaton; NFA stands for nondeterministic finite automaton; CFG stands for context-free grammar; PDA stands for pushdown automaton; TM stands for Turing machine. 3. For any state machines that you draw, you must include all states and transitions. 4. For any proofs, be sure to provide a step-by-step argument, with justifications for every step. Unless you are specifically asked to prove a theorem from the book or notes, you may assume that the theorems in the textbook and notes hold; i.e., you do not have to reprove the theorems in the textbook and notes. When using a theorem from the textbook or notes, make sure you provide enough detail so that it is clear which result you are using; e.g., say something like, By the theorem that states S = S, it follows that... Problem 1 2 3 4 5 6 7 Total Points 1

1. [20 points] For each of the following, circle TRUE if the statement is correct. Otherwise, circle FALSE (a) TRUE FALSE The language EQ DFA = { C,D C and D are DFAs with L(C) = L(D)} is decidable. (b) TRUE FALSE There are languages recognized by 5-tape Turing machines that cannot be recognized by single-tape Turing machines. (c) TRUE FALSE There are languages recognized by nondeterministic Turing machines that cannot be recognized by deterministic Turing machines. (d) TRUE FALSE Every Turing-decidable language is finite. (e) TRUE FALSE The universal Turing machine decides A TM = { M,w M is a TM that accepts string w}. (f) TRUE FALSE The language A TM is Turing-recognizable. (g) TRUE FALSE The problem of determining if an NFA and regular expression are equivalent is undecidable. (h) TRUE FALSE Two languages A and B are equal if A B =. (i) TRUE FALSE For any Turing machine M = (Q,Σ,Γ,δ,q 1,q accept,q reject ) and string w Σ, M will either accept or reject w. (j) TRUE FALSE Every infinite set is uncountable. 2

2. [20 points] Give a short answer (at most three sentences) for each part below. For parts (a), (b) and (c), let A = {x,y,z} and B = {1,2,3}, and define the function f : A B such that Explain your answers. (a) Is f one-to-one? f(x) = 1, f(y) = 1, f(z) = 2. (b) Is f onto? (c) Is f a correspondence? 3

(d) What is the difference between a Turing-recognizable language and a Turing-decidable language? (e) What does the Church-Turing Thesis say? 4

3. [10 points] Consider the below Turing machine M = (Q,Σ,Γ,δ,q 1,q accept,q reject ) with Q = {q 1,...,q 8,q accept,q reject }, Σ = {0,1,#}, Γ = {0,1,#,x, }, and transitions below. q 1 # #,R q 8 x x,r 0 0,R 1 1,R 0 x,r 1 x,r q 2 x x,r q 3 0 0,R 1 1,R,R # #,R q 7 # #,R 0 0,L q 4 1 1,L # #,L q 5 x x,r x x,r 0 x,l 1 x,l q accept q 6 0 0,L 1 1,L x x,l To simplify the figure, we don t show the reject state q reject or the transitions going to the reject state. Those transitions occur implicitly whenever a state lacks an outgoing transition for a particular symbol. For example, because in state q 5 no outgoing arrow with a # is present, if a # occurs under the head when the machine is in state q 5, it goes to state q reject. For completeness, we say that in each of these transitions to the reject state, the head writes the same symbol as is read and moves right. Give the sequence of configurations that M enters when started on the input string 100#0. Scratch-work area 5

Each of the following problems requires you to prove a result. Unless stated otherwise, in your proofs, you can apply any theorems that we went over in class without proving them, except for the result you are asked to prove in the problem. When citing a theorem, make sure that you give enough details so that it is clear what theorem you are using (e.g., say something like, By the theorem that says every context-free language has a CFG in Chomsky normal form, we can show that... ) 4. [10 points] Consider the emptiness problem for Turing machines: E TM = { M M is a Turing machine with L(M) = }. Show that E TM is co-turing-recognizable. 6

5. [15 points] Prove that the set of all languages over an alphabet Σ is uncountable. 7

6. [15 points] Let Σ = {0,1}, and consider the decision problem of testing whether a regular expression with alphabet Σ generates at least one string w that has 101 as a substring. Express this problem as a language and show that it is decidable. 8

7. [10 points] Recall EQ TM = { M 1,M 2 M 1 and M 2 are TMs with L(M 1 ) = L(M 2 )}. Prove that EQ TM is undecidable. 9