Solution to Problem Set 1



Similar documents
Homework 3 Solutions

Regular Sets and Expressions

One Minute To Learn Programming: Finite Automata

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

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

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

Basically, logarithmic transformations ask, a number, to what power equals another number?

Unit 6: Exponents and Radicals

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

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

Regular Languages and Finite Automata

4.11 Inner Product Spaces

Binary Representation of Numbers Autar Kaw

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

Lecture 5. Inner Product

Graphs on Logarithmic and Semilogarithmic Paper

Math 135 Circles and Completing the Square Examples

Reasoning to Solve Equations and Inequalities

LINEAR TRANSFORMATIONS AND THEIR REPRESENTING MATRICES

Integration by Substitution

Vectors Recap of vectors

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

2 DIODE CLIPPING and CLAMPING CIRCUITS

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

19. The Fermat-Euler Prime Number Theorem

RIGHT TRIANGLES AND THE PYTHAGOREAN TRIPLETS

MATH 150 HOMEWORK 4 SOLUTIONS

Physics 43 Homework Set 9 Chapter 40 Key

Experiment 6: Friction

Rotating DC Motors Part II

Lectures 8 and 9 1 Rectangular waveguides

Algebra Review. How well do you remember your algebra?

Geometry 7-1 Geometric Mean and the Pythagorean Theorem

9 CONTINUOUS DISTRIBUTIONS

MODULE 3. 0, y = 0 for all y

Section 5-4 Trigonometric Functions

Math 22B, Homework #8 1. y 5y + 6y = 2e t

EQUATIONS OF LINES AND PLANES

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

FUNCTIONS AND EQUATIONS. xεs. The simplest way to represent a set is by listing its members. We use the notation

SPECIAL PRODUCTS AND FACTORIZATION

Providing Protection in Multi-Hop Wireless Networks

12.4 Problems. Excerpt from "Introduction to Geometry" 2014 AoPS Inc. Copyrighted Material CHAPTER 12. CIRCLES AND ANGLES

Unambiguous Recognizable Two-dimensional Languages

Mixed Method of Model Reduction for Uncertain Systems

A note on profit maximization and monotonicity for inbound call centers

Lecture 3 Gaussian Probability Distribution

Example A rectangular box without lid is to be made from a square cardboard of sides 18 cm by cutting equal squares from each corner and then folding

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

Second Term MAT2060B 1. Supplementary Notes 3 Interchange of Differentiation and Integration

Ratio and Proportion

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

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

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

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

Chapter. Contents: A Constructing decimal numbers

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

Factoring Polynomials

1.2 The Integers and Rational Numbers

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

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

Distributions. (corresponding to the cumulative distribution function for the discrete case).

Solution of the Heat Equation for transient conduction by LaPlace Transform

3 The Utility Maximization Problem

MSc Financial Economics: International Finance. Bubbles in the Foreign Exchange Market. Anne Sibert. Revised Spring Contents

A.7.1 Trigonometric interpretation of dot product A.7.2 Geometric interpretation of dot product

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

The Velocity Factor of an Insulated Two-Wire Transmission Line

Firm Objectives. The Theory of the Firm II. Cost Minimization Mathematical Approach. First order conditions. Cost Minimization Graphical Approach

Figure 2.1. a. Block diagram representation of a system; b. block diagram representation of an interconnection of subsystems

Repeated multiplication is represented using exponential notation, for example:

P.3 Polynomials and Factoring. P.3 an 1. Polynomial STUDY TIP. Example 1 Writing Polynomials in Standard Form. What you should learn

MECH Statics & Dynamics

6. Friction, Experiment and Theory

0.1 Basic Set Theory and Interval Notation

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

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

Mathematics. Vectors. hsn.uk.net. Higher. Contents. Vectors 128 HSN23100

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

COMPONENTS: COMBINED LOADING

Module 8. Three-phase Induction Motor. Version 2 EE IIT, Kharagpur

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

Review guide for the final exam in Math 233

Words Symbols Diagram. abcde. a + b + c + d + e

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

Treatment Spring Late Summer Fall Mean = 1.33 Mean = 4.88 Mean = 3.

Quick Reference Guide: Reset Password

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

Scheduling of Jobs and Maintenance Activities on Parallel Machines

Physics 111. Exam #1. January 24, 2014

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science

v = x t = x 2 x 1 t 2 t 1 The average speed of the particle is absolute value of the average velocity and is given Distance travelled t

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

Transcription:

