Chapter 1 Mathematics Preliminary

Size: px
Start display at page:

Download "Chapter 1 Mathematics Preliminary"

Transcription

1 1 Mthemtics Preliminry Chpter 1 Mthemtics Preliminry Answer for Exercises (Pge 13, Theory of Computer Science: Definitions nd Exmples. 3 rd Ed.) 1. ) {1,10,100} ) { n n Z nd n > 5 } c) { n n N nd n < 5 } d) {} e) { } or { } f) ) A union B, which consists of x, which is memer of A or x is memer of B. ) A intersect B, which consists of x, which is memer of A nd x is memer of B. c) A minus/differ B, which consists of x, which is memer of A nd x is not memer of B. d) A minus/differ B, which consists of x, which is memer of A or x is memer of B nd x is not memer of oth A nd B. e) x is not memer of A. f) crdintility of set A. Length or no. of elements in A. g) powerset of set A ) Is A suset of B? FALSE. ) Is B suset of A? TRUE. c) Wht is A B? Answer: A d) Wht is A B? Answer: B e) Wht is A x B? Answer: {(x,x), (x,y), (y,x), (y, y), (z, x), (z, y)} f) Wht is the power set of B? Answer: {, {x},{y},{x,y}} 4. ) {0, 6, 7, 8, 9} ) {0, 1, 2, 3, 5, 6, 7, 8, 9} = X = {0, 1, 5, 6, 7, 8, 9}, Y = {0, 2, 3, 6, 7, 8, 9}, X U Y =. c) {2, 3, 4, 5} d) {2, 5} 5. 1 P g e

2 1 Mthemtics Preliminry A B ) U A B ) U A B c) U A B d) A B e) U ) {0, 1, 2, 3, 4, 6} ) {2} c) {1, 3} d) {0, 4, 6} ) {{λ}, {}, {}, {,}} 2 P g e

3 1 Mthemtics Preliminry ) {1, 2, 3, 1, 2, 3} 8. ) {{, }, {{, }}} ) {,, d} c) {{}{1}{2}{3}{1,2}{1,3}{2,3}{1,2,3}}-{{} {1}{3}{1,3}} = {{2}{1,2}{2,3}{1,2,3}} d) {{}{}{}{,}} X {{}{c}{d}{c,d}} = {({}, {}),({}{c}),({}{d}),({}{c,d}) ({,}, {}),({,}{c}),({,}{d}),({,}{c,d})} e) {{}} f) {({}, ), ({}, ), ({}, ), ({}, ), ({}, ), ({}, ), ({, }, ), ({, }, )} g) {(1,1,1), (1,1,2), (1,1,3), (1,2,1), (1,2,2), (1,2,3)} A x B hs * elements. A x B stnds for crtesin product which is formed s set of tuples tking ech element from ech set. So for 2 x 2 set. {, } x {c, d} = { (,c), (,d), (,c), (,d)}, thus there re 4 elements. 11. There re x 2 elements in the power set of X. In order to explin this conclusion, I sk you to imgine string of x its, ech it representing n element in X. If we llow 0 to indicte the sence of n element in the superset nd 1 to indicte the presence of n element, we'll find the numer of comintions of 0s nd 1s to e the numer of elements in the powerset. For inry numer of length x, we hve x 2 such comintions ) It is the set of ll odd nturl numers. ) It is the set of ll even rel numers. c) It is set of even nturl numers. d) It is set of nturl numers which re divisile y oth 2 nd 3. e) It is set of inry numers which re i-directionl (tht is red the sme from left to right nd lso from right to left). f) It is set of ll integers. A = Everything in set U ut NOT in set A = {18, 19, 20, 22, 24, 26, 28} B' = Everything in set U ut NOT in set B = {18, 19, 20, 21, 22, 23, 24, 25} Now simply comine the two sets A' nd B' (nd remove ny duplicte elements) to get A U B = {18, 19, 20, 22, 24, 26, 28} U {18, 19, 20, 21, 22, 23, 24, 25} = {18, 19, 20, 21, 22, 23, 24, 25, 26, 28} So the nswer is A U B = {18, 19, 20, 21, 22, 23, 24, 25, 26, 28} 3 P g e

4 1 Mthemtics Preliminry U = {l, m, n, o, p, q, r, s, t, u, v, w} A = {l, m, n, o, p, q} B = {n, o, r, s, v, w} C = {l, m, p, q, r, t} find (A U C ) B. A = {r,s,t,u,v,w} C = {n,o,s,u,v,w} A U C = {n,o,r,s,t,u,v,w} B = {l,m,p,q,t,u} (A U C ) B = {t,u} ) A B = Set of elements tht BOTH sets A nd B hve in common A B = {1, 2, 3} {3, 4, 5, 6} A B = {3} ) A C = Set of elements tht BOTH sets A nd C hve in common A C = {1, 2, 3} {3, 5, 7} A C = {3} c) A U C = Comintion of the sets A nd C (remove ny duplictes) A U C = {1, 2, 3} U {3, 5, 7} A U C = {1,2,3,5,7} d) B U C = Comintion of the sets B nd C (remove ny duplictes) B U C = {3, 4, 5, 6} U {3, 5, 7} B U C = {3,4,5,6,7} 16. To strt with I m going to ssume tht U = {All the lowercse letters of the lphet}. If this is incorrect, then the nswers to (c), (d) nd (e) will e incomplete. To void ny potentil confusion, I will use U for the "universl" set nd "u" for the union opertor When the elements of set re listed, the order is not importnt The union opertor, u, is n inclusive opertor. The union of two sets will lwys include every memer of oth sets. Elements of oth sets, if ny, re listed only once in the union. (Never list duplicte elements in ny set.) The intersection opertor,, is n exclusive opertor. The intersection of two sets will include only elements tht re memers of oth sets. 4 P g e

5 1 Mthemtics Preliminry () A u B This mens "the set whose elements re memers of set A or set B (or oth)". A u B = {c, d, e, f, g, h, k} () A B This mens "the set whose elements re memers of oth set A nd set B". A B = {e, f} (c) A B A mens "the set of ll elements of the universl set, U, which re not memers of set A. A = {,, g, h, i, j, k, l, m,..., z} B mens "the set of ll elements of the universl set, U, which re not memers of set B. B = {,, c, d, i, j, l, m,..., z} A B mens "the set whose elements re memers of oth set A' nd set B'". A B = {,, i, j, l, m,..., z} (d) A u B This mens "the set whose elements re memers of set A or set B (or oth)". Using A nd B from (c) we get A u B = {,, c, d, g, h, i, j, k, l, m,..., z} (e) A u B This mens "the set whose elements re memers of set A or set B (or oth)". Using A nd B from (c) we get A u B = {,, c, d, e, f, i, j, l, m,..., z} (f) (A u B ) B The first prt of this is the nswer to prt (e). (A u B ) B mens "the set whose elements re memers of the set B nd memers of the nswer to prt (e)" (A u B ) B = {e, f} (g) (A u B) (A u B ) The first prt is the nswer to prt (), The lst prt is the nswer to prt (e). So (A u B) (A u B ) mens "the set whose memers re memers of the nswer to prt () nd memers to the nswer to prt (e)". So (A u B) (A u B ) = {c, d, e, f} (which is set A} 5 P g e

6 1 Mthemtics Preliminry 17. ) is simply the union etween the two sets. So simply tke ll of the uniqe elements of ech set nd put them together in the new set So ) is simply the intersection etween the two sets. So whtever elements in two sets hve in common will mke up with set B") (which in English sys "set A intersect Since set A nd set B hve the element "c" in common, this mens the intersection of sets A nd B gives us: c) The nottion A' simply mens the set of every letter tht is NOT in set A. So A' is the entire lphet ut with the letters,c, nd d tken out of it So The nottion B' simply mens the set of every letter tht is NOT in set B. So B' is the entire lphet ut with the letters c, e, f, nd g tken out of it So Now let's tke the intersection etween the two sets. Since set A' nd set B' hve the elements, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, nd z in common, this mens the intersection of sets A' nd B' gives us: d) Using the sme sets A' nd B' from prt c) is simply the union etween the two sets. So simply tke ll of the uniqe 6 P g e

7 1 Mthemtics Preliminry elements of ech set nd put them together in the new set So Strt with the given sets: Find their respective complement sets: e) So Rememer, union is simply the comintion of the unique elements from oth sets f) From prt ), we got So Rememer, to find the intersection of two sets, simply look for ny elements tht the two sets hve in common g) First find So 7 P g e

8 1 Mthemtics Preliminry 18. To find the numer of elements in the set K J, simply dd the two sets together. However, rememer to sutrct the numer of elements in oth sets (since these elements re repeted) In other words, use this formul: n(k J) = n(k) + n(j) - n(k J) In this cse, n(k)=30, n(j)=46 nd n(k J) = 11. Plug these vlues in to get: n(k J) = Add n(k J) = Sutrct n(k J) = 65 So there re 65 elements in set K J #(K J) = #(K) + #(J) - #(K J) = = Notice how ALL of the elements of set A re lso elements of set B, so this shows us tht set A is suset of set B (ie ll of A is in B). So Note: the two sets A nd B re NOT equl since set B hs the element 12 (ut set A does NOT hve the element 12) 20. Drw two overlpping circles, lel one A nd one B, like this First look t these words: 9 letters nd 1 numer is common to oth sets. 8 P g e

9 1 Mthemtics Preliminry Letting L stnd for letter nd N stnd for numer, put 9 L's nd 1 N in the prt in the middle which is common to oth circles, like this: Next look t these words: Set A hs 9 letters nd 3 numers. Set A lredy hs 9 letters nd 1 numer ecuse they re in the prt tht is in common to oth circles. So set A needs 2 more numers so it will hve 3 numers. (It doesn't need ny more letters). So we put 2 N's in the left prt of A, like this: nd now set A hs 9 letters nd 3 numers. Next we look t these words: Set B hs 12 letters nd 1 numer. Set B lredy hs 9 letters nd 1 numer ecuse they re in the prt tht is in common to oth circles. So set B needs 3 more letters so it will hve 12 letters. (It doesn't need ny more numers). So we put 3 L's in the right prt of B, like this: nd now set B hs 12 letters nd 1 numer. 9 P g e

10 1 Mthemtics Preliminry Now the question is: Wht is the numer of elements in set A or set B? If we count ll the L's nd N's tht re in either one of the two sets, we see there re 12 L's nd 3 N's, so tht mkes 15 elements. Answer: 15 elements. 21. In survey of college with 50 memers, 21 were tking mthemtics, 36 were tking English, nd 9 were tking oth. How mny were not tking either of these sujects? We drw rectngle with two overlpping circles, one red nd one lue. There re two circles. The red one contins ll the students tking mth. The lue one contins ll the students tking English. Note tht the red circle nd the lue circle overlp. Here is the mistke mny students mke, so DO NOT mke this mistke: Mny students would see the words "21 were tking mthemtics,36 were tking English,", nd put ll 21 in region "", nd ll 36 in region "c", like this: DO NOT mke tht error!!! Some, ut not ll, of the 21 go in region "" nd the rest of the go in region "". Similr, Some, ut not ll, of the 36 go in region "d" nd the rest of the go in region "". So we do not egin with either the 21 or the P g e

11 1 Mthemtics Preliminry Insted we egin with "9 were tking oth". These 9 go in the middle region,, ecuse those 9 re in oth the red circle nd the lue circle. So we put the 9 in region : Now we see "21 were tking mthemtics", nd of this 21, 9 re tking English too, so we must sutrct the 9 tht re in the middle region, getting 21-9 = 12, nd we put 12 in region "": Now we see "36 were tking English", nd of this 36, 9 re tking too, so we must sutrct the 9 tht re in the middle region, getting 36-9 = 27, nd we put 27 in region "c": We hve one more region, "d". Tht is the region outside of oth circles. They re the ones tht re neither tking mthemtics nor tking English. We hve ccounted for = 48. We re told there re 50 memers. So there re = 2 tht hve not een ccounted for. Those 2 go in the outer region "d": 11 P g e

