Computer Science 456/656 Spring 2018 Practice Examination March 21, 2018

Similar documents
Language properties and Grammar of Parallel and Series Parallel 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

COMPUTATIONAL COMPLEXITY OF LEFT-ASSOCIATIVE GRAMMAR

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

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

Enumeration of Context-Free Languages and Related Structures

A General Class of Noncontext Free Grammars Generating Context Free Languages

The Strong Minimalist Thesis and Bounded Optimality

On the Polynomial Degree of Minterm-Cyclic Functions

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

Grammars & Parsing, Part 1:

Chinese Language Parsing with Maximum-Entropy-Inspired Parser

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

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

Lecture 10: Reinforcement Learning

Self Study Report Computer Science

A Version Space Approach to Learning Context-free Grammars

Proof Theory for Syntacticians

WSU Five-Year Program Review Self-Study Cover Page

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

Refining the Design of a Contracting Finite-State Dependency Parser

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

CS 598 Natural Language Processing

CS Machine Learning

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

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

Natural Language Processing. George Konidaris

Short vs. Extended Answer Questions in Computer Science Exams

Radius STEM Readiness TM

Mathematics subject curriculum

Grade 6: Correlated to AGS Basic Math Skills

Detecting English-French Cognates Using Orthographic Edit Distance

Context Free Grammars. Many slides from Michael Collins

Parsing natural language

Probability and Game Theory Course Syllabus

Diagnostic Test. Middle School Mathematics

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

Bittinger, M. L., Ellenbogen, D. J., & Johnson, B. L. (2012). Prealgebra (6th ed.). Boston, MA: Addison-Wesley.

(Sub)Gradient Descent

SANTIAGO CANYON COLLEGE Reading & English Placement Testing Information

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

AQUA: An Ontology-Driven Question Answering System

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

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

Edexcel GCSE. Statistics 1389 Paper 1H. June Mark Scheme. Statistics Edexcel GCSE

ARNE - A tool for Namend Entity Recognition from Arabic Text

Developing a TT-MCTAG for German with an RCG-based Parser

Math Placement at Paci c Lutheran University

Universiteit Leiden ICT in Business

Factoring - Grouping

CS 1103 Computer Science I Honors. Fall Instructor Muller. Syllabus

2/15/13. POS Tagging Problem. Part-of-Speech Tagging. Example English Part-of-Speech Tagsets. More Details of the Problem. Typical Problem Cases

BANGLA TO ENGLISH TEXT CONVERSION USING OPENNLP TOOLS

Parsing of part-of-speech tagged Assamese Texts

Mining Student Evolution Using Associative Classification and Clustering

CLASSIFICATION OF TEXT DOCUMENTS USING INTEGER REPRESENTATION AND REGRESSION: AN INTEGRATED APPROACH

PRODUCT PLATFORM DESIGN: A GRAPH GRAMMAR APPROACH

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

Evolution of Collective Commitment during Teamwork

Teaching a Laboratory Section

Prediction of Maximal Projection for Semantic Role Labeling

ENGBG1 ENGBL1 Campus Linguistics. Meeting 2. Chapter 7 (Morphology) and chapter 9 (Syntax) Pia Sundqvist

Creating a Test in Eduphoria! Aware

Module 12. Machine Learning. Version 2 CSE IIT, Kharagpur

