CSC-461 Exam #2 April 16, 2014

Similar documents
CS 44 Exam #2 February 14, 2001

Theory of Computation, Homework 3 Sample Solution

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

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

Theory of Computations Spring 2016 Practice Final Exam Solutions

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

ECS 120 Lesson 16 Turing Machines, Pt. 2

CSE 105 THEORY OF COMPUTATION

(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 of Computation Dr. Weiss Extra Practice Exam Solutions

CSE 105 THEORY OF COMPUTATION

Enumerations and Turing Machines

Recursively Enumerable Languages, Turing Machines, and Decidability

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

Multiple Choice Questions

Theory of Computations Spring 2016 Practice Final

CS154 Midterm Examination. May 4, 2010, 2:15-3:30PM

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

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

Outline. Language Hierarchy

Actually talking about Turing machines this time

Theory Bridge Exam Example Questions Version of June 6, 2008

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

Context-Free Grammars

PDA s. and Formal Languages. Automata Theory CS 573. Outline of equivalence of PDA s and CFG s. (see Theorem 5.3)

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2016

Recursive and Recursively Enumerable Languages

Final Course Review. Reading: Chapters 1-9

T.E. (Computer Engineering) (Semester I) Examination, 2013 THEORY OF COMPUTATION (2008 Course)

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

Turing Machines, continued

pp Variants of Turing Machines (Sec. 3.2)

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

ONE-STACK AUTOMATA AS ACCEPTORS OF CONTEXT-FREE LANGUAGES *

Computer Sciences Department

Decision Properties for Context-free Languages

CSE 105 THEORY OF COMPUTATION

CS/ECE 374 Fall Homework 1. Due Tuesday, September 6, 2016 at 8pm

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

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

UNIT I PART A PART B

Semantics via Syntax. f (4) = if define f (x) =2 x + 55.

Formal Grammars and Abstract Machines. Sahar Al Seesi

JNTUWORLD. Code No: R

Succinctness counts. You may receive as little as 0 points for an answer that, even

To illustrate what is intended the following are three write ups by students. Diagonalization

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

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

CpSc 421 Final Solutions

Variants of Turing Machines

Context-Free Grammars

Turing Machine Languages

Final Exam 1, CS154. April 21, 2010

Turing Machines Part Two

14.1 Encoding for different models of computation

CT32 COMPUTER NETWORKS DEC 2015

Final Exam 2, CS154. April 25, 2010

Definition: A context-free grammar (CFG) is a 4- tuple. variables = nonterminals, terminals, rules = productions,,

1 Parsing (25 pts, 5 each)

Ambiguous Grammars and Compactification

CS143 Midterm Fall 2008

Equivalence of NTMs and TMs

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

CS311 / MATH352 - AUTOMATA AND COMPLEXITY THEORY

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

CMPSCI 250: Introduction to Computation. Lecture 20: Deterministic and Nondeterministic Finite Automata David Mix Barrington 16 April 2013

Computer Science 236 Fall Nov. 11, 2010

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

UVa ID: NAME (print): CS 4501 LDI Midterm 1

Context-Free Languages & Grammars (CFLs & CFGs) Reading: Chapter 5

Theory of Programming Languages COMP360

Lecture 18: Turing Machines

AUBER (Models of Computation, Languages and Automata) EXERCISES

6.045J/18.400J: Automata, Computability and Complexity. Practice Quiz 2

Context-Free Grammars

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


QUESTION BANK. Unit 1. Introduction to Finite Automata

Does this program exist? Limits of computability. Does this program exist? A helper function. For example, if the string program is

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

Learn Smart and Grow with world

Complexity Theory. Compiled By : Hari Prasad Pokhrel Page 1 of 20. ioenotes.edu.np

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

CS525 Winter 2012 \ Class Assignment #2 Preparation

Chapter 14: Pushdown Automata

Math 454 Final Exam, Fall 2005

CS21 Decidability and Tractability

Midterm I (Solutions) CS164, Spring 2002

6.080 / Great Ideas in Theoretical Computer Science Spring 2008

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

HKN CS 374 Midterm 1 Review. Tim Klem Noah Mathes Mahir Morshed

Qualifying Exam in Programming Languages and Compilers

Section 1.4 Proving Conjectures: Deductive Reasoning

CMSC 330, Fall 2018 Midterm 2

INFOB3TC Exam 2. Sean Leather. Monday, 30 January 2012, 17:00 20:00

COMP 382: Reasoning about algorithms

Formal languages and computation models

TOPIC PAGE NO. UNIT-I FINITE AUTOMATA

We show that the composite function h, h(x) = g(f(x)) is a reduction h: A m C.

CSE 120. Computer Science Principles

Transcription:

Pledge: On my honor, I pledge that I have not discussed any of the questions on this exam with fellow students, nor will I until after 7 p.m. tonight. Signed: CSC-461 Exam #2 April 16, 2014 Name Time Started: Time Finished: Each question is equally weighted. You may omit two questions, but you must answer #8, and you can only omit one of #6 or #7. Circle the questions you are omitting. (Do not just leave them blank.) Show your work and state your assumptions for partial credit consideration. Unless explicitly stated, there are NO intended errors and NO trick questions. If in doubt, ask! You have two hours to work. 1. Answer the following questions. Explanations are not required, unless you think they would be helpful. (a) Show that the language generated by the grammar S 0S0 1S1 is regular. (This one is a semi-trick question.) [5 points] (b) Show that the language generated by the grammar S 0S S1 ε is regular. [5 points] (c) Give a CFG to generate {w ϵ {a,b}* w contains at least 3 b s}. [5 points] (d) Give a CFG to generate {w ϵ {a,b}* w has more a s than b s}. [5 points]

2. Create the following machines. In each case, fully specify the machine and give a brief description of the algorithm that it follows. Full credit will only be given if the machine takes advantage of its particular features. For example, generating a grammar and building the automatic PDA for that grammar is allowable, but not worthy of full credit. (a) Give a PDA for the language of odd length palindromes over {a,b}. You may specify the transition function or give a state diagram. (b) Give a deterministic, single-tape, one-way infinite Turing Machine for the language {a i b j i < j}. You may specify the transition function or give a state diagram. You may not use TM subroutines unless you specify them also.

3. Answer each of the following questions concerning the intersection of CFLs. [10 points each] (a) Below is a proof of a conjecture that is false. Identify the first step that is wrong, and clearly explain why. The explanation is more important than the step you identify. Conjecture: The intersection of two CFLs is a CFL. Proof: 1. We define the intersection of two context-free languages A and B A B = {w w ϵ A and w ϵ B} 2. The language X = A B is a subset of the language A. That is, X A. This is true since every string in X must also be in A. 3. Since X is a subset of A, and A is context free, X is context free. (b) Now, use the following two languages to show that the class of CFLs is in fact not closed under intersection: A = {a m b n c n m, n 0} B = {a n b n c m m, n 0}

4. (a) Prove that the class of decidable languages is closed under intersection. This should involve a construction as well as an argument that the construction shows the desired result. [7 points] (b) Prove that the class of Turing-recognizable languages is also closed under intersection. This should involve a construction as well as an argument that the construction shows the desired result. [7 points] (c) If A is a Turing-recognizable language and B A, is B necessarily a Turingrecognizable language? Prove your answer. [6 points]

5. Show that each of the following is decidable: (a) Let A = {<R,S> R and S are regular expressions and L(R) L(S)}. (Note that it is proper inclusion.) [10 points] (b) Let S = {<M> M is a DFA that accepts the reverse of w whenever it accepts w}. [10 points] 6. Show that the following language is decidable: REPEATS-STATE = {<M,w> M is a Turing Machine and M enters some state more than once in processing input w}

7. Consider the following CFG: S asa bsb a b (a) Describe the language that is generated by the CFG. [4 points] (b) Prove your answer by induction on the length of a string. (In your proof, if you have a portion that is genuinely analogous to something already completed, you may say so and omit repeating it.) [16 points] NOTE: This calls for a formal proof, not an informal argument. That the conjecture is true is probably something you consider to be obvious. But resist the temptation to let that insight lead you to an insufficient or incomplete proof.

8. Construct a standard (single-tape, one-way infinite, deterministic) TM to insert a single character from the alphabet at the tape head position. That is, the TM should change the configuration from yq0z to a halting configuration yqhaltαz, where y and z are arbitrary strings over the alphabet {a, b}, and α ϵ {a, b} is a single alphabet symbol. Include a brief explanation of how the TM works. You may not use TM subroutines unless you fully specify them also. Have a great break! (after tomorrow s Turing discussion, that is )