THEORY OF COMPUTATION UNIT II CONTEXT FREE LANGUAGES AND PUSH DOWN AUTOMATA

Size: px
Start display at page:

Download "THEORY OF COMPUTATION UNIT II CONTEXT FREE LANGUAGES AND PUSH DOWN AUTOMATA"

Transcription

1 THEORY OF COMPUTATION UNIT II CONTEXT FREE LANGUAGES AND PUSH DOWN AUTOMATA PUSH DOWN AUTOMATA Overview This chapter deals with the PDA(Push Down Automata) which can work with the CFG. We try to learn about properties of PDA and solving various problems Objectives To learn about PDA definition To learn about Equivalence of PDA and context free language To learn about Properties of context free languages To learn about Pumping Lemma for context free languages Introduction In this section we introduce a new type of computational model called pushdown automata. These automata are like nondeterministic finite automata but have an extra component called a stack. The stack provides additional memory beyond the finite amount available in the control. The stack allows pushdown automata to recognize some non regular languages. Pushdown automata are equivalent in power to context-free grammars. This equivalence is useful because it gives us two options for proving that a language is context free. We can give either a context-free grammar generating it or a pushdown automaton recognizing it. Certain languages are more easily described in terms of generators, whereas others are more easily described in terms of recognizers. The following figure is a schematic representation of a finite automaton. The control represents the states and transition function, the tape contains the input string, and the arrow represents the input head, pointing at the next input symbol to be read. Schematic of a finite automation With the addition of a stack component we obtain a schematic representation of a pushdown automaton, as shown in the following figure.

2 Schematic of pushdown automation A pushdown automaton (PDA) can write symbols on the stack and read them back later. Writing a symbol "pushes down" all the other symbols on the stack. At any time the symbol on the top of the stack can be read and removed. The remaining symbols then move back up. Writing a symbol on the stack is often referred to as pushing the symbol, and removing a symbol is referred to as popping it. Note that all access to the stack, for both reading and writing, may be done only at the top. In other words a stack is a "last in, first out" storage device. If certain information is written on the stack and additional information is written afterward, the earlier information becomes inaccessible until the later information is removed. Plates on a cafeteria serving counter illustrate a stack. The stack of plates rests on a spring so that when a new plate is placed on top of the stack, the plates below it move down. The stack on a pushdown automaton is like a stack of plates, with each plate having a symbol written on it. A stack is valuable because it can hold an unlimited amount of information. Recall that a finite automaton is unable to recognize the language {o n 1 n / n > O} because it cannot store very large numbers in its finite memory. A PDA is able to recognize this language because it can use its stack to store the number of 0s it has seen. Thus the unlimited nature of a stack allows the PDA to store numbers of unbounded size. The following informal description shows how the automaton for this language works. Read symbols from the input. As each 0 is read, push it onto the stack. As soon as is are seen, pop a 0 off the stack for each 1 read. If reading the input is finished exactly when the stack becomes empty of Os, accept the input. If the stack becomes empty while is remain or if the is are finished while the stack still contains 0s or if any 0s appear in the input following is, reject the input. As mentioned earlier, pushdown automata may be nondeterministic. Deterministic and nondeterministic pushdown automata are not equivalent in power. Nondeterministic pushdown automata recognize certain languages which no deterministic pushdown automata can recognize, though we will not prove this fact. Recall that deterministic and nondeterministic finite automata do recognize the same class of languages, so the pushdown automata situation is different. We focus on nondeterministic pushdown automata because these automata are equivalent in power to context-free grammars.

3 Formal Definition of PDA The stack is an additional component available as part of PDA. The stack increases its memory. With respect to {a n b n n 1}, we can store a s in the stack. When the symbol b is encountered, an a from the stack can be removed. If the stack becomes empty on the completion of processing a given string, then the PDA accepts the string. Graphical Notation for PDA A transition diagram in which nodes correspond to states Arcs are labeled as a, X / α where a is input symbol, X is on top of stack prior to processing a and α on top of stack after processing a An arc labeled a, X/α from q to p indicates d(q, a, X) contains (p, α)

4 Transition Functions for NPDA

5 Drawing NPDAs Execution of NPDA Assume that someone is in the middle of stepping through a string with a DFA, and we need to take over and finish the job. There are two things that are required to be known: (a) the state of the DFA is in, and (b) what the remaining input is. But if the automaton is an NPDA we need to know one more viz., contents of the stack.

6 Instantaneous Description of a PDA (IDs) Accepting Strings with an NPDA Assume that you have the NPDA given by

7 Example Transition diagram for 0 n 1 n 0, Z 0 /0Z 0 0, 0/00 1, 0/ Start q 0 q 1 q 2 1, 0/, Z 0 /Z 0

8 Accepting Strings with NPDA (Formal Version) Language recognition by PDA Two approaches Acceptance by entering final state Acceptance by entering empty stack The class of languages are same, ie CFL Acceptance by final state Acceptance by empty stack P N to P F

9 Example: PDA for balanced parenthesis P F to P N

10 Example Construct a Push Down Automata (PDA) accepting {a n b n a n m, n 1} by empty store. Solution

11 RELATIONSHIP BETWEEN PDA AND CONTEXT FREE LANGUAGES 1. Simplifying CFGs The productions of context-free grammars can be coerced into a variety of forms without affecting the expressive power of the grammar. (a) Empty Production Removal If the empty string does not belong to a language, then there is no way to eliminate production of the form A λ from the grammar. If the empty string belongs to a language, then we can eliminate λ from all productions same for the single productions S λ. In this case we can eliminate any occurrences of S from the right-hand-side of productions. (b) Unit Production Removal We can eliminate productions of the form A B from a CFG. (c) Left Recursion Removal A variable A is left-recursive if it occurs in a production of the form A Ax for any x (V T )*. A grammar is left-recursive if it contains at least one left-recursive variable. Every CFL can be represented by a grammar that is not left-recursive. Normal Forms of Context-Free Grammars (a) Chomsky Nor mal Form A grammar is in Chomsky Normal form if all productions are of the form A BC or A a where A, B and C are variables and a is a terminal. Any context-free grammar that does not contain λ can be put into Chomsky Normal Form. (b) Greibach Nor mal Form (GNF) A grammar is in Greibach Normal Form if all productions are of the form A ax where a is a terminal and x V *. Grammars in Greibach Normal Form are much longer than the CFG from which they were derived. GNF is useful for proving the equivalence of NPDA and CFG. Thus GNF is useful in converting a CFG to NPDA. CFG to NPDA For any context-free grammar in GNF, it is easy to build an equivalent nondeterministic pushdown automaton (NPDA). Any string of a context-free language has a leftmost derivation. We set up the NPDA so that the stack contents corresponds to this sentential form: every move of the NPDA represents one derivation step.

