COL 352 Introduction to Automata and Theory of Computation Major Exam, Sem II , Max 80, Time 2 hr. Name Entry No. Group

Similar documents
Midterm II : Formal Languages, Automata, and Computability

CSCE 551 Final Exam, April 28, 2016 Answer Key

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

Answers to the CSCE 551 Final Exam, April 30, 2008

6.045 Final Exam Solutions

CSE200: Computability and complexity Space Complexity

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

CSCE 551 Final Exam, Spring 2004 Answer Key

Notes for Lecture Notes 2

Exam Computability and Complexity

1 Showing Recognizability

MTAT Complexity Theory October 13th-14th, Lecture 6

1 Computational Problems

SOLUTION: SOLUTION: SOLUTION:

Computability and Complexity

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

Computational Models Lecture 8 1

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

Computational Models Lecture 8 1

Computation Histories

CSE 105 THEORY OF COMPUTATION. Spring 2018 review class

1 More finite deterministic automata

Advanced topic: Space complexity

Complexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler

Outline. Complexity Theory EXACT TSP. The Class DP. Definition. Problem EXACT TSP. Complexity of EXACT TSP. Proposition VU 181.

CSE 555 HW 5 SAMPLE SOLUTION. Question 1.

CS481F01 Solutions 8

6.841/18.405J: Advanced Complexity Wednesday, February 12, Lecture Lecture 3

Computational Models Lecture 8 1

CS Lecture 29 P, NP, and NP-Completeness. k ) for all k. Fall The class P. The class NP

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

Space Complexity. The space complexity of a program is how much memory it uses.

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET

Week 3: Reductions and Completeness

CSCI3390-Second Test with Solutions

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

3130CIT Theory of Computation

Complexity. Complexity Theory Lecture 3. Decidability and Complexity. Complexity Classes

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

CS20a: Turing Machines (Oct 29, 2002)

CSE 105 THEORY OF COMPUTATION

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Decidability (What, stuff is unsolvable?)

ACS2: Decidability Decidability

V Honors Theory of Computation

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Lecture 3. 1 Terminology. 2 Non-Deterministic Space Complexity. Notes on Complexity Theory: Fall 2005 Last updated: September, 2005.

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

Non-emptiness Testing for TMs

Notes for Lecture 3... x 4

6.045: Automata, Computability, and Complexity (GITCS) Class 15 Nancy Lynch

1 Deterministic Turing Machines

U.C. Berkeley CS278: Computational Complexity Professor Luca Trevisan 9/6/2004. Notes for Lecture 3

CS 151 Complexity Theory Spring Solution Set 5

Foundations of Machine Learning and Data Science. Lecturer: Avrim Blum Lecture 9: October 7, 2015

Lecture 25: Cook s Theorem (1997) Steven Skiena. skiena

Introduction to Turing Machines. Reading: Chapters 8 & 9

CSCI3390-Lecture 16: NP-completeness

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

The Turing Machine. Computability. The Church-Turing Thesis (1936) Theory Hall of Fame. Theory Hall of Fame. Undecidability

Turing Machines Part III

Lecture 20: PSPACE. November 15, 2016 CS 1010 Theory of Computation

U.C. Berkeley CS278: Computational Complexity Professor Luca Trevisan August 30, Notes for Lecture 1

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

Lecture 8: Complete Problems for Other Complexity Classes

Theory of Computation

Lecture 12: Mapping Reductions

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

Ma/CS 117c Handout # 5 P vs. NP

NP-Completeness Part II

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

Lecture 6: Oracle TMs, Diagonalization Limits, Space Complexity

CS151 Complexity Theory. Lecture 1 April 3, 2017

Final exam study sheet for CS3719 Turing machines and decidability.

Finite Automata. Mahesh Viswanathan

Decidability: Church-Turing Thesis

CS154, Lecture 15: Cook-Levin Theorem SAT, 3SAT

Lecture 24: Randomized Complexity, Course Summary

Notes for Lecture 3... x 4

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

1 Circuit Complexity. CS 6743 Lecture 15 1 Fall Definitions

Notes on Space-Bounded Complexity

Logarithmic space. Evgenij Thorstensen V18. Evgenij Thorstensen Logarithmic space V18 1 / 18

Essential facts about NP-completeness:

1 PSPACE-Completeness

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

Classes of Boolean Functions

6.840 Language Membership

Theory Bridge Exam Example Questions

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Turing Machine Recap

