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

Similar documents
Theory of Computation

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET

60-354, Theory of Computation Fall Asish Mukhopadhyay School of Computer Science University of Windsor

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

CISC4090: Theory of Computation

Name: Student ID: Instructions:

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

10. The GNFA method is used to show that

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

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

Computational Models - Lecture 5 1

CPSC 421: Tutorial #1

Properties of Context-Free Languages. Closure Properties Decision Properties

Theory of Computation (IV) Yijia Chen Fudan University

Theory Bridge Exam Example Questions

CSE 105 THEORY OF COMPUTATION

Closure Properties of Context-Free Languages. Foundations of Computer Science Theory

Nondeterministic Finite Automata

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

DM17. Beregnelighed. Jacob Aae Mikkelsen

Pushdown automata. Twan van Laarhoven. Institute for Computing and Information Sciences Intelligent Systems Radboud University Nijmegen

CSE 355 Test 2, Fall 2016

Context Free Languages: Decidability of a CFL

CS 530: Theory of Computation Based on Sipser (second edition): Notes on regular languages(version 1.1)

NODIA AND COMPANY. GATE SOLVED PAPER Computer Science Engineering Theory of Computation. Copyright By NODIA & COMPANY

CSE 105 THEORY OF COMPUTATION

3130CIT Theory of Computation

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

CS5371 Theory of Computation. Lecture 7: Automata Theory V (CFG, CFL, CNF)

SYLLABUS. Introduction to Finite Automata, Central Concepts of Automata Theory. CHAPTER - 3 : REGULAR EXPRESSIONS AND LANGUAGES

Harvard CS 121 and CSCI E-207 Lecture 10: CFLs: PDAs, Closure Properties, and Non-CFLs

MA/CSSE 474 Theory of Computation

ECS 20: Discrete Mathematics for Computer Science UC Davis Phillip Rogaway June 12, Final Exam

Computational Models - Lecture 4

Pushdown Automata. Notes on Automata and Theory of Computation. Chia-Ping Chen

CSE 105 THEORY OF COMPUTATION. Spring 2018 review class

V Honors Theory of Computation

NPDA, CFG equivalence

Final exam study sheet for CS3719 Turing machines and decidability.

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

COMP-330 Theory of Computation. Fall Prof. Claude Crépeau. Lec. 10 : Context-Free Grammars

Solutions to Old Final Exams (For Fall 2007)

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

Theory of Computation (II) Yijia Chen Fudan University

Foundations of Informatics: a Bridging Course

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

CSE 105 THEORY OF COMPUTATION

Theory of Computation (IX) Yijia Chen Fudan University

Computational Models: Class 5

Pushdown Automata. We have seen examples of context-free languages that are not regular, and hence can not be recognized by finite automata.

2.1 Solution. E T F a. E E + T T + T F + T a + T a + F a + a

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

Before We Start. The Pumping Lemma. Languages. Context Free Languages. Plan for today. Now our picture looks like. Any questions?

CPS 220 Theory of Computation Pushdown Automata (PDA)

Automata Theory. Lecture on Discussion Course of CS120. Runzhe SJTU ACM CLASS

Ogden s Lemma for CFLs

Computational Models - Lecture 4 1

CS481F01 Prelim 2 Solutions

Computability Theory

UNIT-VI PUSHDOWN AUTOMATA

Languages, regular languages, finite automata

CPS 220 Theory of Computation

Chapter 6. Properties of Regular Languages

CSE 105 THEORY OF COMPUTATION

Theory of Computation (Classroom Practice Booklet Solutions)

Pushdown Automata (2015/11/23)

CS 455/555: Finite automata

Part 4 out of 5 DFA NFA REX. Automata & languages. A primer on the Theory of Computation. Last week, we showed the equivalence of DFA, NFA and REX

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

PS2 - Comments. University of Virginia - cs3102: Theory of Computation Spring 2010

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

Introduction to Theory of Computing

CpSc 421 Final Exam December 15, 2006

