The Pumping Lemma. for all n 0, u 1 v n u 2 L (i.e. u 1 u 2 L, u 1 vu 2 L [but we knew that anyway], u 1 vvu 2 L, u 1 vvvu 2 L, etc.

Size: px
Start display at page:

Download "The Pumping Lemma. for all n 0, u 1 v n u 2 L (i.e. u 1 u 2 L, u 1 vu 2 L [but we knew that anyway], u 1 vvu 2 L, u 1 vvvu 2 L, etc."

Transcription

1 The Pumping Lemma For every regular language L, there is a number l 1 satisfying the pumping lemma property: All w L with w l can be expressed as a concatenation of three strings, w = u 1 vu 2, where u 1, v and u 2 satisfy: v 1 (i.e. v = ε) u 1 v l for all n 0, u 1 v n u 2 L (i.e. u 1 u 2 L, u 1 vu 2 L [but we knew that anyway], u 1 vvu 2 L, u 1 vvvu 2 L, etc.) Note similarity to construction in Kleene (b)

2 Suppose L = L(M) for a DFA M = (Q, Σ, δ, s, F). Taking l to be the number of elements in Q, if n l, then in a s = 1 a q 0 2 q1 q2 al q }{{} l l+1 states an q n F q 0,..., q l can t all be distinct states. So q i = q j for some 0 i < j l. So the above transition sequence looks like v where s = q 0 u 1 q i = q j u 2 q n F u 1 a 1... a i v a i+1... a j u 2 a j+1... a n

3 How to use the Pumping Lemma to prove that a language L is not regular For each l 1, find some w L of length l so that no matter how w is split into three, w = u 1 vu 2, with u 1 v l and v 1, there is some n 0 for which u 1 v n ( ) u 2 is not in L

4 Examples None of the following three languages are regular: (i) L 1 {a n b n n 0}

5 L 1 = {a n b n n 0} For each l 1, take w = a l b l L 1 If w = u 1 vu 2 with u 1 v l & v 1, then for some r and s: u 1 = a r

6 L 1 = {a n b n n 0} For each l 1, take w = a l b l L 1 If w = u 1 vu 2 with u 1 v l & v 1, then for some r and s: u 1 = a r v = a s, with r+s l and s 1

7 L 1 = {a n b n n 0} For each l 1, take w = a l b l L 1 If w = u 1 vu 2 with u 1 v l & v 1, then for some r and s: u 1 = a r v = a s, with r+s l and s 1 u 2 = a l r s b l

8 L 1 = {a n b n n 0} For each l 1, take w = a l b l L 1 If w = u 1 vu 2 with u 1 v l & v 1, then for some r and s: u 1 = a r v = a s, with r+s l and s 1 u 2 = a l r s b l so u 1 v 0 u 2 =

9 L 1 = {a n b n n 0} For each l 1, take w = a l b l L 1 If w = u 1 vu 2 with u 1 v l & v 1, then for some r and s: u 1 = a r v = a s, with r+s l and s 1 u 2 = a l r s b l so u 1 v 0 u 2 = a r ǫ a l r s b l =

10 L 1 = {a n b n n 0} For each l 1, take w = a l b l L 1 If w = u 1 vu 2 with u 1 v l & v 1, then for some r and s: u 1 = a r v = a s, with r+s l and s 1 u 2 = a l r s b l so u 1 v 0 u 2 = a r ǫ a l r s b l = a l s b l

11 L 1 = {a n b n n 0} For each l 1, take w = a l b l L 1 If w = u 1 vu 2 with u 1 v l & v 1, then for some r and s: u 1 = a r v = a s, with r+s l and s 1 u 2 = a l r s b l so u 1 v 0 u 2 = a r ǫ a l r s b l = a l s b l But a l s b l L 1

12 L 1 = {a n b n n 0} For each l 1, take w = a l b l L 1 If w = u 1 vu 2 with u 1 v l & v 1, then for some r and s: u 1 = a r v = a s, with r+s l and s 1 u 2 = a l r s b l so u 1 v 0 u 2 = a r ǫ a l r s b l = a l s b l But a l s b l L 1, so, by the Pumping Lemma, L 1 is not a regular language

13 Examples None of the following three languages are regular: (i) L 1 {a n b n n 0} [For each l 1, a l b l L 1 is of length l and has property ( ).]

14 Examples None of the following three languages are regular: (i) L 1 {a n b n n 0} [For each l 1, a l b l L 1 is of length l and has property ( ).] (ii) L 2 {w {a, b} w a palindrome}

15 Examples None of the following three languages are regular: (i) L 1 {a n b n n 0} [For each l 1, a l b l L 1 is of length l and has property ( ).] (ii) L 2 {w {a, b} w a palindrome} [For each l 1, a l ba l L 1 is of length l and has property ( ).]

16 Examples None of the following three languages are regular: (i) L 1 {a n b n n 0} [For each l 1, a l b l L 1 is of length l and has property ( ).] (ii) L 2 {w {a, b} w a palindrome} [For each l 1, a l ba l L 1 is of length l and has property ( ).] (iii) L 3 {a p p prime}

17 L 3 = {a p p prime} For each l 1 let w = a p L 3, p prime & p > 2l If w = u 1 vu 2 with the usual...

18 L 3 = {a p p prime} For each l 1 let w = a p L 3, p prime & p > 2l If w = u 1 vu 2 with the usual... then u 1 = a r v = a s u 2 = a p r s with s 1 & r+s l

19 L 3 = {a p p prime} For each l 1 let w = a p L 3, p prime & p > 2l If w = u 1 vu 2 with the usual... then u 1 = a r v = a s u 2 = a p r s with s 1 & r+s l so u 1 v p s u 2 =

20 L 3 = {a p p prime} For each l 1 let w = a p L 3, p prime & p > 2l If w = u 1 vu 2 with the usual... then u 1 = a r v = a s u 2 = a p r s with s 1 & r+s l so u 1 v p s u 2 = a r a s(p s) a p r s =

21 L 3 = {a p p prime} For each l 1 let w = a p L 3, p prime & p > 2l If w = u 1 vu 2 with the usual... then u 1 = a r v = a s u 2 = a p r s with s 1 & r+s l so u 1 v p s u 2 = a r a s(p s) a p r s = a (p s)(s+1)

22 L 3 = {a p p prime} For each l 1 let w = a p L 3, p prime & p > 2l If w = u 1 vu 2 with the usual... then u 1 = a r v = a s u 2 = a p r s with s 1 & r+s l so u 1 v p s u 2 = a r a s(p s) a p r s = a (p s)(s+1) but s 1 s+1 2 and (p s) > (2l l) 1 (p s) 2

23 L 3 = {a p p prime} For each l 1 let w = a p L 3, p prime & p > 2l If w = u 1 vu 2 with the usual... then u 1 = a r v = a s u 2 = a p r s with s 1 & r+s l so u 1 v p s u 2 = a r a s(p s) a p r s = a (p s)(s+1) but s 1 s+1 2 and (p s) > (2l l) 1 (p s) 2 so a (p s)(s+1) L 3

24 Examples None of the following three languages are regular: (i) L 1 {a n b n n 0} [For each l 1, a l b l L 1 is of length l and has property ( ).] (ii) L 2 {w {a, b} w a palindrome} [For each l 1, a l ba l L 1 is of length l and has property ( ).] (iii) L 3 {a p p prime} [For each l 1, we can find a prime p with p > 2l and then a p L 3 has length l and has property ( ).]

25 Pumping Lemma property is necessary for a language to be regular It is not sufficient

26 Example of a non-regular language with the pumping lemma property L {c m a n b n m 1 & n 0} {a m b n m, n 0} satisfies the pumping lemma property with l = 1. [For any w L of length 1, can take u 1 = ε, v = first letter of w, u 2 = rest of w.] But L is not regular see Exercise 5.1.

27 L is not regular: (sketch).

28 L is not regular: (sketch) If L is regular there is a DFA M with L = L(M). Let s build a new machine, M from it..

29 L is not regular: (sketch) If L is regular there is a DFA M with L = L(M). Let s build a new machine, M from it. Take a c transition from the start state of M. Make the state you reach the start state of M.

30 L is not regular: (sketch) If L is regular there is a DFA M with L = L(M). Let s build a new machine, M from it. Take a c transition from the start state of M. Make the state you reach the start state of M. Delete all transitions involving c (and remove c from the alphabet). But don t remove any states and keep the same accept states.

31 L is not regular: (sketch) If L is regular there is a DFA M with L = L(M). Let s build a new machine, M from it. Take a c transition from the start state of M. Make the state you reach the start state of M. Delete all transitions involving c (and remove c from the alphabet). But don t remove any states and keep the same accept states. What language does M recognise?

32 The way ahead, in THEORY What does is mean for a function to be computable? [ Ib Computation Theory ]

33 The way ahead, in THEORY What does is mean for a function to be computable? [ Ib Computation Theory ] Are some computational tasks intrinsiclaly unfeasible? [ Ib ComplexityTheory ]

34 The way ahead, in THEORY What does is mean for a function to be computable? [ Ib Computation Theory ] Are some computational tasks intrinsiclaly unfeasible? [ Ib ComplexityTheory ] How do we specify and reason about program behaviour? [ Ib Logic and Proof, 1b Semantics of PLs ]

35 The way ahead, in FORMAL LANGUAGES Are there other useful language classes?

36 The way ahead, in FORMAL LANGUAGES Are there other useful language classes? Are there other useful automata classes that have a correspondence to them?

37 The way ahead, in FORMAL LANGUAGES Are there other useful language classes? Are there other useful automata classes that have a correspondence to them? What if we ask the same questions about them that we asked about regular languages?

38 Chomsky Hierarchy of Languages Regular Languages Context Free Languages Context Sensitive Languages Recursively Enumerable Languages

39 Grammars Grammars are a shorthand way of expressing the inductive definition of subset inclusion for strings in a Language.

40 Grammars Grammars are a shorthand way of expressing the inductive definition of subset inclusion for strings in a Language. Often by convention we use capitals for non-terminal symbols (which are disjoint from symbols in the alphabet used by the language).

41 Grammars Grammars are a shorthand way of expressing the inductive definition of subset inclusion for strings in a Language. Often by convention we use capitals for non-terminal symbols (which are disjoint from symbols in the alphabet used by the language). We also have productions (or production rules) of the form e.g. A a which says that the non-terminal symbol A can be replaced by the (terminal) symbol a. More complex productions are allowed.

42 Grammars Grammars are a shorthand way of expressing the inductive definition of subset inclusion for strings in a Language. Often by convention we use capitals for non-terminal symbols (which are disjoint from symbols in the alphabet used by the language). We also have productions (or production rules) of the form e.g. A a which says that the non-terminal symbol A can be replaced by the (terminal) symbol a. More complex productions are allowed. There is also a distinguished non-terminal called the goal symbol (we ll use G)

43 Everybody s favourite grammar G E 0 E E+T 1 E T 2 T T P 3 T P 4 P (E) 5 P x 6

44 Everybody s favourite grammar G E 0 E E+T 1 E T 2 T T P 3 T P 4 P (E) 5 P x 6 so, e.g. G 0 E

45 Everybody s favourite grammar G E 0 E E+T 1 E T 2 T T P 3 T P 4 P (E) 5 P x 6 so, e.g. G 0 E 1 E+T

46 Everybody s favourite grammar G E 0 E E+T 1 E T 2 T T P 3 T P 4 P (E) 5 P x 6 so, e.g. G 0 E 1 E+T 4 E+P

47 Everybody s favourite grammar G E 0 E E+T 1 E T 2 T T P 3 T P 4 P (E) 5 P x 6 so, e.g. G 0 E 1 E+T 4 E+P 6 E+x

48 Everybody s favourite grammar G E 0 E E+T 1 E T 2 T T P 3 T P 4 P (E) 5 P x 6 so, e.g. G 0 E 1 E+T 4 E+P 6 E+x 2 T + x

49 Everybody s favourite grammar G E 0 E E+T 1 E T 2 T T P 3 T P 4 P (E) 5 P x 6 so, e.g. G 0 E 1 E+T 4 E+P 6 E+x 2 T + x 4 P+x

50 Everybody s favourite grammar G E 0 E E+T 1 E T 2 T T P 3 T P 4 P (E) 5 P x 6 so, e.g. G 0 E 1 E+T 4 E+P 6 E+x 2 T + x 4 P+x 5 (E)+x

51 Everybody s favourite grammar G E 0 E E+T 1 E T 2 T T P 3 T P 4 P (E) 5 P x 6 so, e.g. G 0 E 1 E+T 4 E+P 6 E+x 2 T + x 4 P+x 5 (E)+x... (x+x)+x

52 Everybody s favourite grammar G E 0 E E+T 1 E T 2 T T P 3 T P 4 P (E) 5 P x 6 so, e.g. G 0 E 1 E+T 4 E+P 6 E+x 2 T + x 4 P+x 5 (E)+x... (x+x)+x is a derivation of (x+x)+x

53 Language classes by forms of production α, β, γ any strings of terminals and non-terminals

54 Language classes by forms of production α, β, γ any strings of terminals and non-terminals Context Free Languages: [ Type 2 ] productions of form N β

55 Language classes by forms of production α, β, γ any strings of terminals and non-terminals Context Free Languages: [ Type 2 ] productions of form N β Context Sensitive Languages: [ Type 1 ] productions of the form αnβ αγβ

56 Language classes by forms of production α, β, γ any strings of terminals and non-terminals Context Free Languages: [ Type 2 ] productions of form N β Context Sensitive Languages: [ Type 1 ] productions of the form αnβ αγβ Recursively Enumerable Languages: [ Type 0 ] productions of the form α β

57 Language classes by forms of production

58 Language classes by forms of production How about Regular Languages? [ Type 3 ]

59 Language classes by forms of production How about Regular Languages? [ Type 3 ] A, B any non-terminals, a any terminal symbol, S any non-terminal that doesn t appear on right side

60 Language classes by forms of production How about Regular Languages? [ Type 3 ] A, B any non-terminals, a any terminal symbol, S any non-terminal that doesn t appear on right side production of the form A a or S ε or A ab (right regular)

61 Language classes by forms of production How about Regular Languages? [ Type 3 ] A, B any non-terminals, a any terminal symbol, S any non-terminal that doesn t appear on right side production of the form A a or S ε or A ab (right regular) or of the form A a or S ε or A Ba (left regular)

62 Language classes by forms of production How about Regular Languages? [ Type 3 ] A, B any non-terminals, a any terminal symbol, S any non-terminal that doesn t appear on right side production of the form A a or S ε or A ab (right regular) or of the form A a or S ε or A Ba (left regular) but not both left and right regular in the same grammar

63 Machines????? Regular Languages: Deterministic Finite Automata

64 Machines????? Regular Languages: Deterministic Finite Automata Context Free Languages: Nondeterministic Push-Down Automata

65 Machines????? Regular Languages: Deterministic Finite Automata Context Free Languages: Nondeterministic Push-Down Automata Context Sensitive Languages: Linear Bounded Nondeterministic Turing Machine

66 Machines????? Regular Languages: Deterministic Finite Automata Context Free Languages: Nondeterministic Push-Down Automata Context Sensitive Languages: Linear Bounded Nondeterministic Turing Machine Recursively Enumerable Languages: Turing Machine

67 Machines????? Regular Languages: Deterministic Finite Automata Context Free Languages: Nondeterministic Push-Down Automata Context Sensitive Languages: Linear Bounded Nondeterministic Turing Machine Recursively Enumerable Languages: Turing Machine Context Free Languages (and particularly the subset that can be recognised by deterministic push-down automata) are important since most programming languages are deterministic context free languages.

68 Deterministic Push-Down Automata (Sketch) Idea: need some way to remember arbitrary number of things that we have seen, eg a n b n

69 Deterministic Push-Down Automata (Sketch) Idea: need some way to remember arbitrary number of things that we have seen, eg a n b n Slightly modified DFA along with a stack which stores pairs of states and symbols.

70 Deterministic Push-Down Automata (Sketch) Idea: need some way to remember arbitrary number of things that we have seen, eg a n b n Slightly modified DFA along with a stack which stores pairs of states and symbols. DPDA looks at top of stack as well as input to decide what to do

71 Deterministic Push-Down Automata (Sketch) Idea: need some way to remember arbitrary number of things that we have seen, eg a n b n Slightly modified DFA along with a stack which stores pairs of states and symbols. DPDA looks at top of stack as well as input to decide what to do on state transitions, DPDA can pop and/or push things on the stack as well as (perhaps) reading symbol

72 What about our "questions"?

73 What about our "questions"? Given two DPDA, M 1 and M 2, can we determine if L(M 1 ) = L(M 2 )?

74 What about our "questions"? Given two DPDA, M 1 and M 2, can we determine if L(M 1 ) = L(M 2 )? Yes.

75 What about our "questions"? Given two DPDA, M 1 and M 2, can we determine if L(M 1 ) = L(M 2 )? Yes. Proved in 1997.

76 What about our "questions"? Given two DPDA, M 1 and M 2, can we determine if L(M 1 ) = L(M 2 )? Yes. Proved in Earned 2002 Gödel Prize.

77 What about our "questions"? Given two DPDA, M 1 and M 2, can we determine if L(M 1 ) = L(M 2 )? Yes. Proved in Earned 2002 Gödel Prize. But for NPDA, the question of equivalence is

78 What about our "questions"? Given two DPDA, M 1 and M 2, can we determine if L(M 1 ) = L(M 2 )? Yes. Proved in Earned 2002 Gödel Prize. But for NPDA, the question of equivalence is undecidable

Foundations of Informatics: a Bridging Course

Foundations of Informatics: a Bridging Course Foundations of Informatics: a Bridging Course Week 3: Formal Languages and Semantics Thomas Noll Lehrstuhl für Informatik 2 RWTH Aachen University noll@cs.rwth-aachen.de http://www.b-it-center.de/wob/en/view/class211_id948.html

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

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

Turing machines and linear bounded automata

Turing machines and linear bounded automata and linear bounded automata Informatics 2A: Lecture 30 John Longley School of Informatics University of Edinburgh jrl@inf.ed.ac.uk 25 November 2016 1 / 17 The Chomsky hierarchy: summary Level Language

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 machines and linear bounded automata

Turing machines and linear bounded automata and linear bounded automata Informatics 2A: Lecture 29 John Longley School of Informatics University of Edinburgh jrl@inf.ed.ac.uk 27 November 2015 1 / 15 The Chomsky hierarchy: summary Level Language

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

Turing machines and linear bounded automata

Turing machines and linear bounded automata and linear bounded automata Informatics 2A: Lecture 29 John Longley School of Informatics University of Edinburgh jrl@inf.ed.ac.uk 25 November, 2011 1 / 13 1 The Chomsky hierarchy: summary 2 3 4 2 / 13

More information

NPDA, CFG equivalence

NPDA, CFG equivalence NPDA, CFG equivalence Theorem A language L is recognized by a NPDA iff L is described by a CFG. Must prove two directions: ( ) L is recognized by a NPDA implies L is described by a CFG. ( ) L is described

More 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

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 15 Ana Bove May 17th 2018 Recap: Context-free Languages Chomsky hierarchy: Regular languages are also context-free; Pumping lemma

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

Push-down Automata = FA + Stack

Push-down Automata = FA + Stack Push-down Automata = FA + Stack PDA Definition A push-down automaton M is a tuple M = (Q,, Γ, δ, q0, F) where Q is a finite set of states is the input alphabet (of terminal symbols, terminals) Γ is the

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

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

Theory Bridge Exam Example Questions

Theory Bridge Exam Example Questions Theory Bridge Exam Example Questions Annotated version with some (sometimes rather sketchy) answers and notes. This is a collection of sample theory bridge exam questions. This is just to get some idea

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

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

Undecidability COMS Ashley Montanaro 4 April Department of Computer Science, University of Bristol Bristol, UK

Undecidability COMS Ashley Montanaro 4 April Department of Computer Science, University of Bristol Bristol, UK COMS11700 Undecidability Department of Computer Science, University of Bristol Bristol, UK 4 April 2014 COMS11700: Undecidability Slide 1/29 Decidability We are particularly interested in Turing machines

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

MA/CSSE 474 Theory of Computation

MA/CSSE 474 Theory of Computation MA/CSSE 474 Theory of Computation CFL Hierarchy CFL Decision Problems Your Questions? Previous class days' material Reading Assignments HW 12 or 13 problems Anything else I have included some slides online

More information

CS500 Homework #2 Solutions

CS500 Homework #2 Solutions CS500 Homework #2 Solutions 1. Consider the two languages Show that L 1 is context-free but L 2 is not. L 1 = {a i b j c k d l i = j k = l} L 2 = {a i b j c k d l i = k j = l} Answer. L 1 is the concatenation

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

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

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 14 Ana Bove May 14th 2018 Recap: Context-free Grammars Simplification of grammars: Elimination of ǫ-productions; Elimination of

More information

Homework. Context Free Languages. Announcements. Before We Start. Languages. Plan for today. Final Exam Dates have been announced.

Homework. Context Free Languages. Announcements. Before We Start. Languages. Plan for today. Final Exam Dates have been announced. Homework Context Free Languages PDAs and CFLs Homework #3 returned Homework #4 due today Homework #5 Pg 169 -- Exercise 4 Pg 183 -- Exercise 4c,e,i (use JFLAP) Pg 184 -- Exercise 10 Pg 184 -- Exercise

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

Introduction to Turing Machines. Reading: Chapters 8 & 9

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

More information

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

Outline. CS21 Decidability and Tractability. Machine view of FA. Machine view of FA. Machine view of FA. Machine view of FA.

Outline. CS21 Decidability and Tractability. Machine view of FA. Machine view of FA. Machine view of FA. Machine view of FA. Outline CS21 Decidability and Tractability Lecture 5 January 16, 219 and Languages equivalence of NPDAs and CFGs non context-free languages January 16, 219 CS21 Lecture 5 1 January 16, 219 CS21 Lecture

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

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

CS Lecture 29 P, NP, and NP-Completeness. k ) for all k. Fall The class P. The class NP