CSE 5: Introduction to the Theory o Computtion, Winter A. Hevi nd J. Mo Solution to Prolem Set Jnury, Solution to Prolem Set.4 ). L = {w w egin with nd end with }. q q q q, d). L = {w w h length t let nd it third ymol i }.,, q q q q q 4,, l). L = {w w contin n even numer o, or exctly two }. q q q 4 q 6 q q q 5,.5 ). L = {w w end with } with three tte. Notice tht w only h to end with, nd eore the two zero, there cn e nything. Thereore, we cn contruct the ollowing NFA to recognize L:, q q q

CSE 5, Solution to Prolem Set. ). We need to give n exmple o NFA M (nd correponding lnguge C = L(M)) uch tht, wpping the ccept nd non-ccept tte in M yield NFA (y M ) tht doe NOT recognize the complement o C. The exmple i the ollowing: conider the lnguge C = {, } recognized y the ollowing NFA: q q Clerly, wpping the ccept nd non-ccept tte give the ollowing NFA M q q But the lnguge recognized y M contin the empty word () which lredy i in C = L(M). Thereore, L(M ) cnnot e the complement o L(M) (otherwie it wouldn t ccept ).. To trnorm n NFA into DFA, we trt with inding the -cloure o the originl trt tte q nd mke E(q ) the new trt tte. A conveninent wy to ve work nd void mitke i to compute trnition only or the new tte ppered in previou computtion, trting rom the new trt tte. Thi lzy trtegy i proved to e correct nd the proo cn e ound in the irt dicuion ection note. Second thing to er in mind i tht we re lwy computing the -cloure o the trnition. Don t orget tht! ). The -cloure o the originl trt tte remin the me or thi NFA. Plee reer to Figure or the inl DFA., Stte,,,,,, Φ, Figure : Prolem. ()

CSE 5, Solution to Prolem Set ). Notice tht or thi NFA, the -cloure o it originl trt tte i no longer the me. It i ctully the new tte {, }. So we ll trt rom here. Plee reer to Figure or the inl DFA. Stte,,,,,,,,,,,, Figure : Prolem. (),,,, Φ,. e). L = {w w trt with nd h odd length, or trt with nd h even length}. Solution: Almot directly rom the deinition o L: ( ) (( ) ( )). h). L = {w w i ny tring except nd }. Solution: ( ) ( )( ). Tip: How did we come up with thi? Firt uild the NFA or DFA tht recognize the lnguge (or the complement o the lnguge ought; recll tht, given DFA recognizing L, the DFA recognizing L i given y wpping the ccept nd non-ccept tte in the DFA or L). Then, y imple inpection (or uing the NFA-to-RE trnormtion procedure) otin the correponding RE. For exmple, the DFA tht recognize L i: q q q q q 4,, (it not hrd to ee how to get to the regulr expreion rom the ove DFA). j). L = {w w contin t let two nd t mot one }. Solution: ( ). Tip: The DFA tht recognize L i:

CSE 5, Solution to Prolem Set 4 q q q 4 q q q 5 q 6,.4 ). We convert the regulr expreion ( ) ( ) into n NFA y ollowing the tep in Theorem.8 (hown in Figure ). Finlly, or comprion, we lo how n equivlent NFA uilt y oerving pttern which i much impler (hown in Figure 4.) ). Sme tep ove or the regulr expreion ((() ()) ). Plee reer to Figure 5..6 ). We need to convert the NFA o Figure 6 (upper let utomt) into regulr expreion. We mut ollow the uul procedure:. Trnorm the NFA into GNFA. Remove tte o the GNFA one y one. For exmple, we irt remove tte nd then tte.. When only the (ingle) trt tte nd the (ingle) ccept tte re remining, the reulting regulr expreion i the regulr expreion leling the lt rrow. Thi i ( ). The procedure i depicted in Figure 6. ). We need to convert the NFA o Figure 7 (upper let) into regulr expreion. We ollow the me procedure eore, which i depicted in Figure 7. The equivlent regulr expreion i (( ) )( ( )) ) ( )..7 ). A = {www w, } Proo: Sme Exmple.4 on Pg. 8 o the Siper ook. c). A = { n n }. (Here, n men tring o n ) Proo: Aume to the contrry tht A i regulr. By the Pumping Lemm, ny tring in it longer thn the pumping length hould e pumple. Let the pumping length e p. We chooe p A the tring tht we will pump. Let w = xyz = p. By condition o the lemm, xy p. Thi men tht the pumping prt, which h to e non-zero in length cnnot e o length greter thn p.

CSE 5, Solution to Prolem Set 5 (U)* Figure : Prolem.4 () NFA rom ollowing tep in Theorem.8,, Figure 4: Prolem.4 () Simpler NFA y inpection

