CMPS130 F2011: Final Exam

Similar documents
A R "! I,,, !~ii ii! A ow ' r.-ii ' i ' JA' V5, 9. MiN, ;

Enumeration of Context-Free Languages and Related Structures

Informatics 2A: Language Complexity and the. Inf2A: Chomsky Hierarchy

Are You Ready? Simplify Fractions

Language properties and Grammar of Parallel and Series Parallel Languages

COMPUTATIONAL COMPLEXITY OF LEFT-ASSOCIATIVE GRAMMAR

A General Class of Noncontext Free Grammars Generating Context Free Languages

Grammars & Parsing, Part 1:

A Version Space Approach to Learning Context-free Grammars

Proof Theory for Syntacticians

Syntax Parsing 1. Grammars and parsing 2. Top-down and bottom-up parsing 3. Chart parsers 4. Bottom-up chart parsing 5. The Earley Algorithm

On the Polynomial Degree of Minterm-Cyclic Functions

Erkki Mäkinen State change languages as homomorphic images of Szilard languages

RANKING AND UNRANKING LEFT SZILARD LANGUAGES. Erkki Mäkinen DEPARTMENT OF COMPUTER SCIENCE UNIVERSITY OF TAMPERE REPORT A ER E P S I M S

Grade 6: Correlated to AGS Basic Math Skills

CS 598 Natural Language Processing

Using Proportions to Solve Percentage Problems I

Standard 1: Number and Computation

Backwards Numbers: A Study of Place Value. Catherine Perez

Classroom Connections Examining the Intersection of the Standards for Mathematical Content and the Standards for Mathematical Practice

Objectives. Chapter 2: The Representation of Knowledge. Expert Systems: Principles and Programming, Fourth Edition

Lecture 1: Machine Learning Basics

Basic Parsing with Context-Free Grammars. Some slides adapted from Julia Hirschberg and Dan Jurafsky 1

Grade 5 + DIGITAL. EL Strategies. DOK 1-4 RTI Tiers 1-3. Flexible Supplemental K-8 ELA & Math Online & Print

Statewide Framework Document for:

TCC Jim Bolen Math Competition Rules and Facts. Rules:

arxiv: v1 [math.at] 10 Jan 2016

This scope and sequence assumes 160 days for instruction, divided among 15 units.

Physics 270: Experimental Physics

Blank Table Of Contents Template Interactive Notebook

Lecture 10: Reinforcement Learning

The New York City Department of Education. Grade 5 Mathematics Benchmark Assessment. Teacher Guide Spring 2013

systems have been developed that are well-suited to phenomena in but is properly contained in the indexed languages. We give a

Natural Language Processing. George Konidaris

Page 1 of 11. Curriculum Map: Grade 4 Math Course: Math 4 Sub-topic: General. Grade(s): None specified

FONDAMENTI DI INFORMATICA

Probability and Statistics Curriculum Pacing Guide

TOPICS LEARNING OUTCOMES ACTIVITES ASSESSMENT Numbers and the number system

Evolution of Collective Commitment during Teamwork

School of Innovative Technologies and Engineering

Context Free Grammars. Many slides from Michael Collins

Dublin City Schools Mathematics Graded Course of Study GRADE 4

Diagnostic Test. Middle School Mathematics

ARNE - A tool for Namend Entity Recognition from Arabic Text

Probability and Game Theory Course Syllabus

BANGLA TO ENGLISH TEXT CONVERSION USING OPENNLP TOOLS

have to be modeled) or isolated words. Output of the system is a grapheme-tophoneme conversion system which takes as its input the spelling of words,

Chapter 2. Intelligent Agents. Outline. Agents and environments. Rationality. PEAS (Performance measure, Environment, Actuators, Sensors)

Mathematics subject curriculum

An empirical study of learning speed in backpropagation

NCU IISR English-Korean and English-Chinese Named Entity Transliteration Using Different Grapheme Segmentation Approaches

Testing A Moving Target: How Do We Test Machine Learning Systems? Peter Varhol Technology Strategy Research, USA

B.S/M.A in Mathematics

Computer Science 1015F ~ 2016 ~ Notes to Students

Reinforcement Learning by Comparing Immediate Reward

LLD MATH. Student Eligibility: Grades 6-8. Credit Value: Date Approved: 8/24/15

2 nd grade Task 5 Half and Half

Parsing natural language

Spring 2016 Stony Brook University Instructor: Dr. Paul Fodor

Math 181, Calculus I

IAT 888: Metacreation Machines endowed with creative behavior. Philippe Pasquier Office 565 (floor 14)

GRAMMAR IN CONTEXT 2 PDF