CS Lecture 29 P, NP, and NP-Completeness. k ) for all k. Fall The class P. The class NP CS 301 - Lecture 29 P, NP, and NP-Completeness Fall 2008 Review Languages and Grammars Alphabets, strings, languages Regular Languages Deterministic Finite and Nondeterministic Automata Equivalence of

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

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

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

NODIA AND COMPANY. GATE SOLVED PAPER Computer Science Engineering Theory of Computation. Copyright By NODIA & COMPANY

NODIA AND COMPANY. GATE SOLVED PAPER Computer Science Engineering Theory of Computation. Copyright By NODIA & COMPANY No part of this publication may be reproduced or distributed in any form or any means, electronic, mechanical, photocopying, or otherwise without the prior permission of the author. GATE SOLVED PAPER Computer

More information

Pushdown Automata. Notes on Automata and Theory of Computation. Chia-Ping Chen

Pushdown Automata. Notes on Automata and Theory of Computation. Chia-Ping Chen Pushdown Automata Notes on Automata and Theory of Computation Chia-Ping Chen Department of Computer Science and Engineering National Sun Yat-Sen University Kaohsiung, Taiwan ROC Pushdown Automata p. 1

More information

CPSC 421: Tutorial #1

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

More information

Automata Theory - Quiz II (Solutions)

