Computational Models - Lecture 3 1

Size: px
Start display at page:

Download "Computational Models - Lecture 3 1"

Transcription

1 Computational Models - Lecture 3 1 Handout Mode Iftach Haitner. Tel Aviv University. November 14, Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice Herlihy, Brown University. Iftach Haitner (TAU) Computational Models, Lecture 3 November 14, / 43

2 Lecture highlight תן לי הכוח לשנות את מה שאני יכול לשנות, לקבל את מה שאינני יכול לשנות, ואת החוכמה להבדיל בין שניהם. Iftach Haitner (TAU) Computational Models, Lecture 3 November 14, / 43

3 Computational Models - Lecture 3 Non-regular languages: two approaches 1. Pumping Lemma 2. Myhill-Nerode Theorem (not in Sipser s book) Closure properties Algorithmic questions for NFAs Sipser, 1.4, 2.1, 2.2 Hopcroft and Ullman, 3.4 Iftach Haitner (TAU) Computational Models, Lecture 3 November 14, / 43

4 Proved last time Theorem 1 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 they cannot do? Iftach Haitner (TAU) Computational Models, Lecture 3 November 14, / 43

5 Negative results Is there a DFA that accepting the following languages (over {0, 1}). 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. Consider B: DFA must remember how many 0 s it has seen Impossible with finite state. The others languages seem to be exactly the same... Question: Is this a proof? Answer: No, D is regular... Iftach Haitner (TAU) Computational Models, Lecture 3 November 14, / 43

6 Part I Pumping Lemma Iftach Haitner (TAU) Computational Models, Lecture 3 November 14, / 43

7 Regular languages can be pumped For every regular language L, there exists l > 0, the pumping length, s.t.: Every 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. Iftach Haitner (TAU) Computational Models, Lecture 3 November 14, / 43

8 The Pumping Lemma Lemma 2 For every regular language L, exists l > 0 (i.e., the pumping length) s.t.: every s L with s l, can be written as s = xyz with 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. Iftach Haitner (TAU) Computational Models, Lecture 3 November 14, / 43

9 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 By the pigeonhole principle, at least one of the states in the above sequence repeats. s = xyz Iftach Haitner (TAU) Computational Models, Lecture 3 November 14, / 43

10 Proving the Pumping Lemma, cont. 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. Iftach Haitner (TAU) Computational Models, Lecture 3 November 14, / 43

11 Application # 1 Corollary 3 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 (one possible) strings guaranteed by the pumping lemma (i.e., s = xyz) 1. xy i z B for every i 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. We did not use the third property. Iftach Haitner (TAU) Computational Models, Lecture 3 November 14, / 43

12 Application # 2 Corollary 4 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 (possible) set of 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? Iftach Haitner (TAU) Computational Models, Lecture 3 November 14, / 43

13 Application # 3 Corollary 5 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 pumping lemma, s = xyz, where xy k z E for every k 0, y > 0 and xy l. But xy 0 z = xz / E (at least as much 1 s as 0 s) Iftach Haitner (TAU) Computational Models, Lecture 3 November 14, / 43

14 Application # 4 Corollary 6 The language Primes 1 all strings whose length is a prime number is not regular. Proof: Suppose Primes is regular, and let l be its 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 0. Let y = m. Hence, xy p+1 z = 1 p+mp Primes but p(m + 1) is not prime... Iftach Haitner (TAU) Computational Models, Lecture 3 November 14, / 43

15 Another Example Consider the language L = {a i b n c n : n 0, i 1} {b n c m : n, m 0}. Any non-empty s L can be pumped: If s = a i b n c n with i > 0, then set x = ε and y = a. If s = b n c m with n > 0, then set x = ε and y = b. If s = c m with m > 0, then set x = ε and y = c. (in all cases z is set arbitrarily). Is L regular? No How can we prove it? Iftach Haitner (TAU) Computational Models, Lecture 3 November 14, / 43

16 Part II Characterization of Regular Languages Iftach Haitner (TAU) Computational Models, Lecture 3 November 14, / 43

17 The equivalence relation L Definition 7 For L Σ, define the equivalence relation L over words in Σ, by x L y if for every z Σ, it holds that xz L yz L. Easy to see that L is indeed an equivalence relation (reflexive, symmetric, transitive) on Σ. Hence, L partitions Σ into equivalence classes. For x Σ, let [x] Σ denote its equivalence class with respect to L How many equivalence classes does L induce? finite or infinite? Could be either (depends on L). Fact 8 (right invariance) If x L y, then xw L yw for every w Σ Proof: (xw)z L x(wz) L y(wz) L (yw)z L Iftach Haitner (TAU) Computational Models, Lecture 3 November 14, / 43

