CS 311 Homework 5 Solutions due 16:40, Thursday, 28 th October 2010

Similar documents
Homework 3 Solutions

One Minute To Learn Programming: Finite Automata

Regular Sets and Expressions

Solution to Problem Set 1

MATH 150 HOMEWORK 4 SOLUTIONS

FORMAL LANGUAGES, AUTOMATA AND THEORY OF COMPUTATION EXERCISES ON REGULAR LANGUAGES

flex Regular Expressions and Lexical Scanning Regular Expressions and flex Examples on Alphabet A = {a,b} (Standard) Regular Expressions on Alphabet A

Regular Languages and Finite Automata

CS99S Laboratory 2 Preparation Copyright W. J. Dally 2001 October 1, 2001

Solutions for Selected Exercises from Introduction to Compiler Design

FAULT TREES AND RELIABILITY BLOCK DIAGRAMS. Harry G. Kwatny. Department of Mechanical Engineering & Mechanics Drexel University

A Visual and Interactive Input abb Automata. Theory Course with JFLAP 4.0

Java CUP. Java CUP Specifications. User Code Additions You may define Java code to be included within the generated parser:

Math 135 Circles and Completing the Square Examples

PROF. BOYAN KOSTADINOV NEW YORK CITY COLLEGE OF TECHNOLOGY, CUNY

Reasoning to Solve Equations and Inequalities

Modular Generic Verification of LTL Properties for Aspects

Unambiguous Recognizable Two-dimensional Languages

EQUATIONS OF LINES AND PLANES

Appendix D: Completing the Square and the Quadratic Formula. In Appendix A, two special cases of expanding brackets were considered:

Experiment 6: Friction

Physics 43 Homework Set 9 Chapter 40 Key

Pentominoes. Pentominoes. Bruce Baguley Cascade Math Systems, LLC. The pentominoes are a simple-looking set of objects through which some powerful

Quick Reference Guide: One-time Account Update

Bypassing Space Explosion in Regular Expression Matching for Network Intrusion Detection and Prevention Systems

Polynomial Functions. Polynomial functions in one variable can be written in expanded form as ( )

and thus, they are similar. If k = 3 then the Jordan form of both matrices is

Lecture 5. Inner Product

Bayesian Updating with Continuous Priors Class 13, 18.05, Spring 2014 Jeremy Orloff and Jonathan Bloom

Basic Research in Computer Science BRICS RS Brodal et al.: Solving the String Statistics Problem in Time O(n log n)

Geometry 7-1 Geometric Mean and the Pythagorean Theorem

Automated Grading of DFA Constructions

Solving the String Statistics Problem in Time O(n log n)

1.00/1.001 Introduction to Computers and Engineering Problem Solving Fall Final Exam

1. In the Bohr model, compare the magnitudes of the electron s kinetic and potential energies in orbit. What does this imply?

PHY 140A: Solid State Physics. Solution to Homework #2

Algebra Review. How well do you remember your algebra?

Unit 6: Exponents and Radicals

Vectors Recap of vectors

Binary Representation of Numbers Autar Kaw

Quick Reference Guide: Reset Password

String Searching. String Search. Spam Filtering. String Search

Welch Allyn CardioPerfect Workstation Installation Guide

Lec 2: Gates and Logic

Use Geometry Expressions to create a more complex locus of points. Find evidence for equivalence using Geometry Expressions.

Or more simply put, when adding or subtracting quantities, their uncertainties add.

How fast can we sort? Sorting. Decision-tree model. Decision-tree for insertion sort Sort a 1, a 2, a 3. CS Spring 2009

Rotating DC Motors Part II

Example 27.1 Draw a Venn diagram to show the relationship between counting numbers, whole numbers, integers, and rational numbers.

Concept Formation Using Graph Grammars

Math 314, Homework Assignment Prove that two nonvertical lines are perpendicular if and only if the product of their slopes is 1.