Automata Theory - Quiz II (Solutions) Automata Theory - Quiz II (Solutions) K. Subramani LCSEE, West Virginia University, Morgantown, WV {ksmani@csee.wvu.edu} 1 Problems 1. Induction: Let L denote the language of balanced strings over Σ =

More information

CS481F01 Solutions 6 PDAS

CS481F01 Solutions 6 PDAS CS481F01 Solutions 6 PDAS A. Demers 2 November 2001 1. Give a NPDAs that recognize the following languages: (a) The set of all strings in {0, 1} that contain twice as many 1s as 0s. (answer a) We build

More information

Pushdown Automata. Chapter 12

Pushdown Automata. Chapter 12 Pushdown Automata Chapter 12 Recognizing Context-Free Languages We need a device similar to an FSM except that it needs more power. The insight: Precisely what it needs is a stack, which gives it an unlimited

More information

Pushdown Automata (2015/11/23)

Pushdown Automata (2015/11/23) Chapter 6 Pushdown Automata (2015/11/23) Sagrada Familia, Barcelona, Spain Outline 6.0 Introduction 6.1 Definition of PDA 6.2 The Language of a PDA 6.3 Euivalence of PDA s and CFG s 6.4 Deterministic PDA

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

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

60-354, Theory of Computation Fall Asish Mukhopadhyay School of Computer Science University of Windsor