18 Three examples L 1 = {w : # 1 (w) mod 5 = 0} L 1 has finitely many equivalence classes. The equivalent classes are: [ε], [1], [11], [111], [1111]. Proof: Classes cover {0, 1} : for any x {0, 1} : x L 1 # 1(w) mod 5. xz L # 1 (xz) mod 5 = 0 (# 1 (x) mod 5) + # 1 (z) mod 5 = 0 1 # 1(x) mod 5 z L. Classes are disjoint: 1 i L 1 j for i j {0, 1, 2, 3, 4} L 2 = {0 n 1 n : n N} L 2 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} L 3 has infinitely many equivalence classes. [ab] [ab 2 ] [ab 3 ]... Iftach Haitner (TAU) Computational Models, Lecture 3 November 14, / 43

19 Myhill-Nerode Theorem Theorem 9 (Myhill-Nerode Theorem) L Σ is regular iff L finitely many equivalence classes. Hence L 1 = {w {0, 1} : # 1 (w) mod 4 = 0} is regular. L 2 = {0 n 1 n : n N} is not regular. L 3 = {a i b n c n : n 0, i 1} {b n c m : n, m 0} is not regular. Iftach Haitner (TAU) Computational Models, Lecture 3 November 14, / 43

20 Proving Myhill-Nerode Theorem = Let L be a regular language and let M = (Q, Σ, δ, q 0, F) be a DFA accepting it. Define the binary relation M by x M y if δ(q 0, x) = δ(q 0, y). M is an equivalence relation. x M y = xz M yz for every z Σ. = xz L iff yz L. Hence, x M y = x L y. Each equivalence class of L corresponds to union of classes of. M Namely, M is a refinement of. L (see drawing on board) Specifically, # of equivalence classes of L is less or equal than # of equivalence classes of M. M has finitely many equivalence classes. (?) Therefore, L has finitely many equivalence classes. Iftach Haitner (TAU) Computational Models, Lecture 3 November 14, / 43

21 Proving Myhill-Nerode theorem = Assume L has finitely many equivalence classes and let x 1,..., x n Σ be their representatives. We ll construct a DFA M = (Q, Σ, δ, q 0, F ) that accepts L. For x Σ, let C(x) be the index i {1,..., n} with x [x i ]. Q = {1,..., n}. δ(i, σ) = C(x i σ). q 0 = C(ε). F = {i : x i L}. Claim. For any y Σ : δ(q0, y) = C(y). Hence, y L(M) δ(q 0, y) F C(y) F x C(y) L y L. This is the optimal DFA, number of states wise, for L. (?) Proof: (of claim) By induction on word length. Let y = wσ Σ, and assume w [x i ] and y [x j ]. δ(i, σ) := C(x i σ) = (by right invariance) C(wσ) = C(y) = j. = δ(q 0, wσ) := δ( δ(q 0, w), σ) = (by i.h) δ(i, σ) = j. Iftach Haitner (TAU) Computational Models, Lecture 3 November 14, / 43

22 Example Construct a DFA for {w {0, 1} : # 1 (w) 0 (mod 5)}, via the latter proof method. Equivalent class representatives: {ε, 1, 11, 111, 1111} Q = {0, 1, 2, 3, 4} q 0 = 0 F = {0} δ(i, 0) = C(1 i 0) = i and δ(i, 1) = C(1 i 1) = i + 1 (mod 5) Iftach Haitner (TAU) Computational Models, Lecture 3 November 14, / 43

23 Part III Closure Properties of Regular Languages Iftach Haitner (TAU) Computational Models, Lecture 3 November 14, / 43

24 Simple closure properties 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. 3. NFA?! Regular languages are closed under intersection. 1. L 1 L 2 = L 1 L Proof with automata? Iftach Haitner (TAU) Computational Models, Lecture 3 November 14, / 43

25 Division For languages L 1, L 2 Σ, define L 1 /L 2 = {x Σ : y L 2, xy L 1 } Examples: L 1 = L(01 1) and L 2 = L(00). Then L 1 /L 2 = L 3 = L(a b c ) and L 4 = L(b). Then L 3 /L 4 = L(a b ) Iftach Haitner (TAU) Computational Models, Lecture 3 November 14, / 43

26 Closure under division Recall, L 1 /L 2 = {x : y L 2, xy L 1 } Theorem 10 Regular languages are closed under division with any language :L 1 is regular = L 1 /L 2 is regular. Proof: Let L 1 be a regular language and let L 2 be an arbitrary language. L 1 is a refinement of L 1 /L 2. Proof: Assume x L 1 y. For z Σ : xz L 1 /L 2 xzw L 1 yzw L 1 yz L 1 /L 2. = x L 1 /L 2 y. Hence, L 1 /L 2 has finite number of equivalent states, and thus regular. Another proof. Let M = (Q, Σ, δ, q 0, F) be a DFA for L 1. Let F = {q Q : y L 2, δ(q, y) F } The DFA M = (Q, Σ, δ, q 0, F ) accepts L 1 /L 2. F is well defined, but might be hard to compute non constructive proof. Iftach Haitner (TAU) Computational Models, Lecture 3 November 14, / 43

27 Homomorphism Definition 11 (Homomorphism) An homomorphism from alphabet to words over alphabet Σ, is a function h : Σ. For w, let h(w = w 1,..., w n ) = h(w 1 ) h(w n ). For L, let h(l) = {h(w): w L}. By definition, h(ε) = ε and h( ) =. Examples: Let h : {0, 1} {a, b} be defined by h(1) = aba and h(0) = aa. h(010) = aa aba aa. For L 1 = (01), h(l 1 ) = (aaaba). Let h(0) = a, h(1) = a. For L 2 = {0 n 1 n : n 0}, h(l 2 ) = {a 2n : n 0}. Iftach Haitner (TAU) Computational Models, Lecture 3 November 14, / 43

28 Closure under homomorphism Theorem 12 Regular languages are closed under homomorphism. Proof idea: Using regular expressions. Let L be regular language and let h : Σ. 1. h(l( )) =, h(l(ε)) = {ε}, and h(l(a)) = {h(a)} for any a. 2. h(l 1 L 2 ) = h(l 1 ) h(l 2 ), h(l 1 L 2 ) = h(l 1 ) h(l 2 ) and h(l ) = h(l) Let R be a regular expression with L(R) = L. The proof is by induction on R. R = 1. By Item 1, h(l) = h(l(r)) is regular. R > 1. Assume R = (R 1 R 2 ) (other cases are similar). By item 2, h(l) = h(l(r1 ) L(R 2 )) = h(l(r 1 )) h(l(r 2 )). By i.h., h(l(r1 ) and h(l(r 2 ) are regular. Thus, h(l) is regular. Iftach Haitner (TAU) Computational Models, Lecture 3 November 14, / 43

29 Closure under homomorphism, proof using Automata Let M = (Q,, δ, q 0, F) bea DFA for L. Define NFA N = (Q, Σ, δ, q 0, F ) for h(l) as follows: if δ(q i, σ) = q j and h(σ) = w 1,..., w t, then δ (diσ k, w i) = d k+1 iσ for all k {1,..., t 1}, letting diσ 1 = q i and diσ t = q j. Q includes Q and all new states. Claim 13 L(N) = h(l). Proof idea: h(l) L(N): w L = r 1,..., r w +1 s.t. r 1 = q 0, r w +1 F and r i+1 = δ(r i, w i+1 ).... = h(w) L(N). L(N) h(l): w L(N) = r 1,..., r w +1 s.t.r 1 = q 0, r w +1 F and r i+1 δ (r i, w i+1 ).... = w L with h(w ) = w. Iftach Haitner (TAU) Computational Models, Lecture 3 November 14, / 43

30 Inverse homomorphism Definition 14 (Inverse homomorphism) For homomorphism h : Σ, define its inverse homomorphism h 1 : Σ P( ), by h 1 (w) = {x : h(x) = w}. For L Σ, let h 1 (L) = x L h 1 (x) = {x : h(x) L} Example: h(0) = a, h(1) = b and h(2) = a. Then h 1 ({a n ba n : n 0}) = {{0, 2} n 1{0, 2} n : n 0}. Claim 15 For any h : Σ : 1. h(h 1 (L)) L, for any L Σ 2. L h 1 (h(l)), for any L Proof: 1. Immediate 2. Holds since w h 1 (h(w)) for any w Iftach Haitner (TAU) Computational Models, Lecture 3 November 14, / 43

31 Closure under inverse homomorphism Theorem 16 Regular languages are closed under inverse homomorphism. Proof idea: Let L be a regular language, let M = (Q, Σ, δ, q 0, F) be a DFA for L and let h : Σ. w h(l) h(w) L(M). Hence, to decide w simply emulate M(h(w))... More formally, Let M = (Q,, δ, q 0, F) with δ (q, a) = δ(q, h(a)). Easy to verify that δ (q, w) = δ M (q, h(w)) = w L(M ) h(w) L(M) w h 1 (L) Iftach Haitner (TAU) Computational Models, Lecture 3 November 14, / 43

32 Part IV Algorithmic Questions for NFAs Iftach Haitner (TAU) Computational Models, Lecture 3 November 14, / 43

33 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: 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 (TAU) Computational Models, Lecture 3 November 14, / 43

34 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 (TAU) Computational Models, Lecture 3 November 14, / 43

35 Part V Summary Regular Languages Iftach Haitner (TAU) Computational Models, Lecture 3 November 14, / 43

36 Summary - Regular Languages So far we saw Finite automata, Regular languages, Regular expressions, Myhill-Nerode theorem and pumping lemma for regular languages. Did not do (see appendix): Given a DFA M, the minimal (in # of states) DFA M with L(M ) = L(M). Next class we introduce stronger machines and languages with more expressive power: pushdown automata, context-free languages, context-free grammars Iftach Haitner (TAU) Computational Models, Lecture 3 November 14, / 43

37 Part VII Appendix Not Taught in Class Iftach Haitner (TAU) Computational Models, Lecture 3 November 14, / 43

38 Section 1 Finding the Minimal Automata Iftach Haitner (TAU) Computational Models, Lecture 3 November 14, / 43

39 Finding the minimal automata Given a DFA M = (Q, Σ, δ, q 0, F ), find the minimal (with respect to # of states) DFA M with L(M ) = L(M). Definition 17 (Equivalent states ) For DFA (Q, Σ, δ, q 1, F), states q 1, q 2 Q are equivalent, if for all x 1, x 2 Σ with δ(q L 0, x i ) = q i, it holds that x 1 x 2. Idea: keep merging equivalent states in Q, until all states are non-equivalent. Actual idea: 1. Start with the two sets F and Q \ F. 2. Keep splitting the sets until all states in the same set are equivalent. To check whether states q and q are equivalent, check if δ(q, σ) and δ(q, σ) are in the same set, for all σ Σ.(?) 3. Merge all states in the same set. Is this a minimal automate? Yes, if M has no unreachable states. But we can assume that wlg. (?) Iftach Haitner (TAU) Computational Models, Lecture 3 November 14, / 43

40 Finding the minimal automata Algorithm 18 Input: DFA M = (Q, Σ, δ, q 0, F ) 1. Let T = {F, Q \ F }. 2. While S T, q 1, q 2 S and σ Σ s.t, δ(q 1, σ) S and δ(q 2, σ) / S for some S T : 2.1 Let S sp = {q S : δ(q, σ) S }. 2.2 Set T = T S sp (S \ S sp ) \ S. 3. Output DFA M = (Q, δ, q 0, F ), where Claim 19 Q = T q 0 = S 0 T, where q 0 S 0. F = {S T : S F} δ (S, σ) = S T, s.t. δ(q, σ) S for (every) q S. The above algorithm outputs the minimal automata for L(M). Iftach Haitner (TAU) Computational Models, Lecture 3 November 14, / 43

41 Example a s b a q 1 r 1 a b a b a b q 2 r 2 b On board... Iftach Haitner (TAU) Computational Models, Lecture 3 November 14, / 43

42 Section 2 Using Homomorphism Iftach Haitner (TAU) Computational Models, Lecture 3 November 14, / 43

43 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. Let h 1 (a) = a, h 1 (b) = b, h 1 (c) = a. (h 1 : {a, b, c} {a, b, c} ) h 2 (a) = 0, h 2 (b) = ɛ, h 2 (c) = 1. (h 1 : {a, b, c} {0, 1} ) We prove h 2 (h 1 1 (L 2) a b c ) = L 1. Thus, L 2 is not regular (?) h 1 1 (L 2) = L((a c) n ) b L((a c) n ) 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 (TAU) Computational Models, Lecture 3 November 14, / 43

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

Computational Models: Class 3

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

CMPSCI 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 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

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

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

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

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

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

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

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

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

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

Lecture 7 Properties of regular languages

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

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

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

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

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

Warshall s algorithm

Warshall 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 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

Recitation 2 - Non Deterministic Finite Automata (NFA) and Regular OctoberExpressions

Recitation 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 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

Notes on State Minimization

Notes 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 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

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

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

Outline. Summary. DFA -> Regex. Finish off Regex -> e-nfa -> NFA -> DFA -> Regex Minimization/equivalence (Myhill-Nerode theorem)

Outline. 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 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

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

Incorrect reasoning about RL. Equivalence of NFA, DFA. Epsilon Closure. Proving equivalence. One direction is easy:

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

Properties of Regular Languages (2015/10/15)

Properties of Regular Languages (2015/10/15) Chapter 4 Properties of Regular Languages (25//5) Pasbag, Turkey Outline 4. Proving Languages Not to e Regular 4.2 Closure Properties of Regular Languages 4.3 Decision Properties of Regular Languages 4.4

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

Minimization of DFAs

Minimization of DFAs CS 72: Computability and Complexity Minimization of DFAs Sanjit A. Seshia EECS, UC Berkeley Acknowledgments: L.von Ahn, L. Blum, M. Blum, A. Sinclair What is Minimization? Minimized DFA for language L

More information

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

cse303 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 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

Finite State Automata

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

T (s, xa) = T (T (s, x), a). The language recognized by M, denoted L(M), is the set of strings accepted by M. That is,

T (s, xa) = T (T (s, x), a). The language recognized by M, denoted L(M), is the set of strings accepted by M. That is, Recall A deterministic finite automaton is a five-tuple where S is a finite set of states, M = (S, Σ, T, s 0, F ) Σ is an alphabet the input alphabet, T : S Σ S is the transition function, s 0 S is the

More information

Ogden s Lemma for CFLs

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

CSE 105 Homework 1 Due: Monday October 9, Instructions. should be on each page of the submission.

CSE 105 Homework 1 Due: Monday October 9, Instructions. should be on each page of the submission. CSE 5 Homework Due: Monday October 9, 7 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 in this

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

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

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

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

Section Summary. Relations and Functions Properties of Relations. Combining Relations

Section Summary. Relations and Functions Properties of Relations. Combining Relations Chapter 9 Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations Closures of Relations (not currently included

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

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

Theory of Computation (I) Yijia Chen Fudan University

Theory of Computation (I) Yijia Chen Fudan University Theory of Computation (I) Yijia Chen Fudan University Instructor Yijia Chen Homepage: http://basics.sjtu.edu.cn/~chen Email: yijiachen@fudan.edu.cn Textbook Introduction to the Theory of Computation Michael

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

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

2. Elements of the Theory of Computation, Lewis and Papadimitrou,

2. Elements of the Theory of Computation, Lewis and Papadimitrou, Introduction Finite Automata DFA, regular languages Nondeterminism, NFA, subset construction Regular Epressions Synta, Semantics Relationship to regular languages Properties of regular languages Pumping

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

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

CMSC 330: Organization of Programming Languages

CMSC 330: Organization of Programming Languages CMSC 330: Organization of Programming Languages Theory of Regular Expressions DFAs and NFAs Reminders Project 1 due Sep. 24 Homework 1 posted Exam 1 on Sep. 25 Exam topics list posted Practice homework

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

GEETANJALI INSTITUTE OF TECHNICAL STUDIES, UDAIPUR I

GEETANJALI 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 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

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

Homomorphisms and Efficient State Minimization

Homomorphisms and Efficient State Minimization Homomorphisms and Efficient State Minimization Mridul Aanjaneya Stanford University July 10, 2012 Mridul Aanjaneya Automata Theory 1/ 23 Homomorphisms A homomorphism on an alphabet is a function that gives

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 3.3, 4.1 State and use the Church-Turing thesis. Give examples of decidable problems.

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

Closure under the Regular Operations

Closure 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 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

Pushdown automata. Twan van Laarhoven. Institute for Computing and Information Sciences Intelligent Systems Radboud University Nijmegen

Pushdown automata. Twan van Laarhoven. Institute for Computing and Information Sciences Intelligent Systems Radboud University Nijmegen Pushdown automata Twan van Laarhoven Institute for Computing and Information Sciences Intelligent Systems Version: fall 2014 T. van Laarhoven Version: fall 2014 Formal Languages, Grammars and Automata

More information