Computational Models - Lecture 3 1
|
|
- Mabel Martin
- 5 years ago
- Views:
Transcription
1 Computational Models - Lecture 3 1 Handout Mode Iftach Haitner and Yishay Mansour. Tel Aviv University. March 13/18, Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice Herlihy, Brown University. Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
2 Computational Models - Lecture 3 Non Regular Languages: Two Approaches (1) The Pumping Lemma (2) Myhill-Nerode Theorem (not in Sipser s book) Closure properties Algorithmic questions for NFAs Sipser s book, 1.4, 2.1, 2.2 Hopcroft and Ullman, 3.4 Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
3 Proved Last Time Theorem 1 A language, L, is described by a regular expression, R, if and only if L is regular. = construct an NFA accepting R. = Given a regular language, L, construct an equivalent regular expression We have made a lot of progress understanding what finite automata can do. But what can t they do? Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
4 Negative Results Is there a DFA that accepts B = {0 n 1 n : n 0} C = {w: w has an equal number of 0 s and 1 s} D = {w: w has an equal number of occurrences of 01 and 10 substrings} Consider B: DFA must remember how many 0 s it has seen impossible with finite state. The others are exactly the same... Question: Is this a proof? Answer: No, D is regular!??? Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
5 Part I Pumping Lemma Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
6 Pumping Lemma We will show that all regular languages have a special property. Suppose L is regular. If a string in L is longer than a certain critical length l (the pumping length), then it can be pumped to a longer string by repeating an internal substring any number of times. The longer string must be in L too. This is a powerful technique for showing that a language is not regular. Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
7 Pumping Lemma Lemma 2 If L is a regular language, then there is an l > 0 (the pumping length), where if s is any string in L of length s l, then s may be divided into three pieces s = xyz such that 1 for every i 0, xy i z L, 2 y > 0, and 3 xy l. Remarks: Without the second condition, the theorem would be trivial. The third condition is technical and sometimes useful. Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
8 Pumping Lemma Proof Let M = (Q,Σ,δ, q 1, F) be a DFA that accepts L. Let l be Q, the number of states of M. If s L has length at least l, consider the sequence of states M goes through as it reads s: s 1 s 2 s 3 s 4 s 5 s 6... s n q 1 q 20 q 9 q 17 q 12 q 13 q 9 q 2 q 5 F Since the sequence of states is of length s +1 > l, and there are only l different states in Q, at least one state is repeated (by the pigeonhole principle). Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
9 Pumping Lemma Proof (cont.) Write down s = xyz q 1 x q 9 y z q 5 By inspection, M accepts xy k z for every k 0. y > 0 because the state (q 9 in figure) is repeated. To ensure that xy l, pick first state repetition, which must occur no later than l+1 states in sequence. Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
10 Application # 1 Corollary 3 The language B = {0 n 1 n : n > 0} is not regular. Proof: By contradiction. Suppose B is regular. Let 2l be the pumping length. Consider the string s = 0 l 1 l. By pumping lemma s = xyz, where xy k z B for every k 0. If y is all 0, then xy k z has too many 0 s, for k 2. If y is all 1, then xy k z has too many 1 s, for k 2. If y is mixed, then xy k z is not of right form. Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
11 Using the Pumping Lemma How to prove that a language is not regular Given a language L An adversary sets the parameter l. Select a word s L. The word s would (usually) depend on l. The adversary selects a partition s = xyz, such that y 1 and xy l. Show an index k, such that xy k z L. Need to prove for any parameter l and any partition xyz. Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
12 Application # 2 Corollary 4 The language C = {w: # 1 (w) = # 0 (w)} is not regular. Proof: By contradiction. Suppose C is regular. Let l be the pumping length. Consider the string s = 0 l 1 l. By pumping lemma s = xyz, where xy k z C for every k 0. Since xy l then y is all 0, and xy k z has too many 0 s. Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
13 Reflections What about using (01) l C? What about D = {w: w has an equal number of occurrences of 01 and 10 substrings}? Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
14 Application # 3 Corollary 5 The language E = {0 i 1 j : i > j} is not regular. Proof: By contradiction. Suppose E is regular. Let l be its pumping length. Consider the string s = 0 l 1 l 1. By pumping lemma s = xyz, where xy k z E for every k 0, y > 0 and xy l But for k = 0 we have xz / E, contradiction. Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
15 Application # 4 Corollary 6 The language Primes {1}, which contains all strings whose length is a prime number, is not regular. Proof: By contradiction. Suppose Primes is regular, accepted by DFA M. Let l be the pumping length. Let s = 1 p Primes, where p l is a prime. By pumping lemma s = xyz, where xy k z Primes for every k. For k = p + 1 we have xy k z = 1 p+mp, where y = m. since p(m+1) is not prime, we have a contradiction. Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
16 Another Example Consider the language L = {a i b n c n : n 0, i 1} {b n c m : n, m 0}, For any word s L we can apply the pumping lemma: If s = a i b n c n, then set x = ε and y = a. If s = b n c m, then set x = ε and y = b. If s = c m, then set x = ε and y = c. Is L regular?! How can we prove it?! Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
17 Part II Characterization of Regular Languages Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
18 The Equivalence Relation L Let L Σ be a language. Define an equivalence relation L on pairs of strings: Let x, y Σ. We say that x L y if for every string z Σ, xz L if and only if yz L. It is easy to see that L is indeed an equivalence relation (reflexive, symmetric, transitive) on Σ. In addition, if x L y then for every string z Σ, xz L yz as well (this is called right invariance). Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
19 The Equivalence Relation L cont. Like every equivalence relation, L partitions Σ to (disjoint) equivalence classes. For every string x, let [x] Σ denote its equivalence class w.r.t. L (if x L y then [x] = [y] equality of sets). Question is, how many equivalence classes does L induce? L finite or infinite? Well, it could be either finite or infinite. This depends on the language L. Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
20 Three Examples Let L 1 {0, 1} contain all strings where the number of 1s is divisible by 4. Then L1 has finitely many equivalence classes. Let L 2 {0, 1} contain all strings of the form 0 n 1 n. Then L2 has infinitely many equivalence classes. Let L 3 = {a i b n c n : n 0, i 1} {b n c m : n, m 0}. Then L3 has infinitely many equivalence classes. (Proof on the board) Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
21 Myhill-Nerode Theorem Theorem 7 Let L Σ be a language. Then L is regular L has finitely many equivalence classes. Three specific consequences: L 1 {0, 1} contains all strings where the number of 1s is divisible by 4. Then L 1 is regular. L 2 {0, 1} contains all strings of the form 0 n 1 n. Then L 2 is not regular. Let L 3 = {a i b n c n : n 0, i 1} {b n c m : n, m 0}. Then L 3 is not regular. Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
22 Myhill-Nerode Theorem: Proof = Suppose L is regular. Let M = (Q,Σ,δ, q 0, F) be a DFA accepting it. The relation M on pairs of strings is defined as follows: x M y if δ(q 0, x) = δ(q 0, y). Clearly, M is an equivalence relation. Furthermore, if x M y, then xz M yz for every z Σ. Therefore, xz L if and only if yz L. This means that x M y = x L y (i.e., M is a refinement of L ). Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
23 Myhill-Nerode Theorem: Proof cont. = The equivalence relation M has finitely many equivalence classes (at most the number of states in M). We saw that x M y = x L y, so the number of equivalence classes of L is less or equal than the number of equivalence classes of M. Therefore, L has finitely many equivalence classes. Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
24 Myhill-Nerode Theorem: Proof cont. = Suppose L has finitely many equivalence classes. We ll construct a DFA M = (Q,Σ,δ, q 0, F) that accepts L. Let x 1,...,x n Σ be representatives for the finitely many equivalence classes of L. Q = {[x 1 ],...,[x n ]}. δ([x i ], a) = [x i a] for all a Σ. q 0 = [ε]. F = {[x i ]: x i L}. Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
25 Myhill-Nerode Theorem: Proof cont. = δ([ε], x) = [x] proof: Assume δ([ε], x) = [x] = [x i ]. By right invariance δ([ε], xa) = δ([x i ], a) = [x i a] = [xa] Therefore, M accepts x iff x L So L is accepted by DFA, hence L is regular. Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
26 Example Construct DFA (via the above method) for L 1 {0, 1} contains all strings where the number of 1s is divisible by 5. Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
27 Applications of the Proof Let L be a regular language and let M be a DFA accepting it The number of equivalence classes of L lowerbounds the number of equivalence classes of M, which equals the number of states in M. The equivalence relation M, is a refinement of L (each equivalence class of L correspond to a union of states). There is an automata whose number of states equals the number of equivalence classes of L Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
28 Minimizing Automata Input: An automata M Output: An automata M, such that L(M) = L(M ) and M has a minimal number of states. Let S 1 = F and S 2 = Q F. Set S = {S 1, S 2 }. While exists equivalence class S i S, q 1, q 2 S i and σ Σ such that, δ(q 1,σ) S j1 and δ(q 2,σ) S j2, j 1 j 2, then let S i,1 = {q S i : δ(q,σ) S j1 }, j 1 i. S = S S i S i,1 (S i S i,1 ) Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
29 Minimizing Automata Claim 8 Output M = (Q,δ, q 0, F ): where Q = S, q 0 = S 0 S such that q 0 S 0 F = {S 1,...,S k } S, such that S i F. δ (S i,σ) = S j if for q S i then δ(q,σ) S j. The algorithm terminates, and outputs a (in fact, the) minimal automata. Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
30 Example a s b a q 1 r 1 a b a b a b q 2 r 2 b Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
31 Part III Closure Properties of Regular Languages Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
32 Simple Closure Properties Regular languages are closed under complement. Let M = (Q,Σ,δ, q 0, F) be a DFA that accepts L. Then M = (Q,Σ,δ, q 0, Q F) is a DFA that accepts L = Σ \L. NFA?! Regular languages are closed under intersection. L 1 L 2 = L 1 L 2. Proof with automata?! Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
33 Division L 1 /L 2 = {x: y L 2, xy L 1 } Examples: L 1 = (01 1) and L 2 = 00, L 1 /L 2 =? L 1 /L 2 =. L 3 = a b c and L 4 = b, L 3 /L 4 =?. L 3 /L 4 = a b. Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
34 Division cont. Theorem 9 Regular languages are closed under division with any language. Proof: L 1 is a regular language, so it has a DFA M = (Q,Σ,δ, q 0, F). L 2 is an arbitrary language. For L 1 /L 2 we build M = (Q,Σ,δ, q 0, F ). F = {q: y L 2,δ(q, y) F}. F is well defined, but might be hard to compute non constructive proof". Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
35 Homomorphism Definition 10 Homomorphism: an assignment that replaces each letter with a word, i.e., h : Σ. For a word w = w 1,...,w n, then h(w) = h(w 1 ) h(w n ), ad for a language L, then h(l) = {h(x) : x L}. Example: h(1) = aba, h(0) = aa h(010) = aa aba aa L 1 = (01), h(l 1 ) = (aaaba). h(0) = a, h(1) = a L 2 = {0 n 1 n n 0}, h(l 2 ) = {a 2n n 0}. Theorem 11 Regular languages are closed under homomorphism. Proof: Using regular expressions. Using Automata Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
36 Inverse Homomorphism Definition 12 Inverse homomorphism: h 1 (w) = {x: h(x) = w}, h 1 (L) = {x: h(x) L} Example: h(1) = aba, h(0) = aa L 2 = (ab ba) a, h 1 (L 2 ) = {1}. Claim 13 h(h 1 (L)) L h 1 (h(l)). Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
37 Inverse Homomorphism cont. Theorem 14 Regular languages are closed under inverse homomorphism. Proof idea: Let M = (Q,Σ,δ, q 0, F) the automata for L, and h : Σ. for each letter a we advance in M using h(a). Formally, we define M = (Q,,δ, q 0, F), where δ (q, a) = δ(q, h(a)). Hence, δ (q, w) = δ(q, h(w)) w L(M ) h(w) L(M) Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
38 Using Homomorphism We know that L 1 = {0 n 1 n : n 1} is not regular. Show that L 2 = {a n ba n : n 1} is not regular We will prove using homomorphism and inverse homomorphism h 1 (a) = a, h 1 (b) = b, h 1 (c) = a. h 2 (a) = 0, h 2 (b) = ɛ, h 2 (c) = 1. h 2 (h 1 1 (L 2) a b c ) = L 1 h 1 1 (L 2) = (a c) k b(a c) k h 1 1 (L 2) a b c = {a n bc n : n 1} h 2 (h 1 1 (L 2) a b c ) = {0 n 1 n : n 1} Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
39 Part IV Algorithmic Questions for NFAs Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
40 Algorithmic Questions for NFAs Q.: Given an NFA, N, and a string w, is w L(N)? Answer: Construct the DFA equivalent to N and run it on w. Q.: Is L(N) =? Answer 1: Build a minimal size DFA. (Might be exponential time!) Answer 2: This is a reachability question in graphs: Is there a path in the states graph of N from the start state to some accepting state. There are simple, efficient algorithms for this task. Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
41 More Questions Q.: Is L(N) = Σ? Answer: Check if L(N) =. Q.: Given N 1 and N 2, is L(N 1 ) L(N 2 )? Answer: Check if L(N 2 ) L(N 1 ) =. Q.: Given N 1 and N 2, is L(N 1 ) = L(N 2 )? Answer: Check if L(N 1 ) L(N 2 ) and L(N 2 ) L(N 1 ). In the future, we will see that for stronger models of computations, many of these problems cannot be solved by any algorithm. Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
42 Part V Summary Regular Languages Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
43 Summary - Regular Languages So far we saw finite automata, regular languages, regular expressions, Myhill-Nerode theorem and pumping lemma for regular languages. Next class we introduce stronger machines and languages with more expressive power: pushdown automata, context-free languages, context-free grammars Iftach Haitner and Yishay Mansour (TAU) Computational Models Lecture 3 March 13/18, / 43
Computational Models - Lecture 3 1
Computational Models - Lecture 3 1 Handout Mode Iftach Haitner. Tel Aviv University. November 14, 2016 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice Herlihy, Brown University.
More informationComputational Models: Class 3
Computational Models: Class 3 Benny Chor School of Computer Science Tel Aviv University November 2, 2015 Based on slides by Maurice Herlihy, Brown University, and modifications by Iftach Haitner and Yishay
More informationWhat we have done so far
What we have done so far DFAs and regular languages NFAs and their equivalence to DFAs Regular expressions. Regular expressions capture exactly regular languages: Construct a NFA from a regular expression.
More informationComputational Models - Lecture 3
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. p. 1 Computational Models - Lecture 3 Equivalence of regular expressions and regular languages (lukewarm leftover
More informationComputational Models - Lecture 5 1
Computational Models - Lecture 5 1 Handout Mode Iftach Haitner and Yishay Mansour. Tel Aviv University. April 10/22, 2013 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice
More informationComputational Models - Lecture 4
Computational Models - Lecture 4 Regular languages: The Myhill-Nerode Theorem Context-free Grammars Chomsky Normal Form Pumping Lemma for context free languages Non context-free languages: Examples Push
More informationComputational Models - Lecture 4 1
Computational Models - Lecture 4 1 Handout Mode Iftach Haitner and Yishay Mansour. Tel Aviv University. April 3/8, 2013 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice
More informationComputational Models - Lecture 4 1
Computational Models - Lecture 4 1 Handout Mode Iftach Haitner. Tel Aviv University. November 21, 2016 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice Herlihy, Brown University.
More informationComputational Models - Lecture 5 1
Computational Models - Lecture 5 1 Handout Mode Iftach Haitner. Tel Aviv University. November 28, 2016 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice Herlihy, Brown University.
More informationComputational Models - Lecture 1 1
Computational Models - Lecture 1 1 Handout Mode Ronitt Rubinfeld and Iftach Haitner. Tel Aviv University. February 29/ March 02, 2016 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames
More informationComputational Models Lecture 2 1
Computational Models Lecture 2 1 Handout Mode Ronitt Rubinfeld and Iftach Haitner. Tel Aviv University. March 16/18, 2015 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice
More informationComputational Models Lecture 2 1
Computational Models Lecture 2 1 Handout Mode Iftach Haitner. Tel Aviv University. October 30, 2017 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice Herlihy, Brown University.
More informationFinite Automata and Regular languages
Finite Automata and Regular languages Huan Long Shanghai Jiao Tong University Acknowledgements Part of the slides comes from a similar course in Fudan University given by Prof. Yijia Chen. http://basics.sjtu.edu.cn/
More informationMore on Finite Automata and Regular Languages. (NTU EE) Regular Languages Fall / 41
More on Finite Automata and Regular Languages (NTU EE) Regular Languages Fall 2016 1 / 41 Pumping Lemma is not a Sufficient Condition Example 1 We know L = {b m c m m > 0} is not regular. Let us consider
More information3515ICT: Theory of Computation. Regular languages
3515ICT: Theory of Computation Regular languages Notation and concepts concerning alphabets, strings and languages, and identification of languages with problems (H, 1.5). Regular expressions (H, 3.1,
More informationBefore we show how languages can be proven not regular, first, how would we show a language is regular?
CS35 Proving Languages not to be Regular Before we show how languages can be proven not regular, first, how would we show a language is regular? Although regular languages and automata are quite powerful
More informationFormal Languages, Automata and Models of Computation
CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 5 School of Innovation, Design and Engineering Mälardalen University 2011 1 Content - More Properties of Regular Languages (RL)
More informationComputational Models: Class 1
Computational Models: Class 1 Benny Chor School of Computer Science Tel Aviv University October 19, 2015 Based on slides by Maurice Herlihy, Brown University, and modifications by Iftach Haitner and Yishay
More informationCS 455/555: Finite automata
CS 455/555: Finite automata Stefan D. Bruda Winter 2019 AUTOMATA (FINITE OR NOT) Generally any automaton Has a finite-state control Scans the input one symbol at a time Takes an action based on the currently
More informationTheory of Computation
Fall 2002 (YEN) Theory of Computation Midterm Exam. Name:... I.D.#:... 1. (30 pts) True or false (mark O for true ; X for false ). (Score=Max{0, Right- 1 2 Wrong}.) (1) X... If L 1 is regular and L 2 L
More informationCSE 105 THEORY OF COMPUTATION
CSE 105 THEORY OF COMPUTATION Spring 2017 http://cseweb.ucsd.edu/classes/sp17/cse105-ab/ Today's learning goals Sipser Ch 1.4 Explain the limits of the class of regular languages Justify why the Pumping
More informationUnit 6. Non Regular Languages The Pumping Lemma. Reading: Sipser, chapter 1
Unit 6 Non Regular Languages The Pumping Lemma Reading: Sipser, chapter 1 1 Are all languages regular? No! Most of the languages are not regular! Why? A finite automaton has limited memory. How can we
More informationCSci 311, Models of Computation Chapter 4 Properties of Regular Languages
CSci 311, Models of Computation Chapter 4 Properties of Regular Languages H. Conrad Cunningham 29 December 2015 Contents Introduction................................. 1 4.1 Closure Properties of Regular
More informationThe Pumping Lemma and Closure Properties
The Pumping Lemma and Closure Properties Mridul Aanjaneya Stanford University July 5, 2012 Mridul Aanjaneya Automata Theory 1/ 27 Tentative Schedule HW #1: Out (07/03), Due (07/11) HW #2: Out (07/10),
More informationLecture 4: More on Regexps, Non-Regular Languages
6.045 Lecture 4: More on Regexps, Non-Regular Languages 6.045 Announcements: - Pset 1 is on piazza (as of last night) - If you don t have piazza access but are registered for 6.045, send email to TAs with
More informationFinite Automata and Regular Languages
Finite Automata and Regular Languages Topics to be covered in Chapters 1-4 include: deterministic vs. nondeterministic FA, regular expressions, one-way vs. two-way FA, minimization, pumping lemma for regular
More informationComputational Models: Class 5
Computational Models: Class 5 Benny Chor School of Computer Science Tel Aviv University March 27, 2019 Based on slides by Maurice Herlihy, Brown University, and modifications by Iftach Haitner and Yishay
More informationComputational Models Lecture 8 1
Computational Models Lecture 8 1 Handout Mode Ronitt Rubinfeld and Iftach Haitner. Tel Aviv University. May 11/13, 2015 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice
More informationComputational Models Lecture 8 1
Computational Models Lecture 8 1 Handout Mode Nachum Dershowitz & Yishay Mansour. Tel Aviv University. May 17 22, 2017 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice
More informationComputational Models Lecture 8 1
Computational Models Lecture 8 1 Handout Mode Ronitt Rubinfeld and Iftach Haitner. Tel Aviv University. April 18/ May 2, 2016 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice
More informationCSE 105 THEORY OF COMPUTATION
CSE 105 THEORY OF COMPUTATION Spring 2016 http://cseweb.ucsd.edu/classes/sp16/cse105-ab/ Today's learning goals Sipser Ch 1.4 Give an example of a non-regular language Outline two strategies for proving
More informationFORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
5-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY NON-DETERMINISM and REGULAR OPERATIONS THURSDAY JAN 6 UNION THEOREM The union of two regular languages is also a regular language Regular Languages Are
More informationPS2 - Comments. University of Virginia - cs3102: Theory of Computation Spring 2010
University of Virginia - cs3102: Theory of Computation Spring 2010 PS2 - Comments Average: 77.4 (full credit for each question is 100 points) Distribution (of 54 submissions): 90, 12; 80 89, 11; 70-79,
More informationFORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
15-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY REVIEW for MIDTERM 1 THURSDAY Feb 6 Midterm 1 will cover everything we have seen so far The PROBLEMS will be from Sipser, Chapters 1, 2, 3 It will be
More informationCSE 105 THEORY OF COMPUTATION
CSE 105 THEORY OF COMPUTATION "Winter" 2018 http://cseweb.ucsd.edu/classes/wi18/cse105-ab/ Today's learning goals Sipser Section 1.4 Explain the limits of the class of regular languages Justify why the
More information1 More finite deterministic automata
CS 125 Section #6 Finite automata October 18, 2016 1 More finite deterministic automata Exercise. Consider the following game with two players: Repeatedly flip a coin. On heads, player 1 gets a point.
More informationClosure Properties of Regular Languages. Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism
Closure Properties of Regular Languages Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism Closure Properties Recall a closure property is a statement
More informationNotes on State Minimization
U.C. Berkeley CS172: Automata, Computability and Complexity Handout 1 Professor Luca Trevisan 2/3/2015 Notes on State Minimization These notes present a technique to prove a lower bound on the number of
More informationComputer Sciences Department
1 Reference Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER 3 objectives Finite automaton Infinite automaton Formal definition State diagram Regular and Non-regular
More informationLecture 7 Properties of regular languages
Lecture 7 Properties of regular languages COT 4420 Theory of Computation Section 4.1 Closure properties of regular languages If L 1 and L 2 are regular languages, then we prove that: Union: L 1 L 2 Concatenation:
More informationCOMP-330 Theory of Computation. Fall Prof. Claude Crépeau. Lec. 5 : DFA minimization
COMP-33 Theory of Computation Fall 27 -- Prof. Claude Crépeau Lec. 5 : DFA minimization COMP 33 Fall 27: Lectures Schedule 4. Context-free languages 5. Pushdown automata 6. Parsing 7. The pumping lemma
More informationThe View Over The Horizon
The View Over The Horizon enumerable decidable context free regular Context-Free Grammars An example of a context free grammar, G 1 : A 0A1 A B B # Terminology: Each line is a substitution rule or production.
More informationCS 154. Finite Automata, Nondeterminism, Regular Expressions
CS 54 Finite Automata, Nondeterminism, Regular Expressions Read string left to right The DFA accepts a string if the process ends in a double circle A DFA is a 5-tuple M = (Q, Σ, δ, q, F) Q is the set
More informationWe define the multi-step transition function T : S Σ S as follows. 1. For any s S, T (s,λ) = s. 2. For any s S, x Σ and a Σ,
Distinguishability Recall A deterministic finite automaton is a five-tuple M = (S,Σ,T,s 0,F) where S is a finite set of states, Σ is an alphabet the input alphabet, T : S Σ S is the transition function,
More informationCOMP-330 Theory of Computation. Fall Prof. Claude Crépeau. Lec. 9 : Myhill-Nerode Theorem and applications
COMP-33 Theory of Computation Fall 217 -- Prof. Claude Crépeau Lec. 9 : Myhill-Nerode Theorem and applications COMP 33 Fall 212: Lectures Schedule 1-2. Introduction 1.5. Some basic mathematics 2-3. Deterministic
More informationBüchi Automata and their closure properties. - Ajith S and Ankit Kumar
Büchi Automata and their closure properties - Ajith S and Ankit Kumar Motivation Conventional programs accept input, compute, output result, then terminate Reactive program : not expected to terminate
More informationSri vidya college of engineering and technology
Unit I FINITE AUTOMATA 1. Define hypothesis. The formal proof can be using deductive proof and inductive proof. The deductive proof consists of sequence of statements given with logical reasoning in order
More informationTheory of Computation (II) Yijia Chen Fudan University
Theory of Computation (II) Yijia Chen Fudan University Review A language L is a subset of strings over an alphabet Σ. Our goal is to identify those languages that can be recognized by one of the simplest
More informationContext Free Languages. Automata Theory and Formal Grammars: Lecture 6. Languages That Are Not Regular. Non-Regular Languages
Context Free Languages Automata Theory and Formal Grammars: Lecture 6 Context Free Languages Last Time Decision procedures for FAs Minimum-state DFAs Today The Myhill-Nerode Theorem The Pumping Lemma Context-free
More informationComputational Models Lecture 5
Computational Models Lecture 5 One More PDAs Example Equivalence of PDAs and CFLs Nondeterminism adds power to PDAs (not in book) Closure Properties of CFLs Algorithmic Aspects of PDAs and CFLs DFAs and
More informationNon-Deterministic Finite Automata
Slides modified Yishay Mansour on modification by Benny Chor, based on original slides by Maurice Herlihy, Brown University. p. 8 Non-Deterministic Finite Automata 0,1 0,1 0 0,ε q q 1 q 2 3 1 q 4 an NFA
More informationChapter 6. Properties of Regular Languages
Chapter 6 Properties of Regular Languages Regular Sets and Languages Claim(1). The family of languages accepted by FSAs consists of precisely the regular sets over a given alphabet. Every regular set is
More informationIntroduction to the Theory of Computation. Automata 1VO + 1PS. Lecturer: Dr. Ana Sokolova.
Introduction to the Theory of Computation Automata 1VO + 1PS Lecturer: Dr. Ana Sokolova http://cs.uni-salzburg.at/~anas/ Setup and Dates Lectures and Instructions 23.10. 3.11. 17.11. 24.11. 1.12. 11.12.
More informationWarshall s algorithm
Regular Expressions [1] Warshall s algorithm See Floyd-Warshall algorithm on Wikipedia The Floyd-Warshall algorithm is a graph analysis algorithm for finding shortest paths in a weigthed, directed graph
More informationIntroduction to the Theory of Computation. Automata 1VO + 1PS. Lecturer: Dr. Ana Sokolova.
Introduction to the Theory of Computation Automata 1VO + 1PS Lecturer: Dr. Ana Sokolova http://cs.uni-salzburg.at/~anas/ Setup and Dates Lectures Tuesday 10:45 pm - 12:15 pm Instructions Tuesday 12:30
More informationCOMP4141 Theory of Computation
COMP4141 Theory of Computation Lecture 4 Regular Languages cont. Ron van der Meyden CSE, UNSW Revision: 2013/03/14 (Credits: David Dill, Thomas Wilke, Kai Engelhardt, Peter Höfner, Rob van Glabbeek) Regular
More informationProperties of Context-Free Languages. Closure Properties Decision Properties
Properties of Context-Free Languages Closure Properties Decision Properties 1 Closure Properties of CFL s CFL s are closed under union, concatenation, and Kleene closure. Also, under reversal, homomorphisms
More informationClosure under the Regular Operations
September 7, 2013 Application of NFA Now we use the NFA to show that collection of regular languages is closed under regular operations union, concatenation, and star Earlier we have shown this closure
More informationCS 154. Finite Automata vs Regular Expressions, Non-Regular Languages
CS 154 Finite Automata vs Regular Expressions, Non-Regular Languages Deterministic Finite Automata Computation with finite memory Non-Deterministic Finite Automata Computation with finite memory and guessing
More informationcse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska
cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska LECTURE 6 CHAPTER 2 FINITE AUTOMATA 2. Nondeterministic Finite Automata NFA 3. Finite Automata and Regular Expressions 4. Languages
More informationHKN CS/ECE 374 Midterm 1 Review. Nathan Bleier and Mahir Morshed
HKN CS/ECE 374 Midterm 1 Review Nathan Bleier and Mahir Morshed For the most part, all about strings! String induction (to some extent) Regular languages Regular expressions (regexps) Deterministic finite
More informationLecture Notes On THEORY OF COMPUTATION MODULE -1 UNIT - 2
BIJU PATNAIK UNIVERSITY OF TECHNOLOGY, ODISHA Lecture Notes On THEORY OF COMPUTATION MODULE -1 UNIT - 2 Prepared by, Dr. Subhendu Kumar Rath, BPUT, Odisha. UNIT 2 Structure NON-DETERMINISTIC FINITE AUTOMATA
More informationDM17. Beregnelighed. Jacob Aae Mikkelsen
DM17 Beregnelighed Jacob Aae Mikkelsen January 12, 2007 CONTENTS Contents 1 Introduction 2 1.1 Operations with languages...................... 2 2 Finite Automata 3 2.1 Regular expressions/languages....................
More informationCS 154, Lecture 3: DFA NFA, Regular Expressions
CS 154, Lecture 3: DFA NFA, Regular Expressions Homework 1 is coming out Deterministic Finite Automata Computation with finite memory Non-Deterministic Finite Automata Computation with finite memory and
More informationTHEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET
THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET Regular Languages and FA A language is a set of strings over a finite alphabet Σ. All languages are finite or countably infinite. The set of all languages
More informationFinite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018
Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018 Lecture 9 Ana Bove April 19th 2018 Recap: Regular Expressions Algebraic representation of (regular) languages; R, S ::= a R + S RS R......
More informationProperties of Regular Languages. BBM Automata Theory and Formal Languages 1
Properties of Regular Languages BBM 401 - Automata Theory and Formal Languages 1 Properties of Regular Languages Pumping Lemma: Every regular language satisfies the pumping lemma. A non-regular language
More informationMore Properties of Regular Languages
More Properties of Regular anguages 1 We have proven Regular languages are closed under: Union Concatenation Star operation Reverse 2 Namely, for regular languages 1 and 2 : Union 1 2 Concatenation Star
More informationEinführung in die Computerlinguistik
Einführung in die Computerlinguistik Context-Free Grammars formal properties Laura Kallmeyer Heinrich-Heine-Universität Düsseldorf Summer 2018 1 / 20 Normal forms (1) Hopcroft and Ullman (1979) A normal
More informationFinite State Automata
Trento 2005 p. 1/4 Finite State Automata Automata: Theory and Practice Paritosh K. Pandya (TIFR, Mumbai, India) Unversity of Trento 10-24 May 2005 Trento 2005 p. 2/4 Finite Word Langauges Alphabet Σ is
More informationLanguages, regular languages, finite automata
Notes on Computer Theory Last updated: January, 2018 Languages, regular languages, finite automata Content largely taken from Richards [1] and Sipser [2] 1 Languages An alphabet is a finite set of characters,
More informationFORMAL LANGUAGES, AUTOMATA AND COMPUTATION
FORMAL LANGUAGES, AUTOMATA AND COMPUTATION IDENTIFYING NONREGULAR LANGUAGES PUMPING LEMMA Carnegie Mellon University in Qatar (CARNEGIE MELLON UNIVERSITY IN QATAR) SLIDES FOR 15-453 LECTURE 5 SPRING 2011
More informationContext-Free Languages (Pre Lecture)
Context-Free Languages (Pre Lecture) Dr. Neil T. Dantam CSCI-561, Colorado School of Mines Fall 2017 Dantam (Mines CSCI-561) Context-Free Languages (Pre Lecture) Fall 2017 1 / 34 Outline Pumping Lemma
More informationOutline. Summary. DFA -> Regex. Finish off Regex -> e-nfa -> NFA -> DFA -> Regex Minimization/equivalence (Myhill-Nerode theorem)
Outline Finish off Regex -> e-nfa -> NFA -> DFA -> Regex Minimization/equivalence (Myhill-Nerode theorem) http://www.cs.caltech.edu/~cs20/a October 9, 2002 1 Summary NFA -> DFA If NFA has states Q, construct
More informationTime Magazine (1984)
Time Magazine (1984) Put the right kind of software into a computer, and it will do whatever you want it to. There may be limits on what you can do with the machines themselves, but there are no limits
More informationOgden s Lemma for CFLs
Ogden s Lemma for CFLs Theorem If L is a context-free language, then there exists an integer l such that for any u L with at least l positions marked, u can be written as u = vwxyz such that 1 x and at
More informationGEETANJALI INSTITUTE OF TECHNICAL STUDIES, UDAIPUR I
GEETANJALI INSTITUTE OF TECHNICAL STUDIES, UDAIPUR I Internal Examination 2017-18 B.Tech III Year VI Semester Sub: Theory of Computation (6CS3A) Time: 1 Hour 30 min. Max Marks: 40 Note: Attempt all three
More informationFORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
15-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY THE PUMPING LEMMA FOR REGULAR LANGUAGES and REGULAR EXPRESSIONS TUESDAY Jan 21 WHICH OF THESE ARE REGULAR? B = {0 n 1 n n 0} C = { w w has equal number
More informationAutomata Theory. Lecture on Discussion Course of CS120. Runzhe SJTU ACM CLASS
Automata Theory Lecture on Discussion Course of CS2 This Lecture is about Mathematical Models of Computation. Why Should I Care? - Ways of thinking. - Theory can drive practice. - Don t be an Instrumentalist.
More informationCS154. Non-Regular Languages, Minimizing DFAs
CS54 Non-Regular Languages, Minimizing FAs CS54 Homework is due! Homework 2 will appear this afternoon 2 The Pumping Lemma: Structure in Regular Languages Let L be a regular language Then there is a positive
More informationCISC 4090: Theory of Computation Chapter 1 Regular Languages. Section 1.1: Finite Automata. What is a computer? Finite automata
CISC 4090: Theory of Computation Chapter Regular Languages Xiaolan Zhang, adapted from slides by Prof. Werschulz Section.: Finite Automata Fordham University Department of Computer and Information Sciences
More informationComputational Theory
Computational Theory Finite Automata and Regular Languages Curtis Larsen Dixie State University Computing and Design Fall 2018 Adapted from notes by Russ Ross Adapted from notes by Harry Lewis Curtis Larsen
More informationFooling Sets and. Lecture 5
Fooling Sets and Introduction to Nondeterministic Finite Automata Lecture 5 Proving that a language is not regular Given a language, we saw how to prove it is regular (union, intersection, concatenation,
More informationCSE 105 Homework 5 Due: Monday November 13, Instructions. should be on each page of the submission.
CSE 05 Homework 5 Due: Monday November 3, 207 Instructions Upload a single file to Gradescope for each group. should be on each page of the submission. All group members names and PIDs Your assignments
More informationMA/CSSE 474 Theory of Computation
MA/CSSE 474 Theory of Computation Closure properties of Regular Languages Pumping Theorem Your Questions? Previous class days' material? Reading Assignments? HW 6 or 7 problems? Anything else? 1 To Show
More information10. The GNFA method is used to show that
CSE 355 Midterm Examination 27 February 27 Last Name Sample ASU ID First Name(s) Ima Exam # Sample Regrading of Midterms If you believe that your grade has not been recorded correctly, return the entire
More informationExam 1 CSU 390 Theory of Computation Fall 2007
Exam 1 CSU 390 Theory of Computation Fall 2007 Solutions Problem 1 [10 points] Construct a state transition diagram for a DFA that recognizes the following language over the alphabet Σ = {a, b}: L 1 =
More informationCritical CS Questions
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. p. 1 Critical CS Questions What is a computer? And What is a Computation? real computers too complex for any
More informationAutomata: a short introduction
ILIAS, University of Luxembourg Discrete Mathematics II May 2012 What is a computer? Real computers are complicated; We abstract up to an essential model of computation; We begin with the simplest possible
More informationCS 275 Automata and Formal Language Theory
CS 275 Automata and Formal Language Theory Course Notes Part II: The Recognition Problem (II) Chapter II.4.: Properties of Regular Languages (13) Anton Setzer (Based on a book draft by J. V. Tucker and
More informationTDDD65 Introduction to the Theory of Computation
TDDD65 Introduction to the Theory of Computation Lecture 2 Gustav Nordh, IDA gustav.nordh@liu.se 2012-08-31 Outline - Lecture 2 Closure properties of regular languages Regular expressions Equivalence of
More informationRecitation 2 - Non Deterministic Finite Automata (NFA) and Regular OctoberExpressions
Recitation 2 - Non Deterministic Finite Automata (NFA) and Regular Expressions Orit Moskovich Gal Rotem Tel Aviv University October 28, 2015 Recitation 2 - Non Deterministic Finite Automata (NFA) and Regular
More informationFall 1999 Formal Language Theory Dr. R. Boyer. 1. There are other methods of nding a regular expression equivalent to a nite automaton in
Fall 1999 Formal Language Theory Dr. R. Boyer Week Four: Regular Languages; Pumping Lemma 1. There are other methods of nding a regular expression equivalent to a nite automaton in addition to the ones
More informationFinite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018
Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018 Lecture 14 Ana Bove May 14th 2018 Recap: Context-free Grammars Simplification of grammars: Elimination of ǫ-productions; Elimination of
More informationNotes for Comp 497 (Comp 454) Week 5 2/22/05. Today we will look at some of the rest of the material in Part 1 of the book.
Notes for Comp 497 (Comp 454) Week 5 2/22/05 Today we will look at some of the rest of the material in Part 1 of the book Errata (Chapter 9) Chapter 9 p. 177, line 11, replace "for L 1 " by "for L 2 ".
More informationCS 154 Introduction to Automata and Complexity Theory
CS 154 Introduction to Automata and Complexity Theory cs154.stanford.edu 1 INSTRUCTORS & TAs Ryan Williams Cody Murray Lera Nikolaenko Sunny Rajan 2 Textbook 3 Homework / Problem Sets Homework will be
More informationIncorrect reasoning about RL. Equivalence of NFA, DFA. Epsilon Closure. Proving equivalence. One direction is easy:
Incorrect reasoning about RL Since L 1 = {w w=a n, n N}, L 2 = {w w = b n, n N} are regular, therefore L 1 L 2 = {w w=a n b n, n N} is regular If L 1 is a regular language, then L 2 = {w R w L 1 } is regular,
More informationComputational Models #1
Computational Models #1 Handout Mode Nachum Dershowitz & Yishay Mansour March 13-15, 2017 Nachum Dershowitz & Yishay Mansour Computational Models #1 March 13-15, 2017 1 / 41 Lecture Outline I Motivation
More informationNPDA, CFG equivalence
NPDA, CFG equivalence Theorem A language L is recognized by a NPDA iff L is described by a CFG. Must prove two directions: ( ) L is recognized by a NPDA implies L is described by a CFG. ( ) L is described
More informationCMPSCI 250: Introduction to Computation. Lecture #22: From λ-nfa s to NFA s to DFA s David Mix Barrington 22 April 2013
CMPSCI 250: Introduction to Computation Lecture #22: From λ-nfa s to NFA s to DFA s David Mix Barrington 22 April 2013 λ-nfa s to NFA s to DFA s Reviewing the Three Models and Kleene s Theorem The Subset
More information