Florida Mathematics Standards for Geometry Honors (CPalms # )

Reducing Abstraction When Learning Graph Theory

OCR for Arabic using SIFT Descriptors With Online Failure Prediction

Dublin City Schools Mathematics Graded Course of Study GRADE 4

Character Stream Parsing of Mixed-lingual Text

Spring 2016 Stony Brook University Instructor: Dr. Paul Fodor

The Interface between Phrasal and Functional Constraints

Some Principles of Automated Natural Language Information Extraction

Using dialogue context to improve parsing performance in dialogue systems

Conversation Task: The Environment Concerns Us All

flash flash player free players download.

A Grammar for Battle Management Language

West s Paralegal Today The Legal Team at Work Third Edition

The Internet as a Normative Corpus: Grammar Checking with a Search Engine

Morphotactics as Tier-Based Strictly Local Dependencies

Using Proportions to Solve Percentage Problems I

The CYK -Approach to Serial and Parallel Parsing

First Grade Curriculum Highlights: In alignment with the Common Core Standards

Catchy Title for Machine

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

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

Compositional Semantics

Chunk Parsing for Base Noun Phrases using Regular Expressions. Let s first let the variable s0 be the sentence tree of the first sentence.

Version Space. Term 2012/2013 LSI - FIB. Javier Béjar cbea (LSI - FIB) Version Space Term 2012/ / 18

Physics 270: Experimental Physics

GACE Computer Science Assessment Test at a Glance

The Indices Investigations Teacher s Notes

Grades. From Your Friends at The MAILBOX

Efficient Normal-Form Parsing for Combinatory Categorial Grammar

Statewide Framework Document for:

Merry-Go-Round. Science and Technology Grade 4: Understanding Structures and Mechanisms Pulleys and Gears. Language Grades 4-5: Oral Communication

Lecture 1: Machine Learning Basics

South Carolina English Language Arts

Machine Learning and Data Mining. Ensembles of Learners. Prof. Alexander Ihler

Purdue Data Summit Communication of Big Data Analytics. New SAT Predictive Validity Case Study

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

Transcription:

Computer Science 456/656 Spring 2018 Practice Examination March 21, 2018 The entire examination is 690 points. 1. True or False. [5 points each] T = true, F = false, and O = open, meaning that the answer is not known to science at this time. (Review the 3 page True/False homework given for February 28 and March 5.) (a) (b) (c) (d) (e) (f) (g) (h) Every subset of a regular language is regular. Let L be the language over Σ = {a,b} consisting of all strings of the form a m b n, where m,n 0. Then L is a regular language. The complement of every regular language is regular. The Kleene closure of every context-free language is context-free. If a language has an unambiguous context-free grammar, then it is is accepted by some deterministic push-down automaton. If a language has an ambiguous context-free grammar, then it is is not accepted by any deterministic push-down automaton. There is a PDA that accepts all valid C++ programs. The intersection of any two regular languages is regular. (i) The language consisting of all base 7 numerals for positive integers n such that n % 3 = 2 is regular. (j) (k) (l) (m) (n) (o) (p) (q) (r) (s) (t) (a) The intersection of any two context-free languages is context-free. Let L be the language over Σ = {a,b} consisting of all strings of the form a m b n c m, where m,n 0. Then L is a context-free language. Let L be the language over Σ = {a,b} consisting of all strings of the form a m b n, where m n. Then L is a context-free language. The complement of every context-free language is context-free. The union of any two context-free languages is context-free. If a language has an context-free grammar, then it is is accepted by some push-down automaton. {0,1}. Every context-free language has an unambiguous context-free grammar. Every language that has an unambiguous context-free grammar is accepted by some DPDA. Every deterministic machine is a non-deterministic machine. The language consisting of all base 2 numerals for integer powers of 2 is regular. There is a DPDA that accepts the language of all palindromes over the binary alphabet There exists a machine 1 that runs forever and outputs the string of decimal digits of π (the well-known ratio of the circumference of a circle to its diameter). 1 As always in automata theory, machine means abstract machine, a mathematical object whose memory and running time are not constrained by the size and lifetime of the known (or unknown) universe, or any other physical laws. If we want to discuss the kind of machine that exists (or could exist) physically, we call it a physical machine. 1

(b) For every real number x, there exists a machine that runs forever and outputs the string of binary digits of x. (c) If a language has an unambiguous context-free grammar, then there must be some DPDA that accepts it. (d) The problem of whether a given string is generated by a given context-free grammar is P-TIME. (e) The language {a n b n c n d n n 0} is recursive. (f) Let L be the language over {a,b,c} consisting of all strings which have more a s than b s and more b s than c s. There is some PDA that accepts L. (g) There exists a mathematical proposition that can be neither proved nor disproved. (h) The language {a n b n c n n 0} is in the class P. (i) (j) There exists a polynomial time algorithm which finds the factors of any positive integer, where the input is given as a binary numeral. The problem of whether a given context-free grammar generates all strings is decidable. (k) The language { a i b j c k j i+k } is context-free. (l) If a language L is undecidable, then there can be no machine that enumerates L. (m) Recall that if L is a class of languages, co-l is defined to be the class of all languages that are not in L. Let RE be the class of all recursively enumerable languages. If L is in RE and also L is in co-re, then L must be decidable. (n) If a language has an unambiguous context-free grammar, then there must be some DPDA that accepts it. (o) There exists a polynomial time algorithm which finds the factors of any positive integer, where the input is given as a unary numeral. (p) Every bounded function is recursive. (q) (r) For any two languages L 1 and L 2, if L 1 is NP-complete, L 2 is NP, and there is a polynomial time reduction of L 2 to L 1, then L 2 must be NP-complete. If P is a mathematical proposition that can be stated using n binary bits, and P has a proof, then P must have a proof whose length is O(2 2n ). 2

Fill in the blanks. [5 points each blank] (a) An LALR outputs a derivation. (b) An other strings. of a language L is a machine that outputs all the strings of L and no 3

2. [20 points] State the pumping lemma for regular languages. (Your answer must be correct in its structure, not just the words you use. Even if all the correct words are there, you could get no credit if you get the logic wrong.) 3. [30 points] State the Church-Turing thesis, and explain (in about 5 lines or less) why it is important. 4

4. [30 points] Give a sketch of the proof that the independent set problem is NP-complete, assuming that 3-CNF-SAT is N P-complete. You may draw pictures and use examples. 5

5. [30 points] What is the diagonal language? Give a brief sketch of the proof that it is not accepted by any Turing machine. (If you use more than this page, you are writing too much.) 6

6. [20 points] Describe, in English, what the Turing machine diagrammed below does. Hint: It only takes a few words. (Look at one of the sample problems from the Assignments page.) 7

7. [30 points] Prove that, if a language L is decidable, then L can be enumerated in canonical order by some machine. 8. [25 points] Draw an NFA with five states which accepts the language described by the regular expression (0+1) 0(0+1)(0+1)(0+1) 9. [25 points] Write a regular expression for the language accepted by the following NFA. If your answer is unnecessarily long by a wide margin, I might mark it wrong even if it s right. a a,b b b,c b,c b b,c Find a Regular Expression 10. [20 points] Let G be the context-free grammar given below. (a) S a (b) S ws (c) S is (d) S ises Prove that G is ambiguous by writing two different leftmost derivations for the string iwiaea. [If you simply show two different parse trees, you are not following instructions.] 11. [30 points] Design a PDA that accepts the language L = {a n bc n : n 0}. 12. [30 points] Give a context-free grammar for the language of all strings over {0,1} of the form 0 m 1 n where n m. 13. [30 points] The following context-free grammar G is ambiguous. Give an equivalent unambiguous grammar. 8

14. Fill in the ACTION and GOTO tables for the ambiguous grammar given in Problem 13 (This problem is hard. I will give more clues in class.) 0 a b c + eof E 1 halt 2 3 4 5 6 7 8 9 10 11 12 13 9

15. [30 points] Let L be the language generated by the Chomsky Normal Form (CNF) grammar given below. (a) S a (b) E a (c) S LA (d) E LA (e) L ( (f) A ER (g) R ) (h) S PE (i) E PE (j) S EE (k) E EE (l) P EQ (m) Q + Use the CYK algorithm to prove that the string a(a+a) is a member of L. 10

16. [15 points] State the pumping lemma for regular languages. 17. Let L be the language generated by the context-free grammar given in the first box. The second box contains a Chomsky Normal Form (CNF) grammar that also generates L. (a) S WS (b) S IS (a) S a (b) S ws (c) S is (d) S ises (c) S AB (d) A IS (e) B ES (f) S a (g) I i (h) W w (i) E e (a) [20 points] Use the CYK algorithm to prove that the string iwiaea is a member of L. (b) [20 points] By looking at your work carefully, you can determine that the CNF grammar given above is ambiguous. Write two different parse trees for iwiaea, using the CNF grammar. 18. [30 points] Consider the NFA whose transition diagram is in Figure 1 below. where the input alphabet is {a,b,c}. Draw the transition diagram of an equivalent minimal DFA. Show your steps. 19. [30 points] Let L = { w {a,b} # a (w) = 2# b (w) }, here # a (w) denotes the number of instances of the symbol a in the string w. For example, aaababaaabba L, because that string has the twice as many a s as b s. Give a context-free grammar for L. Your grammar may be ambiguous. 20. [30 points] 1. S ǫ 2. S a 2 S 3 b 4 S 5 11

a c b b,c a b a Figure 1: Find a minimal DFA equivalent to this NFA a b eof S 0 1 halt 2 3 4 5 Complete the ACTION and GOTO tables of an LALR parser for the grammar given above. This grammar unambiguously generates the Dyck language, where (to avoid difficulty grading) a represents a left parenthesis, and b represents a right parenthesis. Example strings include ǫ, ab, aabb, abab, and aabbab. 12