P is the class of problems for which there are algorithms that solve the problem in time O(n k ) for some constant k.

Decidability and Undecidability

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

CpSc 421 Homework 9 Solution

There are two main techniques for showing that problems are undecidable: diagonalization and reduction

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

UNIT-VIII COMPUTABILITY THEORY

Lecture #14: NP-Completeness (Chapter 34 Old Edition Chapter 36) Discussion here is from the old edition.

Turing Machines and Time Complexity

Transcription:

COL 352 Introduction to Automata and Theory of Computation Major Exam, Sem II 2015-16, Max 80, Time 2 hr Name Entry No. Group Note (i) Write your answers neatly and precisely in the space provided with with each question including back of the sheet. You won t get a second chance to explain what you have written. (ii) You can quote any result covered in the lectures without proof but any other claim should be formally justified. 1. Answer True or false, tick the right choice or fill up as necessary (negative 2 for each incorrect answer) (3 10 ) (a) If P = N P then con P = N P If P = N P then N P is closed under comlementation. (b) If L 1 P and L 2 N P then (i) L 1 polytime L 2 (ii) L 2 polytime L 1 (iii) Neither Note that both L 1, L 2 φ, Σ. Since L 1 P, we can actually compute if w L 1 in polynomial time and then map w to x where x L 2. Similarly for w L 2. Note that L 2 is not known to be in P we we cannot do this in the other direction. (c) The satisfiability of a boolean formula given in Disjunctive Normal Form (disjunction of minterms) is in (i) P (ii) In N P but not known to be in P In DNF, we only have to pick up and satisfy a minterm. For example, if it is x 1 x 2 x 3 then we can assign x 1 = T rue and x 2, x 3 = F alse. (d) If L is NP-complete and L DSP ACE( n), then N P DT IME(2 O( n) ). (Give a bound that is the best known) (e) Let G 1 contain the productions S AS b A a ɛ. Let G 2 contain the productions S AS b A a. Then (i) L(G 2 ) L(G 1 ) (strict subset) (ii) L(G 1 ) = L(G 2 ) We can eliminate ɛ production by having S AS S which is the same as G 1. (f) P SP ACE = NP SP ACE. Follows from Savitch s theorem that NSP ACE(f(n)) DSP ACE(f 2 (n)). (g) L rev contains all the reversal of the strings in L. Which of the following classes are closed under reversal (i) Regular but not CFL (ii) CFLs but not recursively enumerable (iii) recursively enumerable First reverse w and then run the TM for L on w rev. (h) Give an example of a language L such that both L and L (complement) are not CFLs. L = {0 n2 n 1} (i) Given a clause C = (x 1 x 2 x 3 x 4 x 5 ) express the satisfiability of C in 3-CNF using at most two extra boolean variables. (x 1 x 2 y 1 ) (ȳ 1 x 3 y 2 ) (ȳ 2 x 4 x 5 ). (j) Let L be any co-nplanguage. Then L is reducible to L SAT (complement of L SAT ) in polynomial time. If L 1 L 2 then L 1 L 2 using the same reduction function by definition.

2. Let L 1, L 2 be two languages. Then L 1 /L 2 = {x x y L 1 for some y L 2 } If L 1 is regular and L 2 is CFL, then is L 1 /L 2 regular? (10 ) Since L 1 is regular consider a DFA M 1 that recognises L 1. Let L = L 1 /L 2 - suppose w L. Then there exists at least some y L 2 such that w y L 1. Stated otherwise Where M 1 = (Q, q 0, δ, F ). w L y δ(q 0, w y) F Suppose δ(q 0, w) = p. Then for any w such that δ(q 0, w ) = p, w L. We can therefore design a DFA M for L by using the same state diagram as M 1 and define the final states F as those states q such that there exists some string y L 2 δ(q, y) F. Note: To determine which states of M are in F, we do not need to use any properties of L 2, so the above construction works for any language L 2, not just CFLs. That is, the above suffices as an existential proof. However, if L 2 is CFL we can design an algorithm by observing that intersection of L 2 with regular expression (the strings that take us between two states of a DFA) is CFL. Then we can use the emptiness algorithm on the intersection. This observation was not necessary for a correct solution. A number of solutions went astray by trying to construct such a machine using hitherto unproven claims about CFL s having regular expressions, complicated state-transition diagram mixing NFA with reversed CFLs that was completely unnecessary and also incorrectly argued. These were penalized accordingly