RIGHT TRIANGLES AND THE PYTHAGOREAN TRIPLETS

When Simulation Meets Antichains (on Checking Language Inclusion of NFAs)

Warm-up for Differential Calculus

Pointed Regular Expressions

! What can a computer do? ! What can a computer do with limited resources? ! Don't talk about specific machines or problems.

Econ 4721 Money and Banking Problem Set 2 Answer Key

19. The Fermat-Euler Prime Number Theorem

MODULE 3. 0, y = 0 for all y

DlNBVRGH + Sickness Absence Monitoring Report. Executive of the Council. Purpose of report

Drawing Diagrams From Labelled Graphs

APPLICATION NOTE Revision 3.0 MTD/PS-0534 August 13, 2008 KODAK IMAGE SENDORS COLOR CORRECTION FOR IMAGE SENSORS

Regular Repair of Specifications

Graphs on Logarithmic and Semilogarithmic Paper

9 CONTINUOUS DISTRIBUTIONS

I calculate the unemployment rate as (In Labor Force Employed)/In Labor Force

AREA OF A SURFACE OF REVOLUTION

2.016 Hydrodynamics Prof. A.H. Techet

Generating In-Line Monitors For Rabin Automata

trademark and symbol guidelines FOR CORPORATE STATIONARY APPLICATIONS reviewed

Protocol Analysis / Analysis of Software Artifacts Kevin Bierhoff

Section 5-4 Trigonometric Functions

On decidability of LTL model checking for process rewrite systems

Learning Workflow Petri Nets

5 a LAN 6 a gateway 7 a modem

v T R x m Version PREVIEW Practice 7 carroll (11108) 1

c b N/m 2 (0.120 m m 3 ), = J. W total = W a b + W b c 2.00

2 DIODE CLIPPING and CLAMPING CIRCUITS

4 Approximations. 4.1 Background. D. Levy

1. Find the zeros Find roots. Set function = 0, factor or use quadratic equation if quadratic, graph to find zeros on calculator

Review guide for the final exam in Math 233

SE3BB4: Software Design III Concurrent System Design. Sample Solutions to Assignment 1

The remaining two sides of the right triangle are called the legs of the right triangle.

Data Compression. Lossless And Lossy Compression

SURFACE OF MATTRESS MUST BE AT LEAST 5 IN. (127 MM) BELOW THE UPPER EDGE OF GUARDRAILS

1.2 The Integers and Rational Numbers

0.1 Basic Set Theory and Interval Notation

LINEAR TRANSFORMATIONS AND THEIR REPRESENTING MATRICES

SINCLAIR COMMUNITY COLLEGE DAYTON, OHIO DEPARTMENT SYLLABUS FOR COURSE IN MAT COLLEGE ALGEBRA (4 SEMESTER HOURS)

Week 11 - Inductance

Complexity Results in Epistemic Planning

On the expressive power of temporal logic

GENERAL APPLICATION FOR FARM CLASSIFICATION

3 The Utility Maximization Problem

All pay auctions with certain and uncertain prizes a comment

Unit 29: Inference for Two-Way Tables

Learning Subregular Classes of Languages with Factored Deterministic Automata

, and the number of electrons is -19. e e C. The negatively charged electrons move in the direction opposite to the conventional current flow.

9.3. The Scalar Product. Introduction. Prerequisites. Learning Outcomes

2012 Mathematics. Higher. Finalised Marking Instructions

Transcription:

