Nme Im Smple ASU ID 2468024680 CSE 355 Test 1, Fll 2016 30 Septemer 2016, 8:35-9:25.m., LSA 191 Regrding of Midterms If you elieve tht your grde hs not een dded up correctly, return the entire pper to the instructor with short note indicting wht you elieve to e the error. Other thn for tht reson, test grdes re lmost never chnged. If you elieve tht you did not receive the proper credit, first red these smple solutions crefully to see if you cn understnd the nswer to your concern. If tht does not resolve it, write cler explntion of why you elieve the grde is in error nd sumit tht, long with the entire test pper, to the instructor. Plese do not discuss in your explntion how your solution is like tht of nother student, s FERPA legisltion mkes it impossile for me to discuss one student s work with nother. Plese tke into ccount tht more thn 350 ppers were grded, nd it is uite unfir to chnge the grde on one pper without giving every other student the sme opportunity. If you nevertheless wnt the pper regrded, e dvised tht the entire pper will e regrded nd the grde my go up, sty the sme, or go down. The new grde will e finl. It is violtion of the Acdemic Integrity Policy to reuest grde chnge simply ecuse you need or wnt higher grde. If you reuire clrifiction of the smple solutions (not grde chnge or review s discussed ove), sk in recittions, or in office hours of the TA or instructor. You will e sked whether you hve red the smple solution nd to indicte wht precisely is uncler to you out it, so red these smple solutions crefully first. Note tht under no circumstnces cn nyone chnge grde other thn the instructor, so do not sk the TAs to do so they re not le to. Grde chnge reuests, whether sumitted s descried ove or not, will not e considered if received fter 26 Octoer 2016. Instructions Do not open the exm until you re instructed to do so. The exm will e sumitted in THREE pieces: Multiple Choice Questions, Answers to Multiple Choice, nd Long Answer. You must write your nme nd student numer on ech nd every sheet indicted; filure to do so my result in your test not eing properly grded. Write legily we must e le to red your nme nd numer. You must turn in ll sheets including the multiple choice uestions. You hve 50 minutes to complete the exm. No ooks, notes, electronic devices, or other ids re permitted. Turn off ll wireless devices nd plce them wy from your work spce. Write ll nswers on the exmintion pper itself. BUDGET YOUR TIME WELL! SHOW ALL WORK! 1
Nme: Im Smple Multiple Choice 1 Student Numer: 2468024680 Some Generl Comments 1. As stted in clss, ppers written in pencil re not eligile for regrding. 2. Some students continued to write fter it ws nnounced tht the time is over. This is n cdemic integrity violtion nd my result in your receiving no credit for your test. 3. We noticed group of students discussing the test fter the time ws over ut efore they hnded in their tests. This is n cdemic integrity violtion. Hnd in your test efore you strt your post mortem. 4. Mny people did not write their nme nd/or student numer on ll sheets.this creted sustntil mount of extr work for the TAs nd instructor. You were sked to do this t the strt of the test; do not wit until it is time to hnd it in nd hold up 300+ people trying to hnd in the test. 5. Mny people wrote nme tht is not in greement with the nme under which they re listed in the ASU system. Use the nme y which ASU knows you. In t lest one cse, in trying to red the nme I did not guess single letter correctly, nor did I guess the numer of letters correctly. Plese write your nme clerly; use BLOCK letters if there is ny chnce it will e misred. 6. Sixteen people did not fill in the nswers to the multiple choice in the Answers to Multiple Choice. In two cses there ws no corresponding uestion sheets on which to locte the nswers. The Answers to Multiple Choice sheet ws displyed in clss on 28 Septemer precisely to void this prolem, nd the instructions on the test itself re cler. Follow the instructions. 7. I know tht the time is severely limited to do ech uestion. There is no need to write out of time or no time left. On the other hnd, kudos to the students who sid If I hd time, I would find long enough string in the lnguge nd show there is no wy it cn e pumped to lwys sty in the lnguge or similr sttement. Answers to Multiple Choice [17 mrks in totl] Enter ech response (one of,, c, d, e) for the uestions on the Multiple Choice pges. Giving 0, or 2 or more, responses to uestion is incorrect. Illegile or lnk responses re incorrect. 1 2 3 4 5 6 7 8 D D E B E A D D 9 10 11 12 13 14 15 16 E C C A E B D B 17 TOTAL A Multiple Choice [17 mrks in totl] Select the most pproprite nswer for ech, nd enter ech response (one of,, c, d, e) on the Answers to Multiple Choice pge.
Multiple Choice 2 1. The powerset method d constructs DFA from n NFA 2. Which of the following is flse? d Lnguges re defined to hve finite numer of strings. 3. On input string w Σ, the numer of computtions of n NFA (Q, Σ, δ, 0, F ) is lwys e t lest 1 if the NFA ccepts w 4. If DFA M = (Q, Σ, δ, 0, F ) ccepts input string w Σ with w = n, computtion of M on w is seuence of exctly n + 1 sttes 5. The pumping lemm for regulr lnguges cn e proved y e showing tht DFA computtion must repet stte. 6. DeMorgn s Lws ensure tht Closure under intersection nd complementtion imply closure under union. 7. The regulr opertions re d str, union, nd conctention. 8. To show tht lnguge is regulr, one could give DFA for it. One could lso d give regulr expression or use closure properties 9. To show tht lnguge is not regulr, one could e use the pumping lemm for regulr lnguges or use closure properties 10. The pumping lemm for regulr lnguges implies tht c regulr lnguge is infinite if nd only if it contins string tht cn e pumped 11. A generlized NFA, or GNFA, c cn hve trnsitions lelled with or 12. To rip stte rip in the GNFA method, when there is trnsition from to rip leled A, trnsition from rip to rip leled B, trnsition from rip to leled C, nd trnsition from to leled D, we mke trnsition from to leled (A(B) C) D 13. The GNFA method is used to show tht e Every regulr lnguge is descried y regulr expression. 14. Which of these does not imply tht L is regulr? L is closed under the regulr opertions: i.e, L = LL = L L = L. 15. The greement A of two lnguges L 1 nd L 2 is lnguge consisting of ll strings tht re in oth or neither of the two. Suppose tht L 1 nd L 2 re regulr. d A is regulr ecuse we could construct DFA using the product construction 16. For n NFA M = (Q, Σ, δ, 0, F ) nd suset S Q, which of the following is not lwys true out the ε closure E(S)? there is no ε trnsition from stte not in E(S) to stte in E(S) 17. { n m : n > m 0} is not regulr ecuse p+1 p cnnot e pumped
Nme: Im Smple Long Answers 1 Student Numer: 2468024680 Question 1. [11 mrks] Let L {, } e the lnguge L = { n m : n < m or m < n}. Stte whether or not L is regulr, nd show tht your nswer is correct. L is not regulr. To show this, suppose to the contrry tht L is regulr, nd let p e its pumping length from the pumping lemm for regulr lnguges. Choose w = p p2 +1. Note tht w L ecuse p < p 2 + 1, nd w = p 2 +p+1 p. Therefore y the pumping lemm, we cn write w = uvx with v not empty nd uv p so tht uv i x L for ll i 0. Becuse uv is prefix of w of length t most p, it contins only s. So without loss of generlity, u = α, v = β, nd x = p α β p2 +1, with α 0, β 1, nd α + β p. Now uv 2 x = p+β p2 +1, nd p + 1 p + β 2p. Becuse p + 1 > p 2 + 1, uv 2 x cn only elong to L if p 2 + 1 < p + β 2p. But for every positive integer p, p 2 + 1 > 2p. We conclude tht uv 2 x L, which is contrdiction. So L is not regulr. Other strings you might hve considered: w = p2 +1 p good choice, y considering uv 0 x, i.e. pumping down. w = p p+p! good choice, using the p! trick. w = p2 p or w = p p d choices, ecuse they re not in L. w = p 1 p d choice ecuse we cnnot e sure tht p is n integer. w = p 1 p or w = p 1 p2 d choice ecuse it cn e pumped in the s. w = d choice ecuse the string my e too short. Some students wrote L = L 1 L 2 with L 1 = { n m : n < m} nd L 2 = { n m : m < n}. Then they rgued tht neither L 1 nor L 2 is regulr, which is correct. But then they wnted to conclude tht therefore L is not regulr. But this is not true in generl. Indeed let N e ny lnguge tht is not regulr. Then N is not regulr either. However N N = Σ, which definitely is regulr. So this rgument is fllcious.
Nme: Im Smple Long Answers 2 Student Numer: 2468024680 Question 2. [11 mrks] () [5 mrks] Using the method from clss, produce n NFA for the regulr expression ( ). Do not simplify. (You cn give trnsition digrm or trnsition tle, nd do not need oth.) 2 3 4 5 0 1 6 7 8 9 () [6 mrks] Using the powerset method, produce DFA for the NFA from the () prt. Do not simplify the NFA first. (You cn give trnsition digrm or trnsition tle, nd do not need oth.) { 3, 4 } { 0, 1, 2, 5, 6 } { 0, 1, 2, 6 }, { 7, 8 } { 0, 1, 2, 6, 9 }
Nme: Im Smple Long Answers 3 Student Numer: 2468024680 Question 3. [11 mrks] DFAs with lphet {, } nd trnsition functions Stte Symol 0 strt, finl 1 0 1 0 1 Stte Symol 0 strt, finl 0 1 1 1 0 recognize lnguges of strings with n even numer of s, nd n even numer of s, respectively. () [5 mrks] Let L {, } consist of strings hving n n even numer of s or n even numer of s. Using the product construction on the two given mchines, produce DFA M tht recognizes L. 0,0 0,1 1,0 1,1 () [6 mrks] Show how to turn M into GNFA M. Then show the GNFA otined fter one stte is removed from M using the GNFA method. s 0,0 1,0 0,1 1,1 f Rip stte 1,1 : s 0,0 0,1 f 1,0