12 1 Mthemtics Preliminry So the nswer to the prolem is those F' = Set of everything in U ut NOT in F = {Lower cost, Less time to see the sights, Cn visit reltives long the wy} D' = Set of everything in U ut NOT in D = {Higher cost, More time to see the sights, Cnnot visit reltives long the wy, Less time to see the sights} Now just look for the common elements in oth sets. Since there re no common elements, this mens tht the result of the intersection etween these sets is the empty set. 23. The first thing is to find out how mny do tke either lnguge. Since 25 don't tke either tht mens tht tke t lest one of them. 55 tke t lest one of them study French nd Spnish tke oth French nd Spnish nd 15 tke only Spnish nd 25 tke only French. 24. First drw 2 overlpping circles cll the left circle qurium nd the right zoo. Second, drw smll horizontl lines in ech of the three regions nd lso one on the outside right of the digrm. step 1 - "15 hd oth" mens put 15 into the overlpping region shred y oth. step 2 - "22 hd memership to the Birch Aqurium" mens tht 15 + x = 22 - > so x = 7. Put 7 on the qurium line. step 3 - "26 hd memership to the Sn Diego Zoo" mens 15 + y = > so y = 11. Put n 11 on the zoo line. step 4- there is only one line left, the outside. "140 Sn Diego residents" mens tht ll lines of informtion must dd to 140. We hve z = > z = 107. Put 107 on the outside line. i. How mny hd only zoo memership? this is y, so P g e

13 1 Mthemtics Preliminry ii. How mny hd only n qurium memership? this is x, so 7 iii. How mny elonged to either one or the other or oth? this is = 33 iv. How mny elonged to neither? this is z, so =11 11 hd only zoo 22-15=7 7 hd only qurium =33 33 elonged to one or oth = elonged to neither 25. Since 35 students re in lger, nd 18 re in oth, this mens tht 35-18=17 students re in lger only. Also, ecuse 52 students re in history, nd 18 in oth clsses, there re 52-18=34 students in just history lone. Now dd up the numer of students in lger only (17), the numer of students in history only (34), nd the numer of students in oth (18) to get: =69 So there re 69 students in either clss or oth. Now sutrct this figure from 100 to find the numer of students who re in neither clss: =31 So there re 31 students in neither clss. 26. Use Venn Digrms: Drw two intersecting circles inside rectngle. Lel one circle "rown eyes" ; Lel the other circle "londe hir". put "10" in the intersection of the circles. put "23" in the rectngle ut not in either circle put = "15" in the rown eyes circle tht is not in the intersection put = "5" in the londe hir circle tht is not in the intersection Count up ll the "" numers to get 53 Tht is the numer of people interviews. 13 P g e

14 1 Mthemtics Preliminry Follow this sme pttern to work the other prolem you posted which involves three intersecting circles. 27. If you wnt to mke your Venn digrm on the computer, here re some symols/shpes you might need: 3 intersecting circles r, l, r-l- 7 l- 19-7=12 r- 17-7=10 r-l 15-7=8 r =9 l = =8 ) r=9 ) r + l + =9+3+8=20 c) =57 d) l- + r- + r-l = =30 e) 75-57=18 14 P g e

15 2 Lnguges Chpter 2 Lnguges Answer for Exercises (Pge 45, Theory of Computer Science: Definitions nd Exmples. 3 rd Ed.) Prt A Multiple Choices Questions 1. B 2. D 3. B 4. B 5. C 6. D 7. C 8. A 9. D 10. C 11. D 12. C 13. D 14. C 15. A 16. C 17. D 18. A 19. B 20. D 21. C 22. D 23. D 24. B 25. C 26. D 27. D 28. C 29. D 30. A 31. D 32. D 33. D 34. D 35. A 36. C 37. D 38. C 39. A 40. C 41. D 42. D 43. D 44. C 45. A 46. B 47. A 48. C 49. A 50. B 1 P g e

16 2 Lnguges Prt B 1. Structured Questions ) { } ) {0, 00, 000} c) {0, 00, 000, 0000, 00000, } d) {01111, , } e) {011011, , , , , , , , } f) {111111} g) {, 0, 00, 000, 0000, 00000, ,...} h) {00, 000, 0000, 011, 00000, 0011, , 00011, 110, 1100, 11000, 1111} 2. First we oserve tht L1 = {ε,,,,,,,,,,,,,, }. ) L3 = {ε,,,,,,,,,,,,,,, } ) L4 = {, } c) L5 = every wy of selecting one element from L1 followed y one element from L4: {ε,,,,,,,,,,,,,, } {ε,,,,,,,,,,,,,, }. Note tht we've written ε, just to mke it cler how this string ws derived. It should ctully e written s just. Also note tht some elements re in oth of these sets (i.e., there's more thn one wy to derive them). Eliminting duplictes (since L is set nd thus does not contin duplictes), we get: {,,,,,,,,,,,,,,,,,,,,,, } d) L6 = every string tht is in L1 ut not in L2: {ε,,,,,,,,,,,, }. 3. ) Yes. n = 0 nd m = 0. ) Yes. n = 1 nd m = 0. c) Yes. n = 0 nd m = 1. d) No. There must e equl numers of 's nd 's. e) Yes. n = 2 nd m = 2. f) No. There must e equl numers of 's nd 's. 4. Y = {would, wood, could, cood} 5. ) {,,,, } ) {,,,,, } c) 8 d) {λ,,,, } e) {,,,,,,, } 2 P g e

17 2 Lnguges 6. ) X 0 Y = Y = {} X 1 Y = {} X 2 Y = {} X 3 Y = {} ) XY 0 = {} XY 1 = {} XY 2 = {} XY 3 = {} c) (XY) 0 = {λ} (XY) 1 = {} (XY) 2 = {} (XY) 3 = {} 7. { λ, 0,1,00,01,10,11,...} 8. ) 2 ) 2 c) All strings over {, } tht contin multiple of 9. Tle 1 Sustring Prefix Suffix None 10. ) No ) {,,,,,,,,,, } 11. ) No ) No c) No 12. ) The lnguge consisting of ny conctention of s nd s of even length. 3 P g e

18 2 Lnguges ) If S contins ll possile strings of nd of length 3, then ll the words in S* will hve length divisile y 3 nd will include ny conctention of s nd s (ecuse S did). By the product rule, there re 2*2*2 = 8 possile words of length 3: S = {,,,,,,, } c) S* = { nd ll possile strings of s nd s of ny length}. This is ecuse S nd S, nd ny comintion of these letters cn result in ny word. Furthermore, n odd word + nd odd word = n even word. n odd word + n odd word + n odd word = n odd word. So oth odd nd even words re included. 13. ) Y = {00, 01,10, 11} ) {10000, 10001, 10010, 10011} c) {00100, 01100, 10100, 11100} d) { , , , 11100} 14. ) 11(1 0)*00 ) (11(1 0)*) ((1 0)*00) c) 11(1 0)* {,,,,, } 16. IN the lnguge,,,,, Tle 2. Descrie the lnguge in your own words All strings over {, } tht end with,,, All strings over {, } tht do not contin sustring,,,, All strings over {, } tht do not contin sustring,,,,,,,, All strings over {, } tht contin sustring nd end with or 17. Tle 3. IN the lnguge,,,,,,,,, NOT IN the lnguge,,,,,,,,, 18. ) (R ) is R since does not dd nything to their union, nd (R ) mens ppending nothing to ll strings in R which is lso R, hence they re the sme. ) (R ) represents the set R nd empty string. c) (R ) represents R. 4 P g e

19 2 Lnguges ) All string tht contin only s re not in the lnguge. I.e.:,,, ) {,,,,,,,,,,,,,,,,,,,,,, }. To understnd how they re generted, we need first to list down ll of them strting from the most sic fctor s follows: ( + ) 0 ( + ) 0 = ( + ) 0 ( + ) 1 =, ( + ) 1 ( + ) 0 =, ( + ) 1 ( + ) 1 =,,, ( + ) 0 ( + ) 2 = ( + )( + ) =,,, ( + ) 2 ( + ) 0 = ( + )( + ) =,,, ( + ) 1 ( + ) 2 = ( + )( + )( + ) =,,,,,,, ( + ) 2 ( + ) 1 = ( + )( + )( + ) =,,,,,,, Other thn these fctors re excluded ecuse they will produce the string with more thn 4 letters. Now we will remove ny duplicte strings nd we get = {,,,,,,,,,,,,,,,,,,,,,, }. ) 001, 011, 0001, 0011; ny string of length 3 or greter tht is one or more 0 s re followed y one or more 1 s. ) 111, 0111, 01011, ; ny string tht hs t lest three 1 s. c) 0, 1, 01, 0101; ny string tht hs no sustring 110. d) 1, 01, 1011, 10110; ny string tht hs no sustring 00 fter first 11 (if there is ny 11 in the string). ) ( + ) 0 = = ( + ) 1 = ( + ) =, ( + ) 2 = ( + ) ( + ) =,,, ( + ) 3 = ( + ) ( + ) ( + ) =,,,,,,, So ( + )* = {,,,,,,,,,,,,,,,...} ) 0 0 = 1 0 = 0 1 = 1 1 = 2 1 = 1 2 = 2 2 = So ** = {,,,,,,...} 5 P g e

20 2 Lnguges c) () 0 = () 1 = () 2 = () () = () 3 = () () () = So ()* = {,,,,.} 22. Let X = ; nd Y = (XY) r = () r = Y r X r. = () r () r = () () = 23. Length is n Three possile generted strings Shortest string which is NOT in the lnguge,,,,,,,,,,,,,,,,,,,,,,,,,, 25. 0*11*222* 26. {, }* 27. *** + * or ( + )*( + )*( + )* or **( + )* 28. ) the lnguge of ll strings over {, } tht strts nd ends with. ) the lnguge of ll strings over {, } with s the second letter. 29. ) ( + ) + ) () + c) () + ()*() + d) ()* + ()* e) ( + )*( + )( + )* f) ( + )* + ( + )* g) ( + )* 30. ) **c*. ) + *c* * + c* **c +. 6 P g e

21 2 Lnguges 31. ) nd re memers, nd re not memers. ) nd re memers, nd re not memers. 32. ) **c*. ) + *c* * + c* **c +. c) ( c)( c)( c). d) ( c) 0 ( c) 1 ( c) 2. e) ( c) + ( c) + ( c) +. f) ( ) + ( )* ( )*( ) + g) + + h) ( )*( )*( )* ( )*( )*( )*. The two expressions joined y the indicte tht the my precede or follow the. i) ( )*( )*( )* j) The leding nd triling cc explicitly plced in the expression ( c)*( c) *( c)*cc. Any numer of s nd c s, represented y the expression ( c)* my surround the two s. k) At first glnce it my seem tht the desired lnguge is given y the regulr expression ( )*( )*( )* ( )*( )*( )*. Clerly every string in this lnguge hs sustrings nd. Every string descried y the preceding expression hs length four or more. Hve we missed some strings with the desired property? Consider,, nd. A regulr expression for the set of strings contining sustrings nd cn e otined y dding ( )*( )* ( )*( )* to the expression ove. l) ( c + c)* m) The lnguge consisting of strings over {, } contining exctly three 's is defined y the regulr expression ****. Applying the Kleene str to the preceding expression produces strings in which the numer of 's is multiple of three. However, (****)* does not contin strings consisting of 's lone; the null string is the only string tht does hve t lest three 's. To otin strings with no 's, * is conctented to the end of the preceding expression. Strings consisting solely of 's re otined from (****)** y conctenting, from (****)* with 's from *. The regulr expression (***)* defines the sme lnguge. n) *( c)*( c)*( c)* or *(( c)*) 3 o) In the regulr expression ( )*, 's followed y re produced y the first component, 's preceded y y the second component, nd two 's "covered" y single y the third component. The inclusion of within the scope of the * opertor llows ny numer dditionl 's to occur nywhere in the string. Another regulr expression for this lnguge is (( )( ))*. p) ( + + )* or ()* + * or ( )*( ) q) ( + + )( + )* r) Every in the expression ( )* is followed y t lest one, which precludes the occurrence of. However, every string in this expression ends with 7 P g e