3. Is the following problem decidable? Given a TM M and w, does M use finite number of tape cells for input w? (15 ) For undecidability proof, you must describe the many-one reduction function precisely. Otherwise, the decision algorithm must be decsribed in a structured manner. If we know that a TM uses finite (bounded) space then we can decide if M accepts w or not. Even if the exact bound is not known, we can try iteratively space bound 1, 2... i... which is a maximum of 2 O(i) steps. Then either (i) M accepts w (ii) M rejects w by stopping in a non-accepting state or (iii) enters an infinite loop (and hence rejects w. In cases (ii) and (iii), we can easily modify M (by adding lines of code) such that subsequently the head moves right indefinitely. The reduction function f takes input (M, w) and outputs (M, w ) that ignores its input w and simulates M on w as above. M accepts w if M accepts w. Thus w L(M) M uses finite space Moreover M, w can be computed by a recursive TM (that inserts the additional code to achieve the above behavior). Therefore we have achieved L u L finite using a turing computable function. If the proof is not written explicitly as a description of the many-one Turing computable reduction function and what exactly is the input-output of the reduction function, maximum marks given is 5. The technique of many-one reduction is a fundamental concept that was emphasized in the course and it is important that it is demonstrated in the answers written. It was iterated after last assignment submission and mentioned explicitly in the question. It is possible that your answers can be modified to this format but this was strictly enforced and accordingly penalized and there will be no re-evaluation if the description did not conform to this requirement.

4. A language L 1 log L 2 (LOGSPACE reducible) iff x L 1 f(x) L 2 and f(x) can be computed using a log x space-bounded turing machine with an additional write-only output tape where f(x) is written and this space is not counted. Note that the length f(x) can be much longer than log x. The head on the output tape can only move right. Recall that it has a read only tape also whose space is not counted. Show that if L 1 log L 2 and L 2 can be computed using a log n space bounded Turing machine, then L 1 can also be computed using a log n space bounded Turing Machine. Here n is the length of the input.(15 ) The straightforward approach is to integrate the TMs for the reduction function f and M 2 on f(x). f uses log x storage tape and M 2 uses log f(x) space (f(x) is the input to M 2 ). But note that f(x) 2 O(log x ) which can exceed log x and therefore we cannot store the output tape of f explicitly in the composite machine. The challenging issue is how do we store f(x) if we want to run the TM for L 2 on f(x). Instead we compute f(x) on demand. We store the current head position on the write-only tape also the symbol being currently scanned by the head on the (hypothetical) output tape of the TM computing the reduction function. Whenever, the j-th symbol is required we restart the TM for the reduction function and keep computing until the j-th output symbol is produced. Since the counter only needs to count till f(x) which needs O(log x) and we can reduce by a constant factor to make it less than log x (no constant factor). Since f(x) is the input to M 2, it cannot be modified, so generating the symbol scanned by the head will not affect the computation. Simply Composing the two machines does not work since the output tape of M 1 becomes an internal storage tape and therefore the space counts. This was the most common mistake and heavily penalized since this was the most important part of the construction

5. Given an undirected graph G = (V, E) it is 3-colorable iff there is a coloring of the vertices χ : V {1, 2, 3} such that for all edges (x, y) E, χ(x) χ(y). By assuming that the 3-coloring problem is NP-complete, prove that the 4-coloring problem is also NP-complete. Here the colors are from the set {1, 2, 3, 4}. (10 ) Clearly, 4-coloring problem is in NP as we can verify whether the coloring is legal by checking all edges. Now we want to achieve L 3col f L 4col where f can be computed in polynomial time. So, given a graph G(V, E), we have to define G (V, E ) = f(v, E) such that G is 4-colorable iff G is 3-colorable. G is defined as follows V = V {t} and E = E v V, additional vertex t that is connected to all vertices. {v, t}. Essentially G contains an If G is 3-colorable then we can assign the 4th color to t and therefore all edges will distinct colors on the two points. So G is 4-colorable. If G is 4-colorable then G must be 3-colorable - we can prove this by contradiction. Suppose not, then to color t we will be forced to use a fifth color since t is connected to all vertices, i.e., G is not 4-colorable. If the answer was written without giving the explicit reduction (construction of G ) and using some algorithmic construction based on coloring then no credit was given. Every answer must include the proof that it is in NP. After reduction, the proof must be done both ways - if and only if Other reductions are possible but proof must have all the previous components.