Computational Models: Class 3

Size: px
Start display at page:

Download "Computational Models: Class 3"

Transcription

1 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 Mansour. Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

2 Computational Models, Lecture 3: Plan Two approaches for proving languages are non regular: 1 Pumping Lemma 2 Myhill-Nerode Theorem (not in Sipser s book) Closure properties Algorithmic questions for NFAs Context free grammers Sipser, 1.4, 2.1, 2.2 Hopcroft and Ullman, 3.4 Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

3 What We Proved Last Time (among other things) Theorem 1 A language is described by a regular expression, iff it is regular. We will now review the construction of the more involved part (if L is accepted by a DFA/NFA, then L can be described by a regular expression), and go over a proof of the correctness of the construction. Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

4 Generalized Non-Deterministic Finite Automata (reminder) We now define generalized non-deterministic finite automata (GNFA). An NFA: A GNFA: Each transition labeled with a symbol or ε, reads zero or one symbols, takes matching transition, if any. Each transition labeled with a regular expression, reads zero or more symbols, takes transition whose regular expression matches string, if any. GNFAs are natural generalization of NFAs. Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

5 A Special Form of GNFA (reminder) We will focus on a special type of GNFA Start state has outgoing arrows to every other state, but no incoming arrows. Unique accept state has incoming arrows from every other state, but no outgoing arrows. Except for start and accept states, an arrow goes from every state to every other state, including itself. Easy to transform any GNFA into special form. Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

6 GNFA Model of Computation (reminder) Definition 2 A GNFA G = (Q, Σ, δ, q s, q a ) accepts a string w Σ, if there exists parsing w = w 1 w 2 w k, where each w i Σ, and r 0,..., r k Q, such that r 0 = q s, r k = q a, and w i L(δ(r i 1, r i )), for every 0 < i k. Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

7 The Construction: DFA/NFA = Regular Expression Strategy sequence of transformations, changing one automata to an equivalent one. Last automata in sequence will be a 2 state special form GNFA (yielding a regular expression). Given an n-state DFA. Transform into an (n + 2)-state GNFA. While GNFA has more than 2 states, transform it into equivalent GNFA with one fewer state. Eventually reach 2-state GNFA (states are just start and accept). Label on single transition is the desired regular expression. Q.: why do we not care if we start from DFA or NFA here? Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

8 Converting strategy ( =) 3-state DFA 5-state GNFA 4-state GNFA 3-state GNFA 2-state GNFA regular expression Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

9 Removing One State While there are more than two states, we choose any state q r that differs from the start and accept state. We remove the state q r, and then repair the GNFA by altering regular expression of other transitions. R 4 q i q j R 1 R 3 q r R 2 q i R 1 R* 2 R 3 UR 4 q j This process is done for any ordered pair of states (q i, q j ). Each such alteration corresponds to strings "going from q i to q j directly or via q r. In particular, if i j, we do it separately for (q i, q j ) and (q j, q i ). And if i = j, we do it for (q i, q i ). Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

10 Proof of Correctness (reminder) We showed that if G k is a k-state GNFA which is generated from the GNFA G k+1 by the removal of one state, q r q start, q accept, then L(G k ) = L(G k+1 ). To do that, we showed that for every string w Σ, w L(G k+1 ) = w L(G k ) w L(G k ) = w L(G k+1 ) R 4 q i q j R 1 R 3 q r R 2 q i R 1 R* 2 R 3 UR 4 q j We will not repeat the (rather tedious) proof during today s lecture. Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

11 Summing it up We proved L(G k+1 ) = L(G k ). Likewise, L(G k ) = L(G k 1 ).. Likewise, L(G 3 ) = L(G 2 ). Hence, L(G 2 ) and (the regular expression) and the language of the original DFA/NFA accept the same language. We proved (in lecture 2): A language is described by a regular expression iff it is regular. Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

12 Summing It Up (again) Theorem 3 A language is described by a regular expression, iff it is regular. We have made a lot of progress understanding what finite automata can do. But what can they not do? Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

13 And Now for Something Somewhat Different: Let Us Be Negative, For a Change Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