60-354, Theory of Computation Fall Asish Mukhopadhyay School of Computer Science University of Windsor 60-354, Theory of Computation Fall 2013 Asish Mukhopadhyay School of Computer Science University of Windsor Pushdown Automata (PDA) PDA = ε-nfa + stack Acceptance ε-nfa enters a final state or Stack is

More information

How to Pop a Deep PDA Matters

How to Pop a Deep PDA Matters How to Pop a Deep PDA Matters Peter Leupold Department of Mathematics, Faculty of Science Kyoto Sangyo University Kyoto 603-8555, Japan email:leupold@cc.kyoto-su.ac.jp Abstract Deep PDA are push-down automata

More information

Final Exam Comments. UVa - cs302: Theory of Computation Spring < Total

Final Exam Comments. UVa - cs302: Theory of Computation Spring < Total UVa - cs302: Theory of Computation Spring 2008 Final Exam Comments < 50 50 59 60 69 70 79 80 89 90 94 95-102 Total 2 6 8 22 16 16 12 Problem 1: Short Answers. (20) For each question, provide a correct,

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

Section 1 (closed-book) Total points 30

Section 1 (closed-book) Total points 30 CS 454 Theory of Computation Fall 2011 Section 1 (closed-book) Total points 30 1. Which of the following are true? (a) a PDA can always be converted to an equivalent PDA that at each step pops or pushes

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

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