Context Free Languages (CFL) Language Recognizer A device that accepts valid strings. The FA are formalized types of language recognizer.

1. Induction on Strings

Chapter Five: Nondeterministic Finite Automata

Theory of Computation Turing Machine and Pushdown Automata

False. They are the same language.

1. Draw a parse tree for the following derivation: S C A C C A b b b b A b b b b B b b b b a A a a b b b b a b a a b b 2. Show on your parse tree u,

Introduction to the Theory of Computing

Section 1 (closed-book) Total points 30

CSE 105 Theory of Computation Professor Jeanne Ferrante

Pushdown Automata. Reading: Chapter 6

Introduction to Languages and Computation

Introduction to the Theory of Computation. Automata 1VO + 1PS. Lecturer: Dr. Ana Sokolova.

Decidability (What, stuff is unsolvable?)

CS 154 Introduction to Automata and Complexity Theory

October 6, Equivalence of Pushdown Automata with Context-Free Gramm

ECS 120: Automata Theory and Formal Languages. UC Davis Phillip Rogaway December 13, ECS 120 Final { Fall 1995

Computational Models Lecture 5

Mathematics for linguists

COMP-330 Theory of Computation. Fall Prof. Claude Crépeau. Lec. 5 : DFA minimization

Non-context-Free Languages. CS215, Lecture 5 c

Introduction to the Theory of Computation. Automata 1VO + 1PS. Lecturer: Dr. Ana Sokolova.

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

UNIT-VIII COMPUTABILITY THEORY

Comment: The induction is always on some parameter, and the basis case is always an integer or set of integers.

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

Decidability (intro.)

Sri vidya college of engineering and technology

Transcription:

ECS 120: Theory of Computation Handout MT UC Davis Phillip Rogaway February 16, 2012 Midterm Exam Instructions: The exam has six pages, including this cover page, printed out two-sided (no more wasted paper). Please read the questions carefully, then answer carefully. Be mathematically precise, and precise and grammatical with your English, too; you know what an ogre that crazy professor is. Good luck, phil rogaway Name: Notation: CFG = context free grammar CFL = context free language CNF = Chomsky normal form DFA = deterministic finite automaton NFA = nondeterministic finite automaton PDA = pushdown automaton reasonably efficient = polynomial running time On page 2 3 4 5 6 Σ you got

ECS 120 Handout MT: Midterm Exam 2 1 True or False Indicate if the following statements are true or false, by filling in (darkening) the correct box. Some of the questions will be familiar, but do be careful. Do not provide any justification. If in doubt, guess; missing answers will be treated as. 1. There is an efficient algorithm to decide if a multivariate polynomial over the integers has an integer root. True False 2. L = is a language. True False 3. All finite languages are regular. True False 4. An infinite language can have an infinite complement. True False 5. All infinite languages have infinite complements. True False 6. The union of infinitely many regular languages is regular. True False 7. If L is regular then so is {xx : x L}. True False 8. If L is regular then so is {xy : x, y L}. True False 9. Let A = {1 2p : p is prime}. Then A is regular. True False 10. The pumping lemma is a useful tool to show that a language is regular. True 11. Language L = {w {0, 1} : w has an equal number of 01 s and 10 s} is regular. True False False 12. For every number n, the language L n = {0 n 1 n } is regular. True False 13. If there s a 10-state DFA that accepts L then there s a 20-state DFA that accepts L. True False 14. Given a DFA M, there is a reasonably efficient. procedure to find a smallest DFA for L(M). True False 15. Given an NFA M, we know a reasonably efficient procedure to find a smallest NFA for L(M). True False

ECS 120 Handout MT: Midterm Exam 3 16. If M is an NFA then (L(M)) can be accepted by an NFA. True False 17. If L is regular then L is regular. True False 18. If M is an NFA and there is one abb-labeled path from the start state to a final state, and there is another abb-labeled path from the start state to a non-final state, then M is invalid: it neither accepts nor rejects abb. True False 19. If there s a 10-state NFA that accepts L then there s a 100-state DFA that accepts L. True False 20. Given h: Σ {0, 1}, define h(l) = {h(a 1 ) h(a n ) : a 1 a n L}. Then h(l) is regular if L is regular. True False 21. If L is context free then L is context free. True False 22. All DFA-acceptable languages are context free. True False 23. You can always convert a PDA into an NFA for the same language. True False 24. Every subset of a context free language is regular. True False 25. There s a reasonably efficient procedure to decide if a string w is in the language of a CNF CFG G. True False 26. If a CFG G is in CNF, then G is not ambiguous. True False 27. Some PDAs need infinite-length descriptions, as the rules (productions) can be an arbitrary subset of V (V Σ). True False 28. The context-free languages are closed under union. True False 29. The context-free languages are closed under complement. True False 30. If A and B are regular then {xy x A and y B and x = y } is context free. True False

ECS 120 Handout MT: Midterm Exam 4 2 Short Answer 1. Complete the following sentence, being mathematically precise and following the conventions of your text: A DFA is a five-tuple M = (Q, Σ, δ, q 0, F ) where Q is a finite set, Σ is an alphabet, q 0 Q, F Q, and δ is a function with domain and range. 2. Carefully explain what it means if I say: the context-free languages are closed under intersection. Don t indicate if the statement is true or false just provide a precise mathematical translation of the meaning of the claim. 3. List the first five strings, in lexicographic order, of the language L = {x y : x, y {0, 1} are unequal strings} Here is a formal symbol, just like 0 and 1. 0 < 1 <. Assume that characters are ordered 4. Sketch, briefly and informally, how a PDA for would work. L = {x y : x, y {0, 1} are unequal strings} 5. Give an example of a claim that we proved using the product construction. Don t prove the claim just make a precise claim that was proven with the product construction.

ECS 120 Handout MT: Midterm Exam 5 6. Let M = (Q, Σ, δ, q 0, F ) be a DFA. In class and in the online notes we described an algorithm to minimize the number of states in a DFA for L(M). The algorithm worked by defining an equivalence relation on pairs of states of Q. In particular, we said that p q if for all x Σ,. You will wish to use the notation δ (q, x), as we did in class, to indicate the state you are in if you start in state q and consume the string x. 7. You are given the regular expression α = (000) (111). Composing the constructions given in class and in your text (do not simplify anything), imagine converting α into a DFA M for which L(M) = L(α). How many states will M have? 8. Specify a CFG for the language L = {a n b m : m > n}. Make your CFG as simple as possible. 9. Complete the definition, being precise with any quantifiers and not using any form of the word ambiguous in your definition: A CFL L is inherently ambiguous if: 10. Carefully state the pumping lemma for context free languages. Don t use the word pumps and be careful with any quantifiers.

ECS 120 Handout MT: Midterm Exam 6 11. How many states are in a smallest DFA for the language L n = (a n ) if the underlying alphabet is Σ = {a, b}? (Note: b n L n.) 12. Continuing the last problem: how would you prove that, for all n, there is no smaller DFA for L n? (You don t need to provide such a proof, but name the main tool and sketch the main idea.) 13. A regular grammar is a context-free grammar G = (V, Σ, R, S) in which every rule is of the form A ε or A ab, where a is a terminal and A and B are variables. Suppose that L is regular, say L = L(M) for a DFA M = (Q, Σ, δ, q 0, F ). Define a CFG G = (V, Σ, R, S) such that L = L(G) by saying: 14. A prefix of a string y is a string x such that y = xx for some x. A prefix is proper if it is not the empty string. For any language L, let G(L) = {w L no proper prefix of w is in L}. List the elements of G({ε, 00, 01, 110, 0100, 0110, 1110, 1111}). 15. In a paragraph of 2 5 clear and grammatical English sentences, answer the following question: what is the scientific value of having multiple characterizations of a class of languages, such as the regular languages or the CFLs?