CS3102 Theory of Computation Problem Set 2, Spring 2011 Department of Computer Science, University of Virginia

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

CS3102 Theory of Computation Solutions to Selected Problems from Set 1 Department of Computer Science, University of Virginia

CS3102 Theory of Computation Solutions to Problem Set 1, Spring 2012 Department of Computer Science, University of Virginia

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

Topology Homework 3. Section Section 3.3. Samuel Otten

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

Cardinality of Sets. Washington University Math Circle 10/30/2016

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

Topology 550A Homework 3, Week 3 (Corrections: February 22, 2012)

CS402 Theory of Automata Solved Subjective From Midterm Papers. MIDTERM SPRING 2012 CS402 Theory of Automata

Final Test in MAT 410: Introduction to Topology Answers to the Test Questions

Homework Set #2 Math 440 Topology Topology by J. Munkres

9/19/12. Why Study Discrete Math? What is discrete? Sets (Rosen, Chapter 2) can be described by discrete math TOPICS

Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103. Chapter 2. Sets

Proof Techniques Alphabets, Strings, and Languages. Foundations of Computer Science Theory

Let A(x) be x is an element of A, and B(x) be x is an element of B.

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

Slides for Faculty Oxford University Press All rights reserved.

CS402 - Theory of Automata Glossary By

