The Pumping Lemma (cont.) 2IT70 Finite Automata and Process Theory

Size: px
Start display at page:

Download "The Pumping Lemma (cont.) 2IT70 Finite Automata and Process Theory"

Transcription

1 The Pumping Lemma (cont.) 2IT70 Finite Automata and Process Theory Technische Universiteit Eindhoven May 4, 2016

2 The Pumping Lemma theorem if L Σ is a regular language then m > 0 : w L, w m : x,y,z : w = xyz xy m y > 0 : i 0 : xy i z L 2IT70 (2016) The Pumping Lemma (cont.) 2/14

3 The Pumping Lemma (negative version) theorem if L Σ and m > 0 : w L, w m : x,y,z : w = xyz xy m y > 0 : i 0 : xy i z / L then L is not a regular language 2IT70 (2016) The Pumping Lemma (cont.) 3/14

4 One example more theorem if L Σ and m > 0 : w L, w m : x,y,z : w = xyz xy m y > 0 : i 0 : xy i z / L then L is not a regular language the language L = {a n2 n 0} is not regular 2IT70 (2016) The Pumping Lemma (cont.) 4/14

5 One example more theorem if L Σ and m > 0 : w L, w m : x,y,z : w = xyz xy m y > 0 : i 0 : xy i z / L then L is not a regular language the language L = {a n2 n 0} is not regular for any m > 0, consider a m2 2IT70 (2016) The Pumping Lemma (cont.) 4/14

6 Push-Down Automata 2IT70 Finite Automata and Process Theory Technische Universiteit Eindhoven May 4, 2016

7 Push-Down Automaton architecture Input Automaton yes/no 2 IT70 (2016) Push-Down Automata 6/ 14

8 Push-Down Automaton architecture Input Automaton yes/no Stack 2 IT70 (2016) Push-Down Automata 6/ 14

9 Push-Down Automaton architecture Input Automaton yes/no Tape Tape 2 IT70 (2016) Push-Down Automata 6/ 14

10 Push-Down Automaton architecture Input Automaton yes/no Tape Tape NFA: no external memory PDA: top-access first-in/last-out stack rtm: random-access two-way infinite tape 2 IT70 (2016) Push-Down Automata 6/ 14

11 An example PDA a[1/11] b[1/ε] a[ /1] b[1/ε] τ[ /ε] IT70 (2016) Push-Down Automata 7/ 14

12 An example PDA a[1/11] b[1/ε] a[ /1] b[1/ε] τ[ /ε] state input stack q0 aaabbb ε q1 aabbb 1 q1 abbb 11 q1 bbb 111 q2 bb 11 q2 b 1 q2 ε ε q3 ε ε ACCEPT 2 IT70 (2016) Push-Down Automata 7/ 14

13 An example PDA (cont.) a[1/11] b[1/ε] a[ /1] b[1/ε] τ[ /ε] IT70 (2016) Push-Down Automata 8/ 14

14 An example PDA (cont.) a[1/11] b[1/ε] a[ /1] b[1/ε] τ[ /ε] state input stack q0 aabbb ε q1 abbb 1 q1 bbb 11 q2 bb 1 q2 b ε q3 b ε REJECT 2 IT70 (2016) Push-Down Automata 8/ 14

15 An example PDA (cont.) a[1/11] b[1/ε] a[ /1] b[1/ε] τ[ /ε] state input stack q0 aabbb ε q1 abbb 1 q1 bbb 11 q2 bb 1 q2 b ε q3 b ε REJECT state input stack q0 aaab ε q1 aab 1 q1 ab 11 q1 b 111 q2 ε 11 REJECT 2 IT70 (2016) Push-Down Automata 8/ 14

16 Another example PDA a[ /A] a[a/aa] a[b/ab] b[b/ε] 0 τ[ /ε] τ[ /ε] 1 τ[a/a] 2 τ[b/b] b[ /B] b[a/ba] b[b/bb] a[a/ε] 2 IT70 (2016) Push-Down Automata 9/ 14

17 Another example PDA (rephrased) a[ /A] a[d/ad] b[b/ε] τ[ /ε] τ[ /ε] τ[d/d] b[ /B] b[d/bd] a[a/ε] D {A,B} 2 IT70 (2016) Push-Down Automata 10/ 14

18 A non-regular language a[1/11] b[1/ε] a[ /1] b[1/ε] τ[ /ε] L(P) = {a n b n n 1} state q input w stack x q 0 ε ε q 1 a n 1 n 1 n q 2 a n b m 1 n m 1 m n q 3 a n b n ε 1 n if (q,w,x) in invariant table then (q 0,w,ε) P (q,ε,x) 2 IT70 (2016) Push-Down Automata 11/ 14

19 Invariant table (cont.) a[ /a] a[d/ad] b[b/ε] τ[ /ε] τ[ /ε] τ[d/d] b[ /b] b[d/bd] a[a/ε] d = a,b L(P) = {ww R w {a,b} } state q input w stack x q 0 w w R q 1 wv u vu = w R q 2 ww R ε if (q,w,x) in invariant table then (q 0,w,ε) P (q,ε,x) 2 IT70 (2016) Push-Down Automata 12/ 14

20 PDA more powerful than NFA language is context-free if accepted by PDA 2 IT70 (2016) Push-Down Automata 13/ 14

21 PDA more powerful than NFA language is context-free if accepted by PDA {a n b n n 0} not regular, but accepted by PDA {ww R w {a,b} } not regular, but accepted by PDA 2 IT70 (2016) Push-Down Automata 13/ 14

22 PDA more powerful than NFA language is context-free if accepted by PDA {a n b n n 0} not regular, but accepted by PDA {ww R w {a,b} } not regular, but accepted by PDA regular languages subclass of context-free languages 2 IT70 (2016) Push-Down Automata 13/ 14

23 The Reactive Turing Machine 2IT70 Finite Automata and Process Theory Technische Universiteit Eindhoven May 4, 2016

24 Reactive Turing machine architecture Input Automaton yes/no Tape Tape 2IT70 (2016) The Reactive Turing Machine 15/14

