Theory of Computations Spring 2016 Practice Final

Similar documents
Theory of Computations Spring 2016 Practice Final Exam Solutions

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

Theory Bridge Exam Example Questions Version of June 6, 2008

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION

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

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

Theory of Computation Dr. Weiss Extra Practice Exam Solutions

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

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

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

Theory of Programming Languages COMP360

Computer Sciences Department

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

Introduction to Computers & Programming

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2016

Outline. Language Hierarchy

CISC 4090 Theory of Computation

Theory of Computation, Homework 3 Sample Solution

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

ECS 120 Lesson 16 Turing Machines, Pt. 2

The Big Picture. Chapter 3

UNIT I PART A PART B

Recursively Enumerable Languages, Turing Machines, and Decidability

CSE 105 THEORY OF COMPUTATION

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.

Last lecture CMSC330. This lecture. Finite Automata: States. Finite Automata. Implementing Regular Expressions. Languages. Regular expressions

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

CSC-461 Exam #2 April 16, 2014

Multiple Choice Questions

Problems, Languages, Machines, Computability, Complexity

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


1 Parsing (25 pts, 5 each)

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

Final Course Review. Reading: Chapters 1-9

Enumerations and Turing Machines

CS 125 Section #10 Midterm 2 Review 11/5/14

Turing Machine Languages

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

Equivalence of NTMs and TMs