2/18/14. Uses for Discrete Math in Computer Science. What is discrete? Why Study Discrete Math? Sets and Functions (Rosen, Sections 2.1,2.2, 2.

A B. bijection. injection. Section 2.4: Countability. a b c d e g

Infinity and Uncountability. Countable Countably infinite. Enumeration

Comparing sizes of sets

Calculating Cardinalities

Finite automata. We have looked at using Lex to build a scanner on the basis of regular expressions.

What is Set? Set Theory. Notation. Venn Diagram

CS314: FORMAL LANGUAGES AND AUTOMATA THEORY L. NADA ALZABEN. Lecture 1: Introduction

CSC Discrete Math I, Spring Sets

CSE 105 THEORY OF COMPUTATION

Theory of Computations Spring 2016 Practice Final Exam Solutions

2. Functions, sets, countability and uncountability. Let A, B be sets (often, in this module, subsets of R).

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

Lecture 15: The subspace topology, Closed sets

Set and Set Operations

Material from Recitation 1

Theory Bridge Exam Example Questions Version of June 6, 2008

MATH 139 W12 Review 1 Checklist 1. Exam Checklist. 1. Introduction to Predicates and Quantified Statements (chapters ).

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

2 Review of Set Theory

However, this is not always true! For example, this fails if both A and B are closed and unbounded (find an example).

Sets MAT231. Fall Transition to Higher Mathematics. MAT231 (Transition to Higher Math) Sets Fall / 31

Rational subsets in HNN-extensions

Chapter 3. Set Theory. 3.1 What is a Set?

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

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

Cantor s Diagonal Argument for Different Levels of Infinity

9.5 Equivalence Relations

THEORY OF COMPUTATION

Point-Set Topology 1. TOPOLOGICAL SPACES AND CONTINUOUS FUNCTIONS

Chapter 11. Topological Spaces: General Properties

Topology - I. Michael Shulman WOMP 2004

2.1 Sets 2.2 Set Operations

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

Figure 1.1: This is an illustration of a generic set and its elements.

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

Ling/CSE 472: Introduction to Computational Linguistics. 4/6/15: Morphology & FST 2

[Ch 6] Set Theory. 1. Basic Concepts and Definitions. 400 lecture note #4. 1) Basics

Open and Closed Sets

Converting a DFA to a Regular Expression JP

Introduction to Algebraic and Geometric Topology Week 5

Johns Hopkins Math Tournament Proof Round: Point Set Topology

1 Sets, Fields, and Events

Languages and Finite Automata

Multiple Choice Questions

Sets. Margaret M. Fleck. 15 September 2010

Ambiguous Grammars and Compactification

1 Finite Representations of Languages

CS2 Language Processing note 3

A.1 Numbers, Sets and Arithmetic

DISCRETE MATHEMATICS

A set with only one member is called a SINGLETON. A set with no members is called the EMPTY SET or 2 N

Topology notes. Basic Definitions and Properties.

2.1 Symbols and Terminology

2.2 Set Operations. Introduction DEFINITION 1. EXAMPLE 1 The union of the sets {1, 3, 5} and {1, 2, 3} is the set {1, 2, 3, 5}; that is, EXAMPLE 2

CSE 105 THEORY OF COMPUTATION

CHAPTER 8. Copyright Cengage Learning. All rights reserved.

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

ECS 120 Lesson 16 Turing Machines, Pt. 2

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

(Refer Slide Time: 0:19)

Final Exam 2, CS154. April 25, 2010

CS Bootcamp Boolean Logic Autumn 2015 A B A B T T T T F F F T F F F F T T T T F T F T T F F F

Review of Sets. Review. Philippe B. Laval. Current Semester. Kennesaw State University. Philippe B. Laval (KSU) Sets Current Semester 1 / 16

MAT 003 Brian Killough s Instructor Notes Saint Leo University

4. Definition: topological space, open set, topology, trivial topology, discrete topology.

CS 341 Homework 1 Basic Techniques

Cardinality of Sets MAT231. Fall Transition to Higher Mathematics. MAT231 (Transition to Higher Math) Cardinality of Sets Fall / 15

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

Lecture 1. 1 Notation

Exercises Computational Complexity

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

Phil 320 Chapter 1: Sets, Functions and Enumerability I. Sets Informally: a set is a collection of objects. The objects are called members or

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

CIT3130: Theory of Computation. Regular languages

Solutions to Homework 10

CSE 105 THEORY OF COMPUTATION

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

Lecture 25 Notes Spanning Trees

Formal languages and computation models

Recursively Enumerable Languages, Turing Machines, and Decidability

Transcription:

CS3102 Theory of Computation Problem Set 2, Spring 2011 Department of Computer Science, University of Virginia Gabriel Robins Please start solving these problems immediately, and work in study groups. Please prove all your answers; informal arguments are acceptable, but please make them precise / detailed / convincing enough so that they can be easily made rigorous. To review notation and definitions, please read the "Basic Concepts" summary posted on the class Web site, and also read the second chapter (on regular languages) from the Sipser textbook. Important note: this is not a due homework, but rather a pool of problems meant to calibrate the scope and depth of the knowledge & skills in CS theory that you (eventually) need to have for the course exams, becoming a better problem-solver, thinking more abstractly, performing more effectively as a computer scientist, etc. You don t necessarily have to completely solve every last question in this problem set (although it would be great if you did!). Rather, please solve as many of these problems as you can, and use this problem set as a resource to improve your problemsolving skills, abstract thinking, and to find out what topics you need to further focus & improve on. Recall that most (and perhaps even all) of the midterm and final exam questions in this course will come from these problem sets, so your best strategy of studying for the exams in this course is to solve (in study groups) as many of these problems as possible, and the sooner the better! Advice: Please try to solve the easier problems first (where the meta-problem here is to figure out which are the easier ones. ) Please don t spend too long on any single problem without also attempting (in parallel) to solve other problems as well; this way, the easiest problems (at least to you) will reveal themselves much sooner (think about this as a hedging strategy ).

1. Solve the following problems from the [Sipser, Second Edition] textbook: Pages 83-93: 1.4, 1.5, 1.6, 1.7, 1.11, 1.12, 1.13, 1.16, 1.17, 1.18, 1.19, 1.20, 1.21, 1.23, 1.29, 1.30, 1.31, 1.36, 1.38, 1.40, 1.41, 1.42, 1.43, 1.45, 1.46, 1.48, 1.57, 1.58, 1.60, 1.61, 1.63, 1.64 2. Prove or disprove: a countable set of parabolas (arbitrarily oriented and placed) can completely cover (every point inside) the unit square in the plane (i.e., the interior and boundary of a square of side 1) 3. Prove or disprove: an uncountable set of pairwise-disjoint line segments can completely cover (every point in) the unit disk in the plane (i.e., the interior and boundary of a circle of diameter 1). What if the segments could intersect each other, but must all have unique slopes? 4. What is the cardinality of the set of all finite-sized matrices with rational entries? 5. What is the cardinality of the set of all infinite matrices (i.e., matrices with a countably-infinite number of rows and columns) with Boolean entries? 6. Does every regular language have a proper regular subset? Does every regular language have a proper regular superset? 7. Is every subset of a regular language necessarily regular? Is every superset of a regular language necessarily non-regular? 8. Are the regular languages closed under infinite union? Infinite intersection? 9. Is a countable union of regular languages necessarily regular? Decidable? Is a countable union of decidable languages necessarily decidable? 10. Prove or disprove: every regular language is countable. 11. Prove or disprove: the set of all regular languages is countable. 12. Prove or disprove: the set of all languages is countable.

13. Determine as precisely as possible, for a language L, when is the following true: L + = L * - { } 14. What is the infinite union of all the regular languages? Decidable languages? What is the infinite intersection of all the regular languages? Decidable languages? 15. Are the decidable languages closed Kleene closure? Concatenation? Union? Complementation? Are the non-decidable languages closed Kleene closure? Concatenation? Union? 16. Are the non-finitely-describable languages closed under concatenation? Kleene closure? Complementation? Union? 17. Can an non-computable number be rational? Must an irrational number be non-computable? 18. Is the set of non-finitely-describable real numbers closed under addition? Squaring? 19. Let YESNO(L)={xy x L and y L, x,y * }. Does YESNO preserve regularity? Decidability? 20. Let PALI(L)={w x L and x R L}. Does PALI preserve regularity? Decidability? 21. Describe an algorithm that determines for a given pair of regular expressions whether they denote the same language. What is the time complexity of your algorithm? 22. True or false: for any given regular language, there exists a linear-time algorithm for testing whether an arbitrary input string is a member of that language. 23. What is the smallest language, closed under concatenation, containing the languages L 1 and L 2? 24. Give a sufficient condition (but as general as possible) for L 1 * + L2 * = (L 1 + L 2 ) * to hold. 25. Given two arbitrary languages S and T, find a new language R (in term of S and T) so that the equation R = SR + T holds. 26. Describe exactly what happens if we apply the powerset construction to a finite automaton that is already deterministic?

27. Define a new operation on languages as follows: (L) = {w w *, ww R L}, where w R denotes the "reverse" of the string w. Does preserve regularity? 28. Let L={0 n 1 n n 0}. Is L (i.e. the complement of L) a regular language? 29. Let L= {0 i 1 j i j}. Is L a regular language? 30. Are there two non-regular languages whose concatenation is regular? Are there a countably infinite number of such examples? Are there an uncountable number of such examples? 31. Show that the intersection of two sets of languages can be empty, finite (of arbitrarily large cardinality), countably infinite, or uncountably infinite. 32. Define a new operation on languages as follows: (L) = {w z * w = z wz L}. Does the operation preserve regularity? 33. Define an "infinite automata" similarly to finite automata, but where the state set Q is no longer restricted to be finite. Characterize precisely the class of languages accepted by deterministic infinite automata. Is the characterization any different for non-deterministic infinite automata? 34. We define the SHUFFLE of two strings v,w * as: SHUFFLE(v,w) = {v 1 w 1 v 2 w 2...v k w k v=v 1 v 2...v k, w=w 1 w 2...w k, For example, 212ab1baa2b22 SHUFFLE(abbaab,2121222) and for some k 1, v i,w i *, 1 i k} Extend the definition of SHUFFLE to two languages L 1,L 2 * as follows: SHUFFLE(L 1,L 2 ) = {w w 1 L 1, w 2 L 2, w SHUFFLE(w 1,w 2 ) } a) Is the SHUFFLE of two regular languages necessarily regular? b) Is the SHUFFLE of two decidable languages necessarily decidable?