CSE 5, Solution to Prolem Set 6 Figure 5: Prolem.4 () ( ) Figure 6: Prolem.6 (). Trnorming NFA into the equivlent RE. Firt, convert the originl NFA (irt grph) into GNFA (econd grph); then remove tte (third grph) nd tte (lt grph) until only tte nd re let.

CSE 5, Solution to Prolem Set 7, ( ) ( ) ( ( )) ( ) (( ( )) ) ( ) Figure 7: Prolem.6 () Trnorming NFA into the equivlent RE. Firt, convert the given NFA (upper let) into GNFA (upper middle); then in equence remove tte (upper right), (lower let), nd (lower right) until only tte nd re let. Let the length o thi prt e q.t. q p. By Clue o the Pumping Lemm: k N, n N.t. n = p + kq Let u conider the ce where k =. By the Pumping Lemm, there mut e n n.t. n = p + q where < q p. Now we know tht or m N, m + m < m+. Since q < p, it ollow tht p + q < p+. Hence it i not poile tht the tring we get y one round o pumping e memer o A. Tht i, there i long enough tring in A tht cnnot e pumped. Hence A i not regulr. In generl, lnguge tht involve more thn liner growth re never regulr.. c). Conider L = { n m : n m }. Prove thi lnguge i not regulr y uing the Pumping Lemm. Proo: Aume y contrdiction tht L i regulr. Then, y PL, we know tht there exit pumping length p > uch tht ny word w L, w p cn e prtitioned xyz = w (with xy p nd y > ) in uch wy tht, or ny i, the word xy i z lo elong to L. Notice tht reching contrdiction my e tricky in thi ce, ince it not enough to how tht there exit prtition xyz = w uch tht w cnnot e pumped (recll tht y pumping word w = xyz we men conidering word o the orm xy i z or i ). Inted, we need to exhiit word w L uch tht, ny poile prtition xyz = w, w cnnot e pumped without lling out lnguge L. Mot choice o word do not work ince they cn e pumped. Mgiclly, (hopeully, y the end o the prolem you ll ee why) we ue the word p p+p!, where p! = p (p ). Clerly w p. Moreover, ny prtition o w into xyz mut e uch tht y comprie only (ince xy p). Then, it mut e the ce tht y = k or ome k < k p (ince y > ). Now, we conider the word w = xy i z, or ome i which we leve unpeciied or now.

CSE 5, Solution to Prolem Set 8 The word w equl xy i z = p+(i )k p+p!. We wnt to prove tht or ny vlue o k (tht i, ny poile y nd thu, ny poile prtition) there exit vlue o i which cue w to hve the me numer o nd : n = p + (i )k = p + p! = m. Thi contrdict the condition n m or word in L. Indeed, y olving p + (i )k = p + p! we get i = p! k +. So, or ny vlue o k (recll tht < k p) p! k + will e poitive integer nd thu, there exit vlue i (nmely i = p! k + ) uch tht w L. Neverthele, y PL, w L. We ve got contrdiction. Alterntive olution: We cn lo how tht thi lnguge i not regulr y uing cloure propertie o regulr lnguge. By contrdiction, ume L i regulr. Then L i lo regulr. Let ee how L look like: L i the lnguge o ll the word tht either () re o the orm n m, where n = m, or () contin the utring (which i not llowed in L). Thereore, L = { n n : n } { w : w = ( ) ( ) }. And thu, L \ { w : w = ( ) ( ) } = { n n : n }. The let hnd ide o the lt expreion i regulr ecue the et-minu opertion i regulr (recll tht A \ B = A B). However, the right hnd ide i not. We ve got contrdiction. d). Show tht the lnguge L = {w w {, } i not plindrome }. Proo: Recll tht word w i plindrome i w = w R, where w R i the word ormed y revering the ymol in w (eg. i w =, then w R = ). For exmple w = i plindrome. A lwy, we prove it y contrdiction. Aume L i regulr. Then the lnguge complement o L, y L = L = {w w {, } i plindrome } i lo regulr. I L i regulr, then y pumping lemm, there exit n integer p > (the pumping length) uch tht ny word w L, w p cn e prtitioned xyz = w (with xy p nd y > ) in uch wy tht, or ny i, the word xy i z lo elong to L. However, conider the word w = p p. Clerly, w = p + o it tiie the condition w p o the theorem. However, ny vlid prtition o w into word x, y, z (vlid in the ene tht w = xyz, y >, nd xy p) mut e uch tht y = k or ome integer k >, (ince xy p, tring y cn t contin the middle ) nd then x = p k, nd z = p. I we orm the word w = xy z (tht i, tke i = ). then w = p k p = p k p which cnnot e plindrome ince p k < p. Thu, w L, which contrdict the reult o the pumping lemm.