22 2 Lnguges while strings in the lnguge my end in or s well s. Thus the expression ( )*( ) represents the set of ll strings over {, } tht do not contin the sustring. s) A string cn egin with ny numer of 's. Once 's re generted, it is necessry to ensure tht n occurrence of is either followed y nother or ends the string. The regulr expression *( + )*( ) descries the desired lnguge. t) ( )*( )* u) To otin n expression for the strings over {,, c} with n odd numer of occurrences of the sustring we first construct n expression w defining strings over {,, c} tht do not contin the sustring, w = *( c*)*: Using w, the desired set cn e written (ww)*ww. v) (( c)( c))*( c c)(( c)( c))* w) ()*()*()* ()*()*()* ()*()*()* x) The regulr expression (**)** (**)*** defines strings over {, } with n even numer of 's or n odd numer of 's. This expression is otined y comining n expression for ech of the component susets with the union opertion. y) ([ ()*] [( ()*)(()*)*( ()*)])*. 33. Tle 1. Tle 2. No. Mtching no. of lnguge Generte 3 possile strings 1. 9,,, 2. 11,,, 3. 12,,, 4. 1,,, 5. 2,,, 6. 6,, 9. 3,,, ,,, ,,, 12. 4,, 13. 5,,, 14 15,, 15 10,, 8 P g e

23 3 Context-Free Grmmr Answer for Exercises (Pge 45, Theory of Computer Science: Definitions nd Exmples. 3 rd Ed.) Prt A Multiple Choices Questions 1. B 2. B 3. D 4. C 5. D 6. D 7. D 8. C 9. D 10. A 11. A 12. C 13. C 14. B 15. C 16. B 17. A 18. A 19. D 20. D 21. B 22. D 23. B 24. C 25. C 26. A 27. D 28. A 29. D 30. C 31. B 32. D 33. C 34. A 35. B 36. B 37. B 38. A 39. A 40. A 41. A 42. B 43. C 44. C 45. D 46. D 1 P g e

24 3 Context-Free Grmmr Prt B Structured Questions 1. ) S SAB SABAB λabab λbab λbab λbab λλab λλab λλb λλb λλλ ) S SAB S SAB λab SABAB λab λabab λb λbab λλ λλab λλb λλλ c) S S A B λ A λ S S A B S A B λ λ λ d) (**)* 2 P g e

25 3 Context-Free Grmmr 2. ) Derivtion Rule S Sc S Sc Scc S Sc Acc S A cadcc A cad ccddcc A cd c) The derivtion tree corresponding to the preceding derivtion is S S c S c A c A d c d d) L(G) = {() n c m d m c n n 0; m > 0} 3. ) Derivtion Rule S ASB S ASB ASB A A ASB A A SB A B S B ) Derivtion Rule S ASB S ASB ASB B B AS B AASB S ASB AASB B B AAS B AAASB S ASB AAAS B AAA S 3 P g e

26 3 Context-Free Grmmr AAA A A AAA A A AA A AA A A A A A c) S A S B A A S A S B A S B B A A S B B A A d) L(G) = { n1 n1 nk nk m1 m1 ml ml n i, m i > 0; k, l 0; k l} 4. ) S AB AB B AB B 4 P g e

27 3 Context-Free Grmmr ) S AB AAB AB A A 5. Set nottions { 2i i *, i 0} or {() i j i > 0, j i} { } or { 2i j i > 0, j i} { }. { n c + 2n, n 0} or { n c m () n n 0, m > 0} or { n c m 2n n 0, m > 0}. {() n (cd) m () m (dc) n, n 1, m 0} { n c m p p d m n, m 1, n 0, p 1} { k j 0 < k j 2k} Descriptions The S rules S SB nd S generte n equl numer of leding 's nd triling B's. Ech B is trnsformed into one or more 's. Since t lest one ppliction of the rule S SB is necessry to generte 's, strings consisting solely of 's re not in the lnguge. The lnguge of the grmmr is {() i j i > 0, j i} { } or we cn write { 2i j i > 0, j i} { }. The recursion of S rules S S generte n equl numer of leding 's nd triling 's. The recursion is terminted y n ppliction of the rule S A. Ech A is trnsformed into one or more c's. The lnguge of the grmmr is { n c m () n n 0, m > 0} or we cn write { n c m 2n n 0, m > 0}. Repeted pplictions of the recursive rule S Sdc produce string of the form () i S(dc) i, i 0. The recursion is terminted y n ppliction of the rule S A. The A rules produce strings of the form (cd) j () j, j 0. The lnguge generted y the rules is {() i (cd) j () j (dc) i i 0, j 0}. Repeted pplictions of the recursive rule S S produce string of the form m S m, m 0. The recursion is terminted y n ppliction of the rule S A. The A rules produce strings of the form c n Ad n, n > 0. While the B rules produce strings of the form i B i, i > 0. The lnguge generted y the rules is { m c n i i d n m m 0; n, i > 0} The rule S SB genertes strings of the form k SB k, y pplying the first option of the rewrite rule k times, or k B k y pplying the second option to replce S. The rule B, pplied k times to the strings generted ove will eventully yield k ( ) k. This cn e written s L = { k j 0 < k j 2k}. Shortest string nd 3 other strings,, c c cc ccc dc / cd cddc, cdcddc, cdcddcdc cd cccddd, cd, cd,, 5 P g e

28 3 Context-Free Grmmr 6. S AB A A B cb c 7. The lnguge consisting of the set of strings { n m c 2n+m m, n > 0} is generted y S Scc Acc A Ac c For ech leding generted y the S rules, two c's re produced t the end of the string. The rule A rules generte n equl numer of 's nd c's. 8. This grmmr cn e constructed y first generting s mny 's s c's to the left nd right. Susequently generte s mny 's s c's in the middle. This gives us s mny 's nd 's s c's. Then we crete possily more c's. S Sc B Generte n Bc n, n 0 y pplying left option n times. B Bc C Use n Bc n nd this rule to generte n m Cc n+m, n, m 0. C cc Use n m Cc n+m nd this rule to get n m c j c n+m, n, m, j 0}. This gives us the lnguge L = { n m c j c n+m n, m, j 0}. Let i = j + n + m to get: { n m c i 0 n + m i}. 9. S AAS λ or S AS λ A λ A 10. S LR L L λ R L λ 11. The grmmr of this lnguge is S SSS SSS 12. An cn e specificlly plced in the middle position of string using the rules A A A A A The termintion of the ppliction of recursive A rules y the rule A inserts the symol into the middle of the string. Using this strtegy, the grmmr S A A B B A A A A A B B B B B genertes ll strings over f; g with the sme symol in the eginning nd middle positions. If the derivtion egins with n S rule tht egins with n, the A rules ensure tht n occurs in the middle of the string. Similrly, the S nd B rules comine to produce strings with in the first nd middle positions. 13. ) ( + )*( + )* ) S AA A A A λ 6 P g e

29 3 Context-Free Grmmr 14. ) * ) S A A A λ 15. S AA BA BA BA λa λb λλ S A A B B B λ B λ 16. S SSS XSS SS XS S X S S S S X X X 17. S U111 U 0U 1U λ 18. ) S SAB SABAB λabab λabab λbab λbab λλab λλab λλab λλb λλb 7 P g e

30 3 Context-Free Grmmr λλb λλλ ) S S A B S A B A B λ A B A B λ λ c) S S A B S A B A B S A B B A B λ λ λ λ d) (**)* 19. ) Anlysis: the lnguge will produce strings with exctly 3 s nd end with. in etween of the s cn hve s mny s s we like. The pttern of the string will e : BBB. S S A A A B B B ) Anlysis: the lnguge will produce strings with t lest one nd one. The pttern of the string will e : ABBA. S S A A A B B B λ 20. ) S A A A B 8 P g e

31 3 Context-Free Grmmr B A ) S A A A B A B A A. 21. L(G 1 ) = { m n m : n 0, m 0} 22. G1 = ({,, S}, {, }, S, P) with P defined y: S S λ 23. ) S A S S filed. ) S S A A S A S A A A S S A S S S A A A A A S S A S A 24. ) ( + )* ) ** or + + c) ** d) (* + *)* 25. S S A A A B B cb 26. The lnguge ( )*( )*( )* is generted y G 1 : S 1 S 1 S 1 A A B B B B C C D D D D 9 P g e

32 3 Context-Free Grmmr G 2 genertes the strings ( )*( )*( )* G 2 : S 2 S 2 S 2 E E F F F F G G H H H H A grmmr G tht genertes ( )*( )*( )* ( )*( )*( )* cn e otined from G 1 nd G 2. The rules of G consist of the rules of G1 nd G2 ugmented with S S 1 S 2 where S is the strt symol of the composite grmmr. The lterntive in these productions corresponds to the in the definition of the lnguge. While the grmmr descried ove genertes the desired lnguge, it is not regulr. The rules S S 1 S 2 do not hve the form required for rules of regulr grmmr. A regulr grmmr cn e otined y explicitly replcing S 1 nd S 2 in the S rules with the right-hnd sides of the S 1 nd S 2 rules. The S rules of the new grmmr re S S1 S1 A S S2 S2 E The strtegy used to modify the rules S S 1 S 2 is n instnce of more generl rule modifiction technique known s removing chin rules. 27. S S S A A B B B B C C D D D D 28. G 1 genertes the strings ( )*( )*( )* G 1 : S 1 S 1 S 1 A A B B B B C C D D D D G 2 genertes the strings ( )*( )*( )* G 2 : S 2 S 2 S 2 E E F F F F G G H H H H Thus grmmr G tht genertes ( )*( )*( )* ( )*( )*( )* S S1 S1 A S S2 S2 E S 1 S 1 S 1 A A B B B B C C D 10 P g e

33 3 Context-Free Grmmr D D D S 2 S 2 S 2 E E F F F F G G H H H H or G: S S S A E A B B B B C C D D D D E F F F F G G H H H H 29. S S A λ A A B B B S 30. The lnguge (( )( ))* is generted y the grmmr S A B A B B S B This lnguge consists of ll strings over {, } in which every is preceded or followed y. An generted y the rule S A is followed y. An generted y B S is preceded y. 31. When we strt nd we red then we re no closer to reding nd we remin in the sme stte. However, if we red n, we my encounter next, so we proceed to stte A, where we my not red next. If we red n in this stte A there still might follow B, so we remin in stte A. On the other hnd, when we red B in stte A, we end up in stte where we my not red n ecuse we hve just red. If the chrcter we red then is we re ck t the initil stte where the string to follow my not e. Of course, we re lwys llowed to stop reding nd ccept tht word in ny stte. This yields the following grmmr S S A A A B B S 32. G: S S A C A B B B D C S D B string to follow my not e string to follow my not e string to follow my not e 11 P g e