35. Which of the following modifications / restrictions to finite automata would change the class of languages accepted relative to "normal" finite automata? a) The ability to move the read head backwards (as well as forwards) on the input. b) The ability to write on (as well as read from) the input tape. c) Both a) and b) simultaneously. d) Having 2 read-heads moving (independently, left-to-right) over the input. e) Having one billion or less different states. 36. Determine whether each of the following languages is regular: a) {a n a n a n n>0} b) {www w {x,y,z} *, w < 10 100 } c) {vw v,w {a,b} * } d) {ww w {a}* }

37. Given an arbitrary alphabet ={a 1,a 2,...,a n }, we can impose a total ordering on it in the sense that we can define < so that a 1 < a 2 <... <a n. We now proceed to define a new operation called the SORT of a string w = w 1 w 2...w k * (where w i and k = w ) as: SORT(w) = w (1) w (2)...w (k) so that w (i) < w (i+1) for 1 i k-1 and is a permutation (i.e., a 1-to-1 onto mapping :[1..k] [1..k]) For example, SORT(11210010120)=00001111122. Now extend the definition of SORT to languages, so that SORT( L) = {SORT(w) w L}. For each one of the following statements, state whether it is true or false and explain: a) SORT( * ) is regular. b) SORT(L) L c) SORT(SORT(L))=SORT(L) d) SHUFFLE(L 1,L 2 )=SHUFFLE(L 2,L 1 ) e) SORT(SHUFFLE(L 1,L 2 )) = SORT(L 1 L 2 ) f) L such that SORT(L)=SHUFFLE(L,L)=L g) SORT preserves regularity. h) SORT preserves decidability i) SORT preserves non-decidability j) SORT preserves non-finite-describability (The definition of SHUFFLE operator is the same as above.) 38. Define a DIVISION operator on languages as follows: L 1 L 2 = {w w * and v L 2 wv L 1 } Does DIVISION preserve regularity? Decidability? What if L 1 is regular and L 2 is arbitrary?

39. Give algorithms (i.e., a well-defined, deterministic, always-terminating decision procedures, and state their time complexities) to determine whether for a given finite automaton M, L(M) is: a) countable a) empty b) * c) finite d) infinite e) co-finite (i.e., with a finite complement) f) regular g) also accepted by a smaller FA (i.e., with fewer states) 40. Give algorithms (and state their time complexities) to determine whether for a given pair of finite automata: a) they both accept the same language b) the intersection of their languages is empty c) the intersection of their languages is * d) the intersection of their languages is finite e) the difference of their languages is finite