1 Homework #6 (Models of Computation, Spring, 2001) Due: Section 1; March 29 Section 2; March 30 2. Let L be the language of the following grammar G 1.

Slides:



Advertisements
Similar presentations
1 Lecture 32 Closure Properties for CFL’s –Kleene Closure construction examples proof of correctness –Others covered less thoroughly in lecture union,
Advertisements

Pushdown Automata Chapter 12. Recognizing Context-Free Languages Two notions of recognition: (1) Say yes or no, just like with FSMs (2) Say yes or no,
YES-NO machines Finite State Automata as language recognizers.
Nathan Brunelle Department of Computer Science University of Virginia Theory of Computation CS3102 – Spring 2014 A tale.
142 Parsing start (a, Z 0 /aZ 0 ) ( a, a/aa ) (b, a/  ) ( , Z 0 /Z 0 ) For a given CFG G, parsing a string w is to check if w  L(G) and, if it is,
Intro to DFAs Readings: Sipser 1.1 (pages 31-44) With basic background from Sipser 0.
CS5371 Theory of Computation
Theory of Computation What types of things are computable? How can we demonstrate what things are computable?
start 0, 4, 8 1, 5, 9 2, 6 3, 7 2 0,4,8 2, 6 3, 7 1, 5, 9 to state 2 to state 3 to state 1 to state 0 to state 1 to state 3 to state 0 to state.
1 1. Show the result of each of the following set operations in terms of set property. Write your sets as simple as possible. (a) L 0  L 4 (b) L 0  L.
Fall 2005 CSE 467/567 1 Formal languages regular expressions regular languages finite state machines.
104 Closure Properties of Regular Languages Regular languages are closed under many set operations. Let L 1 and L 2 be regular languages. (1) L 1  L 2.
CS 490: Automata and Language Theory Daniel Firpo Spring 2003.
79 Regular Expression Regular expressions over an alphabet  are defined recursively as follows. (1) Ø, which denotes the empty set, is a regular expression.
1 Module 31 Closure Properties for CFL’s –Kleene Closure construction examples proof of correctness –Others covered less thoroughly in lecture union, concatenation.
Key to Homework #2 1. What is the language of L-system G = ({a, b, c}, h, acb ), where the rewriting rule h is defined as follows: h (a) = aa h (b) = cb.
Finite State Machines Data Structures and Algorithms for Information Processing 1.
Great Theoretical Ideas in Computer Science.
Regular Languages A language is regular over  if it can be built from ;, {  }, and { a } for every a 2 , using operators union ( [ ), concatenation.
Chapter 2 Languages.
CS490 Presentation: Automata & Language Theory Thong Lam Ran Shi.
1 Theory of Digital Computation Course material for undergraduate students on IT Department of Computer Science University of Veszprem Veszprem, Hungary.
Theory of Computation, Feodor F. Dragan, Kent State University 1 Regular expressions: definition An algebraic equivalent to finite automata. We can build.
1 Homework #7 (Models of Computation, Spring, 2001) Due: Section 1; April 16 (Monday) Section 2; April 17 (Tuesday) 2. Covert the following context-free.
Context-free Grammars Example : S   Shortened notation : S  aSaS   | aSa | bSb S  bSb Which strings can be generated from S ? [Section 6.1]
Grammars CPSC 5135.
Decidable Questions About Regular languages 1)Membership problem: “Given a specification of known type and a string w, is w in the language specified?”
Membership problem CYK Algorithm Project presentation CS 5800 Spring 2013 Professor : Dr. Elise de Doncker Presented by : Savitha parur venkitachalam.
Push-down Automata Section 3.3 Fri, Oct 21, 2005.
Phrase-structure grammar A phrase-structure grammar is a quadruple G = (V, T, P, S) where V is a finite set of symbols called nonterminals, T is a set.
1 Module 31 Closure Properties for CFL’s –Kleene Closure –Union –Concatenation CFL’s versus regular languages –regular languages subset of CFL.
CHAPTER 1 Regular Languages
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 11 Midterm Exam 2 -Context-Free Languages Mälardalen University 2005.
CS 3240 – Chapter 4.  Closure Properties  Algorithms for Elementary Questions:  Is a given word, w, in L?  Is L empty, finite or infinite?  Are L.
1 A well-parenthesized string is a string with the same number of (‘s as )’s which has the property that every prefix of the string has at least as many.
1 1. Let A ={r, p, i } and B = { w, o, r, l, d }. What does each of the following (a), (b) and (c) denote? Briefly explain in plain English. (a) A * B.
Closure Properties Lemma: Let A 1 and A 2 be two CF languages, then the union A 1  A 2 is context free as well. Proof: Assume that the two grammars are.
Chapter 6 Properties of Regular Languages. 2 Regular Sets and Languages  Claim(1). The family of languages accepted by FSAs consists of precisely the.
Lecture 8 Context-Free Grammar- Cont.
Introduction Finite Automata accept all regular languages and only regular languages Even very simple languages are non regular (  = {a,b}): - {a n b.
Three Basic Concepts Languages Grammars Automata.
UNIT - I Formal Language and Regular Expressions: Languages Definition regular expressions Regular sets identity rules. Finite Automata: DFA NFA NFA with.
Regular Grammars Reading: 3.3. What we know so far…  FSA = Regular Language  Regular Expression describes a Regular Language  Every Regular Language.
Discrete Structures ICS252 Chapter 5 Lecture 2. Languages and Grammars prepared By sabiha begum.
98 Nondeterministic Automata vs Deterministic Automata We learned that NFA is a convenient model for showing the relationships among regular grammars,
CS 154 Formal Languages and Computability February 11 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron.
1 A well-parenthesized string is a string with the same number of (‘s as )’s which has the property that every prefix of the string has at least as many.
Regular Expressions CS 130: Theory of Computation HMU textbook, Chapter 3.
 2004 SDU Lecture4 Regular Expressions.  2004 SDU 2 Regular expressions A third way to view regular languages. Say that R is a regular expression if.
Pushdown Automata Chapter 12. Recognizing Context-Free Languages Two notions of recognition: (1) Say yes or no, just like with FSMs (2) Say yes or no,
1 Section 11.2 Finite Automata Can a machine(i.e., algorithm) recognize a regular language? Yes! Deterministic Finite Automata A deterministic finite automaton.
1 Chapter Pushdown Automata. 2 Section 12.2 Pushdown Automata A pushdown automaton (PDA) is a finite automaton with a stack that has stack operations.
1 Section 12.2 Pushdown Automata A pushdown automaton (PDA) is a finite automaton with a stack that has stack operations pop, push, and nop. PDAs always.
1 1. Eliminate all  -transitions from the following FA without changing the number of states and the language accepted by the automaton. You should also.
1 Key to Homework #3 (Models of Computation, Spring, 2001) Finite state control with a 4-way read/write head Figure (a)Figure (b) (over)
Context-Free and Noncontext-Free Languages Chapter 13.
20 G M aaba acba aaba.. What is it about? Models of Language Generation Models of Language Recognition.
PROPERTIES OF REGULAR LANGUAGES
Natural Language Processing - Formal Language -
Theorem 29 Given any PDA, there is another PDA that accepts exactly the same language with the additional property that whenever a path leads to ACCEPT,
Push-down Automata Section 3.3 Wed, Oct 27, 2004.
Push-down Automata.
Jaya Krishna, M.Tech, Assistant Professor
REGULAR LANGUAGES AND REGULAR GRAMMARS
Chapter 7 Regular Grammars
Non-Deterministic Finite Automata
Midterm (Models of Computation, Fall, 2000)
Homework #5 (Models of Computation, Spring, 2001) Due: Section 1; February 27 Section 2; February 28 ** Please put your homework in the collection.
ReCap Chomsky Normal Form, Theorem regarding CNF, examples of converting CFG to be in CNF, Example of an FA corresponding to Regular CFG, Left most and.
CSCI 2670 Introduction to Theory of Computing
Presentation transcript:

1 Homework #6 (Models of Computation, Spring, 2001) Due: Section 1; March 29 Section 2; March Let L be the language of the following grammar G 1. Construct a regular grammar whose language is L R, i.e., the reversed language of L. Your grammar’s production rules should observe the restriction that the nonterminal symbol at the right side of each production rule, if any, should be located at the right end. You should also clearly show the procedure that you took to get your answer. G 1 : S  aA | bB A  bD |  B  aC | bE C  aC | bE |  D  aE | bD |  E  aE | bD 3. Let L be the language of the following grammar G 1. Construct a regular grammar whose language is the complement of L. You should also clearly show the procedure that you took to get your answer. 4. Let L’ be the language of grammar G 2 below and L be the language of grammar G 1 in problem 2 above. (a) Construct a context-free grammar whose language is L’L, the concatenation of the two languages. (b) Construct a context-free grammar whose language is L’  L, the union of the two languages. G2: S  aA A  Sb | b You should also clearly show the procedure that you took to get your answers. 1. Using the partition technique find the reduced DFA (i.e., the minimum state DFA that accepts the same language) of the following DFA. For your answer you should also show your partitioning record. starta a b b b a a a a a b b b b ab

2 5. Convert the following CFG G to another CFG G’ such that L(G) = L(G’) and G’ has the smallest possible number of  -production rules. You should also clearly show the procedure that you took to get your answer. G: S  ABCd | BEF A  aA |  B  FGH | b C  cC |  E  a |  F  f |  G  Gg | H H  h |  The following 2 problems are design applications of finite state automata. 6. Consider a toy shown in Figure 1 on the following page. A sequence of marbles is dropped in, each at gate A or B. Levers x 1 and x2 cause the marble to fall either to the left or right. Whenever a marble hit a lever, it causes the lever to change the position so that the next marble to encounter the lever will take the opposite path. The figure shows the initial states of the levers. Model this toy by a DFA. Design your machine such that it enters an accepting state when the last marble comes out of exit D. Denote a marble put in at A by a 0 input, and a marble put in at B by a 1 input. 7. Historically, finite state automata were first used to model neuron (nerve cell) nets (see Figure 2 on the following page). Each neuron has excitatory (empty circles in the figure) and inhibitory (filled circles) synapses. A neuron produces a 1-output if the number of excitatory synapses with 1-inputs exceeds the number of inhibitory synapses with 1-inputs by at least the threshold of the neuron (the number inside the triangle). Model the neuron net in Figure 2 in term of a DFA which enters an accepting state if the neuron net’s output is 1. Assume that there is sufficient time for an input signal (either 1 or 0) to propagate and let the network reach a stable configuration before another input comes. Further assume that initially the values in y 1, y 2, and y 3 are all 0.

3 A B CD Figure 1 x2x2 x1x1 neuron net output      input y1y1 y2y2 y3y3 Figure 2 1  