CS 311 Homework 5 Solutions due 16:40, Thursdy, 28 th Octoer 2010 Homework must e sumitted on pper, in clss. Question 1. [30 pts.; 15 pts. ech] Prove tht the following lnguges re not regulr using the pumping lemm.. L = {0 n 1 m 0 n m, n 0}. To prove tht L is not regulr lnguge, we will use proof y contrdiction. Assume tht L is regulr. Then y the Pumping Lemm for Regulr Lnguges, there exists pumping length, p for L such tht for ny string s L where s p, s = xyz suject to the following conditions: () y > 0 () xy p, nd (c) i > 0, xy i z L. Choose s = 0 p 10 p. Clerly, s p nd s L. By condition () ove, it follows tht x nd y re composed only of zeros. By condition (), it follows tht y = 0 k for some k > 0. Per (c), we cn tke i = 0 nd the resulting string will still e in L. Thus, xy 0 z should e in L. xy 0 z = xz = 0 (p k) 10 p. But, this is clerly not in L. This is contrdiction with the pumping lemm. Therefore our ssumption tht L is regulr is incorrect, nd L is not regulr lnguge.. L = {wtw w, t {0, 1} + }. To prove tht L is not regulr lnguge, we will use proof y contrdiction. Assume tht L is regulr lnguge. Then y the Pumping Lemm for Regulr Lnguges, there exists pumping length p for L such tht for ny sring s L where s p, s = xyz suject to the following conditions: () y > 0 () xy p, nd (c) i > 0, xy i z L. 1

Choose s = 0 p 110 p 1. Clerly s L with w = 0 p 1 nd t = 1, nd s p. By condition (), it is ovious tht xy is composed only of zeros, nd further, y () nd (), it follows tht y = 0 k for some k > 0. By condition (c), we cn tke ny i nd xy i z will e in L. Tking i = 2, then xy 2 z L. xy 2 z = xyyz = 0 (p+k) 110 p 1. There is no wy tht this string cn e divided into wtw s required to e in L, thus xy 2 z / L. This is contrdiction with condition (c) of the pumping lemm. Therefore the ssumption tht L is regulr lnguge is incorrect nd thus L is not regulr lnguge. Question 2. [20 pts] Convert the following DFA into regulr expression using stte elimintion. Be sure to show intermedite steps of the process. q0 q1 First we introduce new strt nd finl stte, with ε trnsitions to nd from the originl strt nd finl sttes. S ε q0 q1 ε F 2

Now we remove stte, nd reconnect stte q1 to q0, including the regulr expression for the pth through long with the originl pth from q1 to q0. Now remove q1, dding the regulr expression for the pth through q1 to the self-loop on q0. Finlly, remove stte q0, connecting the strt nd finl stte with the regulr expression for the self-loop on q0. This regulr expression represents ll the strings tht this NFA ccepts. Question 3. [20 pts.; 10 pts. ech] Write context free grmmrs tht generte the following lnguges. In ech cse use the lphet Σ = {0, 1}.. {x#y x y }. 3

To construct this grmmr, we will uild lnced string of ritrry length, nd then force the genertion to choose etween pth tht forces either the left or the right side to e ritrrily longer thn the other side. S XSX XL RX L # XL R # RX X 0 1. {w w contins t lest two occurences of the sustring 101} This lnguge is strightforwrd. Force the inclusion of two occurences of the sustring 101 right in the first rule. Then llow ritrry other sustrings to e plced in ll other positions. S A101A101A A AA 0 1 ε Question 4. [30 pts; 15 pts. ech] Construct PDAs tht recognize the following lnguges:. L = { i j i > j} This mchine will count the numer of s y pushing them on the stck. Then it will strt compring s from the input with s on the stck. When ll the s re consumed, then the mchine will drin the stck nd ccept if there re still s on the stck. So long s there re s on the stck, then the string of s must e shorter. 4

. L = {xcy x, y {, } nd x y R } This mchine will push everything onto the stck until it reds the c. Then it will ttempt to mtch the stck ginst the input, consuming input so long s it mtches. The mchine will ccept if it sees one set of mis-mtched chrcters, or if either prt is longer thn the other. In ll other cses, the mchine will get stuck without ccepting. q4 ε, $ ; ε, ε ; ε ε, ; ε ε, ; ε q3, ; ε, ; ε, ε ; ε, ε ; ε ε, ; ε ε, ; ε 5