34 3 Context-Free Grmmr 33. G: S S A D G A B B B C C C D E E E F F F G G H H I I I 34. The vriles of the grmmr indicte whether n even or odd numer of 's hs een generted nd the progress towrd the next. The interprettion of the vriles is Vrile Prity Progress towrd S even none A even B odd none C odd The rules of the grmmr re S A S A A B B C B C C S A derivtion my terminte with -rule when B or C is present in the sententil form since this indictes tht n odd numer of 's hve een generted. 35. The ojective is to construct grmmr tht genertes the set of strings over {, } contining n even numer of 's or n odd numer of 's. In the grmmr, S O E O E E O E O E O O O E E E O the E nd O rules generte strings with n even numer of 's. The derivtion of string with positive even numer of 's is initited y the ppliction of n S rule tht genertes either E or O. The derivtion then lterntes etween occurrences of E nd O until it is terminted with n ppliction of the rule E. In like mnner, the O nd E rules generte strings with n odd numer of 's. The string cn e generted y two derivtions; one eginning with the ppliction of the rule S O nd the other eginning with S E. 36. ) { n m n n 0, m > 0} or we cn write { m n n > m 0}. ) { n 2m d 2m 2n n 0, m > 0} c) { n m n n, m 0} 12 P g e

35 3 Context-Free Grmmr 37. ) ( + + ) + ) The rules S S nd S S llow the genertion of leding 's or triling 's in ny order. Two leftmost derivtions for the string re S S S S S S c) The derivtion trees corresponding to the derivtions of () re S S S S S S 38. The regulr expression for this lnguge is { m n n m > 0, n 0} or we cn write { m n m > n 0} ) The lnguge {, }* ) The set {, }*{} c) The set {}*{} d) The set {**} e) {}*{}{}*{}{}*, the set of strings in *{, } contining exctly two s f) The set of strings over {, } tht re not plindromes ut could e mde into plindromes y chnging one to or vice vers g) The set of even-length strings in {, }* h) The set of odd-length strings in {, }* ) S S S ) S S S c) S S d) S S S e) S S S S f) S A A; A A A A 13 P g e

36 3 Context-Free Grmmr 42. Tle 1. Tle 2. No. Lnguge No. Grmmrs CFG or RG 1. ( + )* 6 S A A A B B B λ RG 2. ( + ) + 5 S A A A λ 3. ( + ) 2 S S S RG 4. () * 4 6. ** 9 7. ** 8 S AA A A A λ S A A S S S A A B B B B λ S A A A A 8. ( + )* 1 S S S λ RG 9. ( + )*( + )* 7 S S A A B B B λ 10. ( + )*( + )* 3 S RG RG CFG RG RG RG RG 43. Tle 3. Tle 4. No. Lnguge No. Grmmrs CFG or RG Generte 3 possile strings 1. L = {ww R : w ( + )*} 4 S S S SS CFG,, 2. L = { n 2m c n n, m > 0} 3 3. L = (* + *)* 5 4. Let L e the lnguge of ll strings over {, } tht hve the sme numer of s s s S A B λ A A S B B S S X Y X X Y Y S ASC B A C c B B 5. L = { n n n > 0} { n n n > 0} 1 S S S CFG 2 RG CFG CFG 14 P g e

37 4 Finite Automt Chpter 4 Finite Automt Answer for Exercises (Pge 151, Theory of Computer Science: Definitions nd Exmples. 3 rd Ed.) Prt A Multiple Choices Questions 1. B 2. B 3. C 4. A 5. B 6. D 7. D 8. B 9. A 10. A 11. D 12. D 13. B 14. B 15. B 16. B 17. D 18. B 19. C 20. C 21. C 22. A 23. D 24. C 162 P g e

38 4 Finite Automt Prt B Structured Questions 1. Wht is the mening of error or trp stte? Non-ccepting stte 2. Wht re the chrcteristics of NFA compred to DFA? Fetures DFA NFA Choice of trnsition Single Multiple Input lel Alphets only Alphets or or Undefined trnsitions No Possile 3. ) S, O, DFA ) [, ] [, ] [, ] [, ] [, λ] Stop t (finl stte) nd ll lphet is trced (string is empty); Hence, string is ccepted y the mchine. [, ] [, ] [, ] [, λ] All lphet is trced (string is empty) ut stop t (not finl stte) ; Hence, string is not ccepted y the mchine. [, ] [, ] [, ] [, λ] All lphet is trced (string is empty) ut stop t (not finl stte) ; Hence, string is not ccepted y the mchine. [, ] [, ] [, ] [, ] [, λ] Stop t (finl stte) nd ll lphet is trced (string is empty); Hence, string is ccepted y the mchine. [, ] [, ] [, ] 163 P g e

39 4 Finite Automt [, ] [, λ] Stop t (finl stte) nd ll lphet is trced (string is empty); Hence, string is ccepted y the mchine. c),, nd re ccepted., re not ccepted. d) ((+) (+))* 4. ) Yes, DFA. ) [, ] [, ] [, ] [, ] [, λ] Stop t (finl stte) nd ll lphet is trced (string is empty); Hence, string is ccepted y the mchine. [, ] [, ] [, ] [, ] [, ] [, ] [, λ] All lphet is trced (string is empty) ut stop t (not finl stte) ; Hence, string is not ccepted y the mchine. [, ] [, ] [, ] [, ] [, ] [, ] [, λ] Stop t (finl stte) nd ll lphet is trced (string is empty); Hence, string is ccepted y the mchine. [, ] [, ] [, ] [, ] [, ] [, λ] Stop t (finl stte) nd ll lphet is trced (string is empty); Hence, string is ccepted y the mchine. 164 P g e

40 4 Finite Automt c),, nd re ccepted nd is not ccepted. d) ***(***)* nd (***)**** or * + + (* + + )* nd (* + + )** + +, since * = + 5. ) DFA ) [, ] [, ] [, ] [, ] [, ] [, ] [, λ] All lphet is trced (string is empty) ut stop t (not finl stte) ; Hence, string is not ccepted y the mchine. c) ( + + (*()* (**()* )*)*)* 6. ) DFA ) [, ] [, ] [, ] [, ] [, ] [, ] [, λ] Stop t (finl stte) nd ll lphet is trced (string is empty); Hence, string is ccepted y the mchine. c) ** ((*) + (**))* 7. ) q 3 q 3 q P g e

41 4 Finite Automt q 3 DFA The lnguge consisting of ll strings over {, } with n even numer of s nd n even numer of s. ) [, ] [, ] [q 3, λ] All lphet is trced (string is empty) ut stop t q 3 (not finl stte) ; Hence, string is not ccepted y the mchine. [, ] [, ] [, λ] Stop t (finl stte) nd ll lphet is trced (string is empty); Hence, string is ccepted y the mchine. [, ] [, ] [, ] [, λ] All lphet is trced (string is empty) ut stop t (not finl stte) ; Hence, string is not ccepted y the mchine. [, ] [, ] [q 3, ] [, ] [, λ] Stop t (finl stte) nd ll lphet is trced (string is empty); Hence, string is ccepted y the mchine. c) Only nd. d) (()* + ()*)* 8. ) q0 q1 q2 q3 No, NFA. ) [, ] [q 3, ] [q 3, ] [q 3, ] [q 3, λ] Stop t q 3 (finl stte) nd ll lphet is trced (string is empty); Hence, string is ccepted y the mchine. 166 P g e

42 4 Finite Automt [, ] [, ] [, ] [, λ] Stop t (finl stte) nd ll lphet is trced (string is empty); Hence, string is ccepted y the mchine. [, ] [, ] [, ] [, λ] Stop t (finl stte) nd ll lphet is trced (string is empty); Hence, string is ccepted y the mchine. [, ] [, ] [, ] [, ] [, λ] All lphet is trced (string is empty) ut stop t (not finl stte) ; Hence, string is not ccepted y the mchine. [, ] [, ] [, ] [, ] [, ] [, λ] Stop t (finl stte) nd ll lphet is trced (string is empty); Hence, string is ccepted y the mchine. c) Only,, nd re ccepted. d) * + ( + )* 9. ) - ),, re ccepted y M c) ** 10. ) 1*01*01* ) (0 + 1)*0(0 + 1)*0(0 + 1)* 167 P g e

43 4 Finite Automt 0, 1 0, 1 0, c) (0 + 1)*00(0 + 1)* 0, 1 0, d) ( + )*, q 3 e) ( + )*, q 3 f) ( + )*( + )*,, q ) ) Only nd re ccepted y M c) ** (* + **)* 12. ) ***, ) ( + )*( + )*( + )*,, q 3, c) ( + )*( + ) 168 P g e

44 4 Finite Automt, d) The lnguge of ll strings tht egin or end with or. ( + )( + )* + ( + )* ( + ) e) ( + )*( + ) f) (* + )* g) q 3 h) ( + ) * ( + ) * q 3 q 4 i) ( + )* j) ( + )*( + )*( + )* + ( + )*( + )*( + )* 169 P g e

45 4 Finite Automt,, q 3 q 4, q 5 q 6, q 7 q 8 q 9 k) ( + )*( + )*( + )* + ( + )*( + )*( + )*,, q 6 q 7 q 3, q 8 q 4 q 9 q 5 0 1, 13. For ech of the following lnguges, drw n FA ccepting it. ) ( + )* ) ( + )* c) ( + )*( + ) ( + )* d) ( + )* e) + * + * f) ( + )*( + ) g) ( + )* h) ( + )*()* 14. ) **c* The DFA,, c q 3 c, c c tht ccepts **c* uses the loops in sttes q0, q1, nd q2 to red 's, 's, nd c's. Any devition from the prescried order cuses the computtion to enter q3 nd reject the string. ) The set of strings over {, } in which the sustring occurs t lest twice. ( + )*( + )*( + )* c) The set of strings over {, } tht do not egin with the sustring. ( + + )( + )* d) ( )*( ) 170 P g e

46 4 Finite Automt A DFA tht ccepts the strings over {, } tht do not contin the sustring is given y the stte digrm, q 3 The sttes re used to count the numer of consecutive 's tht hve een processed. When three consecutive 's re encountered, the DFA enters stte q3, processes the reminder of the input, nd rejects the string. e) The set of strings over {,, c} tht egin with, contin exctly two 's, nd end with cc. ( + c)*( + c)*( + c)*cc f) The set of strings over {,, c} in which every is immeditely followed y t lest one c. ( + c + c)* g) The set of strings over {, } in which the numer of s is divisile y three. h) The set of strings over {, } in which every is either immeditely preceded or immeditely followed y, for exmple,,, nd. ( )* i) The set of strings of odd length over {, } tht contin the sustring. j) The set of strings over {, } tht hve odd length or end with. k) ccepts strings of even length over {,, c} tht contin exctly one. A string ccepted y this mchine must hve exctly one nd the totl numer of 's nd c's must e odd. Sttes q1 or q3 re entered upon processing single. The stte q3 represents the comintion of the two conditions required for cceptnce. Upon reding second, the computtion enters the nonccepting stte q4 nd rejects the string. l) The set of strings over {, } tht hve n odd numer of occurrences of the sustring. Note tht hs two occurrences of. m) The set of strings over {, } tht contin n even numer of sustrings. n) The set of strings over {1, 2, 3} the sum of whose elements is divisile y six. o) The set of strings over {,, c} in which the numer of s plus the numer of 's plus twice the numer of c's is divisile y six. p) The sttes of the mchine re used to count the numer of symols processed since n hs een red or since the eginning of the string, whichever is smller. 171 P g e

47 4 Finite Automt A computtion is in stte qi if the previous i elements re not 's. If n input string hs sustring of length four without n, the computtion enters q4 nd rejects the string. All other strings ccepted. q) The DFA to ccept this lnguge differs from the mchine in Exercise 20 y requiring every fourth symol to e n. The first my occur t position 1, 2, 3, or 4. After reding the first, the computtion enters stte q4 nd checks for pttern consisting of comintion of three 's or c's followed y n. If the string vries from this pttern, the computtion enters stte q8 nd rejects the input. Strings of length 3 or less re ccepted, since the condition is vcuously stisfied. 15. ) q 3 ) q 3 c) d),, q 3 q 4 q P g e