(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

Theory and Compiling COMP360

Theory of Languages and Automata

CSE Qualifying Exam, Spring February 2, 2008

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

Turing Machines, continued

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

Variants of Turing Machines

Finite Automata. Dr. Nadeem Akhtar. Assistant Professor Department of Computer Science & IT The Islamia University of Bahawalpur

Specifying Syntax COMP360

JNTUWORLD. Code No: R

CS21 Decidability and Tractability

Midterm I (Solutions) CS164, Spring 2002

Formal languages and computation models

Decision Properties for Context-free Languages

A Characterization of the Chomsky Hierarchy by String Turing Machines

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

Actually talking about Turing machines this time

CT32 COMPUTER NETWORKS DEC 2015

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

Nondeterministic Polynomial Time

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

Chapter 14: Pushdown Automata

Front End: Lexical Analysis. The Structure of a Compiler

Material from Recitation 1

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

AUBER (Models of Computation, Languages and Automata) EXERCISES

Computability and Complexity Sample Exam Questions

III. Supplementary Materials

1. Provide two valid strings in the languages described by each of the following regular expressions, with alphabet Σ = {0,1,2}.

1. Provide two valid strings in the languages described by each of the following regular expressions, with alphabet Σ = {0,1,2}.

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

1. Draw the state graphs for the finite automata which accept sets of strings composed of zeros and ones which:

4.1 Review - the DPLL procedure

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

14.1 Encoding for different models of computation

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

W[1]-hardness. Dániel Marx 1. Hungarian Academy of Sciences (MTA SZTAKI) Budapest, Hungary

Lexical Analysis - 2

Lecture 18: Turing Machines

CSE 105 THEORY OF COMPUTATION

Theory of Computation

Chapter 3 Complexity of Classical Planning

More on Polynomial Time and Space

DHANALAKSHMI SRINIVASAN INSTITUTE OF RESEARCH AND TECHNOLOGY SIRUVACHUR, PERAMBALUR DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

Structure of a Compiler: Scanner reads a source, character by character, extracting lexemes that are then represented by tokens.

Formal Languages and Automata

Automata & languages. A primer on the Theory of Computation. The imitation game (2014) Benedict Cumberbatch Alan Turing ( ) Laurent Vanbever

Answer All Questions. All Questions Carry Equal Marks. Time: 20 Min. Marks: 10.

CS 44 Exam #2 February 14, 2001

A Note on the Succinctness of Descriptions of Deterministic Languages

Definition 2.8: A CFG is in Chomsky normal form if every rule. only appear on the left-hand side, we allow the rule S ǫ.

QUESTION BANK. Unit 1. Introduction to Finite Automata

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

CSCI 340: Computational Models. Turing Machines. Department of Computer Science

PS3 - Comments. Describe precisely the language accepted by this nondeterministic PDA.

6.080 / Great Ideas in Theoretical Computer Science Spring 2008

CpSc 421 Final Solutions

CSE 105 THEORY OF COMPUTATION

Transcription:

1 of 6 Theory of Computations Spring 2016 Practice Final 1. True/False questions: For each part, circle either True or False. (23 points: 1 points each) a. A TM can compute anything a desktop PC can, although it might take more time. True False b. A Push-Down Automata can compute things that a TM cannot compute. True False c. Every Turing-decidable language is also Turing-recognizable. True False d. The Halting problem is decidable. True False e. All problems have an algorithm that will solve/decide them. True False f. 4n 2 = O(n) True False g. 3n 3 = O(n 3 ) True False h. nlogn = o(n 2 ) True False i. 2 n = O(n 20 ) True False j. You cannot build a DFA to recognize {0 500 1 10000 1 1000 0 200 } True False k. NP is the class of languages with polynomial time verifiers. True False l. The various sorting algorithms (e.g., bubblesort, heapsort) are in NP True False m. Most theoretical computer scientists believe that P = NP. True False n. All languages are Turing-recognizable True False o. The class of regular languages is closed under union True False p. All languages are decidable True False q. A regular language L may not be context-free. True False r. A DFA is decidable. A DFA = {<B,w> B is a DFA that accepts input string w}. True False s. Deterministic and non-deterministic PDA s have equivalent expressive power. True False t. If a problem A is reducible to problem B, then problem A must be no harder than B. True False u. An algorithm implemented on a single tape Turing machine will always have the same running time (e.g., big-o value) when run on a 2-tape Turing machine. True False v. NP is the class of languages decided by some nondeterministic polynomial time Turing Machine. w. From a computability perspective, every multi-tape Turing machine has an equivalent single-tape TM. True False True False

2 of 6 2. Short answer questions. Answer each question in a few sentences. (14 points: 2 each) a. The diagram below show a hierarchy of the languages we learned, with respect to computability. Write the proper language next to the labels a-d in the diagram below such that the hierarchy is correct. The languages are: Turing-recognizable, regular, decidable, contextfree. a: c: d: b: b. A finite automata will run until its input is completely processed and then it will stop. This is not true for a Turing machine. Explain why. c. A language is Turing-recognizable if some Turing machine recognizes it (this is a definition). But what does it mean when we say that a TM recognizes a language? The answer can be quite simple (one sentence) but please be precise.

3 of 6 d. A language is Turing-decidable if some Turing machine decides it. What does it mean for a Turing machine to decide a language? Again, please be precise, but you can be relatively informal. e. We are given a problem and find out that it is undecidable. Could there be an algorithm to solve it in polynomial time? Answer yes or no and then explain/justify your answer. f. I tell you that an algorithm runs in O(2 n ) but yet is in P. How can this be? g. Assume that someone finds a polynomial time solution to an NP-complete problem. 1) What does that say about all NP-complete problems? 2) What does that say about the question of whether P = NP?

4 of 6 3. (7 points) Draw the DFA that, for the alphabet Σ = {0,1} accepts all strings that do not have any consecutive 0 s or 1 s (e.g., 0, 0101, 101, and 10 are accepted but 11, 001, and 01001 are not) 4. (7 points) Provide a Context Free grammar that generates the language 00*1*. 5. (7 points) Let E DFA = {<A> A is a DFA and L(A) = }. Prove that E DFA is decidable by providing an algorithm that decides it. You should also comment on why the provided algorithm is decidable.

5 of 6 6. (10 points total) Give implementation level descriptions of Turing machines that decide the following languages over the alphabet {a,b,c}. Recall that implementation level is lower level than the pseudo code that we use to describe algorithms (at the implementation level you talk about scanning the tape and tape movements). {w w contains more than 5 times as many b s as a s}

6 of 6 7. (5 points) Let A DFA = {<B,w> B is a DFA that accepts input string w}. Provide a simple explanation (one could call it a very informal proof) for why this language is decidable. 8. (9 points) Describe a PDA that accepts the following languages. For part b, if you want, rather than describing it from scratch, you can just say how you would modify your answer from part a. Note: part b is a bit tricky. Hint: for part b, you will need to utilize a capability of the PDA not used in part a. a. L = {0 m 1 n : n m}