14 Negative Results Is there a DFA that accepting B = {0 n 1 n : n 0} C = {w : # 1 (w) = # 0 (w)} D = {w : # 01 (w) = # 10 (w)} # s (w) the number of times s appears in w. All languages are over {0, 1}. Consider B: DFA must remember how many 0 s it has seen Impossible with finite state. The other languages seem to be exactly the same. Question: Is this a proof? Answer: Well, not quite. In fact, D is regular... Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

15 Part I The Pumping Lemma for Regular Languages Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

16 Regular Languages can be Pumped For any regular language L there exists l > 0 (the pumping length) s.t.: Any s L longer than l, can be pumped into a longer string in L. This is a powerful technique for showing that a language is not regular. Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

17 The Pumping Lemma Lemma 4 For any regular language L, exists l > 0 (the pumping length) s.t.: every s L with s l can be written as s = xyz such that: 1 xy i z L for every i 0, 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. Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

18 Proving the Pumping Lemma Let M = (Q, Σ, δ, q 1, F) be a DFA accepting L, and let l = Q. Let s L be with s l, and consider the sequence of states M traverse as it reads s = s 1... s n : 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). Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

19 Proving the Pumping Lemma, cont. Let q 9 be the repeating state. Write s = xyz By inspection, M accepts xy k z for every k 0. y > 0, because the state q 9 is repeated. To ensure that xy l, pick first state repetition, which must occur no later than l + 1 states in sequence. and formally, by induction on k 0 Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

20 Application # 1 Corollary 5 B = {0 n 1 n : n > 0} is not regular. Proof: By contradiction. Suppose B is regular and let l be its pumping length. Consider the string s = 0 l 1 l B. Let x, y, z be strings guaranteed by the pumping lemma (i.e. s = xyz) 1 xy k z B for every k 0, 2 y > 0, and 3 xy l. If y is all 0, then xy 2 z has too many 0 s. If y is all 1, then xy 2 z has too many 1 s. If y is mixed, then xy 2 z is not of right form. In this proof, we did not use the third property. Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

21 Application # 2 Corollary 6 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 C. Let x, y, z be strings guaranteed by the pumping lemma (i.e. s = xyz) 1 xy i z B for every k 0, 2 y > 0, and 3 xy l. Since xy l, the string y is all 0 s. Thus, xy 2 z / C (more 0 s than 1 s). Could we have used s = (01) l? Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

22 An Alternative Proof Claim 7 C = {w : # 1 (w) = # 0 (w)} is not regular. Proof: By contradiction. Suppose C is regular. Let D = 0 1, then D is regular. Thus, D C should be regular as well (why?). But D C = B, and by corollary 5, B is not regular. Contradiction. Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

23 Application # 3 Corollary 8 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 E. By the pumping lemma, s = xyz, where xy k z E for every k 0, y > 0 and xy l. Since xy l, y consists of 0s only. But xy 0 z = xz / E (it does not have more 0s than 1s). Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

24 Application # 4 Corollary 9 The language Primes {0, 1} all strings whose length is a prime number is not regular. Proof: Suppose Primes is regular, accepted by DFA M, and let l be its pumping length. Let s = 1 p Primes, where p l is a prime (why does such p exist?). By the pumping lemma, s = xyz, where xy k z Primes for every k 0. Let y = m. Hence, xy p+1 z = 1 p+mp Primes Ahaa: p(m + 1) is not prime... Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

25 Another Example Consider the language L = {a i b n c n : n 0, i 1} {b n c m : n, m 0}. Any s L can be pumped: 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. (in all cases z is set arbitrarily). Is L regular? Well, no! So, how would you prove it? Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

26 Part II The Myhill-Nerode Characterization of Regular Languages Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

27 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). Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

28 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? In particular, is the number of equivalence classes of L finite or infinite? Well, it could be either finite or infinite. This depends on the language L. Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