48 4 Finite Automt q 4 q 3 e) ) IN the lnguge c,, c,, cc, c,,, cc, c, c, cc, ccc, c {, } Ø Ø {, } {, } Ø NOT IN the lnguge,, c, c, c, c ) [, ] [, ] [, ] [, ] No such input, string rejected [, ] [, ] [, ] [, ] [, ] [, λ] Not finl stte, string rejected [, ] [, ] [, ] [, ] [, ] [, λ] String Accepted [, ] [, ] [, ] [, ] [, ] No such input, string rejected 173 P g e

49 4 Finite Automt [, ] [, ] [, ] No such input, string rejected [, ] [, ] No such input, string rejected c) Yes d) **(* + **)* or ( + + ) +. A regulr expressions for L(M) is + + ( )*. Processing + + leves the computtion in stte q2. After rriving t q2 there re two wys to leve nd return, tking the cycle q0, q1, q2 or the cycle q1, q2. The first pth processes string from + + nd the second +. This expression cn e reduced to ( + + ) ) ) {, } Ø Ø {, } Ø {, } [, ] [, ] [, ] String Rejected [, ] [, ] [, ] [, ] [, λ] String Accepted [, ] [, ] [, ] [, ] [, λ] String Accepted [, ] [, ] [, ] [, ] String Rejected etc..! c) Yes e) *(* + *)* stop t *( + + *)* stop t Regulr exp is: *(* + *)* + *( + + *)* or + ( )* + + ( )* since * = + nd * = P g e

50 4 Finite Automt {,} {,} {,, }, 0 {,} 19. ) ( )* ) q 3 c) The NFA q 3 c ccepts the lnguge (c)**. Strings of the form (c)* re ccepted in q0. Stte q3 ccepts (c)* +. q 4 q 3 c d) 175 P g e

51 4 Finite Automt,, q 3 q 4 e) q ) The set of strings over {, } tht contin either nd s sustrings. ( + )*( + )*( + )* + ( + )*( + )*( + )* ) The set of strings over {, } tht contin oth or neither nd s sustrings. c) The set of strings over {, } whose third-to-the-ist symol is. ( + )*( + )( + ) The set of strings over f; g whose third to the lst symol is is ccepted y the NFA When is red in stte q0, nondeterminism is used to choose whether to enter stte q1 or remin in stte q0. If q1 is entered upon processing the third to the lst symol, the computtion ccepts the input. A computtion tht enters q1 in ny other mnner termintes unsuccessfully. d) The set of strings over {, } whose third nd third-to-ist symols re oth. For exmple,,, nd re in the lnguge. ( + )( + )( + )*( + )( + ) + ( + )( + )( + )( + ) + ( + )( + ) + ( + ) e) The set of strings over {, } in which every is followed y or. ( + + ) f) The set of strings over {, } tht hve sustring of length four tht egins nd ends with the sme symol. ( + )( + ) + ( + )( + ) g) The set of strings over {, } tht contin sustrings nd. ( + )*( + )*( + )* + ( + )*( + )*( + )* h) The set of strings over {,, c} tht hve sustring of length three contining ech of the symols exctly once. c + c + c + c + c + c 21. Construct the stte digrm of DFA tht ccepts the strings over {, } ending with the 176 P g e

52 4 Finite Automt sustring. Give the stte digrm of n NFA with six rcs tht ccepts the sme lnguge. ( + )* 22. ) S A S A A ) S A B A A B B S, c) S A A B B A d) q 3 q 3 q 3 e) 23. ), S O, 177 P g e

53 4 Finite Automt 24. ) ) (( + )( + ))* S B A C ),,,,,. 25. ) RE = ( + c + c)*,c c only finl, remove finl in ) q 3, 26. ) C D S A B ) ()*()* 27. Design finite utomton to ccept the lnguge defined y the regulr expression ) ()*()* ) (+) + c) (() + )* 178 P g e

54 4 Finite Automt d) * + ()* e) *(*)* + λ 28.,,, q 3 q 4 q 5,, q 3 ), q 3 q 4 q , ,1 q 3 0 q q 4 q 5 q (( + ) ( + )) ( + )* (( + ) ( + )) Tle 1. Tle 2. DFA or NFA No. Mtching No. no. of RE (0) DFA Z (i) DFA j 3. 7 (ii) NFA 4. 6 (iii) NFA 5. 1 (iv) DFA g 6. 2 (v) DFA i 7. 5 (vi) DFA h 8. 9 (vii) DFA e (viii) DFA f P g e

55 4 Finite Automt (ix) DFA c (x) DFA d 180 P g e

56 Answer for Exercises of Chpter 5 (Questions t Pge 190, Introduction to Theory of Computer Science: Definitions nd Exmples) Prt A Multiple Choices Questions 1. C 2. D 3. D 4. C 5. B Prt B 1. Structured Questions ) The stte digrm of M is, e/a e, A/e e, A/e, A/e e, e/e, A/e ) (,, ) (,, A) (,, AA) (,, A) (,, ) ccept (,, ) (,, A) (,, ) reject (,, ) (,, A) (,, ) reject c) To show tht the strings nd re in L(M), we trce computtion of M tht ccepts these strings. Stte String Stck A AA A Stte String Stck A AA AAA AA A Both of these computtions terminte in the ccepting stte q2 with n empty stck.

57 d) The PDA M ccepts the lnguge { i j 0 j i}. Processing n pushes A onto the stck. Strings of the form i re ccepted in stte. The trnsitions in empty the stck fter the input hs een red. A computtion with input i j enters stte upon processing the first. To red the entire input string, the stck must contin t lest j A s. The trnsition (,, A) = [, ] will pop ny A s remining on the stck. The computtion for n input string tht hs fewer s thn s or in which n occurs fter hlts in stte without processing the entire string. Thus strings with either of these forms re rejected. 2. ) δ(,, λ) = {[, A]} δ(,, λ) = {[, B]} δ(, λ, λ) = {[, λ]} δ(,, A) = {[, λ]} δ(,, B) = {[, λ]} ) {ww R w {, }*}. c) The computtions of in M re s follows: Stte String Stck q0 λ q1 λ Stte String Stck q0 λ q0 A q1 A Stte String Stck q0 λ q0 A q0 λ BA q1 λ BA The computtions of in M re s follows: Stte String Stck q0 λ q1 λ Stte String Stck q0 λ q0 A q1 A Stte String Stck q0 λ q0 A q0 BA q1 BA q1 λ A Stte String Stck

58 q0 λ q0 A q0 BA q0 λ BBA q1 λ BBA The computtions of in M re s follows: Stte String Stck q0 λ q1 λ Stte String Stck q0 λ q0 A q1 A Stte String Stck q0 λ q0 A q0 BA q1 BA q1 A Stte String Stck q0 λ q0 A q0 BA q0 BBA q1 BBA q1 λ BA Stte String Stck q0 λ q0 A q0 BA q0 BBA q0 λ BBBA q1 λ BBBA d) Stte String Stck q0 λ q0 A q0 AA q1 AA q1 A q1 λ λ Stte String Stck q0 λ q0 B q0 AB q1 AB q1 B

59 q1 λ λ e) To show tht the string nd re not in L(M), we trce ll computtions of these strings in M, nd check whether none of them ccepts these strings. We hve listed ll the computtions of in (), nd none of them ccepts it. Now we trce ll computtions of in M. Stte String Stck q0 λ q1 λ Stte String Stck q0 λ q0 A q1 A q1 λ Stte String Stck q0 λ q0 A q0 AA q1 AA q1 λ A Stte String Stck q0 λ q0 A q0 AA q0 λ AAA q1 λ AAA Since none of the computtions ove is ccepted, we hve is not in M. 3. (, ) (, ) (, A ) (, A ) (, ) q 4 q 3 ) or ) (,e X) (,e Y) (c,y/e) (d,x e) (, ) c) d) (,e X) (,e Y) (c,y/e) (d,x e) (,e Y) (c,y/e) (d,x e)

60 (,e X) (,X e) (c,e Y) (d,y/e) e) f) (,e X) (,X e) (c,e Y) (d,y/e) (,X e) (c,e Y) (d,y/e) (,e X) (,e X) (c,x/e) (d,x e) (,e X) (c,x/e) (d,x e) g) (e,e e) (, e) (e,$/e) (c,e e) (e,e $) (,e ) (e,e e) (,e e) (c, e) (e,e e) (e,$/e), e/a, A/e e, $/e ( /A) ( B/ ) ( AA/ ) ( /BB) ( A/B) e, e/$, e/a, e/b, $/$ e, e/b q 4 e, A/e e, e/a, $/$ e, e/b q 3 q 5 e, $/e q 8 h) ( /A) ( A/ ) ( /B) ( B/ ) or q 6, e/b q 7, B/e i) j) e, e X (, e X, X e (, e X, X e, e e k) e, e X, X e or e, e e (,e ) (c,e e) (, e) (e,e e) (e,e e)

61 l) (,e/a) (,A/e) (,e/ ) (c /e) (, e ) (,A/e) (,e/ ) q 3 (c /e) q 4 or (,e/a) (,A/e) (,e/b) (c B/e) (e,e/e) (e,e/e) q 4 m), A, A (, ) (, ) q 3 (, ), q 4, n) (e,e/e) (,e/) (e,e/e) (,/e) (e,e/e) q 3 (c,e/e) (e,e/e) (,e/e) (e,e/e) (,e/) (e,e/e) q 4 (c,/e) o) (,e A) (,A e) (,e e) (e,e e) (,e e) (e, A e) q 3 (e, A e) p) (,e ) (, A e) (,e ) e, e/e e, e/a (, A e) q 3 q)

62 (,e/a) (,A/e) (c, /e) (e,e e) (e,e e) r) /A /B / / / A/ B/ 4. (,e/a) (,e/b) (c,e/c) (,A/e) (,B/e) (c,c/e) (d,e/e) 5. Give the stte digrm of PDA M tht ccepts { 2i i+j 0 j i} with cceptnce y empty stck. Explin the role of the stck symols in the computtion of M. Trce the computtions of M with input nd. 6. The mchine M, A, A, A ccepts the lnguge L = { i i i 0} y finl stte nd empty stck. ) Give the stte digrm of PDA tht ccepts L y empty stck. ) Give the stte digrm of PDA tht ccepts L y finl stte. 7. ) (,e/a) (,A/e) (,e/e) (,e/e) (e,e/b) (, B/e) ) (,e/a) (,A/e) (,e/e) (,e/e) (e,e/b) (, B/e) 8. Let L = { 2i i i 0}. ) Construct PDA M 1 with L(M 1 ) = L. ) Construct n tomic PDA M 1 with L(M 2 ) = L.

63 c) Construct n extended PDA M 3 with L(M 3 ) = L tht hs fewer trnsitions thn M 1. d) Trce the computtion tht ccepts the string in ech of the utomt constructed in (), (), nd (c). 9. Let L = { 2i 3i i 0}. ) Construct PDA M 1 with L(M 1 ) = L. ) Construct n tomic PDA M 2 with L(M 2 ) = L. c) Construct n extended PDA M 3 with L(M 3 ) = L tht hs fewer trnsitions thn M 1. d) Trce the computtion tht ccepts the string in ech of the utomt constructed in (), (), nd (c). 10. ) This lnguge ccepts the strings which strt with nd followed y. The numer of s is doule thn s. ) (,e ) (,A e) (,e e) c) L = { n 2n n > 0} d) S S A A (,A e) e) (,, ) (,, A) (,, AA) (,, A) (,, A) (,, ) (,, ) ccept f) S S S A 11. ) (, c, ) (, c, A) (, c, AA) (,, AA) (,, A) (,, ) ccept ) S S S ca A A A c) S S S ca ca ca c c 12. ) ) (0,e,X) (1,X,e) (1,X,e) (0,e,X) (1,X,e) (1,X,e) 13. ) (,, ) (,, A) (,, AA) (,, AAA) (,, AA) (,, A) (,, ) ccept ) (,, ) (,, A) (,, A) (,, ) reject