Machine Learning from Garden Path Sentences: The Application of Computational Linguistics

DETECTING RANDOM STRINGS; A LANGUAGE BASED APPROACH

Learning to Think Mathematically With the Rekenrek

Cal s Dinner Card Deals

The Strong Minimalist Thesis and Bounded Optimality

Classify: by elimination Road signs

GACE Computer Science Assessment Test at a Glance

Paper 2. Mathematics test. Calculator allowed. First name. Last name. School KEY STAGE TIER

AGS THE GREAT REVIEW GAME FOR PRE-ALGEBRA (CD) CORRELATED TO CALIFORNIA CONTENT STANDARDS

A Minimalist Approach to Code-Switching. In the field of linguistics, the topic of bilingualism is a broad one. There are many

Numeracy Medium term plan: Summer Term Level 2C/2B Year 2 Level 2A/3C

Short vs. Extended Answer Questions in Computer Science Exams

University of Groningen. Systemen, planning, netwerken Bosman, Aart

PRODUCT PLATFORM DESIGN: A GRAPH GRAMMAR APPROACH

Stacks Teacher notes. Activity description. Suitability. Time. AMP resources. Equipment. Key mathematical language. Key processes

Parsing of part-of-speech tagged Assamese Texts

If we want to measure the amount of cereal inside the box, what tool would we use: string, square tiles, or cubes?

The Interface between Phrasal and Functional Constraints

GUIDE TO THE CUNY ASSESSMENT TESTS

11/29/2010. Statistical Parsing. Statistical Parsing. Simple PCFG for ATIS English. Syntactic Disambiguation

EECS 700: Computer Modeling, Simulation, and Visualization Fall 2014

Montana Content Standards for Mathematics Grade 3. Montana Content Standards for Mathematical Practices and Mathematics Content Adopted November 2011

STA 225: Introductory Statistics (CT)

Algebra 1 Summer Packet

CS 101 Computer Science I Fall Instructor Muller. Syllabus

Bluetooth mlearning Applications for the Classroom of the Future

Sample Problems for MATH 5001, University of Georgia

Multimedia Application Effective Support of Education

Activity 2 Multiplying Fractions Math 33. Is it important to have common denominators when we multiply fraction? Why or why not?

"f TOPIC =T COMP COMP... OBJ

Decision Making. Unsure about how to decide which sorority to join? Review this presentation to learn more about the mutual selection process!

Notes on The Sciences of the Artificial Adapted from a shorter document written for course (Deciding What to Design) 1

Guest Editorial Motivating Growth of Mathematics Knowledge for Teaching: A Case for Secondary Mathematics Teacher Education

Math-U-See Correlation with the Common Core State Standards for Mathematical Content for Third Grade

Agents and environments. Intelligent Agents. Reminders. Vacuum-cleaner world. Outline. A vacuum-cleaner agent. Chapter 2 Actuators

Characteristics of Functions

Math 121 Fundamentals of Mathematics I

Intelligent Agents. Chapter 2. Chapter 2 1

Transcription:

CMPS130 F2011: Final Exam Robert Levinson Date: Monday, December 5, 2011 4-7pm All problems are 10 points unless otherwise marked. There are 328 points possible. 1. Construct a DFA over the alphabet 0,1 that accepts exactly those strings in which the first 2 input symbols are the same or the last 2 input symbols are the same but not both. (no string of less than 3 symbols should be accepted) 2. Construct an NFA or DFA over a,b which accepts all strings but the empty string. 3. Which one of the following is true? a. All 1PDAs are PDAs b. All PDAs are 1PDAs c. All DPDAs are PDAs d. All NFAs are DFAs. 4. Prove or disprove: For each alphabet Sigma, Square(sigma) = set of strings in Sigma* with length = size (number of symbols) of Sigma squared is context free. (For example, if Sigma is a,b,c, Square(sigma) is all strings of a,b,c with length 9.) 1

5. Construct a NFA M over the alphabet 0,1 that accepts exactly those strings which contain an odd number of consecutive 1s as a substring. (use some non-determinism!) 6. Give a regular expression for the language accepted by the machine M above. 7. Using the subset construction, produce a DFA M that accepts exactly the same language as M. 8. USING THE PRODUCT CONSTRUCTION (from two simple DFAs) construct a DFA that accepts the language L made up of strings of a,b that begin with a and end with b. 2

9. Consider the regular language L: L={x in {a,b}* x contains at least one 2-symbol palindrome but no 3-symbol palindromes as a substring} (a) (15 points) Give a MINIMUM SIZE DFA for the language L! (b) (5 points) Give a regular expression for L. 3

