# Register now to access 7 million high quality study materials (What's Course Hero?) Course Hero is the premier provider of high quality online educational resources. With millions of study documents, online tutors, digital flashcards and free courseware, Course Hero is helping students learn more efficiently and effectively. Whether you're interested in exploring new subjects or mastering key topics for your next exam, Course Hero has the tools you need to achieve your goals.

2 Pages

### hw3

Course: CS 322, Fall 2009
School: Washington
Rating:

Word Count: 373

#### Document Preview

322: CSE Formal Models in Computer Science April 18, 2008 Reading Assignment: Sipser 1.4 Problems: Assignment #3 Due: Friday, April 25, 2008 1. For the language denoted by each of the following regular expressions, give two strings that are members and two strings that are non-members - a total of four strings for each part. Assume the alphabet = {a, b} in all parts: (a) a(ab) b (b) a b (c) a b a (d) (aba...

Register Now

#### Unformatted Document Excerpt

Coursehero >> Washington >> Washington >> CS 322

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
322: CSE Formal Models in Computer Science April 18, 2008 Reading Assignment: Sipser 1.4 Problems: Assignment #3 Due: Friday, April 25, 2008 1. For the language denoted by each of the following regular expressions, give two strings that are members and two strings that are non-members - a total of four strings for each part. Assume the alphabet = {a, b} in all parts: (a) a(ab) b (b) a b (c) a b a (d) (aba bab) (e) ( a)b (f) (a ba bb) 2. Give regular expressions for the following languages: (a) L3 , which is the language of all valid comments in the C language. Assume for this problem that a valid comment in C starts with /# and ends with #/ with no intervening #/. Assume for simplicity that the alphabet for L3 is = {/, #, a, b}. For example, /#ab#/ and /#a/#b#/ are in L3 while /#ab and /#a#/b#/ are not. (b) L4 = {w|w {0, 1} and w starts with a 1 and has odd length or w starts with a 010 and has length that is a multiple of 3}. 3. Using the construction given by the proof of Lemma 1.55 (1st edition Lemma 1.29) (as shown in Examples 1.57 and 1.58 (1st edition and 1.30 1.31) to draw state diagrams for NFAs that accept the languages given by the following regular expressions. Include all states that would be created by this construction (in other words do not simplify any of the steps in the construction.) (a) ((ab) b) bb . (b) (a b(ab ) b ) 4. Consider the DFA M = ({q0 , q1 , q2 , q3 }, {0, 1}, , q0 , {q1 }) with the following transition function for i = 0, 1, 2, 3; (qi , 0) = q2i mod 4 and (qi , 1) = q2i+1 mod 4 . (a) Let L5 be the language accepted by M . Give a simple description of L5 . (b) Using the NFA to regular expression covered in class, obtain a regular expression that describe...

Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Washington - CS - 322
CSE 322: Formal Models in Computer Science April 25, 2008Assignment #4 Due: Monday, May 5, 2008Reading Assignment: Lecture notes on pattern matching, Myhill-Nerode, and DFA Minimization. Sipser 2.1 Problems: 1. Use the pumping lemma to prove that
Washington - CS - 322
CSE 322: Formal Models in Computer Science May 9, 2008 Reading Assignment: Sipser 2.1Assignment #5 Due: Friday, May 16, 20081. Design context-free grammars which generate each of the following languages. Justify your grammar designs. You may spec
Washington - CS - 322
CSE 322: Formal Models in Computer Science May 16, 2008 Reading Assignment: Sipser 2.2,2.3Assignment #6 Due: Wednesday, May 28, 20081. Find a pushdown automaton which recognizes the language {am bn |n m 2n, m, n 0} For the transition function,
Washington - CS - 322
CSE 322: Formal Models in Computer Science May 27, 2008 Reading Assignment: Sipser 3.1,3.2, 4.1,4.2Assignment #7 Due: Friday, June 6, 20081. Let L = {0n 11 0n 1n |n 0}. Prove that L is not context-free. 2. Let L be the language of all palindrome
Washington - CS - 322
CSE 322: Formal Models in Computer Science May 28, 2008Extra Credit Due: Monday, June 9, 2008, MidnightThis extra credit involves building automata and Turing machines using JFLAP, a Java-based simulator. You can download the program from the fol
Washington - CS - 322
CSE 322 - Introduction to Formal Methods in Computer Science Formal Definition of a Deterministic Finite AutomataDave BaconDepartment of Computer Science &amp; Engineering, University of WashingtonI.EXAMPLE FROM MY YOUTH AND MY OLD AGEBack in the
Washington - CS - 322
CSE 322 - Introduction to Formal Methods in Computer Science Regular Operations on LanguagesDave BaconDepartment of Computer Science &amp; Engineering, University of WashingtonI.A QUESTIONNow that we have defined deterministic finite automata, we
Washington - CS - 322
CSE 322 - Introduction to Formal Methods in Computer Science Nondeterministic Finite AutomataDave BaconDepartment of Computer Science &amp; Engineering, University of WashingtonToday we are going to talk about nondeterministic finite automata. Our mo
Washington - CS - 322
CSE 322 - Introduction to Formal Methods in Computer Science Equivalence of DFAs and NFAsDave BaconDepartment of Computer Science &amp; Engineering, University of WashingtonLast time we defined nondeterministic finite automata. Our motivation for doi
Washington - CS - 322
CSE 322 - Introduction to Formal Methods in Computer Science Regular ExpressionsDave BaconDepartment of Computer Science &amp; Engineering, University of WashingtonHaving just put behind us our first major theoretical result, that the class of langua
Washington - CS - 322
CSE 322 - Introduction to Formal Methods in Computer Science Converting DFAs to Regular ExpressionsDave BaconDepartment of Computer Science &amp; Engineering, University of WashingtonLast time we saw how, given a regular expression, we could take thi
Washington - CS - 322
CSE 322 - Introduction to Formal Methods in Computer Science The Pumping Lemma for Regular LanguagesDave BaconDepartment of Computer Science &amp; Engineering, University of WashingtonSo far we have talked about regular languages and showed that they
Washington - CS - 322
CSE 322 - Introduction to Formal Methods in Computer Science String MatchingDave BaconDepartment of Computer Science &amp; Engineering, University of WashingtonSuppose that you are given a short pattern and a long text and you wish to determine if th
Washington - CS - 322
CSE 322 - Introduction to Formal Methods in Computer Science The Myhill-Nerode TheoremDave BaconDepartment of Computer Science &amp; Engineering, University of WashingtonThe pumping lemma for regular languages is nice, but it has one fatal drawback,
Washington - CS - 322
CSE 322 - Introduction to Formal Methods in Computer Science Minimizing DFAsDave BaconDepartment of Computer Science &amp; Engineering, University of WashingtonLast time we discussed the Myhill-Nerode theorem: Myhill-Nerode Theorem A is regular if an
Washington - CS - 322
CSE 322 - Introduction to Formal Methods in Computer Science Introduction to Context-Free GrammarsDave BaconDepartment of Computer Science &amp; Engineering, University of WashingtonIn the last few lectures we finished up talking about regular langua
Washington - CS - 322
CSE 322 - Introduction to Formal Methods in Computer Science Chomsky Normal FormDave BaconDepartment of Computer Science &amp; Engineering, University of WashingtonA useful form for dealing with context free grammars is the Chomksy normal form. This
Washington - CS - 322
CSE 322 - Introduction to Formal Methods in Computer Science Pushdown AutomataDave BaconDepartment of Computer Science &amp; Engineering, University of WashingtonOkay now that we've talked a little about context free grammars, a natural question to a
Washington - CS - 322
CSE 322 - Introduction to Formal Methods in Computer Science Pushdown Automata And Context-Free LanguagesDave BaconDepartment of Computer Science &amp; Engineering, University of WashingtonHaving introduced pushdown automata, we will now show that pu
Washington - CS - 322
CSE 322 - Introduction to Formal Methods in Computer Science Closure Properties of Context-Free LanguagesDave BaconDepartment of Computer Science &amp; Engineering, University of WashingtonPreviously we showed how regular operations were closed under
Washington - CS - 322
CSE 322 - Introduction to Formal Methods in Computer Science Turing MachinesDave BaconDepartment of Computer Science &amp; Engineering, University of WashingtonToday we finally make it up to.computers! Well at least to the model which best captures w
Washington - CS - 322
CSE 322 - Introduction to Formal Methods in Computer Science DecidabilityDave BaconDepartment of Computer Science &amp; Engineering, University of WashingtonIn the last lecture we introduced the Turing machine. We talked about how it worked, and show
Washington - CS - 322
CSE 322: Formal Models in Computer ScienceMidterm TopicsThe midterm will be Friday, May 9th in class. It will be 50 minutes in length and will be closed book. The midterm will cover everything covered in class up to and including the first half o
Washington - CS - 322
CSE 322: Formal Models in Computer ScienceFinal TopicsThe nal will be Monday, June 9 from 2:30-4:20 in EEB 045. It will be 110 minutes in length and will be closed book. It will cover everything in the class with slightly more coming from the mat
Washington - CS - 322
CSE322: Formal Models in Computer Science Partial Solutions to Sample FinalSpring 2006This handout has (partial) solutions to some of the problems in the sample final exam that was handed out in class on Friday, May 26. I have not given solutions
Washington - CS - 322
1 CSE 322: Formal Models in Computer Science April 2, 2008 HandoutN,S,W,ENNN,EQQQ Fremont Troll o QQQ y QQQ QQQ QQQ N,S,W N QQQ Q@ E G Queen Anne Ave o Villa Sophia o W iRRR y RRR RRR N S RRR W R Space Needle o yNWGas Works Park o
Washington - CS - 322
CSE 322 Introduction to Formal Models in Computer ScienceDefining from In the definition of DFAs, the transition function explicitly describes, for each character a , the name of the state reached on a when started at state q. This is precisely
Washington - CS - 322
Washington - CS - 322
CSE 322: Formal Models in Computer Science Website: http:/www.cs.washington.edu/322 Lecture Times: MWF 1:30-2:30 in EE 045 (in the dungeon of EE.) Instructor: Dave Bacon Office: CSE 460 Email: dabacon@cs.washington.edu Phone: 206-221-6503 Office hour
Washington - CS - 521
CSE 521: Design and Analysis of Algorithms Winter 2005 Course InformationInstructor: TAs:Anna R. Karlin Neva Cherniavsky Ning ChenPGA 594 PGA 378 PGA 310karlin@cs.washington.edu nchernia@cs.washington.edu ning@cs.washington.edu543-9344 685-
Washington - CS - 521
CSE 521: Design and Analysis of Algorithms Assignment #0 January 3, 2005 Due: Wednesday, January 5Reading Assignment: Kleinberg and Tardos, Chapters 1 and 4 Questions: 1. For each of the following topics, indicate your level of comfort on a scale o