64 14. ) ) (,e X) (,X/e) (c,x/e) (e,x e) (e,e e) (e,e e) (e,x e) (e,e X) (,e X) (,X/e) (c,x e) (e,e X) (e,e e) (e,e e) q 3 q ) CFG : S XC AY X X ε C cc ε A A ε Y Yc ε ) (e,e/e) (,e/) (,/e) (e,e/e) q1 q3 (c,e/e) q0 (,e/e) (e,e/e) q2 (e,e/e) q4 (,e/) (c,/e) 16. OR On seeing ( push it on the stck On seeing ) pop ( from the stck If ttempt to pop n empty stck, reject If stck not empty t the end, reject Else ccept First push ottom-of-the-stck sysmol $ nd move to On seeing ( push it onto the stck On seeing ) pop if ( is in the stck Pop $ nd move to finl stte q f, e/( e, e/$ q e, $/e q f ), (/e

65 5 Push-down Automt 17. ) S ABA BB δ(q0,, λ)= {[q0, ABA]¹, [q1, BB]²} A A δ(q1,, A)= {[q1, A]³, [q1, λ] 4 } B cb c δ(q1, c, B)= {[q1, B] 5, [q1, λ] 6 } ) Drw the PDA mchine M tht ccept L(G). M: Q = {, } = {,, c} = {A, B} F = { } δ(q0,, λ) = {[q0, ABA] } δ(q0,, λ) = { [q1, BB] } δ(q1,, A) = {[q1, A] } δ(q1,, A) = {[q1, λ] } δ(q1, c, B) = {[q1, B] } δ(q1, c, B) = {[q1, λ]} 18. (i) (ii) (iii) (iv) (v) (vi) (vii) (viii) (ix) (x) (xi) c i k j e g h f d 164 P g e

Homework 3 Solutions

Homework 3 Solutions CS 341: Foundtions of Computer Science II Prof. Mrvin Nkym Homework 3 Solutions 1. Give NFAs with the specified numer of sttes recognizing ech of the following lnguges. In ll cses, the lphet is Σ = {,1}.

More information

Regular Sets and Expressions

Regular Sets and Expressions Regulr Sets nd Expressions Finite utomt re importnt in science, mthemtics, nd engineering. Engineers like them ecuse they re super models for circuits (And, since the dvent of VLSI systems sometimes finite

More information

One Minute To Learn Programming: Finite Automata

One Minute To Learn Programming: Finite Automata Gret Theoreticl Ides In Computer Science Steven Rudich CS 15-251 Spring 2005 Lecture 9 Fe 8 2005 Crnegie Mellon University One Minute To Lern Progrmming: Finite Automt Let me tech you progrmming lnguge

More information

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

FORMAL LANGUAGES, AUTOMATA AND THEORY OF COMPUTATION EXERCISES ON REGULAR LANGUAGES FORMAL LANGUAGES, AUTOMATA AND THEORY OF COMPUTATION EXERCISES ON REGULAR LANGUAGES Introduction This compendium contins exercises out regulr lnguges for the course Forml Lnguges, Automt nd Theory of Computtion

More information

Reasoning to Solve Equations and Inequalities

Reasoning to Solve Equations and Inequalities Lesson4 Resoning to Solve Equtions nd Inequlities In erlier work in this unit, you modeled situtions with severl vriles nd equtions. For exmple, suppose you were given usiness plns for concert showing

More information

Solution to Problem Set 1

Solution to Problem Set 1 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

More information

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

CS99S Laboratory 2 Preparation Copyright W. J. Dally 2001 October 1, 2001 CS99S Lortory 2 Preprtion Copyright W. J. Dlly 2 Octoer, 2 Ojectives:. Understnd the principle of sttic CMOS gte circuits 2. Build simple logic gtes from MOS trnsistors 3. Evlute these gtes to oserve logic

More information

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

Polynomial Functions. Polynomial functions in one variable can be written in expanded form as ( ) Polynomil Functions Polynomil functions in one vrible cn be written in expnded form s n n 1 n 2 2 f x = x + x + x + + x + x+ n n 1 n 2 2 1 0 Exmples of polynomils in expnded form re nd 3 8 7 4 = 5 4 +

More information

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

PROF. BOYAN KOSTADINOV NEW YORK CITY COLLEGE OF TECHNOLOGY, CUNY MAT 0630 INTERNET RESOURCES, REVIEW OF CONCEPTS AND COMMON MISTAKES PROF. BOYAN KOSTADINOV NEW YORK CITY COLLEGE OF TECHNOLOGY, CUNY Contents 1. ACT Compss Prctice Tests 1 2. Common Mistkes 2 3. Distributive

More information

0.1 Basic Set Theory and Interval Notation

0.1 Basic Set Theory and Interval Notation 0.1 Bsic Set Theory nd Intervl Nottion 3 0.1 Bsic Set Theory nd Intervl Nottion 0.1.1 Some Bsic Set Theory Notions Like ll good Mth ooks, we egin with definition. Definition 0.1. A set is well-defined

More information

Unit 6: Exponents and Radicals

Unit 6: Exponents and Radicals Eponents nd Rdicls -: The Rel Numer Sstem Unit : Eponents nd Rdicls Pure Mth 0 Notes Nturl Numers (N): - counting numers. {,,,,, } Whole Numers (W): - counting numers with 0. {0,,,,,, } Integers (I): -

More information

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

Example 27.1 Draw a Venn diagram to show the relationship between counting numbers, whole numbers, integers, and rational numbers. 2 Rtionl Numbers Integers such s 5 were importnt when solving the eqution x+5 = 0. In similr wy, frctions re importnt for solving equtions like 2x = 1. Wht bout equtions like 2x + 1 = 0? Equtions of this

More information

EQUATIONS OF LINES AND PLANES

EQUATIONS OF LINES AND PLANES EQUATIONS OF LINES AND PLANES MATH 195, SECTION 59 (VIPUL NAIK) Corresponding mteril in the ook: Section 12.5. Wht students should definitely get: Prmetric eqution of line given in point-direction nd twopoint

More information

Section 5-4 Trigonometric Functions

Section 5-4 Trigonometric Functions 5- Trigonometric Functions Section 5- Trigonometric Functions Definition of the Trigonometric Functions Clcultor Evlution of Trigonometric Functions Definition of the Trigonometric Functions Alternte Form

More information

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

flex Regular Expressions and Lexical Scanning Regular Expressions and flex Examples on Alphabet A = {a,b} (Standard) Regular Expressions on Alphabet A flex Regulr Expressions nd Lexicl Scnning Using flex to Build Scnner flex genertes lexicl scnners: progrms tht discover tokens. Tokens re the smllest meningful units of progrm (or other string). flex is

More information

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

Pentominoes. Pentominoes. Bruce Baguley Cascade Math Systems, LLC. The pentominoes are a simple-looking set of objects through which some powerful Pentominoes Bruce Bguley Cscde Mth Systems, LLC Astrct. Pentominoes nd their reltives the polyominoes, polycues, nd polyhypercues will e used to explore nd pply vrious importnt mthemticl concepts. In this

More information

Binary Representation of Numbers Autar Kaw

Binary Representation of Numbers Autar Kaw Binry Representtion of Numbers Autr Kw After reding this chpter, you should be ble to: 1. convert bse- rel number to its binry representtion,. convert binry number to n equivlent bse- number. In everydy

More information

Factoring Polynomials

Factoring Polynomials Fctoring Polynomils Some definitions (not necessrily ll for secondry school mthemtics): A polynomil is the sum of one or more terms, in which ech term consists of product of constnt nd one or more vribles

More information

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

Appendix D: Completing the Square and the Quadratic Formula. In Appendix A, two special cases of expanding brackets were considered: Appendi D: Completing the Squre nd the Qudrtic Formul Fctoring qudrtic epressions such s: + 6 + 8 ws one of the topics introduced in Appendi C. Fctoring qudrtic epressions is useful skill tht cn help you

More information

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

Bayesian Updating with Continuous Priors Class 13, 18.05, Spring 2014 Jeremy Orloff and Jonathan Bloom Byesin Updting with Continuous Priors Clss 3, 8.05, Spring 04 Jeremy Orloff nd Jonthn Bloom Lerning Gols. Understnd prmeterized fmily of distriutions s representing continuous rnge of hypotheses for the

More information

. At first sight a! b seems an unwieldy formula but use of the following mnemonic will possibly help. a 1 a 2 a 3 a 1 a 2

. At first sight a! b seems an unwieldy formula but use of the following mnemonic will possibly help. a 1 a 2 a 3 a 1 a 2 7 CHAPTER THREE. Cross Product Given two vectors = (,, nd = (,, in R, the cross product of nd written! is defined to e: " = (!,!,! Note! clled cross is VECTOR (unlike which is sclr. Exmple (,, " (4,5,6

More information

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

A Visual and Interactive Input abb Automata. Theory Course with JFLAP 4.0 Strt Puse Step Noninverted Tree A Visul nd Interctive Input Automt String ccepted! 5 nodes generted. Theory Course with JFLAP 4.0 q0 even 's, even 's q2 even 's, odd 's q1 odd 's, even 's q3 odd 's, odd

More information

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

P.3 Polynomials and Factoring. P.3 an 1. Polynomial STUDY TIP. Example 1 Writing Polynomials in Standard Form. What you should learn 33337_0P03.qp 2/27/06 24 9:3 AM Chpter P Pge 24 Prerequisites P.3 Polynomils nd Fctoring Wht you should lern Polynomils An lgeric epression is collection of vriles nd rel numers. The most common type of

More information

Regular Languages and Finite Automata

Regular Languages and Finite Automata N Lecture Notes on Regulr Lnguges nd Finite Automt for Prt IA of the Computer Science Tripos Mrcelo Fiore Cmbridge University Computer Lbortory First Edition 1998. Revised 1999, 2000, 2001, 2002, 2003,

More information

Operations with Polynomials

Operations with Polynomials 38 Chpter P Prerequisites P.4 Opertions with Polynomils Wht you should lern: Write polynomils in stndrd form nd identify the leding coefficients nd degrees of polynomils Add nd subtrct polynomils Multiply

More information

Math 135 Circles and Completing the Square Examples

Math 135 Circles and Completing the Square Examples Mth 135 Circles nd Completing the Squre Exmples A perfect squre is number such tht = b 2 for some rel number b. Some exmples of perfect squres re 4 = 2 2, 16 = 4 2, 169 = 13 2. We wish to hve method for

More information

LINEAR TRANSFORMATIONS AND THEIR REPRESENTING MATRICES

LINEAR TRANSFORMATIONS AND THEIR REPRESENTING MATRICES LINEAR TRANSFORMATIONS AND THEIR REPRESENTING MATRICES DAVID WEBB CONTENTS Liner trnsformtions 2 The representing mtrix of liner trnsformtion 3 3 An ppliction: reflections in the plne 6 4 The lgebr of

More information

Experiment 6: Friction

Experiment 6: Friction Experiment 6: Friction In previous lbs we studied Newton s lws in n idel setting, tht is, one where friction nd ir resistnce were ignored. However, from our everydy experience with motion, we know tht

More information

Algebra Review. How well do you remember your algebra?

Algebra Review. How well do you remember your algebra? Algebr Review How well do you remember your lgebr? 1 The Order of Opertions Wht do we men when we write + 4? If we multiply we get 6 nd dding 4 gives 10. But, if we dd + 4 = 7 first, then multiply by then

More information

1.2 The Integers and Rational Numbers

1.2 The Integers and Rational Numbers .2. THE INTEGERS AND RATIONAL NUMBERS.2 The Integers n Rtionl Numers The elements of the set of integers: consist of three types of numers: Z {..., 5, 4, 3, 2,, 0,, 2, 3, 4, 5,...} I. The (positive) nturl

More information

Multiplication and Division - Left to Right. Addition and Subtraction - Left to Right.

Multiplication and Division - Left to Right. Addition and Subtraction - Left to Right. Order of Opertions r of Opertions Alger P lese Prenthesis - Do ll grouped opertions first. E cuse Eponents - Second M D er Multipliction nd Division - Left to Right. A unt S hniqu Addition nd Sutrction

More information

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

A.7.1 Trigonometric interpretation of dot product... 324. A.7.2 Geometric interpretation of dot product... 324 A P P E N D I X A Vectors CONTENTS A.1 Scling vector................................................ 321 A.2 Unit or Direction vectors...................................... 321 A.3 Vector ddition.................................................

More information

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

Use Geometry Expressions to create a more complex locus of points. Find evidence for equivalence using Geometry Expressions. Lerning Objectives Loci nd Conics Lesson 3: The Ellipse Level: Preclculus Time required: 120 minutes In this lesson, students will generlize their knowledge of the circle to the ellipse. The prmetric nd

More information

Integration by Substitution

Integration by Substitution Integrtion by Substitution Dr. Philippe B. Lvl Kennesw Stte University August, 8 Abstrct This hndout contins mteril on very importnt integrtion method clled integrtion by substitution. Substitution is

More information

DATABASDESIGN FÖR INGENJÖRER - 1056F

DATABASDESIGN FÖR INGENJÖRER - 1056F DATABASDESIGN FÖR INGENJÖRER - 06F Sommr 00 En introuktionskurs i tssystem http://user.it.uu.se/~ul/t-sommr0/ lt. http://www.it.uu.se/eu/course/homepge/esign/st0/ Kjell Orsorn (Rusln Fomkin) Uppsl Dtse

More information

Modular Generic Verification of LTL Properties for Aspects

Modular Generic Verification of LTL Properties for Aspects Modulr Generic Verifiction of LTL Properties for Aspects Mx Goldmn Shmuel Ktz Computer Science Deprtment Technion Isrel Institute of Technology {mgoldmn, ktz}@cs.technion.c.il ABSTRACT Aspects re seprte

More information

5.2. LINE INTEGRALS 265. Let us quickly review the kind of integrals we have studied so far before we introduce a new one.

5.2. LINE INTEGRALS 265. Let us quickly review the kind of integrals we have studied so far before we introduce a new one. 5.2. LINE INTEGRALS 265 5.2 Line Integrls 5.2.1 Introduction Let us quickly review the kind of integrls we hve studied so fr before we introduce new one. 1. Definite integrl. Given continuous rel-vlued

More information

Vectors 2. 1. Recap of vectors

Vectors 2. 1. Recap of vectors Vectors 2. Recp of vectors Vectors re directed line segments - they cn be represented in component form or by direction nd mgnitude. We cn use trigonometry nd Pythgors theorem to switch between the forms

More information

SPECIAL PRODUCTS AND FACTORIZATION

SPECIAL PRODUCTS AND FACTORIZATION MODULE - Specil Products nd Fctoriztion 4 SPECIAL PRODUCTS AND FACTORIZATION In n erlier lesson you hve lernt multipliction of lgebric epressions, prticulrly polynomils. In the study of lgebr, we come

More information

Chapter. Contents: A Constructing decimal numbers

Chapter. Contents: A Constructing decimal numbers Chpter 9 Deimls Contents: A Construting deiml numers B Representing deiml numers C Deiml urreny D Using numer line E Ordering deimls F Rounding deiml numers G Converting deimls to frtions H Converting

More information

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

Words Symbols Diagram. abcde. a + b + c + d + e Logi Gtes nd Properties We will e using logil opertions to uild mhines tht n do rithmeti lultions. It s useful to think of these opertions s si omponents tht n e hooked together into omplex networks. To

More information

5 a LAN 6 a gateway 7 a modem

5 a LAN 6 a gateway 7 a modem STARTER With the help of this digrm, try to descrie the function of these components of typicl network system: 1 file server 2 ridge 3 router 4 ckone 5 LAN 6 gtewy 7 modem Another Novell LAN Router Internet

More information

6.2 Volumes of Revolution: The Disk Method

6.2 Volumes of Revolution: The Disk Method mth ppliction: volumes of revolution, prt ii Volumes of Revolution: The Disk Method One of the simplest pplictions of integrtion (Theorem ) nd the ccumultion process is to determine so-clled volumes of

More information

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

Java CUP. Java CUP Specifications. User Code Additions You may define Java code to be included within the generated parser: Jv CUP Jv CUP is prser-genertion tool, similr to Ycc. CUP uilds Jv prser for LALR(1) grmmrs from production rules nd ssocited Jv code frgments. When prticulr production is recognized, its ssocited code

More information

Review guide for the final exam in Math 233

Review guide for the final exam in Math 233 Review guide for the finl exm in Mth 33 1 Bsic mteril. This review includes the reminder of the mteril for mth 33. The finl exm will be cumultive exm with mny of the problems coming from the mteril covered

More information

Two hours UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE. Date: Friday 16 th May 2008. Time: 14:00 16:00

Two hours UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE. Date: Friday 16 th May 2008. Time: 14:00 16:00 COMP20212 Two hours UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE Digitl Design Techniques Dte: Fridy 16 th My 2008 Time: 14:00 16:00 Plese nswer ny THREE Questions from the FOUR questions provided

More information

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

Or more simply put, when adding or subtracting quantities, their uncertainties add. Propgtion of Uncertint through Mthemticl Opertions Since the untit of interest in n eperiment is rrel otined mesuring tht untit directl, we must understnd how error propgtes when mthemticl opertions re

More information

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

Basic Research in Computer Science BRICS RS-02-13 Brodal et al.: Solving the String Statistics Problem in Time O(n log n) BRICS Bsic Reserch in Computer Science BRICS RS-02-13 Brodl et l.: Solving the String Sttistics Prolem in Time O(n log n) Solving the String Sttistics Prolem in Time O(n log n) Gerth Stølting Brodl Rune

More information

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

FAULT TREES AND RELIABILITY BLOCK DIAGRAMS. Harry G. Kwatny. Department of Mechanical Engineering & Mechanics Drexel University SYSTEM FAULT AND Hrry G. Kwtny Deprtment of Mechnicl Engineering & Mechnics Drexel University OUTLINE SYSTEM RBD Definition RBDs nd Fult Trees System Structure Structure Functions Pths nd Cutsets Reliility

More information

2 DIODE CLIPPING and CLAMPING CIRCUITS

2 DIODE CLIPPING and CLAMPING CIRCUITS 2 DIODE CLIPPING nd CLAMPING CIRCUITS 2.1 Ojectives Understnding the operting principle of diode clipping circuit Understnding the operting principle of clmping circuit Understnding the wveform chnge of

More information

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

Mathematics. Vectors. hsn.uk.net. Higher. Contents. Vectors 128 HSN23100 hsn.uk.net Higher Mthemtics UNIT 3 OUTCOME 1 Vectors Contents Vectors 18 1 Vectors nd Sclrs 18 Components 18 3 Mgnitude 130 4 Equl Vectors 131 5 Addition nd Subtrction of Vectors 13 6 Multipliction by

More information

9 CONTINUOUS DISTRIBUTIONS

9 CONTINUOUS DISTRIBUTIONS 9 CONTINUOUS DISTIBUTIONS A rndom vrible whose vlue my fll nywhere in rnge of vlues is continuous rndom vrible nd will be ssocited with some continuous distribution. Continuous distributions re to discrete

More information

Treatment Spring Late Summer Fall 0.10 5.56 3.85 0.61 6.97 3.01 1.91 3.01 2.13 2.99 5.33 2.50 1.06 3.53 6.10 Mean = 1.33 Mean = 4.88 Mean = 3.

Treatment Spring Late Summer Fall 0.10 5.56 3.85 0.61 6.97 3.01 1.91 3.01 2.13 2.99 5.33 2.50 1.06 3.53 6.10 Mean = 1.33 Mean = 4.88 Mean = 3. The nlysis of vrince (ANOVA) Although the t-test is one of the most commonly used sttisticl hypothesis tests, it hs limittions. The mjor limittion is tht the t-test cn be used to compre the mens of only

More information

Learning Outcomes. Computer Systems - Architecture Lecture 4 - Boolean Logic. What is Logic? Boolean Logic 10/28/2010

Learning Outcomes. Computer Systems - Architecture Lecture 4 - Boolean Logic. What is Logic? Boolean Logic 10/28/2010 /28/2 Lerning Outcomes At the end of this lecture you should: Computer Systems - Architecture Lecture 4 - Boolen Logic Eddie Edwrds eedwrds@doc.ic.c.uk http://www.doc.ic.c.uk/~eedwrds/compsys (Hevily sed

More information

The Velocity Factor of an Insulated Two-Wire Transmission Line

The Velocity Factor of an Insulated Two-Wire Transmission Line The Velocity Fctor of n Insulted Two-Wire Trnsmission Line Problem Kirk T. McDonld Joseph Henry Lbortories, Princeton University, Princeton, NJ 08544 Mrch 7, 008 Estimte the velocity fctor F = v/c nd the

More information

Integration. 148 Chapter 7 Integration

Integration. 148 Chapter 7 Integration 48 Chpter 7 Integrtion 7 Integrtion t ech, by supposing tht during ech tenth of second the object is going t constnt speed Since the object initilly hs speed, we gin suppose it mintins this speed, but

More information

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

and thus, they are similar. If k = 3 then the Jordan form of both matrices is Homework ssignment 11 Section 7. pp. 249-25 Exercise 1. Let N 1 nd N 2 be nilpotent mtrices over the field F. Prove tht N 1 nd N 2 re similr if nd only if they hve the sme miniml polynomil. Solution: If

More information

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

1. In the Bohr model, compare the magnitudes of the electron s kinetic and potential energies in orbit. What does this imply? Assignment 3: Bohr s model nd lser fundmentls 1. In the Bohr model, compre the mgnitudes of the electron s kinetic nd potentil energies in orit. Wht does this imply? When n electron moves in n orit, the

More information

Answer, Key Homework 10 David McIntyre 1

Answer, Key Homework 10 David McIntyre 1 Answer, Key Homework 10 Dvid McIntyre 1 This print-out should hve 22 questions, check tht it is complete. Multiple-choice questions my continue on the next column or pge: find ll choices efore mking your

More information

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

The remaining two sides of the right triangle are called the legs of the right triangle. 10 MODULE 6. RADICAL EXPRESSIONS 6 Pythgoren Theorem The Pythgoren Theorem An ngle tht mesures 90 degrees is lled right ngle. If one of the ngles of tringle is right ngle, then the tringle is lled right

More information

Quick Reference Guide: One-time Account Update

Quick Reference Guide: One-time Account Update Quick Reference Guide: One-time Account Updte How to complete The Quick Reference Guide shows wht existing SingPss users need to do when logging in to the enhnced SingPss service for the first time. 1)

More information

AntiSpyware Enterprise Module 8.5

AntiSpyware Enterprise Module 8.5 AntiSpywre Enterprise Module 8.5 Product Guide Aout the AntiSpywre Enterprise Module The McAfee AntiSpywre Enterprise Module 8.5 is n dd-on to the VirusScn Enterprise 8.5i product tht extends its ility

More information

Econ 4721 Money and Banking Problem Set 2 Answer Key

Econ 4721 Money and Banking Problem Set 2 Answer Key Econ 472 Money nd Bnking Problem Set 2 Answer Key Problem (35 points) Consider n overlpping genertions model in which consumers live for two periods. The number of people born in ech genertion grows in

More information

19. The Fermat-Euler Prime Number Theorem

19. The Fermat-Euler Prime Number Theorem 19. The Fermt-Euler Prime Number Theorem Every prime number of the form 4n 1 cn be written s sum of two squres in only one wy (side from the order of the summnds). This fmous theorem ws discovered bout

More information

Rotating DC Motors Part II

Rotating DC Motors Part II Rotting Motors rt II II.1 Motor Equivlent Circuit The next step in our consiertion of motors is to evelop n equivlent circuit which cn be use to better unerstn motor opertion. The rmtures in rel motors

More information

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

1.00/1.001 Introduction to Computers and Engineering Problem Solving Fall 2011 - Final Exam 1./1.1 Introduction to Computers nd Engineering Problem Solving Fll 211 - Finl Exm Nme: MIT Emil: TA: Section: You hve 3 hours to complete this exm. In ll questions, you should ssume tht ll necessry pckges

More information

5.6 POSITIVE INTEGRAL EXPONENTS

5.6 POSITIVE INTEGRAL EXPONENTS 54 (5 ) Chpter 5 Polynoils nd Eponents 5.6 POSITIVE INTEGRAL EXPONENTS In this section The product rule for positive integrl eponents ws presented in Section 5., nd the quotient rule ws presented in Section

More information

3 The Utility Maximization Problem

3 The Utility Maximization Problem 3 The Utility Mxiiztion Proble We hve now discussed how to describe preferences in ters of utility functions nd how to forulte siple budget sets. The rtionl choice ssuption, tht consuers pick the best

More information

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

Math 314, Homework Assignment 1. 1. Prove that two nonvertical lines are perpendicular if and only if the product of their slopes is 1. Mth 4, Homework Assignment. Prove tht two nonverticl lines re perpendiculr if nd only if the product of their slopes is. Proof. Let l nd l e nonverticl lines in R of slopes m nd m, respectively. Suppose

More information

RIGHT TRIANGLES AND THE PYTHAGOREAN TRIPLETS

RIGHT TRIANGLES AND THE PYTHAGOREAN TRIPLETS RIGHT TRIANGLES AND THE PYTHAGOREAN TRIPLETS Known for over 500 yers is the fct tht the sum of the squres of the legs of right tringle equls the squre of the hypotenuse. Tht is +b c. A simple proof is

More information

Warm-up for Differential Calculus

Warm-up for Differential Calculus Summer Assignment Wrm-up for Differentil Clculus Who should complete this pcket? Students who hve completed Functions or Honors Functions nd will be tking Differentil Clculus in the fll of 015. Due Dte:

More information

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

9.3. The Scalar Product. Introduction. Prerequisites. Learning Outcomes The Sclr Product 9.3 Introduction There re two kinds of multipliction involving vectors. The first is known s the sclr product or dot product. This is so-clled becuse when the sclr product of two vectors

More information

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

Bypassing Space Explosion in Regular Expression Matching for Network Intrusion Detection and Prevention Systems Bypssing Spce Explosion in Regulr Expression Mtching for Network Intrusion Detection n Prevention Systems Jignesh Ptel, Alex Liu n Eric Torng Dept. of Computer Science n Engineering Michign Stte University

More information

Babylonian Method of Computing the Square Root: Justifications Based on Fuzzy Techniques and on Computational Complexity

Babylonian Method of Computing the Square Root: Justifications Based on Fuzzy Techniques and on Computational Complexity Bbylonin Method of Computing the Squre Root: Justifictions Bsed on Fuzzy Techniques nd on Computtionl Complexity Olg Koshelev Deprtment of Mthemtics Eduction University of Texs t El Pso 500 W. University

More information

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

Solving the String Statistics Problem in Time O(n log n) Solving the String Sttistics Prolem in Time O(n log n) Gerth Stølting Brodl 1,,, Rune B. Lyngsø 3, Ann Östlin1,, nd Christin N. S. Pedersen 1,2, 1 BRICS, Deprtment of Computer Science, University of Arhus,

More information

Physics 43 Homework Set 9 Chapter 40 Key

Physics 43 Homework Set 9 Chapter 40 Key Physics 43 Homework Set 9 Chpter 4 Key. The wve function for n electron tht is confined to x nm is. Find the normliztion constnt. b. Wht is the probbility of finding the electron in. nm-wide region t x

More information

AREA OF A SURFACE OF REVOLUTION

AREA OF A SURFACE OF REVOLUTION AREA OF A SURFACE OF REVOLUTION h cut r πr h A surfce of revolution is formed when curve is rotted bout line. Such surfce is the lterl boundr of solid of revolution of the tpe discussed in Sections 7.

More information

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

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 1 Exmple A rectngulr box without lid is to be mde from squre crdbord of sides 18 cm by cutting equl squres from ech corner nd then folding up the sides. 1 Exmple A rectngulr box without lid is to be mde

More information

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

DlNBVRGH + Sickness Absence Monitoring Report. Executive of the Council. Purpose of report DlNBVRGH + + THE CITY OF EDINBURGH COUNCIL Sickness Absence Monitoring Report Executive of the Council 8fh My 4 I.I...3 Purpose of report This report quntifies the mount of working time lost s result of

More information

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

FUNCTIONS AND EQUATIONS. xεs. The simplest way to represent a set is by listing its members. We use the notation FUNCTIONS AND EQUATIONS. SETS AND SUBSETS.. Definition of set. A set is ny collection of objects which re clled its elements. If x is n element of the set S, we sy tht x belongs to S nd write If y does

More information

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

1. Find the zeros Find roots. Set function = 0, factor or use quadratic equation if quadratic, graph to find zeros on calculator AP Clculus Finl Review Sheet When you see the words. This is wht you think of doing. Find the zeros Find roots. Set function =, fctor or use qudrtic eqution if qudrtic, grph to find zeros on clcultor.

More information

Automated Grading of DFA Constructions

Automated Grading of DFA Constructions Automted Grding of DFA Constructions Rjeev Alur nd Loris D Antoni Sumit Gulwni Dileep Kini nd Mhesh Viswnthn Deprtment of Computer Science Microsoft Reserch Deprtment of Computer Science University of

More information

Automata theory. An algorithmic approach. Lecture Notes. Javier Esparza

Automata theory. An algorithmic approach. Lecture Notes. Javier Esparza Automt theory An lgorithmic pproch 0 Lecture Notes Jvier Esprz My 3, 2016 2 3 Plese red this! Mny yers go I don t wnt to sy how mny, it s depressing I tught course on the utomt-theoretic pproch to model

More information

MATH 150 HOMEWORK 4 SOLUTIONS

MATH 150 HOMEWORK 4 SOLUTIONS MATH 150 HOMEWORK 4 SOLUTIONS Section 1.8 Show tht the product of two of the numbers 65 1000 8 2001 + 3 177, 79 1212 9 2399 + 2 2001, nd 24 4493 5 8192 + 7 1777 is nonnegtive. Is your proof constructive

More information

New Internet Radio Feature

New Internet Radio Feature XXXXX XXXXX XXXXX /XW-SMA3/XW-SMA4 New Internet Rdio Feture EN This wireless speker hs een designed to llow you to enjoy Pndor*/Internet Rdio. In order to ply Pndor/Internet Rdio, however, it my e necessry

More information

Lec 2: Gates and Logic

Lec 2: Gates and Logic Lec 2: Gtes nd Logic Kvit Bl CS 34, Fll 28 Computer Science Cornell University Announcements Clss newsgroup creted Posted on we-pge Use it for prtner finding First ssignment is to find prtners Due this

More information

Small Businesses Decisions to Offer Health Insurance to Employees

Small Businesses Decisions to Offer Health Insurance to Employees Smll Businesses Decisions to Offer Helth Insurnce to Employees Ctherine McLughlin nd Adm Swinurn, June 2014 Employer-sponsored helth insurnce (ESI) is the dominnt source of coverge for nonelderly dults

More information

Ratio and Proportion

Ratio and Proportion Rtio nd Proportion Rtio: The onept of rtio ours frequently nd in wide vriety of wys For exmple: A newspper reports tht the rtio of Repulins to Demorts on ertin Congressionl ommittee is 3 to The student/fulty

More information

Generating In-Line Monitors For Rabin Automata

Generating In-Line Monitors For Rabin Automata Generting In-Line Monitors For Rin Automt Hugues Chot, Rphel Khoury, nd Ndi Twi Lvl University, Deprtment of Computer Science nd Softwre Engineering, Pvillon Adrien-Pouliot, 1065, venue de l Medecine Queec

More information

Concept Formation Using Graph Grammars

Concept Formation Using Graph Grammars Concept Formtion Using Grph Grmmrs Istvn Jonyer, Lwrence B. Holder nd Dine J. Cook Deprtment of Computer Science nd Engineering University of Texs t Arlington Box 19015 (416 Ytes St.), Arlington, TX 76019-0015

More information

4.11 Inner Product Spaces

4.11 Inner Product Spaces 314 CHAPTER 4 Vector Spces 9. A mtrix of the form 0 0 b c 0 d 0 0 e 0 f g 0 h 0 cnnot be invertible. 10. A mtrix of the form bc d e f ghi such tht e bd = 0 cnnot be invertible. 4.11 Inner Product Spces

More information

JaERM Software-as-a-Solution Package

JaERM Software-as-a-Solution Package JERM Softwre-s--Solution Pckge Enterprise Risk Mngement ( ERM ) Public listed compnies nd orgnistions providing finncil services re required by Monetry Authority of Singpore ( MAS ) nd/or Singpore Stock

More information

Angles 2.1. Exercise 2.1... Find the size of the lettered angles. Give reasons for your answers. a) b) c) Example

Angles 2.1. Exercise 2.1... Find the size of the lettered angles. Give reasons for your answers. a) b) c) Example 2.1 Angles Reognise lternte n orresponing ngles Key wors prllel lternte orresponing vertilly opposite Rememer, prllel lines re stright lines whih never meet or ross. The rrows show tht the lines re prllel