Fundamentele Informatica II

Fundamentele Informatica II Fundamentele Informatica II Answer to selected exercises 5 John C Martin: Introduction to Languages and the Theory of Computation M.M. Bonsangue (and J. Kleijn) Fall 2011 5.1.a (q 0, ab, Z 0 ) (q 1, b,

More information

Introduction to Turing Machines

Introduction to Turing Machines Introduction to Turing Machines Deepak D Souza Department of Computer Science and Automation Indian Institute of Science, Bangalore. 12 November 2015 Outline 1 Turing Machines 2 Formal definitions 3 Computability

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

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

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

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

COMP/MATH 300 Topics for Spring 2017 June 5, Review and Regular Languages

COMP/MATH 300 Topics for Spring 2017 June 5, Review and Regular Languages COMP/MATH 300 Topics for Spring 2017 June 5, 2017 Review and Regular Languages Exam I I. Introductory and review information from Chapter 0 II. Problems and Languages A. Computable problems can be expressed

More information

Deterministic Finite Automata. Non deterministic finite automata. Non-Deterministic Finite Automata (NFA) Non-Deterministic Finite Automata (NFA)

Deterministic Finite Automata. Non deterministic finite automata. Non-Deterministic Finite Automata (NFA) Non-Deterministic Finite Automata (NFA) Deterministic Finite Automata Non deterministic finite automata Automata we ve been dealing with have been deterministic For every state and every alphabet symbol there is exactly one move that the machine

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

Automata & languages. A primer on the Theory of Computation. Laurent Vanbever. ETH Zürich (D-ITET) October,

Automata & languages. A primer on the Theory of Computation. Laurent Vanbever.   ETH Zürich (D-ITET) October, Automata & languages A primer on the Theory of Computation Laurent Vanbever www.vanbever.eu ETH Zürich (D-ITET) October, 19 2017 Part 5 out of 5 Last week was all about Context-Free Languages Context-Free

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

SYLLABUS. Introduction to Finite Automata, Central Concepts of Automata Theory. CHAPTER - 3 : REGULAR EXPRESSIONS AND LANGUAGES

SYLLABUS. Introduction to Finite Automata, Central Concepts of Automata Theory. CHAPTER - 3 : REGULAR EXPRESSIONS AND LANGUAGES Contents i SYLLABUS UNIT - I CHAPTER - 1 : AUT UTOMA OMATA Introduction to Finite Automata, Central Concepts of Automata Theory. CHAPTER - 2 : FINITE AUT UTOMA OMATA An Informal Picture of Finite Automata,

More information

CS Pushdown Automata

CS Pushdown Automata Chap. 6 Pushdown Automata 6.1 Definition of Pushdown Automata Example 6.2 L ww R = {ww R w (0+1) * } Palindromes over {0, 1}. A cfg P 0 1 0P0 1P1. Consider a FA with a stack(= a Pushdown automaton; PDA).

More information

Pushdown Automata. Pushdown Automata. Pushdown Automata. Pushdown Automata. Pushdown Automata. Pushdown Automata. The stack

Pushdown Automata. Pushdown Automata. Pushdown Automata. Pushdown Automata. Pushdown Automata. Pushdown Automata. The stack A pushdown automata (PDA) is essentially: An NFA with a stack A move of a PDA will depend upon Current state of the machine Current symbol being read in Current symbol popped off the top of the stack With

More information

UNIT-VI PUSHDOWN AUTOMATA

UNIT-VI PUSHDOWN AUTOMATA Syllabus R09 Regulation UNIT-VI PUSHDOWN AUTOMATA The context free languages have a type of automaton that defined them. This automaton, called a pushdown automaton, is an extension of the nondeterministic

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

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

Introduction and Motivation. Introduction and Motivation. Introduction to Computability. Introduction and Motivation. Theory. Lecture5: Context Free

Introduction and Motivation. Introduction and Motivation. Introduction to Computability. Introduction and Motivation. Theory. Lecture5: Context Free ntroduction to Computability Theory Lecture5: Context Free Languages Prof. Amos sraeli 1 ntroduction and Motivation n our study of RL-s we Covered: 1. Motivation and definition of regular languages. 2.

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

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

CS 154, Lecture 2: Finite Automata, Closure Properties Nondeterminism,

CS 154, Lecture 2: Finite Automata, Closure Properties Nondeterminism, CS 54, Lecture 2: Finite Automata, Closure Properties Nondeterminism, Why so Many Models? Streaming Algorithms 0 42 Deterministic Finite Automata Anatomy of Deterministic Finite Automata transition: for

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

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

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

Automata Theory (2A) Young Won Lim 5/31/18

Automata Theory (2A) Young Won Lim 5/31/18 Automata Theory (2A) Copyright (c) 2018 Young W. Lim. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later

More information

Introduction to the Theory of Computing

Introduction to the Theory of Computing Introduction to the Theory of Computing Lecture notes for CS 360 John Watrous School of Computer Science and Institute for Quantum Computing University of Waterloo June 27, 2017 This work is licensed under

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

CISC 4090: Theory of Computation Chapter 1 Regular Languages. Section 1.1: Finite Automata. What is a computer? Finite automata

CISC 4090: Theory of Computation Chapter 1 Regular Languages. Section 1.1: Finite Automata. What is a computer? Finite automata CISC 4090: Theory of Computation Chapter Regular Languages Xiaolan Zhang, adapted from slides by Prof. Werschulz Section.: Finite Automata Fordham University Department of Computer and Information Sciences

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY 5-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY NON-DETERMINISM and REGULAR OPERATIONS THURSDAY JAN 6 UNION THEOREM The union of two regular languages is also a regular language Regular Languages Are

More information

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

Finite Automata and Languages

Finite Automata and Languages CS62, IIT BOMBAY Finite Automata and Languages Ashutosh Trivedi Department of Computer Science and Engineering, IIT Bombay CS62: New Trends in IT: Modeling and Verification of Cyber-Physical Systems (2

More information

DD2371 Automata Theory

DD2371 Automata Theory KTH CSC VT 2008 DD2371 Automata Theory Dilian Gurov Lecture Outline 1. The lecturer 2. Introduction to automata theory 3. Course syllabus 4. Course objectives 5. Course organization 6. First definitions

More information

Part 4 out of 5 DFA NFA REX. Automata & languages. A primer on the Theory of Computation. Last week, we showed the equivalence of DFA, NFA and REX

Part 4 out of 5 DFA NFA REX. Automata & languages. A primer on the Theory of Computation. Last week, we showed the equivalence of DFA, NFA and REX Automata & languages A primer on the Theory of Computation Laurent Vanbever www.vanbever.eu Part 4 out of 5 ETH Zürich (D-ITET) October, 12 2017 Last week, we showed the equivalence of DFA, NFA and REX

More information

INF210 Datamaskinteori (Models of Computation)

INF210 Datamaskinteori (Models of Computation) INF210 Datamaskinteori (Models of Computation) Textbook: John Martin, Introduction to Languages and the Theory of Computation, McGraw Hill, Third Edition. Fedor V. Fomin Datamaskinteori 1 Datamaskinteori

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

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

CS Lecture 28 P, NP, and NP-Completeness. Fall 2008

CS Lecture 28 P, NP, and NP-Completeness. Fall 2008 CS 301 - Lecture 28 P, NP, and NP-Completeness Fall 2008 Review Languages and Grammars Alphabets, strings, languages Regular Languages Deterministic Finite and Nondeterministic Automata Equivalence of

More information

CDM Parsing and Decidability

CDM Parsing and Decidability CDM Parsing and Decidability 1 Parsing Klaus Sutner Carnegie Mellon Universality 65-parsing 2017/12/15 23:17 CFGs and Decidability Pushdown Automata The Recognition Problem 3 What Could Go Wrong? 4 Problem:

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

Embedded systems specification and design

Embedded systems specification and design Embedded systems specification and design David Kendall David Kendall Embedded systems specification and design 1 / 21 Introduction Finite state machines (FSM) FSMs and Labelled Transition Systems FSMs

More information

(pp ) PDAs and CFGs (Sec. 2.2)

(pp ) PDAs and CFGs (Sec. 2.2) (pp. 117-124) PDAs and CFGs (Sec. 2.2) A language is context free iff all strings in L can be generated by some context free grammar Theorem 2.20: L is Context Free iff a PDA accepts it I.e. if L is context

More information

Context-free Languages and Pushdown Automata

Context-free Languages and Pushdown Automata Context-free Languages and Pushdown Automata Finite Automata vs CFLs E.g., {a n b n } CFLs Regular From earlier results: Languages every regular language is a CFL but there are CFLs that are not regular

More information

Automata and Computability. Solutions to Exercises

Automata and Computability. Solutions to Exercises Automata and Computability Solutions to Exercises Spring 27 Alexis Maciel Department of Computer Science Clarkson University Copyright c 27 Alexis Maciel ii Contents Preface vii Introduction 2 Finite Automata

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 2 Define push down automata Trace the computation of a push down automaton Design

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

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

INF Introduction and Regular Languages. Daniel Lupp. 18th January University of Oslo. Department of Informatics. Universitetet i Oslo

INF Introduction and Regular Languages. Daniel Lupp. 18th January University of Oslo. Department of Informatics. Universitetet i Oslo INF28 1. Introduction and Regular Languages Daniel Lupp Universitetet i Oslo 18th January 218 Department of Informatics University of Oslo INF28 Lecture :: 18th January 1 / 33 Details on the Course consists

More information