12 The sentential form is (The characters already read) + (symbols on the stack) (Final z (initial stack symbol) In the NPDA, we will construct the states that are not of much importance. All the real work is done on the stack. We will use only the following three states, irrespective of the complexity of the grammar. (i) (ii) (iii) Start state q0 just gets things initialized. We use the transition from q0 to q1 to put the grammar s start symbol on the stack. δ(q0, λ, Z) {(q1, Sz)} State q1 does the bulk of the work. We represent every derivation step as a move from q1 to q1. We use the transition from q1 to qf to accept the string δ(q1, λ, z) {(q f, z)} Example Consider the grammar G = ({S, A, B},{a, b}, S, P), where P = {S a, S aab, A aa, A a, B bb, B b} These productions can be turned into transition functions by rearranging the components.

13 Note: The PDA simulates the left sentential form for string w If xaα is left sentential form then Aα appears on stack x, the prefix of w(=xy) is consumed, y remains in input Let (q, y, Aα) be the current ID and A β be a production The PDA now replaces A by β on the stack The new ID becomes (q, y,αβ) αβ may not be the next left sentential form To expose next variable on top of stack, Remove matching terminals from stack and input If no matching terminal, PDA fails Procedure for CFG to PDA Let G =( V, T, P, S) and PDA accepting L(G) is defined as N = ({q}, T, V T, δ, q, S) where For each variable A, δ(q,, A) = {(q, β) A->β is in P} For each terminal a, δ(q, a, a) = {(q, )} Example:1 Write the PDA For the given grammar G = ({S,A}, {0,1}, {S->0S1 A, A->1A0 S }, S) Solution: PDA transitions are defined below δ(q,,s) = {(q, 0S1), (q, A)} δ(q,,a) = {(q, 1A0), (q, S), (q, )} δ(q,0,0) = {(q, )} δ(q,1,1) = {(q, )}

14 Explanation Consider each non terminal symbol and apply the production in the write side similarly for terminal symbol too. If the input symbol and the stack symbol are same then there is no output Example :2 Construct the PDA for the below grammar E -> E*E E+E (E) D ; D -> a Da D0 PDA transitions are defined below δ(q,,e) = {(q, E*E), (q, E+E), (q, (E)), (q, D)} δ(q,,d) = {(q, a), (q, Da), (q,d0)} δ(q,0,0) = {(q, )}, δ(q,a,a) = {(q, )} δ(q,(,( ) = {(q, )} δ(q,),) ) = {(q, )} δ(q,+,+ ) = {(q, )} δ(q,*,* ) = {(q, )} NPDA to CFG (a) We have shown that for any CFG, an equivalent NPDA can be obtained. We shall show also that, for any NPDA, we can produce an equivalent CFG. This will establish the equivalence of CFGs and NFDAs. We shall assert without proof that any NPDA can be transformed into an equivalent NPDA which has the following form: (i) (ii) The NPDA has only one final state, which it enters if and only if the stack is empty. All transitions have the form δ(q, a, A) = {c1, c2, c3,.. } where each ci has one of the two forms (q j, λ) (q j, BC) (b) When we write a grammar, we can use any variable names we choose. As in programming languages, we like to use meaningful variable names. When we translate an NPDA into a CFG, we will use variable names that encode information about both the state of the NPDA and the stack content variable names will have the form [qi Aq j ] where qi and q j are states and A is a variable. The meaning of the variable [qi Aqj] is that the NPDA can go from state qi with Ax on the stack to state qj with x on the stack. Each transition of the form δ(qi, a, A)= (q j, λ) results in a single grammar rule. Each transition of the form δ(qi, a, A) {q j, BC) results is a multitude of grammar rules, one for each pair of states qx and qy in the NPDA.

15 Example 1 Example 2

16 Deterministic Pushdown Automata A Non-deterministic finite acceptor differs from a deterministic finite acceptor in two ways: (i) The transition function δ is single-valued for a DFA, but multi-valued for an NFA. (ii) An NFA may have λ-transitions. A non-deterministic pushdown automaton differs from a pushdown automaton in the following ways: (i) The transition function δ is at most single-valued for a DPDA, multi-valued for an NPDA. Formally: δ(q1, a, b) = 0 or1, for every q Q, a Σ {λ}, and b Γ. (ii) Both NPDA and DPDA may have λ-transitions; but a DPDA may have a λ-transition only if no other transition is possible. Formally: If δ(q, λ, b), then δ(q, c, b) = for every c Σ. A deterministic CFL is a language that can be recognized by a DPDA. The deterministic contextfree languages are a proper subset of the context-free languages.

17 Examples for DPDA and NPDA DPDA languages For every regular language there exists a DPDA The language accepted by DPDA must have prefix property All languages accepted by DPDA are CFL but there are CFLs for which cannot be recognized by DPDA The language accepted by DPDA must have unambiguous grammar but there are unambiguous grammars for which DPDA can t be constructed Properties of context free languages Pumping Lemma for CFG A Pumping Lemma is a theorem used to show that, if certain strings belong to a language, then certain other strings must also belong to the language. Let us discuss a Pumping Lemma for CFL. We will show that, if L is a context-free language, then strings of L that are at least m symbols long can be pumped to produce additional strings in L. The value of m depends on the particular language. Let L be an infinite context-free language. Then there is some positive integer m such that, if S is a string of L of Length at least m, then (i) S = uvwxy (for some u, v, w, x, y) (ii) vwx m (iii) vx 1 (iv) uv i wx i y L. for all non-negative values of i.

18 It should be understood that (i) If S is sufficiently long string, then there are two substrings, v and x, somewhere in S. There is stuff (u) before v, stuff (w) between v and x, and stuff (y), after x. (ii) The stuff between v and x won t be too long, because vwx can t be larger than m. (iii) (iv) Definitions Substrings v and x won t both be empty, though either one could be. If we duplicate substring v, some number (i) of times, and duplicate x the same number of times, the resultant string will also be in L. A variable is useful if it occurs in the derivation of some string. This requires that (a) the variable occurs in some sentential form (you can get to the variable if you start from S), and (b) a string of terminals can be derived from the sentential form (the variable is not a dead end ). A variable is recursive if it can generate a string containing itself. For example, variable A is recursive if Proof of Pumping Lemma (a) Suppose we have a CFL given by L. Then there is some context-free Grammar G that generates L. Suppose (i) L is infinite, hence there is no proper upper bound on the length of strings belonging to L. (ii) L does not contain l. (iii) G has no productions or l-productions. There are only a finite number of variables in a grammar and the productions for each variable have finite lengths. The only way that a grammar can generate arbitrarily long strings is if one or more variables is both useful and recursive. Suppose no variable is recursive. Since the start symbol is non recursive, it must be defined only in terms of terminals and other variables. Then

19 since those variables are non recursive, they have to be defined in terms of terminals and still other variables and so on. After a while we run out of other variables while the generated string is still finite. Therefore there is an upper bond on the length of the string which can be generated from the start symbol. This contradicts our statement that the language is finite. Hence, our assumption that no variable is recursive must be incorrect. (b) Let us consider a string X belonging to L. If X is sufficiently long, then the derivation of X must have involved recursive use of some variable A. Since A was used in the derivation, the derivation should have started as

20 Usage of Pumping Lemma

21 Hence our original assumption, that L is context free should be false. Hence the language L is not con text-free. Example Check whether the language given by L = {a m b m c n : m n 2m} is a CFL or not. Solution Summary Thus the Push down automata is designed for recognizing CFL. There are two types of PDAs DPDA and NPDA. The PDA can accept a string in two ways Empty stack and Final state. Any CFG can be recognized by PDA and conversion is also possible. Key terms NDPDA: Non-deterministic Pushdown automata PDA: Pushdown automata Transition Function of NPDA: Are of the form δ = Q (Σ {λ}) Γ These are finite subsets of Q Γ Stack: One additional component available as part of PDA. Move of NPDA: denotes a move of NPDA. PDA: Has (q, w, u), where q = current state of automaton w = unreal part of input string u = stack con tents.

22 Simplifying CFG: Done either through (i) Empty Production removal (ii) Unit production removal (iii) Left recursion removal. DPDA: Deterministic PDA, which has a transition function as single-valued for DFA and has λ- transitions Pumping Lemma: Theorem used to show that if certain strings belong to a language, then certain other strings must also belong to the language. Decision Algorithm: To find out if M accepts zero, a finite number, or an infinite number of strings. Review Questions 1. Define Pushdown automata. 2. Define Nondeterministic Pushdown automata. 3. State the general form of transition function for an NPDA. 4. Give the instantaneous description of a PDA. 5. Explain how the strings are accepted with an NPDA. 6. What are the kinds of moves that can be made while accepting strings with an NPDA? 7. Explain the terms (a) l-transitions (b) Non-empty transitions 8. Give an example of NPDA execution. 9. State the relationship between PDA and context free languages. 10. Explain: (a) Empty Production removal (b) Unit Production removal. 11. What are the Normal forms of CFGs? 12. How will you convert a CFG to NPDA? 13. How will you convert a NPDA to CFG? 14. What do you mean by deterministic pushdown automata? 15. State the properties of Context free languages. 16. State the pumping lemma for CFG. 17. Give the proof for pumping lemma. 18. State the usage of pumping lemma. 19. What are decision algorithms? 20. State the usefulness of decision algorithms.

23 Exercises

24

Pushdown automata. Informatics 2A: Lecture 9. Alex Simpson. 3 October, 2014. School of Informatics University of Edinburgh als@inf.ed.ac.

Pushdown automata. Informatics 2A: Lecture 9. Alex Simpson. 3 October, 2014. School of Informatics University of Edinburgh als@inf.ed.ac. Pushdown automata Informatics 2A: Lecture 9 Alex Simpson School of Informatics University of Edinburgh als@inf.ed.ac.uk 3 October, 2014 1 / 17 Recap of lecture 8 Context-free languages are defined by context-free

More information

Automata and Computability. Solutions to Exercises

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

More information

Formal Languages and Automata Theory - Regular Expressions and Finite Automata -

Formal Languages and Automata Theory - Regular Expressions and Finite Automata - Formal Languages and Automata Theory - Regular Expressions and Finite Automata - Samarjit Chakraborty Computer Engineering and Networks Laboratory Swiss Federal Institute of Technology (ETH) Zürich March

More information

Pushdown Automata. place the input head on the leftmost input symbol. while symbol read = b and pile contains discs advance head remove disc from pile

Pushdown Automata. place the input head on the leftmost input symbol. while symbol read = b and pile contains discs advance head remove disc from pile Pushdown Automata In the last section we found that restricting the computational power of computing devices produced solvable decision problems for the class of sets accepted by finite automata. But along

More information

The Halting Problem is Undecidable

The Halting Problem is Undecidable 185 Corollary G = { M, w w L(M) } is not Turing-recognizable. Proof. = ERR, where ERR is the easy to decide language: ERR = { x { 0, 1 }* x does not have a prefix that is a valid code for a Turing machine

More information

Chapter 7 Uncomputability

Chapter 7 Uncomputability Chapter 7 Uncomputability 190 7.1 Introduction Undecidability of concrete problems. First undecidable problem obtained by diagonalisation. Other undecidable problems obtained by means of the reduction

More information

6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, 2010. Class 4 Nancy Lynch

6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, 2010. Class 4 Nancy Lynch 6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, 2010 Class 4 Nancy Lynch Today Two more models of computation: Nondeterministic Finite Automata (NFAs)

More information

Honors Class (Foundations of) Informatics. Tom Verhoeff. Department of Mathematics & Computer Science Software Engineering & Technology

Honors Class (Foundations of) Informatics. Tom Verhoeff. Department of Mathematics & Computer Science Software Engineering & Technology Honors Class (Foundations of) Informatics Tom Verhoeff Department of Mathematics & Computer Science Software Engineering & Technology www.win.tue.nl/~wstomv/edu/hci c 2011, T. Verhoeff @ TUE.NL 1/20 Information

More information

ÖVNINGSUPPGIFTER I SAMMANHANGSFRIA SPRÅK. 15 april 2003. Master Edition

ÖVNINGSUPPGIFTER I SAMMANHANGSFRIA SPRÅK. 15 april 2003. Master Edition ÖVNINGSUPPGIFTER I SAMMANHANGSFRIA SPRÅK 5 april 23 Master Edition CONTEXT FREE LANGUAGES & PUSH-DOWN AUTOMATA CONTEXT-FREE GRAMMARS, CFG Problems Sudkamp Problem. (3.2.) Which language generates the grammar

More information

(IALC, Chapters 8 and 9) Introduction to Turing s life, Turing machines, universal machines, unsolvable problems.

(IALC, Chapters 8 and 9) Introduction to Turing s life, Turing machines, universal machines, unsolvable problems. 3130CIT: Theory of Computation Turing machines and undecidability (IALC, Chapters 8 and 9) Introduction to Turing s life, Turing machines, universal machines, unsolvable problems. An undecidable problem

More information

Turing Machines: An Introduction

Turing Machines: An Introduction CIT 596 Theory of Computation 1 We have seen several abstract models of computing devices: Deterministic Finite Automata, Nondeterministic Finite Automata, Nondeterministic Finite Automata with ɛ-transitions,

More information

Regular Expressions and Automata using Haskell

Regular Expressions and Automata using Haskell Regular Expressions and Automata using Haskell Simon Thompson Computing Laboratory University of Kent at Canterbury January 2000 Contents 1 Introduction 2 2 Regular Expressions 2 3 Matching regular expressions

More information

SRM UNIVERSITY FACULTY OF ENGINEERING & TECHNOLOGY SCHOOL OF COMPUTING DEPARTMENT OF SOFTWARE ENGINEERING COURSE PLAN

SRM UNIVERSITY FACULTY OF ENGINEERING & TECHNOLOGY SCHOOL OF COMPUTING DEPARTMENT OF SOFTWARE ENGINEERING COURSE PLAN Course Code : CS0355 SRM UNIVERSITY FACULTY OF ENGINEERING & TECHNOLOGY SCHOOL OF COMPUTING DEPARTMENT OF SOFTWARE ENGINEERING COURSE PLAN Course Title : THEORY OF COMPUTATION Semester : VI Course : June

More information

Regular Languages and Finite State Machines

Regular Languages and Finite State Machines Regular Languages and Finite State Machines Plan for the Day: Mathematical preliminaries - some review One application formal definition of finite automata Examples 1 Sets A set is an unordered collection

More information

Philadelphia University Faculty of Information Technology Department of Computer Science First Semester, 2007/2008.

Philadelphia University Faculty of Information Technology Department of Computer Science First Semester, 2007/2008. Philadelphia University Faculty of Information Technology Department of Computer Science First Semester, 2007/2008 Course Syllabus Course Title: Theory of Computation Course Level: 3 Lecture Time: Course

More information

C H A P T E R Regular Expressions regular expression

C H A P T E R Regular Expressions regular expression 7 CHAPTER Regular Expressions Most programmers and other power-users of computer systems have used tools that match text patterns. You may have used a Web search engine with a pattern like travel cancun

More information

Reading 13 : Finite State Automata and Regular Expressions

Reading 13 : Finite State Automata and Regular Expressions CS/Math 24: Introduction to Discrete Mathematics Fall 25 Reading 3 : Finite State Automata and Regular Expressions Instructors: Beck Hasti, Gautam Prakriya In this reading we study a mathematical model

More information

Model 2.4 Faculty member + student

Model 2.4 Faculty member + student Model 2.4 Faculty member + student Course syllabus for Formal languages and Automata Theory. Faculty member information: Name of faculty member responsible for the course Office Hours Office Number Email

More information

3515ICT Theory of Computation Turing Machines

3515ICT Theory of Computation Turing Machines Griffith University 3515ICT Theory of Computation Turing Machines (Based loosely on slides by Harald Søndergaard of The University of Melbourne) 9-0 Overview Turing machines: a general model of computation

More information

Push-down Automata and Context-free Grammars

Push-down Automata and Context-free Grammars 14 Push-down Automata and Context-free Grammars This chapter details the design of push-down automata (PDA) for various languages, the conversion of CFGs to PDAs, and vice versa. In particular, after formally

More information

1 Definition of a Turing machine

1 Definition of a Turing machine Introduction to Algorithms Notes on Turing Machines CS 4820, Spring 2012 April 2-16, 2012 1 Definition of a Turing machine Turing machines are an abstract model of computation. They provide a precise,

More information

Scanner. tokens scanner parser IR. source code. errors

Scanner. tokens scanner parser IR. source code. errors Scanner source code tokens scanner parser IR errors maps characters into tokens the basic unit of syntax x = x + y; becomes = + ; character string value for a token is a lexeme

More information

Composability of Infinite-State Activity Automata*

Composability of Infinite-State Activity Automata* Composability of Infinite-State Activity Automata* Zhe Dang 1, Oscar H. Ibarra 2, Jianwen Su 2 1 Washington State University, Pullman 2 University of California, Santa Barbara Presented by Prof. Hsu-Chun

More information

Automata on Infinite Words and Trees

Automata on Infinite Words and Trees Automata on Infinite Words and Trees Course notes for the course Automata on Infinite Words and Trees given by Dr. Meghyn Bienvenu at Universität Bremen in the 2009-2010 winter semester Last modified:

More information

CS5236 Advanced Automata Theory

CS5236 Advanced Automata Theory CS5236 Advanced Automata Theory Frank Stephan Semester I, Academic Year 2012-2013 Advanced Automata Theory is a lecture which will first review the basics of formal languages and automata theory and then

More information

Informatique Fondamentale IMA S8

Informatique Fondamentale IMA S8 Informatique Fondamentale IMA S8 Cours 1 - Intro + schedule + finite state machines Laure Gonnord http://laure.gonnord.org/pro/teaching/ Laure.Gonnord@polytech-lille.fr Université Lille 1 - Polytech Lille

More information

Implementation of Recursively Enumerable Languages using Universal Turing Machine in JFLAP

Implementation of Recursively Enumerable Languages using Universal Turing Machine in JFLAP International Journal of Information and Computation Technology. ISSN 0974-2239 Volume 4, Number 1 (2014), pp. 79-84 International Research Publications House http://www. irphouse.com /ijict.htm Implementation

More information

6.080/6.089 GITCS Feb 12, 2008. Lecture 3

6.080/6.089 GITCS Feb 12, 2008. Lecture 3 6.8/6.89 GITCS Feb 2, 28 Lecturer: Scott Aaronson Lecture 3 Scribe: Adam Rogal Administrivia. Scribe notes The purpose of scribe notes is to transcribe our lectures. Although I have formal notes of my

More information

Increasing Interaction and Support in the Formal Languages and Automata Theory Course

Increasing Interaction and Support in the Formal Languages and Automata Theory Course Increasing Interaction and Support in the Formal Languages and Automata Theory Course [Extended Abstract] Susan H. Rodger rodger@cs.duke.edu Jinghui Lim Stephen Reading ABSTRACT The introduction of educational

More information

Fast nondeterministic recognition of context-free languages using two queues

Fast nondeterministic recognition of context-free languages using two queues Fast nondeterministic recognition of context-free languages using two queues Burton Rosenberg University of Miami Abstract We show how to accept a context-free language nondeterministically in O( n log

More information

Finite Automata. Reading: Chapter 2

Finite Automata. Reading: Chapter 2 Finite Automata Reading: Chapter 2 1 Finite Automaton (FA) Informally, a state diagram that comprehensively captures all possible states and transitions that a machine can take while responding to a stream

More information

Deterministic Finite Automata

Deterministic Finite Automata 1 Deterministic Finite Automata Definition: A deterministic finite automaton (DFA) consists of 1. a finite set of states (often denoted Q) 2. a finite set Σ of symbols (alphabet) 3. a transition function

More information

Compiler Construction

Compiler Construction Compiler Construction Regular expressions Scanning Görel Hedin Reviderad 2013 01 23.a 2013 Compiler Construction 2013 F02-1 Compiler overview source code lexical analysis tokens intermediate code generation

More information

Automata and Formal Languages

Automata and Formal Languages Automata and Formal Languages Winter 2009-2010 Yacov Hel-Or 1 What this course is all about This course is about mathematical models of computation We ll study different machine models (finite automata,

More information

Overview of E0222: Automata and Computability

Overview of E0222: Automata and Computability Overview of E0222: Automata and Computability Deepak D Souza Department of Computer Science and Automation Indian Institute of Science, Bangalore. August 3, 2011 What this course is about What we study

More information

Regular Languages and Finite Automata

Regular Languages and Finite Automata Regular Languages and Finite Automata 1 Introduction Hing Leung Department of Computer Science New Mexico State University Sep 16, 2010 In 1943, McCulloch and Pitts [4] published a pioneering work on a

More information

6.2 Permutations continued

6.2 Permutations continued 6.2 Permutations continued Theorem A permutation on a finite set A is either a cycle or can be expressed as a product (composition of disjoint cycles. Proof is by (strong induction on the number, r, of

More information

CSC4510 AUTOMATA 2.1 Finite Automata: Examples and D efinitions Definitions

CSC4510 AUTOMATA 2.1 Finite Automata: Examples and D efinitions Definitions CSC45 AUTOMATA 2. Finite Automata: Examples and Definitions Finite Automata: Examples and Definitions A finite automaton is a simple type of computer. Itsoutputislimitedto yes to or no. It has very primitive

More information

How To Understand The Theory Of Computer Science

How To Understand The Theory Of Computer Science Theory of Computation Lecture Notes Abhijat Vichare August 2005 Contents 1 Introduction 2 What is Computation? 3 The λ Calculus 3.1 Conversions: 3.2 The calculus in use 3.3 Few Important Theorems 3.4 Worked

More information

CAs and Turing Machines. The Basis for Universal Computation

CAs and Turing Machines. The Basis for Universal Computation CAs and Turing Machines The Basis for Universal Computation What We Mean By Universal When we claim universal computation we mean that the CA is capable of calculating anything that could possibly be calculated*.

More information

CS154. Turing Machines. Turing Machine. Turing Machines versus DFAs FINITE STATE CONTROL AI N P U T INFINITE TAPE. read write move.

CS154. Turing Machines. Turing Machine. Turing Machines versus DFAs FINITE STATE CONTROL AI N P U T INFINITE TAPE. read write move. CS54 Turing Machines Turing Machine q 0 AI N P U T IN TAPE read write move read write move Language = {0} q This Turing machine recognizes the language {0} Turing Machines versus DFAs TM can both write

More information

CSE 135: Introduction to Theory of Computation Decidability and Recognizability

CSE 135: Introduction to Theory of Computation Decidability and Recognizability CSE 135: Introduction to Theory of Computation Decidability and Recognizability Sungjin Im University of California, Merced 04-28, 30-2014 High-Level Descriptions of Computation Instead of giving a Turing

More information

Lecture summary for Theory of Computation

Lecture summary for Theory of Computation Lecture summary for Theory of Computation Sandeep Sen 1 January 8, 2015 1 Department of Computer Science and Engineering, IIT Delhi, New Delhi 110016, India. E- mail:ssen@cse.iitd.ernet.in Contents 1 The

More information

Computability Theory

Computability Theory CSC 438F/2404F Notes (S. Cook and T. Pitassi) Fall, 2014 Computability Theory This section is partly inspired by the material in A Course in Mathematical Logic by Bell and Machover, Chap 6, sections 1-10.

More information

6.080 / 6.089 Great Ideas in Theoretical Computer Science Spring 2008

6.080 / 6.089 Great Ideas in Theoretical Computer Science Spring 2008 MIT OpenCourseWare http://ocw.mit.edu 6.080 / 6.089 Great Ideas in Theoretical Computer Science Spring 2008 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.

More information

Introduction to Automata Theory. Reading: Chapter 1

Introduction to Automata Theory. Reading: Chapter 1 Introduction to Automata Theory Reading: Chapter 1 1 What is Automata Theory? Study of abstract computing devices, or machines Automaton = an abstract computing device Note: A device need not even be a

More information

Notes on Complexity Theory Last updated: August, 2011. Lecture 1

Notes on Complexity Theory Last updated: August, 2011. Lecture 1 Notes on Complexity Theory Last updated: August, 2011 Jonathan Katz Lecture 1 1 Turing Machines I assume that most students have encountered Turing machines before. (Students who have not may want to look

More information

Properties of Stabilizing Computations

Properties of Stabilizing Computations Theory and Applications of Mathematics & Computer Science 5 (1) (2015) 71 93 Properties of Stabilizing Computations Mark Burgin a a University of California, Los Angeles 405 Hilgard Ave. Los Angeles, CA

More information

Finite Automata. Reading: Chapter 2

Finite Automata. Reading: Chapter 2 Finite Automata Reading: Chapter 2 1 Finite Automata Informally, a state machine that comprehensively captures all possible states and transitions that a machine can take while responding to a stream (or

More information

Lecture 2: Universality

Lecture 2: Universality CS 710: Complexity Theory 1/21/2010 Lecture 2: Universality Instructor: Dieter van Melkebeek Scribe: Tyson Williams In this lecture, we introduce the notion of a universal machine, develop efficient universal

More information

Theory of Computation Class Notes 1

Theory of Computation Class Notes 1 Theory of Computation Class Notes 1 1 based on the books by Sudkamp and by Hopcroft, Motwani and Ullman ii Contents 1 Introduction 1 1.1 Sets.............................................. 1 1.2 Functions

More information

1 if 1 x 0 1 if 0 x 1

1 if 1 x 0 1 if 0 x 1 Chapter 3 Continuity In this chapter we begin by defining the fundamental notion of continuity for real valued functions of a single real variable. When trying to decide whether a given function is or

More information

How To Compare A Markov Algorithm To A Turing Machine

How To Compare A Markov Algorithm To A Turing Machine Markov Algorithm CHEN Yuanmi December 18, 2007 1 Abstract Markov Algorithm can be understood as a priority string rewriting system. In this short paper we give the definition of Markov algorithm and also

More information

Finite Automata and Regular Languages

Finite Automata and Regular Languages CHAPTER 3 Finite Automata and Regular Languages 3. Introduction 3.. States and Automata A finite-state machine or finite automaton (the noun comes from the Greek; the singular is automaton, the Greek-derived

More information

Regular Expressions with Nested Levels of Back Referencing Form a Hierarchy

Regular Expressions with Nested Levels of Back Referencing Form a Hierarchy Regular Expressions with Nested Levels of Back Referencing Form a Hierarchy Kim S. Larsen Odense University Abstract For many years, regular expressions with back referencing have been used in a variety

More information

Handout #1: Mathematical Reasoning

Handout #1: Mathematical Reasoning Math 101 Rumbos Spring 2010 1 Handout #1: Mathematical Reasoning 1 Propositional Logic A proposition is a mathematical statement that it is either true or false; that is, a statement whose certainty or

More information

ω-automata Automata that accept (or reject) words of infinite length. Languages of infinite words appear:

ω-automata Automata that accept (or reject) words of infinite length. Languages of infinite words appear: ω-automata ω-automata Automata that accept (or reject) words of infinite length. Languages of infinite words appear: in verification, as encodings of non-terminating executions of a program. in arithmetic,

More information

Pushdown Automata. International PhD School in Formal Languages and Applications Rovira i Virgili University Tarragona, Spain

Pushdown Automata. International PhD School in Formal Languages and Applications Rovira i Virgili University Tarragona, Spain Pushdown Automata transparencies made for a course at the International PhD School in Formal Languages and Applications Rovira i Virgili University Tarragona, Spain Hendrik Jan Hoogeboom, Leiden http://www.liacs.nl/

More information

Turing Machines, Part I

Turing Machines, Part I Turing Machines, Part I Languages The $64,000 Question What is a language? What is a class of languages? Computer Science Theory 2 1 Now our picture looks like Context Free Languages Deterministic Context

More information

a 11 x 1 + a 12 x 2 + + a 1n x n = b 1 a 21 x 1 + a 22 x 2 + + a 2n x n = b 2.

a 11 x 1 + a 12 x 2 + + a 1n x n = b 1 a 21 x 1 + a 22 x 2 + + a 2n x n = b 2. Chapter 1 LINEAR EQUATIONS 1.1 Introduction to linear equations A linear equation in n unknowns x 1, x,, x n is an equation of the form a 1 x 1 + a x + + a n x n = b, where a 1, a,..., a n, b are given

More information

Introduction to Turing Machines

Introduction to Turing Machines Automata Theory, Languages and Computation - Mírian Halfeld-Ferrari p. 1/2 Introduction to Turing Machines SITE : http://www.sir.blois.univ-tours.fr/ mirian/ Automata Theory, Languages and Computation

More information

Increasing Interaction and Support in the Formal Languages and Automata Theory Course

Increasing Interaction and Support in the Formal Languages and Automata Theory Course Increasing Interaction and Support in the Formal Languages and Automata Theory Course Susan H. Rodger Duke University ITiCSE 2007 June 25, 2007 Supported by NSF Grant DUE 0442513. Outline Overview of JFLAP

More information

Finite Automata and Formal Languages

Finite Automata and Formal Languages Finite Automata and Formal Languages TMV026/DIT321 LP4 2011 Ana Bove Lecture 1 March 21st 2011 Course Organisation Overview of the Course Overview of today s lecture: Course Organisation Level: This course

More information

WRITING PROOFS. Christopher Heil Georgia Institute of Technology

WRITING PROOFS. Christopher Heil Georgia Institute of Technology WRITING PROOFS Christopher Heil Georgia Institute of Technology A theorem is just a statement of fact A proof of the theorem is a logical explanation of why the theorem is true Many theorems have this

More information

The Prime Numbers. Definition. A prime number is a positive integer with exactly two positive divisors.

The Prime Numbers. Definition. A prime number is a positive integer with exactly two positive divisors. The Prime Numbers Before starting our study of primes, we record the following important lemma. Recall that integers a, b are said to be relatively prime if gcd(a, b) = 1. Lemma (Euclid s Lemma). If gcd(a,

More information

CS 3719 (Theory of Computation and Algorithms) Lecture 4

CS 3719 (Theory of Computation and Algorithms) Lecture 4 CS 3719 (Theory of Computation and Algorithms) Lecture 4 Antonina Kolokolova January 18, 2012 1 Undecidable languages 1.1 Church-Turing thesis Let s recap how it all started. In 1990, Hilbert stated a

More information

Automata Theory. Şubat 2006 Tuğrul Yılmaz Ankara Üniversitesi

Automata Theory. Şubat 2006 Tuğrul Yılmaz Ankara Üniversitesi Automata Theory Automata theory is the study of abstract computing devices. A. M. Turing studied an abstract machine that had all the capabilities of today s computers. Turing s goal was to describe the

More information

Using Hands-On Visualizations to Teach Computer Science from Beginning Courses to Advanced Courses

Using Hands-On Visualizations to Teach Computer Science from Beginning Courses to Advanced Courses Using Hands-On Visualizations to Teach Computer Science from Beginning Courses to Advanced Courses Susan H. Rodger Department of Computer Science Duke University Durham, NC 27705 rodger@cs.duke.edu Abstract

More information

Course Manual Automata & Complexity 2015

Course Manual Automata & Complexity 2015 Course Manual Automata & Complexity 2015 Course code: Course homepage: Coordinator: Teachers lectures: Teacher exercise classes: Credits: X_401049 http://www.cs.vu.nl/~tcs/ac prof. dr. W.J. Fokkink home:

More information

Genetic programming with regular expressions

Genetic programming with regular expressions Genetic programming with regular expressions Børge Svingen Chief Technology Officer, Open AdExchange bsvingen@openadex.com 2009-03-23 Pattern discovery Pattern discovery: Recognizing patterns that characterize

More information

So let us begin our quest to find the holy grail of real analysis.

So let us begin our quest to find the holy grail of real analysis. 1 Section 5.2 The Complete Ordered Field: Purpose of Section We present an axiomatic description of the real numbers as a complete ordered field. The axioms which describe the arithmetic of the real numbers

More information

Computer Architecture Syllabus of Qualifying Examination

Computer Architecture Syllabus of Qualifying Examination Computer Architecture Syllabus of Qualifying Examination PhD in Engineering with a focus in Computer Science Reference course: CS 5200 Computer Architecture, College of EAS, UCCS Created by Prof. Xiaobo

More information

On Winning Conditions of High Borel Complexity in Pushdown Games

On Winning Conditions of High Borel Complexity in Pushdown Games Fundamenta Informaticae (2005) 1 22 1 IOS Press On Winning Conditions of High Borel Complexity in Pushdown Games Olivier Finkel Equipe de Logique Mathématique U.F.R. de Mathématiques, Université Paris

More information

Continued Fractions and the Euclidean Algorithm

Continued Fractions and the Euclidean Algorithm Continued Fractions and the Euclidean Algorithm Lecture notes prepared for MATH 326, Spring 997 Department of Mathematics and Statistics University at Albany William F Hammond Table of Contents Introduction

More information

7 Relations and Functions

7 Relations and Functions 7 Relations and Functions In this section, we introduce the concept of relations and functions. Relations A relation R from a set A to a set B is a set of ordered pairs (a, b), where a is a member of A,

More information

Learning Analysis by Reduction from Positive Data

Learning Analysis by Reduction from Positive Data Learning Analysis by Reduction from Positive Data František Mráz 1, Friedrich Otto 1, and Martin Plátek 2 1 Fachbereich Mathematik/Informatik, Universität Kassel 34109 Kassel, Germany {mraz,otto}@theory.informatik.uni-kassel.de

More information

Fundamentele Informatica II

Fundamentele Informatica II Fundamentele Informatica II Answer to selected exercises 1 John C Martin: Introduction to Languages and the Theory of Computation M.M. Bonsangue (and J. Kleijn) Fall 2011 Let L be a language. It is clear

More information

Elementary Number Theory and Methods of Proof. CSE 215, Foundations of Computer Science Stony Brook University http://www.cs.stonybrook.

Elementary Number Theory and Methods of Proof. CSE 215, Foundations of Computer Science Stony Brook University http://www.cs.stonybrook. Elementary Number Theory and Methods of Proof CSE 215, Foundations of Computer Science Stony Brook University http://www.cs.stonybrook.edu/~cse215 1 Number theory Properties: 2 Properties of integers (whole

More information

Modeling of Graph and Automaton in Database

Modeling of Graph and Automaton in Database 1, 2 Modeling of Graph and Automaton in Database Shoji Miyanaga 1, 2 Table scheme that relational database provides can model the structure of graph which consists of vertices and edges. Recent database

More information

14.1 Rent-or-buy problem

14.1 Rent-or-buy problem CS787: Advanced Algorithms Lecture 14: Online algorithms We now shift focus to a different kind of algorithmic problem where we need to perform some optimization without knowing the input in advance. Algorithms

More information

Formal Grammars and Languages

Formal Grammars and Languages Formal Grammars and Languages Tao Jiang Department of Computer Science McMaster University Hamilton, Ontario L8S 4K1, Canada Bala Ravikumar Department of Computer Science University of Rhode Island Kingston,

More information

8 Divisibility and prime numbers

8 Divisibility and prime numbers 8 Divisibility and prime numbers 8.1 Divisibility In this short section we extend the concept of a multiple from the natural numbers to the integers. We also summarize several other terms that express

More information

MATH10040 Chapter 2: Prime and relatively prime numbers

MATH10040 Chapter 2: Prime and relatively prime numbers MATH10040 Chapter 2: Prime and relatively prime numbers Recall the basic definition: 1. Prime numbers Definition 1.1. Recall that a positive integer is said to be prime if it has precisely two positive

More information

24 Uses of Turing Machines

24 Uses of Turing Machines Formal Language and Automata Theory: CS2004 24 Uses of Turing Machines 24 Introduction We have previously covered the application of Turing Machine as a recognizer and decider In this lecture we will discuss

More information

Regular Languages and Finite Automata

Regular Languages and Finite Automata Regular Languages and Finite Automata A C Norman, Lent Term 1996 Part IA 1 Introduction This course is short, but it is present in Part 1A because of the way it introduces links between many different

More information

CS143 Handout 08 Summer 2008 July 02, 2007 Bottom-Up Parsing

CS143 Handout 08 Summer 2008 July 02, 2007 Bottom-Up Parsing CS143 Handout 08 Summer 2008 July 02, 2007 Bottom-Up Parsing Handout written by Maggie Johnson and revised by Julie Zelenski. Bottom-up parsing As the name suggests, bottom-up parsing works in the opposite

More information

An example of a computable

An example of a computable An example of a computable absolutely normal number Verónica Becher Santiago Figueira Abstract The first example of an absolutely normal number was given by Sierpinski in 96, twenty years before the concept

More information

NFAs with Tagged Transitions, their Conversion to Deterministic Automata and Application to Regular Expressions

NFAs with Tagged Transitions, their Conversion to Deterministic Automata and Application to Regular Expressions NFAs with Tagged Transitions, their Conversion to Deterministic Automata and Application to Regular Expressions Ville Laurikari Helsinki University of Technology Laboratory of Computer Science PL 9700,

More information

The Optimum One-Pass Strategy for Juliet

The Optimum One-Pass Strategy for Juliet Master s Thesis One-Pass Strategies for Context-Free Games Christian Cöster August 2015 Examiners: Prof. Dr. Thomas Schwentick Prof. Dr. Christoph Buchheim Technische Universität Dortmund Fakultät für

More information

Kevin James. MTHSC 412 Section 2.4 Prime Factors and Greatest Comm

Kevin James. MTHSC 412 Section 2.4 Prime Factors and Greatest Comm MTHSC 412 Section 2.4 Prime Factors and Greatest Common Divisor Greatest Common Divisor Definition Suppose that a, b Z. Then we say that d Z is a greatest common divisor (gcd) of a and b if the following

More information

Two-dimensional Languages

Two-dimensional Languages Charles University Faculty of Mathematics and Physics Mgr. Daniel Průša Two-dimensional Languages Doctoral Thesis Supervisor: Martin Plátek, CSc. Prague, 2004 Acknowledgements The results presented in

More information

Section 4.2: The Division Algorithm and Greatest Common Divisors

Section 4.2: The Division Algorithm and Greatest Common Divisors Section 4.2: The Division Algorithm and Greatest Common Divisors The Division Algorithm The Division Algorithm is merely long division restated as an equation. For example, the division 29 r. 20 32 948

More information

COUNTING SUBSETS OF A SET: COMBINATIONS

COUNTING SUBSETS OF A SET: COMBINATIONS COUNTING SUBSETS OF A SET: COMBINATIONS DEFINITION 1: Let n, r be nonnegative integers with r n. An r-combination of a set of n elements is a subset of r of the n elements. EXAMPLE 1: Let S {a, b, c, d}.

More information

CHAPTER 5. Number Theory. 1. Integers and Division. Discussion

CHAPTER 5. Number Theory. 1. Integers and Division. Discussion CHAPTER 5 Number Theory 1. Integers and Division 1.1. Divisibility. Definition 1.1.1. Given two integers a and b we say a divides b if there is an integer c such that b = ac. If a divides b, we write a

More information

CS 301 Course Information

CS 301 Course Information CS 301: Languages and Automata January 9, 2009 CS 301 Course Information Prof. Robert H. Sloan Handout 1 Lecture: Tuesday Thursday, 2:00 3:15, LC A5 Weekly Problem Session: Wednesday, 4:00 4:50 p.m., LC

More information

Cartesian Products and Relations

Cartesian Products and Relations Cartesian Products and Relations Definition (Cartesian product) If A and B are sets, the Cartesian product of A and B is the set A B = {(a, b) :(a A) and (b B)}. The following points are worth special

More information

Overview. Essential Questions. Precalculus, Quarter 4, Unit 4.5 Build Arithmetic and Geometric Sequences and Series

Overview. Essential Questions. Precalculus, Quarter 4, Unit 4.5 Build Arithmetic and Geometric Sequences and Series Sequences and Series Overview Number of instruction days: 4 6 (1 day = 53 minutes) Content to Be Learned Write arithmetic and geometric sequences both recursively and with an explicit formula, use them

More information

T-79.186 Reactive Systems: Introduction and Finite State Automata

T-79.186 Reactive Systems: Introduction and Finite State Automata T-79.186 Reactive Systems: Introduction and Finite State Automata Timo Latvala 14.1.2004 Reactive Systems: Introduction and Finite State Automata 1-1 Reactive Systems Reactive systems are a class of software

More information

CS 103X: Discrete Structures Homework Assignment 3 Solutions

CS 103X: Discrete Structures Homework Assignment 3 Solutions CS 103X: Discrete Structures Homework Assignment 3 s Exercise 1 (20 points). On well-ordering and induction: (a) Prove the induction principle from the well-ordering principle. (b) Prove the well-ordering

More information

Computationally Complete Spiking Neural P Systems Without Delay: Two Types of Neurons Are Enough

Computationally Complete Spiking Neural P Systems Without Delay: Two Types of Neurons Are Enough Computationally Complete Spiking Neural P Systems Without Delay: Two Types of Neurons Are Enough Rudolf Freund 1 and Marian Kogler 1,2 1 Faculty of Informatics, Vienna University of Technology Favoritenstr.

More information