More information

1 Fractions from an advanced point of view

1 Fractions from an advanced point of view 1 Frtions from n vne point of view We re going to stuy frtions from the viewpoint of moern lger, or strt lger. Our gol is to evelop eeper unerstning of wht n men. One onsequene of our eeper unerstning

More information

Chapter 2 The Number System (Integers and Rational Numbers)

Chapter 2 The Number System (Integers and Rational Numbers) Chpter 2 The Number System (Integers nd Rtionl Numbers) In this second chpter, students extend nd formlize their understnding of the number system, including negtive rtionl numbers. Students first develop

More information

Module 2. Analysis of Statically Indeterminate Structures by the Matrix Force Method. Version 2 CE IIT, Kharagpur

Module 2. Analysis of Statically Indeterminate Structures by the Matrix Force Method. Version 2 CE IIT, Kharagpur Module Anlysis of Stticlly Indeterminte Structures by the Mtrix Force Method Version CE IIT, Khrgpur esson 9 The Force Method of Anlysis: Bems (Continued) Version CE IIT, Khrgpur Instructionl Objectives

More information

Project 6 Aircraft static stability and control

Project 6 Aircraft static stability and control Project 6 Aircrft sttic stbility nd control The min objective of the project No. 6 is to compute the chrcteristics of the ircrft sttic stbility nd control chrcteristics in the pitch nd roll chnnel. The

More information

Rotational Equilibrium: A Question of Balance

Rotational Equilibrium: A Question of Balance Prt of the IEEE Techer In-Service Progrm - Lesson Focus Demonstrte the concept of rottionl equilirium. Lesson Synopsis The Rottionl Equilirium ctivity encourges students to explore the sic concepts of

More information

Data Compression. Lossless And Lossy Compression

Data Compression. Lossless And Lossy Compression Dt Compression Reduce the size of dt. ƒ Reduces storge spce nd hence storge cost. Compression rtio = originl dt size/compressed dt size ƒ Reduces time to retrieve nd trnsmit dt. Lossless And Lossy Compression

More information