25 A simple reactive Turing machine a[#/1,r] b[1/#,l] τ[#/#,l] 0 1 2IT70 (2016) The Reactive Turing Machine 16/14

26 A simple reactive Turing machine a[#/1,r] b[1/#,l] τ[#/#,l] 0 1 (q 0,aab, # ) M (q 0,ab,1 # ) M (q 0,b,11 # ) M (q 1,b,1 1 ) M (q 1,ε, 1 ) 2IT70 (2016) The Reactive Turing Machine 16/14

27 A simple reactive Turing machine a[#/1,r] b[1/#,l] τ[#/#,l] 0 1 (q 0,aab, # ) M (q 0,ab,1 # ) M (q 0,b,11 # ) M (q 1,b,1 1 ) M (q 1,ε, 1 ) (q 0,abb, # ) M (q 0,bb,1 # ) M (q 1,bb, 1 ) M (q 1,b, # ) 2IT70 (2016) The Reactive Turing Machine 16/14

28 A simple reactive Turing machine a[#/1,r] b[1/#,l] τ[#/#,l] 0 1 (q 0,aab, # ) M (q 0,ab,1 # ) M (q 0,b,11 # ) M (q 1,b,1 1 ) M (q 1,ε, 1 ) (q 0,abb, # ) M (q 0,bb,1 # ) M (q 1,bb, 1 ) M (q 1,b, # ) (q 0,aa, # ) M (q 0,a,1 # ) M (q 0,ε,11 # ) M (q 1,ε,1 1 ) 2IT70 (2016) The Reactive Turing Machine 16/14

29 Definition reactive Turing machine reactive Turing machine M = (Q, Σ,, #,, q 0, F ) Q finite set of states Σ finite alphabet, τ / Σ finite tape alphabet, blank # / Q Σ τ # # {L,R} Q transition relation where Σ τ = Σ {τ} and # = {#} q 0 Q is the initial state F Q is the set of final states 2IT70 (2016) The Reactive Turing Machine 17/14

30 Definition reactive Turing machine reactive Turing machine M = (Q, Σ,, #,, q 0, F ) Q finite set of states Σ finite alphabet, τ / Σ finite tape alphabet, blank # / Q Σ τ # # {L,R} Q transition relation where Σ τ = Σ {τ} and # = {#} q 0 Q is the initial state F Q is the set of final states transitions q a[e/e,µ] q and q τ[e/e,µ] q 2IT70 (2016) The Reactive Turing Machine 17/14

31 Configurations reactive Turing machine M = (Q, Σ,, #,, q 0, F ) configuration (q,w,z) of M control is in state q string w not read from input yet z current tape content 2IT70 (2016) The Reactive Turing Machine 18/14

32 Configurations reactive Turing machine M = (Q, Σ,, #,, q 0, F ) configuration (q,w,z) of M control is in state q string w not read from input yet z current tape content tape content z Z = {x e y x # : x = ε first(x) #, e #, y # : y = ε last(y) #} 2IT70 (2016) The Reactive Turing Machine 18/14

33 Clicker question L51 (i) tape a b bb yields tape content a#b # bb (ii) tape ab bb yields tape content ab # bb (iii) tape ab b yields tape content ab # b (iv) tape abbba yields tape content ab b ba 2IT70 (2016) The Reactive Turing Machine 19/14

34 Clicker question L51 (i) tape a b bb yields tape content a#b # bb (ii) tape ab bb yields tape content ab # bb (iii) tape ab b yields tape content ab # b (iv) tape abbba yields tape content ab b ba Which of the statements (i) to (iv) above does not hold? A. Statement (i) B. Statement (ii) C. Statement (iii) D. Statement (iv) 2IT70 (2016) The Reactive Turing Machine 19/14

35 Execution steps (q,w,x e y) M (q,w,z ) if a Σ e,e # µ {L,R} : w = aw q a[e/e,µ] M q z[e/e,µ] = z 2IT70 (2016) The Reactive Turing Machine 20/14

36 Execution steps (q,w,x e y) M (q,w,z ) if where a Σ e,e # µ {L,R} : w = aw q x e dy [e/e,r] = xe d y xd e y [e/e,l] = x d e y a[e/e,µ] M q z[e/e,µ] = z 2IT70 (2016) The Reactive Turing Machine 20/14

37 Execution steps (q,w,x e y) M (q,w,z ) if where a Σ e,e # µ {L,R} : w = aw q x e dy [e/e,r] = xe d y xd e y [e/e,l] = x d e y x e ε[e/e,r] = xe # ε ε e y [e/e,l] = ε # e y a[e/e,µ] M q z[e/e,µ] = z 2IT70 (2016) The Reactive Turing Machine 20/14

38 Execution steps (cont.) if q if q if q if q a[e/e,l] M q then (q,aw,xd e y) M (q,w,x d e y) a[e/e,l] M q then (q,aw,ε e y) M (q,w,ε # e y) τ[e/e,l] M q then (q,w,xd e y) M (q,w,x d e y) τ[e/e,l] M q then (q,w,ε e y) M (q,w,ε # e y) 2IT70 (2016) The Reactive Turing Machine 21/14

39 Clicker question L52 Suppose q τ[e/e,r] M q (i) (q,aw,x e dy) M (q,w,x e y) (ii) (q,aw,x e dy) M (q,aw,x e y) (iii) (q,aw,x d ey) M (q,w,xd e y) (iv) (q,aw,x e ε) M (q,aw,xe # ε) 2IT70 (2016) The Reactive Turing Machine 22/14

40 Clicker question L52 Suppose q τ[e/e,r] M q (i) (q,aw,x e dy) M (q,w,x e y) (ii) (q,aw,x e dy) M (q,aw,x e y) (iii) (q,aw,x d ey) M (q,w,xd e y) (iv) (q,aw,x e ε) M (q,aw,xe # ε) Only one of the statements above is true. Which one is it? A. Statement (i) B. Statement (ii) C. Statement (iii) D. Statement (iv) E. Can t tell 2IT70 (2016) The Reactive Turing Machine 22/14

41 Another example Turing machine a[#/1,r] b[1/#,l] τ[#/#,l] τ[#/#,r] IT70 (2016) The Reactive Turing Machine 23/14

42 Another example Turing machine a[#/1,r] b[1/#,l] τ[#/#,l] τ[#/#,r] accepting computation for aaabbb (q 0,aaabbb, # ) M (q 0,aabbb,1 # ) M (q 0,abbb,11 # ) M (q 0,bbb,111 # ) M (q 1,bbb,11 1 ) M (q 1,bb,1 1 ) M (q 1,b, 1 ) M (q 1,ε, # ) M (q 2,ε, # ) 2IT70 (2016) The Reactive Turing Machine 23/14

43 Another example Turing machine (cont.) a[#/1,r] b[1/#,l] τ[#/#,l] τ[#/#,r] non-accepting computation for aaabbb (q 0,aaabbb, # ) M (q 0,aabbb,1 # ) M (q 0,abbb,11 # ) M (q 1,abbb,1 1 ) M 2IT70 (2016) The Reactive Turing Machine 24/14

44 Language accepted by a reactive Turing machine reactive Turing machine M = (Q, Σ,, #,, q 0, F ) L(M) = {w Σ q F z Z: (q 0,w, # ) M (q,ε,z)} M reflexive and transitive closure of M 2IT70 (2016) The Reactive Turing Machine 25/14

45 Language accepted by a reactive Turing machine reactive Turing machine M = (Q, Σ,, #,, q 0, F ) L(M) = {w Σ q F z Z: (q 0,w, # ) M (q,ε,z)} a[#/1,r] b[1/#,l] τ[#/#,l] 0 1 M reflexive and transitive closure of M 2IT70 (2016) The Reactive Turing Machine 25/14

46 Language accepted by a reactive Turing machine reactive Turing machine M = (Q, Σ,, #,, q 0, F ) L(M) = {w Σ q F z Z: (q 0,w, # ) M (q,ε,z)} a[#/1,r] b[1/#,l] τ[#/#,l] 0 1 L(M) = {a n b m n m 0} M reflexive and transitive closure of M 2IT70 (2016) The Reactive Turing Machine 25/14

47 Language accepted by a reactive Turing machine reactive Turing machine M = (Q, Σ,, #,, q 0, F ) L(M) = {w Σ q F z Z: (q 0,w, # ) M (q,ε,z)} a[#/1,r] b[1/#,l] τ[#/#,l] 0 1 L(M) = {a n b m n m 0} reactive Turing machines accept recursively enumerable languages M reflexive and transitive closure of M 2IT70 (2016) The Reactive Turing Machine 25/14

48 Language accepted by a reactive Turing machine (cont.) reactive Turing machine M = (Q, Σ,, #,, q 0, F ) L(M) = {w Σ q F z Z: (q 0,w, # ) M (q,ε,z)} a[#/1,r] b[1/#,l] τ[#/#,l] τ[#/#,r] L(M) = {a n b n n 0} M reflexive and transitive closure of M 2IT70 (2016) The Reactive Turing Machine 26/14

49 Accepting a non-context-free language a[#/1, R] b[1/1, L] c[1/#,r] τ[#/#,l] τ[#/#,r] τ[#/#,l] L(M) = {a n b n c n n 0} 2IT70 (2016) The Reactive Turing Machine 27/14

50 Accepting a non-context-free language (cont.) a[#/1, R] b[1/1, L] c[1/#,r] τ[#/#,l] τ[#/#,r] τ[#/#,l] IT70 (2016) The Reactive Turing Machine 28/14

51 Accepting a non-context-free language (cont.) a[#/1, R] b[1/1, L] c[1/#,r] τ[#/#,l] τ[#/#,r] τ[#/#,l] q0 aaabbbccc #ˇ#### q0 aabbbccc #1 ˇ### q0 abbbccc #1 1 ˇ## q0 bbbccc #1 1 1 ˇ# 2IT70 (2016) The Reactive Turing Machine 28/14

52 Accepting a non-context-free language (cont.) a[#/1, R] b[1/1, L] c[1/#,r] τ[#/#,l] τ[#/#,r] τ[#/#,l] q0 aaabbbccc #ˇ#### q0 aabbbccc #1 ˇ### q0 abbbccc #1 1 ˇ## q0 bbbccc #1 1 1 ˇ# q1 bbbccc #1 1 ˇ1# q1 bbccc #1 ˇ1 1# q1 bccc #ˇ1 1 1# q1 ccc ˇ#1 1 1# 2IT70 (2016) The Reactive Turing Machine 28/14

53 Accepting a non-context-free language (cont.) a[#/1, R] b[1/1, L] c[1/#,r] τ[#/#,l] τ[#/#,r] τ[#/#,l] q0 aaabbbccc #ˇ#### q0 aabbbccc #1 ˇ### q0 abbbccc #1 1 ˇ## q0 bbbccc #1 1 1 ˇ# q1 bbbccc #1 1 ˇ1# q1 bbccc #1 ˇ1 1# q1 bccc #ˇ1 1 1# q1 ccc ˇ#1 1 1# q2 ccc #ˇ1 1 1# q2 cc ##ˇ1 1# q2 c ###ˇ1# q2 ε ####ˇ# q3 ε ###ˇ## ACCEPT 2IT70 (2016) The Reactive Turing Machine 28/14

54 Accepting a non-context-free language (cont.) a[#/1, R] b[1/1, L] c[1/#,r] τ[#/#,l] τ[#/#,r] τ[#/#,l] q0 aaabbbccc #ˇ#### q0 aabbbccc #1 ˇ### q0 abbbccc #1 1 ˇ## q0 bbbccc #1 1 1 ˇ# q1 bbbccc #1 1 ˇ1# q1 bbccc #1 ˇ1 1# q1 bccc #ˇ1 1 1# q1 ccc ˇ#1 1 1# q2 ccc #ˇ1 1 1# q2 cc ##ˇ1 1# q2 c ###ˇ1# q2 ε ####ˇ# q3 ε ###ˇ## ACCEPT q0 aaabbbccc #ˇ#### q0 aabbbccc #1 ˇ### q0 abbbccc #1 1 ˇ## q1 abbbccc #1 ˇ1## REJECT 2IT70 (2016) The Reactive Turing Machine 28/14

55 Clicker question L53 d[#/d,r] d[d/#,l] with d {a,b} d[#/#,l] τ[#/#,r] IT70 (2016) The Reactive Turing Machine 29/14

56 Clicker question L53 d[#/d,r] d[d/#,l] with d {a,b} d[#/#,l] τ[#/#,r] Which language is accepted by the Turing machine above? A. L(M) = {w {a,b} # a (w) # b (w)} B. L(M) = {w {a,b} w = w R } C. L(M) = {w {a,b} w is odd} D. L(M) = {w {a,b} w is odd w = w R } E. Can t tell 2IT70 (2016) The Reactive Turing Machine 29/14

57 A Turing machine accepting odd palindromes with d {a,b} d[#/d,r] d[d/#,l] 0 d[#/#,l] 1 τ[#/#,r] 2 2IT70 (2016) The Reactive Turing Machine 30/14

58 A Turing machine accepting odd palindromes with d {a,b} d[#/d,r] d[d/#,l] 0 d[#/#,l] 1 τ[#/#,r] 2 q0 baabaab #ˇ#### q0 aabaab #b ˇ### q0 abaab #b a ˇ## q0 baab #b a a ˇ# q1 aab #b a ǎ# q1 ab #b ǎ## q1 b #ˇb### q1 ε ˇ##### q2 ε #ˇ#### ACCEPT 2IT70 (2016) The Reactive Turing Machine 30/14

59 A Turing machine accepting odd palindromes with d {a,b} d[#/d,r] d[d/#,l] 0 d[#/#,l] 1 τ[#/#,r] 2 q0 baabaab #ˇ#### q0 aabaab #b ˇ### q0 abaab #b a ˇ## q0 baab #b a a ˇ# q1 aab #b a ǎ# q1 ab #b ǎ## q1 b #ˇb### q1 ε ˇ##### q2 ε #ˇ#### ACCEPT q0 baababb #ˇ#### q0 aababb #b ˇ### q0 ababb #b a ˇ## q0 babb #b a a ˇ# q1 abb #b a ǎ# q1 bb #b ǎ## REJECT 2IT70 (2016) The Reactive Turing Machine 30/14

60 A Turing machine accepting all palindromes with d {a,b} d[#/d,r] d[d/#,l] 0 d[#/#,l] 1 τ[#/#,r] 2 2IT70 (2016) The Reactive Turing Machine 31/14

61 A Turing machine accepting all palindromes with d {a,b} d[#/d,r] d[d/#,l] 0 d[#/#,l] 1 τ[#/#,r] 2 τ[#/#,l] 2IT70 (2016) The Reactive Turing Machine 31/14

62 A Turing machine accepting all palindromes with d {a,b} d[#/d,r] d[d/#,l] 0 d[#/#,l] 1 τ[#/#,r] 2 τ[#/#,l] q0 baaaab #ˇ#### q0 aaaab #b ˇ### q0 aaab #b a ˇ## q0 aab #b a a ˇ# q1 aab #b a ǎ# q1 ab #b ǎ## q1 b #ˇb### q1 ε ˇ##### q2 ε #ˇ#### ACCEPT 2IT70 (2016) The Reactive Turing Machine 31/14

63 A Turing machine accepting all palindromes with d {a,b} d[#/d,r] d[d/#,l] 0 d[#/#,l] 1 τ[#/#,r] 2 τ[#/#,l] q0 baaaab #ˇ#### q0 aaaab #b ˇ### q0 aaab #b a ˇ## q0 aab #b a a ˇ# q1 aab #b a ǎ# q1 ab #b ǎ## q1 b #ˇb### q1 ε ˇ##### q2 ε #ˇ#### ACCEPT q0 bbbaaa #ˇ#### q0 bbaaa #b ˇ### q0 baaa #b b ˇ## q0 aaa #b b b ˇ# q1 aaa #b b ˇb# REJECT 2IT70 (2016) The Reactive Turing Machine 31/14

64 Simulating a DFA a b q 0 a q 1 b q 2 a b q 3 a,b 2IT70 (2016) The Reactive Turing Machine 32/14

65 Simulating a DFA a b q 0 a q 1 b q 2 a b q 3 a,b q0 a[#/#,r] q1 q0 b[#/#,r] q3 q1 a[#/#,r] q1 q1 b[#/#,r] q2 q2 a[#/#,r] q1 q2 b[#/#,r] q2 q3 a[#/#,r] q3 q3 b[#/#,r] q3 2IT70 (2016) The Reactive Turing Machine 32/14

66 Simulating a DFA a b q 0 a q 1 b q 2 a b q 3 q0 a[#/#,r] q1 q0 b[#/#,r] q3 q1 a[#/#,r] q1 q1 b[#/#,r] q2 q2 a[#/#,r] q1 q2 b[#/#,r] q2 q3 a[#/#,r] q3 q3 b[#/#,r] q3 a,b q0 abaaab ˇ####### q1 baaab #ˇ###### q2 aaab ##ˇ##### q1 aab ###ˇ#### q1 ab ####ˇ### q1 b #####ˇ## q2 ε ######ˇ# ACCEPT 2IT70 (2016) The Reactive Turing Machine 32/14

67 Regular languages are recursively enumerable theorem if L = L(D) for a DFA D then L = L(M) for a reactive TM M proof suppose D = (Q, Σ, δ, q 0, F ) put M = (Q, Σ,, #,, q 0, F ) transitions q a[#/#,r] δ(q,a) for q Q, a Σ then (q,w) D (q,w ) iff (q,w, # ) M (q,w, # ) hence (q 0,w) D (q,ε) iff (q 0,w, # ) M (q,ε, # ) therefore L(D) = L(M) 2IT70 (2016) The Reactive Turing Machine 33/14

Author: Vivek Kulkarni ( )

Author: Vivek Kulkarni ( ) Author: Vivek Kulkarni ( vivek_kulkarni@yahoo.com ) Chapter-3: Regular Expressions Solutions for Review Questions @ Oxford University Press 2013. All rights reserved. 1 Q.1 Define the following and give

More information

TAFL 1 (ECS-403) Unit- IV. 4.1 Push Down Automata. 4.2 The Formal Definition of Pushdown Automata. EXAMPLES for PDA. 4.3 The languages of PDA

TAFL 1 (ECS-403) Unit- IV. 4.1 Push Down Automata. 4.2 The Formal Definition of Pushdown Automata. EXAMPLES for PDA. 4.3 The languages of PDA TAFL 1 (ECS-403) Unit- IV 4.1 Push Down Automata 4.2 The Formal Definition of Pushdown Automata EXAMPLES for PDA 4.3 The languages of PDA 4.3.1 Acceptance by final state 4.3.2 Acceptance by empty stack

More information

Push-Down Automata and Context-Free Languages

Push-Down Automata and Context-Free Languages Chapter 3 Push-Down Automata and Context-Free Languages In the previous chapter, we studied finite automata, modeling computers without memory. In the next chapter, we study a general model of computers

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

FABER Formal Languages, Automata. Lecture 2. Mälardalen University

FABER Formal Languages, Automata. Lecture 2. Mälardalen University CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 2 Mälardalen University 2010 1 Content Languages, g Alphabets and Strings Strings & String Operations Languages & Language Operations

More information

Theory of Computation (Classroom Practice Booklet Solutions)

Theory of Computation (Classroom Practice Booklet Solutions) Theory of Computation (Classroom Practice Booklet Solutions) 1. Finite Automata & Regular Sets 01. Ans: (a) & (c) Sol: (a) The reversal of a regular set is regular as the reversal of a regular expression

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

HW 3 Solutions. Tommy November 27, 2012

HW 3 Solutions. Tommy November 27, 2012 HW 3 Solutions Tommy November 27, 2012 5.1.1 (a) Online solution: S 0S1 ɛ. (b) Similar to online solution: S AY XC A aa ɛ b ɛ C cc ɛ X axb aa b Y by c b cc (c) S X A A A V AV a V V b V a b X V V X V (d)

More information

Pushdown Automata. Reading: Chapter 6

Pushdown Automata. Reading: Chapter 6 Pushdown Automata Reading: Chapter 6 1 Pushdown Automata (PDA) Informally: A PDA is an NFA-ε with a infinite stack. Transitions are modified to accommodate stack operations. Questions: What is a stack?

More information

The assignment is not difficult, but quite labour consuming. Do not wait until the very last day.

The assignment is not difficult, but quite labour consuming. Do not wait until the very last day. CAS 705 CAS 705. Sample solutions to the assignment 1 (many questions have more than one solutions). Total of this assignment is 129 pts. Each assignment is worth 25%. The assignment is not difficult,

More information

AC68 FINITE AUTOMATA & FORMULA LANGUAGES DEC 2013

AC68 FINITE AUTOMATA & FORMULA LANGUAGES DEC 2013 Q.2 a. Prove by mathematical induction n 4 4n 2 is divisible by 3 for n 0. Basic step: For n = 0, n 3 n = 0 which is divisible by 3. Induction hypothesis: Let p(n) = n 3 n is divisible by 3. Induction

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 14 SMALL REVIEW FOR FINAL SOME Y/N QUESTIONS Q1 Given Σ =, there is L over Σ Yes: = {e} and L = {e} Σ Q2 There are uncountably

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

Chapter 4. Regular Expressions. 4.1 Some Definitions

Chapter 4. Regular Expressions. 4.1 Some Definitions Chapter 4 Regular Expressions 4.1 Some Definitions Definition: If S and T are sets of strings of letters (whether they are finite or infinite sets), we define the product set of strings of letters to be

More information

Homework 4. Chapter 7. CS A Term 2009: Foundations of Computer Science. By Li Feng, Shweta Srivastava, and Carolina Ruiz

Homework 4. Chapter 7. CS A Term 2009: Foundations of Computer Science. By Li Feng, Shweta Srivastava, and Carolina Ruiz CS3133 - A Term 2009: Foundations of Computer Science Prof. Carolina Ruiz Homework 4 WPI By Li Feng, Shweta Srivastava, and Carolina Ruiz Chapter 7 Problem: Chap 7.1 part a This PDA accepts the language

More information

AC68 FINITE AUTOMATA & FORMULA LANGUAGES JUNE 2014

AC68 FINITE AUTOMATA & FORMULA LANGUAGES JUNE 2014 Q.2 a. Show by using Mathematical Induction that n i= 1 i 2 n = ( n + 1) ( 2 n + 1) 6 b. Define language. Let = {0; 1} denote an alphabet. Enumerate five elements of the following languages: (i) Even binary

More information

VTU QUESTION BANK. Unit 1. Introduction to Finite Automata. 1. Obtain DFAs to accept strings of a s and b s having exactly one a.

VTU QUESTION BANK. Unit 1. Introduction to Finite Automata. 1. Obtain DFAs to accept strings of a s and b s having exactly one a. VTU QUESTION BANK Unit 1 Introduction to Finite Automata 1. Obtain DFAs to accept strings of a s and b s having exactly one a.(5m )( Dec-2014) 2. Obtain a DFA to accept strings of a s and b s having even

More information

St.MARTIN S ENGINEERING COLLEGE Dhulapally, Secunderabad

St.MARTIN S ENGINEERING COLLEGE Dhulapally, Secunderabad St.MARTIN S ENGINEERING COLLEGE Dhulapally, Secunderabad-500 014 Subject: FORMAL LANGUAGES AND AUTOMATA THEORY Class : CSE II PART A (SHORT ANSWER QUESTIONS) UNIT- I 1 Explain transition diagram, transition

More information

An automaton with a finite number of states is called a Finite Automaton (FA) or Finite State Machine (FSM).

An automaton with a finite number of states is called a Finite Automaton (FA) or Finite State Machine (FSM). Automata The term "Automata" is derived from the Greek word "αὐτόματα" which means "self-acting". An automaton (Automata in plural) is an abstract self-propelled computing device which follows a predetermined

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

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

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

Turing s thesis: (1930) Any computation carried out by mechanical means can be performed by a Turing Machine

Turing s thesis: (1930) Any computation carried out by mechanical means can be performed by a Turing Machine Turing s thesis: (1930) Any computation carried out by mechanical means can be performed by a Turing Machine There is no known model of computation more powerful than Turing Machines Definition of Algorithm:

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

Clarifications from last time. This Lecture. Last Lecture. CMSC 330: Organization of Programming Languages. Finite Automata.

Clarifications from last time. This Lecture. Last Lecture. CMSC 330: Organization of Programming Languages. Finite Automata. CMSC 330: Organization of Programming Languages Last Lecture Languages Sets of strings Operations on languages Finite Automata Regular expressions Constants Operators Precedence CMSC 330 2 Clarifications

More information

Automata Theory CS F-13 Unrestricted Grammars

Automata Theory CS F-13 Unrestricted Grammars Automata Theory CS411-2015F-13 Unrestricted Grammars David Galles Department of Computer Science University of San Francisco 13-0: Language Hierarchy Regular Languaes Regular Expressions Finite Automata

More information

INSTITUTE OF AERONAUTICAL ENGINEERING

INSTITUTE OF AERONAUTICAL ENGINEERING INSTITUTE OF AERONAUTICAL ENGINEERING DUNDIGAL 500 043, HYDERABAD COMPUTER SCIENCE AND ENGINEERING TUTORIAL QUESTION BANK Course Name : FORMAL LANGUAGES AND AUTOMATA THEORY Course Code : A40509 Class :

More information

Recap from Last Time

Recap from Last Time Regular Expressions Recap from Last Time Regular Languages A language L is a regular language if there is a DFA D such that L( D) = L. Theorem: The following are equivalent: L is a regular language. There

More information

5 Context-Free Languages

5 Context-Free Languages CA320: COMPUTABILITY AND COMPLEXITY 1 5 Context-Free Languages 5.1 Context-Free Grammars Context-Free Grammars Context-free languages are specified with a context-free grammar (CFG). Formally, a CFG G

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

Theory of Computation Turing Machine and Pushdown Automata

Theory of Computation Turing Machine and Pushdown Automata Theory of Computation Turing Machine and Pushdown Automata 1. What is a Turing Machine? A Turing Machine is an accepting device which accepts the languages (recursively enumerable set) generated by type

More information

SCHEME FOR INTERNAL ASSESSMENT TEST 3

SCHEME FOR INTERNAL ASSESSMENT TEST 3 SCHEME FOR INTERNAL ASSESSMENT TEST 3 Max Marks: 40 Subject& Code: Automata Theory & Computability (15CS54) Sem: V ISE (A & B) Note: Answer any FIVE full questions, choosing one full question from each

More information

Automata Theory CS F-04 Non-Determinisitic Finite Automata

Automata Theory CS F-04 Non-Determinisitic Finite Automata Automata Theory CS411-2015F-04 Non-Determinisitic Finite Automata David Galles Department of Computer Science University of San Francisco 04-0: Non-Determinism A Deterministic Finite Automata s transition

More information

Nondeterministic Finite Automata

Nondeterministic Finite Automata Nondeterministic Finite Automata Not A DFA Does not have exactly one transition from every state on every symbol: Two transitions from q 0 on a No transition from q 1 (on either a or b) Though not a DFA,

More information

Recap DFA,NFA, DTM. Slides by Prof. Debasis Mitra, FIT.

Recap DFA,NFA, DTM. Slides by Prof. Debasis Mitra, FIT. Recap DFA,NFA, DTM Slides by Prof. Debasis Mitra, FIT. 1 Formal Language Finite set of alphabets Σ: e.g., {0, 1}, {a, b, c}, { {, } } Language L is a subset of strings on Σ, e.g., {00, 110, 01} a finite

More information

(b) If G=({S}, {a}, {S SS}, S) find the language generated by G. [8+8] 2. Convert the following grammar to Greibach Normal Form G = ({A1, A2, A3},

(b) If G=({S}, {a}, {S SS}, S) find the language generated by G. [8+8] 2. Convert the following grammar to Greibach Normal Form G = ({A1, A2, A3}, Code No: 07A50501 R07 Set No. 2 III B.Tech I Semester Examinations,MAY 2011 FORMAL LANGUAGES AND AUTOMATA THEORY Computer Science And Engineering Time: 3 hours Max Marks: 80 Answer any FIVE Questions All

More information

CSCE 551 Final Exam, Spring 2004 Answer Key

CSCE 551 Final Exam, Spring 2004 Answer Key CSCE 551 Final Exam, Spring 2004 Answer Key 1. (10 points) Using any method you like (including intuition), give the unique minimal DFA equivalent to the following NFA: 0 1 2 0 5 1 3 4 If your answer is

More information

CSE 105 THEORY OF COMPUTATION. Spring 2018 review class

CSE 105 THEORY OF COMPUTATION. Spring 2018 review class CSE 105 THEORY OF COMPUTATION Spring 2018 review class Today's learning goals Summarize key concepts, ideas, themes from CSE 105. Approach your final exam studying with confidence. Identify areas to focus

More information

download instant at Assume that (w R ) R = w for all strings w Σ of length n or less.

download instant at  Assume that (w R ) R = w for all strings w Σ of length n or less. Chapter 2 Languages 3. We prove, by induction on the length of the string, that w = (w R ) R for every string w Σ. Basis: The basis consists of the null string. In this case, (λ R ) R = (λ) R = λ as desired.

More information

CS Automata, Computability and Formal Languages

CS Automata, Computability and Formal Languages Automata, Computability and Formal Languages Luc Longpré faculty.utep.edu/longpre 1 - Pg 1 Slides : version 3.1 version 1 A. Tapp version 2 P. McKenzie, L. Longpré version 2.1 D. Gehl version 2.2 M. Csűrös,

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

Context-Free Grammars. 2IT70 Finite Automata and Process Theory

Context-Free Grammars. 2IT70 Finite Automata and Process Theory Context-Free Grammars 2IT70 Finite Automata and Process Theory Technische Universiteit Eindhoven May 18, 2016 Generating strings language L 1 = {a n b n n > 0} ab L 1 if w L 1 then awb L 1 production rules

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

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

1. Draw a parse tree for the following derivation: S C A C C A b b b b A b b b b B b b b b a A a a b b b b a b a a b b 2. Show on your parse tree u,

1. Draw a parse tree for the following derivation: S C A C C A b b b b A b b b b B b b b b a A a a b b b b a b a a b b 2. Show on your parse tree u, 1. Draw a parse tree for the following derivation: S C A C C A b b b b A b b b b B b b b b a A a a b b b b a b a a b b 2. Show on your parse tree u, v, x, y, z as per the pumping theorem. 3. Prove that

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

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

컴파일러입문 제 3 장 정규언어

컴파일러입문 제 3 장 정규언어 컴파일러입문 제 3 장 정규언어 목차 3.1 정규문법과정규언어 3.2 정규표현 3.3 유한오토마타 3.4 정규언어의속성 Regular Language Page 2 정규문법과정규언어 A study of the theory of regular languages is often justified by the fact that they model the lexical

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY 15-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY Chomsky Normal Form and TURING MACHINES TUESDAY Feb 4 CHOMSKY NORMAL FORM A context-free grammar is in Chomsky normal form if every rule is of the form:

More information

A Universal Turing Machine

A Universal Turing Machine A Universal Turing Machine A limitation of Turing Machines: Turing Machines are hardwired they execute only one program Real Computers are re-programmable Solution: Universal Turing Machine Attributes:

More information

1. (a) Explain the procedure to convert Context Free Grammar to Push Down Automata.

1. (a) Explain the procedure to convert Context Free Grammar to Push Down Automata. Code No: R09220504 R09 Set No. 2 II B.Tech II Semester Examinations,December-January, 2011-2012 FORMAL LANGUAGES AND AUTOMATA THEORY Computer Science And Engineering Time: 3 hours Max Marks: 75 Answer

More information

Let P(n) be a statement about a non-negative integer n. Then the principle of mathematical induction is that P(n) follows from

Let P(n) be a statement about a non-negative integer n. Then the principle of mathematical induction is that P(n) follows from 1. Define automata? ANNA UNIVERSITY, CHENNAI B.E/B.Tech DEGREE EXAMINATION APR/MAY 2008 Fifth Semester Computer Science and Engineering CS1303-Theory of Computation Part-A An automaton is an abstract computing

More information

Equivalent Variations of Turing Machines

Equivalent Variations of Turing Machines Equivalent Variations of Turing Machines Nondeterministic TM = deterministic TM npda = pushdown automata with n stacks 2PDA = npda = TM for all n 2 Turing machines with n tapes (n 2) and n tape heads has

More information

Computability and Complexity

Computability and Complexity Computability and Complexity Lecture 5 Reductions Undecidable problems from language theory Linear bounded automata given by Jiri Srba Lecture 5 Computability and Complexity 1/14 Reduction Informal Definition

More information

7.2 Turing Machines as Language Acceptors 7.3 Turing Machines that Compute Partial Functions

7.2 Turing Machines as Language Acceptors 7.3 Turing Machines that Compute Partial Functions CSC4510/6510 AUTOMATA 7.1 A General Model of Computation 7.2 Turing Machines as Language Acceptors 7.3 Turing Machines that Compute Partial Functions A General Model of Computation Both FA and PDA are

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

CS21 Decidability and Tractability

CS21 Decidability and Tractability CS21 Decidability and Tractability Lecture 8 January 24, 2018 Outline Turing Machines and variants multitape TMs nondeterministic TMs Church-Turing Thesis So far several models of computation finite automata

More information

Topics in Timed Automata

Topics in Timed Automata 1/32 Topics in Timed Automata B. Srivathsan RWTH-Aachen Software modeling and Verification group 2/32 Timed Automata A theory of timed automata R. Alur and D. Dill, TCS 94 2/32 Timed Automata Language

More information

CS 410/610, MTH 410/610 Theoretical Foundations of Computing

CS 410/610, MTH 410/610 Theoretical Foundations of Computing CS 410/610, MTH 410/610 Theoretical Foundations of Computing Fall Quarter 2010 Slides 2 Pascal Hitzler Kno.e.sis Center Wright State University, Dayton, OH http://www.knoesis.org/pascal/ CS410/610 MTH410/610

More information

How do regular expressions work? CMSC 330: Organization of Programming Languages

How do regular expressions work? CMSC 330: Organization of Programming Languages How do regular expressions work? CMSC 330: Organization of Programming Languages Regular Expressions and Finite Automata What we ve learned What regular expressions are What they can express, and cannot

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

Question Bank UNIT I

Question Bank UNIT I Siddhivinayak Technical Campus School of Engineering & Research Technology Department of computer science and Engineering Session 2016-2017 Subject Name- Theory of Computation Subject Code-4KS05 Sr No.

More information

Chapter 1. Formal Definition and View. Lecture Formal Pushdown Automata on the 28th April 2009

Chapter 1. Formal Definition and View. Lecture Formal Pushdown Automata on the 28th April 2009 Chapter 1 Formal and View Lecture on the 28th April 2009 Formal of PA Faculty of Information Technology Brno University of Technology 1.1 Aim of the Lecture 1 Define pushdown automaton in a formal way

More information

Griffith University 3130CIT Theory of Computation (Based on slides by Harald Søndergaard of The University of Melbourne) Turing Machines 9-0

Griffith University 3130CIT Theory of Computation (Based on slides by Harald Søndergaard of The University of Melbourne) Turing Machines 9-0 Griffith University 3130CIT Theory of Computation (Based on slides by Harald Søndergaard of The University of Melbourne) Turing Machines 9-0 Turing Machines Now for a machine model of much greater power.

More information

1.[3] Give an unambiguous grammar that generates the set of all regular expressions on Ó = {a,b}. Justify your construction.

1.[3] Give an unambiguous grammar that generates the set of all regular expressions on Ó = {a,b}. Justify your construction. CAS 705. Sample solutions to the assignment 2 (many questions have more than one solutions). Total of this assignment is 135 pts. Each assignment is worth 25%. 1.[3] Give an unambiguous grammar that generates

More information

CMSC 330: Organization of Programming Languages. Theory of Regular Expressions Finite Automata

CMSC 330: Organization of Programming Languages. Theory of Regular Expressions Finite Automata : Organization of Programming Languages Theory of Regular Expressions Finite Automata Previous Course Review {s s defined} means the set of string s such that s is chosen or defined as given s A means

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

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 Summarize key concepts, ideas, themes from CSE 105. Approach your final exam studying with

More information

Chomsky Normal Form and TURING MACHINES. TUESDAY Feb 4

Chomsky Normal Form and TURING MACHINES. TUESDAY Feb 4 Chomsky Normal Form and TURING MACHINES TUESDAY Feb 4 CHOMSKY NORMAL FORM A context-free grammar is in Chomsky normal form if every rule is of the form: A BC A a S ε B and C aren t start variables a is

More information

Page 1. Compiler Lecture Note, (Regular Language) 컴파일러입문 제 3 장 정규언어. Database Lab. KHU

Page 1. Compiler Lecture Note, (Regular Language) 컴파일러입문 제 3 장 정규언어. Database Lab. KHU Page 1 컴파일러입문 제 3 장 정규언어 Page 2 목차 I. 정규문법과정규언어 II. 정규표현 III. 유한오토마타 VI. 정규언어의속성 Page 3 정규문법과정규언어 A study of the theory of regular languages is often justified by the fact that they model the lexical analysis

More information

CS A Term 2009: Foundations of Computer Science. Homework 2. By Li Feng, Shweta Srivastava, and Carolina Ruiz.

CS A Term 2009: Foundations of Computer Science. Homework 2. By Li Feng, Shweta Srivastava, and Carolina Ruiz. CS3133 - A Term 2009: Foundations of Computer Science Prof. Carolina Ruiz Homework 2 WPI By Li Feng, Shweta Srivastava, and Carolina Ruiz Chapter 4 Problem 1: (10 Points) Exercise 4.3 Solution 1: S is

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 5 CHAPTER 2 FINITE AUTOMATA 1. Deterministic Finite Automata DFA 2. Nondeterministic Finite Automata NDFA 3. Finite Automata

More information

Lecture 17: Language Recognition

Lecture 17: Language Recognition Lecture 17: Language Recognition Finite State Automata Deterministic and Non-Deterministic Finite Automata Regular Expressions Push-Down Automata Turing Machines Modeling Computation When attempting to

More information

Reducability. Sipser, pages

Reducability. Sipser, pages Reducability Sipser, pages 187-214 Reduction Reduction encodes (transforms) one problem as a second problem. A solution to the second, can be transformed into a solution to the first. We expect both transformations

More information

Part I: Definitions and Properties

Part I: Definitions and Properties Turing Machines Part I: Definitions and Properties Finite State Automata Deterministic Automata (DFSA) M = {Q, Σ, δ, q 0, F} -- Σ = Symbols -- Q = States -- q 0 = Initial State -- F = Accepting States

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

1. Provide two valid strings in the languages described by each of the following regular expressions, with alphabet Σ = {0,1,2}.

1. Provide two valid strings in the languages described by each of the following regular expressions, with alphabet Σ = {0,1,2}. 1. Provide two valid strings in the languages described by each of the following regular expressions, with alphabet Σ = {0,1,2}. (a) 0(010) 1 (b) (21 10) 0012 Examples: 001, 001222, 21001, 10001, 210012,

More information

FLAC Context-Free Grammars

FLAC Context-Free Grammars FLAC Context-Free Grammars Klaus Sutner Carnegie Mellon Universality Fall 2017 1 Generating Languages Properties of CFLs Generation vs. Recognition 3 Turing machines can be used to check membership in

More information

Turing Machines. Fall The Chinese University of Hong Kong. CSCI 3130: Formal languages and automata theory

Turing Machines. Fall The Chinese University of Hong Kong. CSCI 3130: Formal languages and automata theory The Chinese University of Hong Kong Fall 2011 CSCI 3130: Formal languages and automata theory Turing Machines Andrej Bogdanov http://www.cse.cuhk.edu.hk/~andrejb/csc3130 Turing Machines control head a

More information

SFWR ENG 2FA3. Solution to the Assignment #4

SFWR ENG 2FA3. Solution to the Assignment #4 SFWR ENG 2FA3. Solution to the Assignment #4 Total = 131, 100%= 115 The solutions below are often very detailed on purpose. Such level of details is not required from students solutions. Some questions

More information

Theory of Computation - Module 4

Theory of Computation - Module 4 Theory of Computation - Module 4 Syllabus Turing Machines Formal definition Language acceptability by TM TM as acceptors, Transducers - designing of TM- Two way infinite TM- Multi tape TM - Universal Turing

More information

Languages. Non deterministic finite automata with ε transitions. First there was the DFA. Finite Automata. Non-Deterministic Finite Automata (NFA)

Languages. Non deterministic finite automata with ε transitions. First there was the DFA. Finite Automata. Non-Deterministic Finite Automata (NFA) Languages Non deterministic finite automata with ε transitions Recall What is a language? What is a class of languages? Finite Automata Consists of A set of states (Q) A start state (q o ) A set of accepting

More information

CISC4090: Theory of Computation

CISC4090: Theory of Computation CISC4090: Theory of Computation Chapter 2 Context-Free Languages Courtesy of Prof. Arthur G. Werschulz Fordham University Department of Computer and Information Sciences Spring, 2014 Overview In Chapter

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

Note: In any grammar here, the meaning and usage of P (productions) is equivalent to R (rules).

Note: In any grammar here, the meaning and usage of P (productions) is equivalent to R (rules). Note: In any grammar here, the meaning and usage of P (productions) is equivalent to R (rules). 1a) G = ({R, S, T}, {0,1}, P, S) where P is: S R0R R R0R1R R1R0R T T 0T ε (S generates the first 0. R generates

More information

2.1 Solution. E T F a. E E + T T + T F + T a + T a + F a + a

2.1 Solution. E T F a. E E + T T + T F + T a + T a + F a + a . Solution E T F a E E + T T + T F + T a + T a + F a + a E E + T E + T + T T + T + T F + T + T a + T + T a + F + T a + a + T a + a + F a + a + a E T F ( E) ( T ) ( F) (( E)) (( T )) (( F)) (( a)) . Solution

More information

Theory of Computation

Theory of Computation Theory of Computation Lecture #2 Sarmad Abbasi Virtual University Sarmad Abbasi (Virtual University) Theory of Computation 1 / 1 Lecture 2: Overview Recall some basic definitions from Automata Theory.

More information

CS 133 : Automata Theory and Computability

CS 133 : Automata Theory and Computability CS 133 : Automata Theory and Computability Lecture Slides 1 Regular Languages and Finite Automata Nestine Hope S. Hernandez Algorithms and Complexity Laboratory Department of Computer Science 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

CpSc 421 Final Exam December 15, 2006

CpSc 421 Final Exam December 15, 2006 CpSc 421 Final Exam December 15, 2006 Do problem zero and six of problems 1 through 9. If you write down solutions for more that six problems, clearly indicate those that you want graded. Note that problems

More information

Finite Automata Theory and Formal Languages TMV026/TMV027/DIT321 Responsible: Ana Bove

Finite Automata Theory and Formal Languages TMV026/TMV027/DIT321 Responsible: Ana Bove Finite Automata Theory and Formal Languages TMV026/TMV027/DIT321 Responsible: Ana Bove Tuesday 28 of May 2013 Total: 60 points TMV027/DIT321 registration VT13 TMV026/DIT321 registration before VT13 Exam

More information

CS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine)

CS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine) CS537 Theory of Computation Lecture : Computability Theory I (Turing Machine) Objectives Introduce the Turing Machine (TM)? Proposed by Alan Turing in 936 finite-state control + infinitely long tape A

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

ECS120 Fall Discussion Notes. October 25, The midterm is on Thursday, November 2nd during class. (That is next week!)

ECS120 Fall Discussion Notes. October 25, The midterm is on Thursday, November 2nd during class. (That is next week!) ECS120 Fall 2006 Discussion Notes October 25, 2006 Announcements The midterm is on Thursday, November 2nd during class. (That is next week!) Homework 4 Quick Hints Problem 1 Prove that the following languages

More information

Solution to CS375 Homework Assignment 11 (40 points) Due date: 4/26/2017

Solution to CS375 Homework Assignment 11 (40 points) Due date: 4/26/2017 Solution to CS375 Homework Assignment 11 (40 points) Due date: 4/26/2017 1. Find a Greibach normal form for the following given grammar. (10 points) S bab A BAa a B bb Ʌ Solution: (1) Since S does not

More information

Student#: CISC-462 Exam, December XY, 2017 Page 1 of 12

Student#: CISC-462 Exam, December XY, 2017 Page 1 of 12 Student#: CISC-462 Exam, December XY, 2017 Page 1 of 12 Queen s University, Faculty of Arts and Science, School of Computing CISC-462 Final Exam, December XY, 2017 (Instructor: Kai Salomaa) INSTRUCTIONS

More information

Intro to Theory of Computation

Intro to Theory of Computation Intro to Theory of Computation 1/26/2016 LECTURE 5 Last time: Closure properties. Equivalence of NFAs, DFAs and regular expressions Today: Conversion from NFAs to regular expressions Proving that a language

More information

CS6902 Theory of Computation and Algorithms

CS6902 Theory of Computation and Algorithms CS6902 Theory of Computation and Algorithms Any mechanically (automatically) discretely computation of problem solving contains at least three components: - problem description - computational tool - procedure/analysis

More information

Main Goal I basic concepts of automata and process theory regular languages

Main Goal I basic concepts of automata and process theory regular languages Cure verview Main Gal I baic cncept f autmata and prce thery regular language determinitic finite autmatn DFA nn-determinitic finite autmatn NFA regular exprein finite memry cntext-free language puh-dwn

More information