29 Four Examples L 1 = {w : # 1 (w) mod 4 = 0} L1 has finitely many equivalence classes. The equivalent classes are: [1], [11], [111], [1111] L 2 = {0 n 1 n : n N} L2 has infinitely many equivalence classes. [0] [0 2 ] [0 3 ]... L 3 = {a i b n c n : n 0, i 1} {b n c m : n, m 0} L3 has infinitely many equivalence classes. [ab] [ab 2 ] [ab 3 ]... Let L 4 {1} contain all strings whose length is a prime number. Then L4 has infinitely many equivalence classes. [2] [3] [5] [7] [11]... Proof sketches for above statements on the board. Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

30 Myhill-Nerode Theorem Theorem 10 (Myhill-Nerode Theorem) Let L Σ be a language. L is regular L has finitely many equivalence classes. Four 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. 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. Let L 4 {1} contain all strings whose length is a prime number. Then L 4 is not regular. Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

31 Myhill-Nerode Theorem: Proof = Suppose L is regular. Let M = (Q, Σ, δ, q 0, F) be a DFA accepting it. For every x Σ, let α(q 0, x) Q be the state where the computation of M on input x ends. 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 for every z Σ, also xz M yz. Therefore, xz L if and only if yz L. This means that x M y = x L y. Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

32 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. Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

33 Myhill-Nerode Theorem: Proof (cont.) = Suppose L has finitely many equivalence classes. We ll construct a DFA M that accepts L. Let x 1,..., x n Σ be representatives for the finitely many equivalence classes of L. The states of M are the equivalence classes [x 1 ],..., [x n ]. The transition function δ is defined as follows: For all a Σ, δ([x i ], a) = [x i a] (the equivalence class of x i a). Hey, why is this a proper definition of δ? (Hint: right invariance). Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

34 Myhill-Nerode Theorem: Proof (cont.) = The initial state is [ε]. The accept states are F = {[x i ] x i L}. Easy: On input x Σ, M ends at state [x] (why?). Therefore M accepts x iff x L (why?). So L is accepted by DFA, hence L is regular. Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

35 Further Consequences of the Myhill-Nerode Theorem We can use the ideas in the proof of the Myhill-Nerode theorem to prove that a given DFA, which accepts a language L, has the minimal number of states among all DFAs that accept L. Examples: Two DFAs for the language {w : # 1 (w) mod 3 = 0} (on board). a s b a q 1 r 1 a b a b a b q 2 r 2 b. Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

36 Minimal DFAs Claim 11 Let L Σ be a regular language, and suppose that L has n equivalence classes. Let M be a DFA accepting L, and let m be the number of its states. Then n m. The claim was proved in the course of the proof of the Myhill-Nerode Theorem, when we saw that x M y implies x L y (in fancier words, the relation M is a refinement of the relation L ). Therefore, an M with n states is minimal in terms of the number of states (among all DFAs accepting L). Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

37 Minimal DFAs, cont. Claim 12 Let L Σ be a regular language, and suppose that L has n equivalence classes. There is a DFA, M that accepts L, and has exactly n states. Proof (sketch): We show how to construct such M. We label the states of M by the n equivalence classes of L, namely [x 1 ], [x 2 ],..., [x n ]. Note that it does not matter which representative x i is used the i-th class won t change. The start state is, well, [ε]. The accepting states are those [x i ] for which x i L. The transition function is δ([x i ], a) = [x i a] (use right invariance to see that δ is well defined). That s it. End of construction Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

38 Minimal DFAs, cont. Claim 13 Let L Σ be a regular language, and suppose that L has n equivalence classes. There is a DFA, M that accepts L, and has exactly n states. That s it. End of construction. Really? We better prove that the DFA constructed above indeed accepts the language L. Proof (sketch): We show the stronger claim that for every x Σ, the DFA on input x reaches state [x]. This will prove the claim, since by the definition of M, x L iff [x] is an accepting state. And how shall we prove the stronger claim? Indeed, by induction on the length of x.. Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

39 Minimal DFAs, cont. Claim 12 enables us to show that a given DFA, M, is minimal with respect to its language, L. To construct such M using it, we should know the number and nature of equivalence classes of L. The claim does not tell us how to take a given DFA and convert it to a minimal one. There is actually an algorithm that performs such minimization (its input is a DFA, and its output is a minimal DFA for the same language). We will not describe this algorithm. In addition, Claim 12 says nothing about minimal NFAs. Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

40 Part III Closure Properties of Regular Languages Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

41 Simple Closure Properties (also seen in recitation) Regular languages are closed under complement. 1 Let M = (Q, Σ, δ, q 0, F ) be a DFA that accepts L. 2 Then M = (Q, Σ, δ, q 0, Q \ F ) is a DFA that accepts L = Σ \ L. This is a proof by construction (done at the recitation on week 1). 3 Complement for NFA?! Regular languages are closed under intersection. 1 L 1 L 2 = L 1 L 2. This is a proof by reduction to closure under union and complement. 2 You saw a proof, using a direct construction of deterministic finite automata, in the recitation. Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

42 The Quotient Operation For languages L 1, L 2 Σ (not necessarily regular), define L 1 /L 2 = {x Σ : y L 2 such that xy L 1 } Examples: L 1 = {a 2n b 2n c 2n : n 0} and L 2 = {b n c 2n : n 0}. For xy to be an element of L 1 when y = b n c 2n is an element of L 2, x must be of the form a 2n b n. Then L 1 /L 2 = {a 2n b n : n 0}. Note that neither L 1 nor L 2 are regular. L 3 = a b c and L 4 = {b n c 2n : n 1}. Then L 3 /L 4 = a b. Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

43 Closure under Quotient Recall, L 1 /L 2 = {x Σ : y L 2 such that xy L 1 } Theorem 14 Regular languages are closed under quotient (to the right) by any language. Proof: Let L 1 be a regular language and let L 2 be an arbitrary language. Let M = (Q, Σ, δ, q 0, F) be a DFA for L 1. We describe a DFA for L 1 /L 2 by keeping the structure of M but modifying the set of accepting states. The new set of accepting states is F = {q Q : y L 2, such that M from state q on the string y reaches an accepting state}. Then the DFA M = (Q, Σ, δ, q 0, F ) accepts L 1 /L 2. F is well defined, but might be hard to determine explicitly. This is an existential, or non constructive, proof. Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

44 Part IV Algorithmic Questions for NFAs and DFAs Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

45 Algorithmic Questions for NFAs and DFAs 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: 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 (studied extensively in the algorithms course). Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

46 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, where many of these problems cannot be solved by any algorithm. Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

47 And Now for Something Somewhat Different: Context Free Languages Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

48 Part V Context Free Languages Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

49 Summary - Regular Languages So far we saw Finite automata, Regular languages, Regular expressions, Myhill-Nerode theorem and pumping lemma for regular languages. Next, we will introduce stronger machines and languages with more expressive power: pushdown automata, context-free languages, context-free grammars Context free grammars are essential in compilers construction and programming languages. Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

50 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. Each rule has the form: symbol string. The left-hand symbol is a variable (usually upper-case). A string consists of variables and terminals. One variable is the start variable. Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

51 Rules for Generating Strings Write down the start variable (lhs of top rule). Pick a variable written down in current string and a derivation that starts with that variable. Replace that variable with right-hand side of that derivation. Repeat until no variables remain. Return final string (concatenation of terminals). Process is inherently non deterministic. Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

52 Example Grammar G 1 : A 0A1 A B B # Derivation with G 1 : A 0A1 00A11 000A B #111 Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

53 A Parse Tree A A A A B # Question: What strings can be generated in this way from the grammar G 1? Answer: Exactly those of the form 0 n #1 n (n 0). Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

54 Context-Free Languages The language generated in this way is called the language of the grammar. For example, L(G 1 ) is {0 n #1 n n 0}. Any language generated by a context-free grammar is called a context-free language. Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

55 A Useful Abbreviation Rules with same variable on left hand side A 0A1 A B are written as: A 0A1 B Benny Chor (Tel Aviv University) Computational Models Class 3: Plan November 2, / 55

Computational Models - Lecture 3 1

Computational Models - Lecture 3 1 Computational Models - Lecture 3 1 Handout Mode Iftach Haitner and Yishay Mansour. Tel Aviv University. March 13/18, 2013 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice

More information

What we have done so far

What 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 information

Computational Models - Lecture 3

Computational 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 information

Computational Models - Lecture 3 1

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 information

Computational Models - Lecture 4

Computational 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 information

Computational Models Lecture 2 1

Computational 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 information

Computational Models Lecture 2 1

Computational 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 information

Computational Models - Lecture 4 1

Computational 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 information

Computational Models - Lecture 4 1

Computational 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 information

Computational Models - Lecture 5 1

Computational 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 information

Computational Models - Lecture 5 1

Computational 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 information

Computational Models - Lecture 1 1

Computational 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 information

Computational Models: Class 1

Computational 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 information

Computational Models: Class 5

Computational 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 information

3515ICT: Theory of Computation. Regular languages

3515ICT: 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 information

Computational Models Lecture 8 1

Computational 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 information

The View Over The Horizon

The 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 information

Computational Models Lecture 8 1

Computational 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 information

CISC 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 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 information

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

FORMAL 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 information

COMP-330 Theory of Computation. Fall Prof. Claude Crépeau. Lec. 5 : DFA minimization

COMP-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 information

CSE 105 THEORY OF COMPUTATION

CSE 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 information

Non-Deterministic Finite Automata

Non-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 information

Theory of Computation

Theory 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 information

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET

THEORY 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 information

Computational Models Lecture 8 1

Computational 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 information

CSE 105 THEORY OF COMPUTATION

CSE 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 information

Computational Models Lecture 5

Computational 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 information

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

FORMAL 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 information

More on Finite Automata and Regular Languages. (NTU EE) Regular Languages Fall / 41

More 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 information

We 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 Σ,

We 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 information

Lecture 4: More on Regexps, Non-Regular Languages

Lecture 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 information

CS 301. Lecture 18 Decidable languages. Stephen Checkoway. April 2, 2018

CS 301. Lecture 18 Decidable languages. Stephen Checkoway. April 2, 2018 CS 301 Lecture 18 Decidable languages Stephen Checkoway April 2, 2018 1 / 26 Decidable language Recall, a language A is decidable if there is some TM M that 1 recognizes A (i.e., L(M) = A), and 2 halts

More information

COMP-330 Theory of Computation. Fall Prof. Claude Crépeau. Lec. 9 : Myhill-Nerode Theorem and applications

COMP-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 information

Formal Languages, Automata and Models of Computation

Formal 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 information

HKN CS/ECE 374 Midterm 1 Review. Nathan Bleier and Mahir Morshed

HKN 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 information

COMP4141 Theory of Computation

COMP4141 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 information

Finite Automata and Regular languages

Finite 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 information

Critical CS Questions

Critical 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 information

CSE 105 THEORY OF COMPUTATION

CSE 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 information

Introduction 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. 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 information

CS 154, Lecture 3: DFA NFA, Regular Expressions

CS 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 information

CS 154 Introduction to Automata and Complexity Theory

CS 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 information

Closure 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 of Regular Languages Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism Closure Properties Recall a closure property is a statement

More information

Time Magazine (1984)

Time 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 information

Computational Models Lecture 9, Spring 2009

Computational Models Lecture 9, Spring 2009 Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. p. 1 Computational Models Lecture 9, Spring 2009 Reducibility among languages Mapping reductions More undecidable

More information

Automata Theory. Lecture on Discussion Course of CS120. Runzhe SJTU ACM CLASS

Automata 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 information

The Pumping Lemma and Closure Properties

The 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 information

DM17. Beregnelighed. Jacob Aae Mikkelsen

DM17. 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 information

Introduction 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. 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 information

CS 154. Finite Automata vs Regular Expressions, Non-Regular Languages

CS 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 information

1 More finite deterministic automata

1 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 information

10. The GNFA method is used to show that

10. 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 information

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

FORMAL 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 information

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Finite 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 information

Sri vidya college of engineering and technology

Sri 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 information

PS2 - Comments. University of Virginia - cs3102: Theory of Computation Spring 2010

PS2 - 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 information

CS 455/555: Finite automata

CS 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 information

Proving languages to be nonregular

Proving languages to be nonregular Proving languages to be nonregular We already know that there exist languages A Σ that are nonregular, for any choice of an alphabet Σ. This is because there are uncountably many languages in total and

More information

Chapter 6. Properties of Regular Languages

Chapter 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 information

Properties of Regular Languages. BBM Automata Theory and Formal Languages 1

Properties 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 information

Computational Theory

Computational 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 information

CS 154. Finite Automata, Nondeterminism, Regular Expressions

CS 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 information

Name: Student ID: Instructions:

Name: Student ID: Instructions: Instructions: Name: CSE 322 Autumn 2001: Midterm Exam (closed book, closed notes except for 1-page summary) Total: 100 points, 5 questions, 20 points each. Time: 50 minutes 1. Write your name and student

More information

Theory of Computation p.1/?? Theory of Computation p.2/?? Unknown: Implicitly a Boolean variable: true if a word is

Theory of Computation p.1/?? Theory of Computation p.2/?? Unknown: Implicitly a Boolean variable: true if a word is Abstraction of Problems Data: abstracted as a word in a given alphabet. Σ: alphabet, a finite, non-empty set of symbols. Σ : all the words of finite length built up using Σ: Conditions: abstracted as a

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

FORMAL 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 information

2. Syntactic Congruences and Monoids

2. Syntactic Congruences and Monoids IAS/PCMI Summer Session 2000 Clay Mathematics Undergraduate Program Advanced Course on Computational Complexity Lecture 3: Algebra and Languages David Mix Barrington and Alexis Maciel July 19, 2000 1.

More information

Before we show how languages can be proven not regular, first, how would we show a language is regular?

Before 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 information

TDDD65 Introduction to the Theory of Computation

TDDD65 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 information

Computer Sciences Department

Computer 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 information

Automata: a short introduction

Automata: 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 information

Theory of Computation (II) Yijia Chen Fudan University

Theory 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 information

Outline. CS21 Decidability and Tractability. Regular expressions and FA. Regular expressions and FA. Regular expressions and FA

Outline. CS21 Decidability and Tractability. Regular expressions and FA. Regular expressions and FA. Regular expressions and FA Outline CS21 Decidability and Tractability Lecture 4 January 14, 2019 FA and Regular Exressions Non-regular languages: Puming Lemma Pushdown Automata Context-Free Grammars and Languages January 14, 2019

More information

Unit 6. Non Regular Languages The Pumping Lemma. Reading: Sipser, chapter 1

Unit 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 information

Computational Models #1

Computational 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 information

Final exam study sheet for CS3719 Turing machines and decidability.

Final exam study sheet for CS3719 Turing machines and decidability. Final exam study sheet for CS3719 Turing machines and decidability. A Turing machine is a finite automaton with an infinite memory (tape). Formally, a Turing machine is a 6-tuple M = (Q, Σ, Γ, δ, q 0,

More information

Equivalence of DFAs and NFAs

Equivalence of DFAs and NFAs CS 172: Computability and Complexity Equivalence of DFAs and NFAs It s a tie! DFA NFA Sanjit A. Seshia EECS, UC Berkeley Acknowledgments: L.von Ahn, L. Blum, M. Blum What we ll do today Prove that DFAs

More information

Fooling Sets and. Lecture 5

Fooling 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 information

Lecture Notes On THEORY OF COMPUTATION MODULE -1 UNIT - 2

Lecture 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 information

Languages, regular languages, finite automata

Languages, 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 information

Büchi Automata and their closure properties. - Ajith S and Ankit Kumar

Bü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 information

Finite Automata and Regular Languages

Finite 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 information

Harvard CS 121 and CSCI E-207 Lecture 10: CFLs: PDAs, Closure Properties, and Non-CFLs

Harvard CS 121 and CSCI E-207 Lecture 10: CFLs: PDAs, Closure Properties, and Non-CFLs Harvard CS 121 and CSCI E-207 Lecture 10: CFLs: PDAs, Closure Properties, and Non-CFLs Harry Lewis October 8, 2013 Reading: Sipser, pp. 119-128. Pushdown Automata (review) Pushdown Automata = Finite automaton

More information

Properties of Context-Free Languages. Closure Properties Decision Properties

Properties 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 information

Context 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. 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 information

September 11, Second Part of Regular Expressions Equivalence with Finite Aut

September 11, Second Part of Regular Expressions Equivalence with Finite Aut Second Part of Regular Expressions Equivalence with Finite Automata September 11, 2013 Lemma 1.60 If a language is regular then it is specified by a regular expression Proof idea: For a given regular language

More information

V Honors Theory of Computation

V Honors Theory of Computation V22.0453-001 Honors Theory of Computation Problem Set 3 Solutions Problem 1 Solution: The class of languages recognized by these machines is the exactly the class of regular languages, thus this TM variant

More information

Theory of Languages and Automata

Theory of Languages and Automata Theory of Languages and Automata Chapter 1- Regular Languages & Finite State Automaton Sharif University of Technology Finite State Automaton We begin with the simplest model of Computation, called finite

More information

CPSC 421: Tutorial #1

CPSC 421: Tutorial #1 CPSC 421: Tutorial #1 October 14, 2016 Set Theory. 1. Let A be an arbitrary set, and let B = {x A : x / x}. That is, B contains all sets in A that do not contain themselves: For all y, ( ) y B if and only

More information

More Properties of Regular Languages

More 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 information

CSE 311: Foundations of Computing. Lecture 23: Finite State Machine Minimization & NFAs

CSE 311: Foundations of Computing. Lecture 23: Finite State Machine Minimization & NFAs CSE : Foundations of Computing Lecture : Finite State Machine Minimization & NFAs State Minimization Many different FSMs (DFAs) for the same problem Take a given FSM and try to reduce its state set by

More information

ECS 120: Theory of Computation UC Davis Phillip Rogaway February 16, Midterm Exam

ECS 120: Theory of Computation UC Davis Phillip Rogaway February 16, Midterm Exam ECS 120: Theory of Computation Handout MT UC Davis Phillip Rogaway February 16, 2012 Midterm Exam Instructions: The exam has six pages, including this cover page, printed out two-sided (no more wasted

More information

Lecture 2: Connecting the Three Models

Lecture 2: Connecting the Three Models IAS/PCMI Summer Session 2000 Clay Mathematics Undergraduate Program Advanced Course on Computational Complexity Lecture 2: Connecting the Three Models David Mix Barrington and Alexis Maciel July 18, 2000

More information

CSC236 Week 10. Larry Zhang

CSC236 Week 10. Larry Zhang CSC236 Week 10 Larry Zhang 1 Today s Topic Deterministic Finite Automata (DFA) 2 Recap of last week We learned a lot of terminologies alphabet string length of string union concatenation Kleene star language

More information

More on Regular Languages and Non-Regular Languages

More on Regular Languages and Non-Regular Languages More on Regular Languages and Non-Regular Languages CSCE A35 Decision Properties of Regular Languages Given a (representation, e.g., RE, FA, of a) regular language L, what can we tell about L? Since there

More information

Uses of finite automata

Uses of finite automata Chapter 2 :Finite Automata 2.1 Finite Automata Automata are computational devices to solve language recognition problems. Language recognition problem is to determine whether a word belongs to a language.

More information

COM364 Automata Theory Lecture Note 2 - Nondeterminism

COM364 Automata Theory Lecture Note 2 - Nondeterminism COM364 Automata Theory Lecture Note 2 - Nondeterminism Kurtuluş Küllü March 2018 The FA we saw until now were deterministic FA (DFA) in the sense that for each state and input symbol there was exactly

More information

Introduction to Turing Machines. Reading: Chapters 8 & 9

Introduction to Turing Machines. Reading: Chapters 8 & 9 Introduction to Turing Machines Reading: Chapters 8 & 9 1 Turing Machines (TM) Generalize the class of CFLs: Recursively Enumerable Languages Recursive Languages Context-Free Languages Regular Languages

More information

Closure Properties of Context-Free Languages. Foundations of Computer Science Theory

Closure Properties of Context-Free Languages. Foundations of Computer Science Theory Closure Properties of Context-Free Languages Foundations of Computer Science Theory Closure Properties of CFLs CFLs are closed under: Union Concatenation Kleene closure Reversal CFLs are not closed under

More information

CSci 311, Models of Computation Chapter 4 Properties of Regular Languages

CSci 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 information