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

Similar documents
Midterm Exam 2 CS 341: Foundations of Computer Science II Fall 2018, 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.

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

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

CSE 105 THEORY OF COMPUTATION

Theory of Computation (IX) Yijia Chen Fudan University

V Honors Theory of Computation

Name: Student ID: Instructions:

1 Showing Recognizability

TURING MAHINES

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET

ACS2: Decidability Decidability

Computability Theory. CS215, Lecture 6,

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

Exam Computability and Complexity

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

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

Decidability (intro.)

Decidability (What, stuff is unsolvable?)

CSE 105 THEORY OF COMPUTATION. Spring 2018 review class

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

Computability and Complexity

CpSc 421 Final Exam December 15, 2006

Part I: Definitions and Properties

Midterm II : Formal Languages, Automata, and Computability

Homework Assignment 6 Answers

Intro to Theory of Computation

Reducability. Sipser, pages

CS 311 Sample Final Examination

CSCE 551 Final Exam, Spring 2004 Answer Key

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

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

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

Turing Machines Part III

CS20a: Turing Machines (Oct 29, 2002)

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION

CPSC 421: Tutorial #1

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

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

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

Decidable Languages - relationship with other classes.

CS154, Lecture 10: Rice s Theorem, Oracle Machines

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

CSE 105 THEORY OF COMPUTATION

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

Undecidable Problems and Reducibility

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

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

Computability Theory

UNIT-VIII COMPUTABILITY THEORY

Foundations of

Undecidability. We are not so much concerned if you are slow as when you come to a halt. (Chinese Proverb)

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

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

Theory of Computation

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

DM17. Beregnelighed. Jacob Aae Mikkelsen

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

Chapter 3: The Church-Turing Thesis

Final exam study sheet for CS3719 Turing machines and decidability.

Computability and Complexity

CSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY

Decidable and undecidable languages

Introduction to Turing Machines. Reading: Chapters 8 & 9

Computation Histories

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

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

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

Chomsky Normal Form and TURING MACHINES. TUESDAY Feb 4

CISC4090: Theory of Computation

A non-turing-recognizable language

Intro to Theory of Computation

Lecture 12: Mapping Reductions

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

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

4.2 The Halting Problem

Theory Bridge Exam Example Questions

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

3130CIT Theory of Computation

} Some languages are Turing-decidable A Turing Machine will halt on all inputs (either accepting or rejecting). No infinite loops.

Computability Theory

Announcements. Using a 72-hour extension, due Monday at 11:30AM.

Turing Machine Recap

CSE 105 THEORY OF COMPUTATION

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

CS20a: Turing Machines (Oct 29, 2002)

Final Exam Version A December 16, 2014 Name: NetID: Section: # Total Score

CpSc 421 Homework 9 Solution

Final Exam (Version B) December 16, 2014 Name: NetID: Section: 1 2 3

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

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

Theory of Computation CS3102 Spring 2014 A tale of computers, math, problem solving, life, love and tragic death

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

Closure under the Regular Operations

CSE 105 Theory of Computation

Turing machines and linear bounded automata

CSCC63 Worksheet Turing Machines

CSE 311: Foundations of Computing I Autumn 2014 Practice Final: Section X. Closed book, closed notes, no cell phones, no calculators.

CSCE 551 Final Exam, April 28, 2016 Answer Key

Transcription:

Midterm Exam 2 CS 341: Foundations of Computer Science II Fall 2016, 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 Code 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 25 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 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 For any Turing machine M = (Q,Σ,Γ,δ,q 1,q accept,q reject ) and string w Σ, M will either accept or reject w. (b) TRUE FALSE Every language is Turing-recognizable. (c) TRUE FALSE Every Turing-decidable language is also Turing-recognizable. (d) TRUE FALSE Every multi-tape Turing machine has an equivalent single-tape Turing machine. (e) TRUE FALSE The universal Turing machine recognizes A TM = { M,w M is a TM that accepts string w}. (f) TRUE FALSE Two languages A and B are equal if and only if A B =. (g) TRUE FALSE Every infinite set is uncountable. (h) TRUE FALSE Every regular language is Turing-decidable. (i) TRUE FALSE The set of all Turing machines is countable. (j) TRUE FALSE There is a language A that is recognized by a nondeterministic Turing machine but is not recognized by any deterministic Turing machine. 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}, and define the function f : A B such that Explain your answers. (a) Is f one-to-one? f(x) = 1, f(y) = 2, f(z) = 1. (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 0#0. 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] Let B be theset of all infinite sequences over {0,1}. Show that B isuncountable. 6

5. [15 points] Consider the problem of determining if a regular expression generates at least one string that has 010 as a substring. Express this problem as a language and show that it is decidable. 7

6. [15 points] Prove that a language A is decidable if and only if it is both Turing-recognizable and co-turing-recognizable. 8

7. [10 points] Recall that HALT TM = { M,w M is a Turing machine that halts on input w}. Prove that HALT TM is undecidable. 9