10. (3 points each part) For each of the following languages state whether they are regular or not by CIRCLING the letters of the regular languages! No need to justify your answer! But show use of the Pumping Lemma on any one uncircled language to justify your answer. (15 points) NOTE: x**y means x to the power of y. a. The language generated by the regular expression cab*adfj(kd)*kj. b. The intersection of 79 regular languages. c. Strings whose length is divisble by 7. d. {a**ib**j i is odd and j > i} e. The set of primes greater than 100000000000. f. The empty set intersection {a}. g. {x in {a,b}* numberof(a) is not divisible by 79} h. {x in {a,b}* numberof(a) <= number(b), number (b) > 8} i. A language not accepted by any Non-deterministic Finite Automaton. j. {x in a* Number of as > Number of bs. } k. Palindromes of {a,b} that are of length 79. l. A*, where A is empty. m. The set of odd length strings of {0,1} with no middle symbol. n. The set of prime integers less than 100203034040506040470707805. o. The set of strings of {a,b} ending 4

with a palindrome of size 110101016. p. The set of strings of {a,b} in which the number of as and the number of bs are each NOT divisible by 3731020032030400500600407. q. The set of strings in which the number of 0s is not a prime number. r. A language which has a string of length 1007, and no string longer than 1550505002 symbols. s. The intersection of 177132487478 regular languages. t. The set of strings of even # of parentheses. 5

11. (25 total points) (a) Consider the language: L= b^nb^2n, "read as n bs, followed by 2n bs". Is this language regular? If yes, give a regular expression for L. Else continue. (b) Is this language context free? (c) If the language is not context free,show why not using the Pumping Lemma for CFLs, else do the remaining parts: (d) Prove not regular using the pumping lemma. (e) Give a CFG for L. (f) Give a grammar in Chomsky Normal Form for L. (g) Show using CYK algorithm whether bab is in the language. (h) Give a 1PDA for L. 6

12. (25 total points) (a) Consider the language: Odd length strings of a,b,c whose middle, beginning and end are the same symbol (the language includes all 1 symbol strings, but does not include epsilon) Is this language regular? If yes, give a regular expression for L. Else continue. (b) Is this language context free? (c) If the language is not context free,show why not using the Pumping Lemma for CFLs, else do the remaining parts: (d) Prove not regular using the pumping lemma. (e) Give a CFG for L. (f) Give a grammar in Chomsky Normal Form for L. (g) Show using CYK algorithm whether bab is in the language. (h) Convert L into a 1PDA. 7

13. (25 total points) (a) Consider the language: even length palindromes on {a,b,c} which only use one symbol (possibly repeated). Is this language regular? If so, give a regular expression for it. Else, continue... (b) Is this language context free? (c) If the language is not context free,show why not using the Pumping Lemma for CFLs, else do the remaining parts: (d) Prove not regular using the pumping lemma. (e) Give a CFG for L. (f) Give a grammar in Chomsky Normal Form for L. (g) Show using CYK algorithm whether bab is in the language. (h) Convert L from CNF into a 1PDA. 8

14. (3 points each) Please answer the following questions TRUE OR FALSE - no need to justify your answers. (a) If problem A reduces to problem B, then B is at least as hard to solve as A. (b) All languages are r.e. or recursive. (c) Every language is either infinite or has a DFA. (d) 1PDAs and NPDAs accept the regular language (and possibly others). (e) DPDAs and 1PDAs accept the regular languages (and possibly others). (f) The intersection of a Regular Language with a Regular Language is always recursive. (g) The intersection of a Context Free Language with a Context Free Language is always Context Free. (h) The intersection of 17 r.e. infinite. (i) All empty sets are finite. (j) All finite sets are r.e. languages is always context free or (k) The set of palindromes over a,b is Context Free but is not acceptable by a DPDA. (l) Every 1PDA can be converted into a grammar in Chomsky Normal Form. (m) The intersection of two context free languages is never equal to the union of two regular languages. (n) The empty set is acceptable by NFA but not TM. (o) The complement of a context free language is always acceptable by PDA. (p) The complement of a regular language is always infinite or deterministic context free. (q) All Turing machines halt on some inputs. 9

(r) There is no Turing machine that can recognize whether its input is a prime number. (s) NonDeterministic Turing machines are less powerful than Turing Machines with 100000 tapes. (t) If a Turing machine accepts baaaaaaaaaaaab it must halt. (u) Whether a Turing machine goes into an infinite loop (doesn t halt) on bab can always be determined without simulating the machine. (v) All languages are r.e. (w) Whether Turing Machine M halts on string w is r.e. recursive. (x) All regular languages are r.e. (y) There are more possible languages than Turing machines. (z) There is a Turing machine that accepts a not r.e language. but not 10