# Context Free and Non Context Free Languages

Save this PDF as:

Size: px
Start display at page:

## Transcription

1 Context Free and Non Context Free Languages

2 Part I: Pumping Theorem for Context Free Languages

3 Context Free Languages and Push Down Automata Theorems For Every Context Free Grammar there Exists an Equivalent Push Down Automata. For Every Push Down Automata There Exist an Equivalent Context Free Grammar. BIG QUESTION Given a Language L, Determine Whether or Not L is Context Free. Examples L = {a n b n n 0} -- Context Free L = {a n b n c n n 0} -- Not Context Free

4 Observations on Context Free Languages Every Regular Language is Context Free -- 2 Proofs Context Free Languages are Countable -- 2 Proofs

5 Pumping Theorem for Regular Languages Pumping Theorem: Let M = {Q, Σ, δ, q 0, F} be a DFSA and let x L(M ) with x Q. Then there are strings u,v, w such that x = uvw u v Q v 1 u v k w L(M ) k = 0,1, 2,

6 Pumping Theorem for Context Free Languages Pumping Theorem: Let L be a Context Free Grammar. There is an integer k 1 such that for all strings w L with w k, there exist strings u, v, x, y, z such that w = uvxyz ª v ε and y ε vxy k uv q xy q z L for all q 0

7 Example Proposition: L = {a n b n c n n 0} is Not Context Free Proof: Suppose L is Context Free. Let w = a n b n c n for n k. By the Pumping Theorem w = uvxyz ª v ε and y ε vxy k uv q xy q z L for all q 0 Case 1: v or y contain a single character -- Impossible. Pump with q = 2. Not all symbols appear equally often. Case 2: v or y contain two different characters -- Impossible. Pump with q = 2. A symbol will appear out of order.

8 Trees Definitions Height -- Longest Path in a Tree Branching Factor = Maximum Number of Children for any Node Yield = Number of Leaf Nodes Theorem: Yield (Branching Factor) Height Proof: By Induction on Height.

9 Pumping Theorem for Context Free Languages Pumping Theorem: Let L be a Context Free Grammar. There is an integer k 1 such that for all strings w L with w k, there exist strings u, v, x, y, z such that w = uvxyz ª v ε or y ε vxy k uv q xy q z L for all q 0

10 Proof of Pumping Theorem for Context Free Languages Let G = { N, Σ,R,S} be a context free grammar, and let w L(G). If no non-terminal appears twice along a path in the parse tree for w, then NonTerminal Symbols w = Yield (Branching Factor) w > (Branching Factor) NonTerminal Symbols a non-terminal X must appear at least twice on the same path in the parse tree for w. Thus S u X z uv X yz uvxyz = w X vx y and X x Consequences S u X z ux z, so ux z L(G) S u X z uv X yz uv p X y p z uv p x y p z, so uv p x y p z L(G) v ε or y ε (Take the smallest parse tree for w.) NonTerminal Symbols vxy (Branching Factor) -- X vx y v x y and no non-terminal appears twice.

11 Closure Properties of Regular Languages 1. The Union, Concatenation, and Star of Regular Languages is Regular Build the Corresponding Non-Deterministic Finite State Automata 2. Every Finite Language is Regular L = s 1 s n 3. The Complement of a Regular Language is Regular Build the Complementary Deterministic Finite State Automata Exchange Accepting and Non-Accepting States 4. The Intersection of Two Regular Languages is Regular L 1 L 2 = ( c c L 1 L2 ) c 5. The Difference of Two Regular Languages is Regular L 1 L 2 = L 1 L 2 c

12 Closure Properties of Context Free Languages 1. The Union of Two Context Free Languages is Context Free Build Union of Grammars S S 1 and S S 2 2. The Concatenation of Two Context Free Languages is Context Free Concatenate Two Grammars S S 1 S 2 3. The Kleene Star of Two Context Free Languages is Context Free Star Two Grammars S ε and S S S 1 4. The Reverse of Two Context Free Languages is Context Free Use Chomsky Normal Form Replace X BC by X C B

13 Non Closure Properties of Context Free Languages 1. The Intersection of Two Context Free Languages Need NOT be Context Free L 1 = {a n b n c m } and L 2 = {a n b m c m } -- Context Free L 1 L 2 = {a p b p c p } -- Not Context Free 2. The Complement of Two Context Free Languages Need NOT be Context Free L 1 L 2 = ( c c L 1 L2 ) c -- Contradicts 1 3. The Difference of Two Context Free Languages Need NOT be Context Free L c = Σ L -- Contradicts 2

14 Closure Properties of Context Free and Regular Languages 1. The Intersection of a Context Free Language and a Regular Language is Context Free L(M ) = L 1 and L(N) = L 2, then L(M N ) = L 1 L 2 where F = F 1 F 2 Only One Stack 2. The Difference Between a Context Free Language and a Regular Language is Context Free c L 1 L 2 = L 1 L 2 Complement of a Regular Language is Regular

15 Examples 1. Removing a Finite Number of Strings F from a Context Free Language L Generates a Context Free Language L F is Context Free because F is Regular 2. L = {w {a,b,c} Number of a's = Number of b 's = Number c' s} is NOT Context Free L {a b c } = {an b n c n } Context Free Regular Not Context Free

16 Part II: Deterministic Context Free Languages

17 Deterministic Push Down Automata Deterministic PDA M = {Q, Σ, Γ,δ, q 0, F} -- Σ = Input Symbols Γ = Stack Symbols -- Q = States -- q 0 = Initial State -- F = Final (Accepting) States Q -- δ :Q Σ {ε} Γ = Q Γ = Deterministic Transition Functions pop push -- Transition to Next State and Next Stack is Unique -- No Transitions Out of an Accepting State Must Consume either an Input Symbol or Symbols from the Stack Must Accept when Can Accept

18 Deterministic Context Free Languages Deterministic Context Free Language Language Accepted by a Deterministic Push Down Automata End of String Symbol \$ Required Example L = a {a n b n n 0} Need End of String Symbol

19 Closure Properties of Regular Languages 1. Union 2. Concatenation 3. Star 4. Complement 5. Intersection 6. Difference

20 Closure Properties of Deterministic Context Free Languages Closure Complement Proof: See Appendix D.2 -- Tedious and Unenlightening Non Closure Union Intersection

21 CounterExample: Intersection L 1 = {a i b j c k i = j} -- Deterministic Context Free L 2 = {a i b j c k j = k} -- Deterministic Context Free L 1 L 2 = {a n b n c n } -- Not Context Free

22 CounterExample: Union L 1 = {a i b j c k i j} -- Deterministic Context Free L 2 = {a i b j c k j k} -- Deterministic Context Free L = L 1 L 2 = {a i b j c k i j or j k} -- Union L c = {a i b j c k i = j = k} {(a,b,c) out of order} -- Complement L = L c a b c = {a n b n c n n 0} -- Intersection with Regular Expression -- But Not Context Free L Deterministic Context Free L c Deterministic Context Free L Context Free Contradiction

23 CounterExample: Union and Ambiguity Inherently Ambiguous Language -- NO Unambiguous Grammar. {a i b j c k i = j or j = k} = {a i b i c k } {a i b k c k } Ambiguous Grammar from Union of Two Unambiguous Grammars S S 1 S S 2 S 1 S 1 c S 2 as 2 S 1 A S 2 B A a Ab B b Bc A ε B ε {a i b i c k } {ai b j c j } {a i b i c i }

24 Part III: Hierarchy of Languages

25 Hierarchy of Languages Theorem: The following Languages are Proper Subsets of Each Other: Regular Deterministic Context Free Inherently Unambiguous Context Free Context Free Proof: See the Following Theorems.

26 Theorems 1. There Exist Context Free Languages that are Not Deterministic Context Free. 1a. There Exist Non Deterministic Push Down Automata for which there is no Equivalent Deterministic Push Down Automata. 2. Every Determinist Context Free Language is a Context Free Language. 2a. Every Deterministic Push Down Automata can be Simulated by a Non Deterministic Push Down Automata.

27 Theorem: Every Determinist Context Free Language L is a Context Free Language. Proof: Let M be a Deterministic PDA that recognize L\$. Build a PDA M = M 1 M 2 to recognize L: M 1 = M without \$ transitions -- Do NOT mark any state of M 1 as Accepting M 2 M with only the ε -transitions (Reads no input symbols) For each \$ transition in M, insert an ε -transition from M 1 to M 2 For each accepting state A in M, make A an accepting state of M 2 M recognizes L\$ M recognize L.

28 Theorem: There Exist Context Free Languages that are Not Deterministic Context Free Languages. Proof: Consider L = {a i b j c k i j or j k} -- Context Free L c = {a i b j c k i = j = k} {(a,b,c) out of order} -- Complement L = L c a b c = {a n b n c n n 0} -- Intersection of L c with Regular Language L Deterministic Context Free L c Deterministic Context Free L c Context Free L Context Free. Contradiction

29 More Theorems 1. Every Regular Language is Deterministic Context Free. 1a. Every Finite State Automaton is a Deterministic Push Down Automaton 2. There Exist Deterministic Context Free Languages that are NOT Regular. 2a. There Exist Deterministic Push Down Automata for which there is no Equivalent Finite State Automaton.

30 More Theorems 1. Every Deterministic Context Free Grammar has an Unambiguous Grammar. 2. There Exist Inherently Unambiguous Context Free Languages that are NOT Deterministic.

31 Theorem: Every Deterministic Context Free Grammar L has an Unambiguous Grammar. Proof: Recall: For Every Push Down Automata M There Exist an Equivalent Context Free Grammar G. Therefore M Recognizes L\$ G Generates L\$ But M Deterministic G is Unambiguous (Tedious -- See Appendix D.2) Hence Replacing \$ by ε in G G generates L

32 Hierarchy of Languages Theorem: The following Languages are Proper Subsets of Each Other: Regular Deterministic Context Free Inherently Unambiguous Context Free Context Free Proof: See the Previous Theorems.

33 Hierarchy of Languages -- Examples Deterministic Context Free, but NOT Regular L = {a n b n n 0} Inherently Unambiguous but NOT Deterministic Context Free L = {a n b n c m d m,n 0} {a n b m c m e m, n 0} Context Free but NOT Inherently Unambiguous L = {a i b j c k (i, j,k 0) and (i = j or j = k)} = {a i b i c k } {a i b k c k } Not Context Free L = {a n b n c n n 0}

### Deterministic Push-Down Store Automata

Deterministic Push-Down tore Automata 1 Context-Free Languages A B C D... A w 0 w 1 D...E The languagea n b n : a b ab 2 Finite-tate Automata 3 Pushdown Automata Pushdown automata (pda s) is an fsa with

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

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

### Regular Expressions. Languages. Recall. A language is a set of strings made up of symbols from a given alphabet. Computer Science Theory 2

Regular Expressions Languages Recall. A language is a set of strings made up of symbols from a given alphabet. Computer Science Theory 2 1 String Recognition Machine Given a string and a definition of

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

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

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

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

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

CPS 140 - Mathematical Foundations of CS Dr. S. Rodger Section: Properties of Context-Free Languages èhandoutè Section 3.5 Which of the following languages are CFL? æ L=fa n b n c j j 0 énçjg æ L=fa n

### Finite Automata and Formal Languages

Finite Automata and Formal Languages TMV026/DIT321 LP4 2011 Lecture 14 May 19th 2011 Overview of today s lecture: Turing Machines Push-down Automata Overview of the Course Undecidable and Intractable Problems

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

### INSTITUTE OF AERONAUTICAL ENGINEERING

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

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

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

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

### Theory of Computation

Theory of Computation For Computer Science & Information Technology By www.thegateacademy.com Syllabus Syllabus for Theory of Computation Regular Expressions and Finite Automata, Context-Free Grammar s

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

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

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

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

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

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

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

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

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

### ASSIGNMENT ONE SOLUTIONS MATH 4805 / COMP 4805 / MATH 5605

ASSIGNMENT ONE SOLUTIONS MATH 4805 / COMP 4805 / MATH 5605 (1) (a) (0 + 1) 010 (finite automata below). (b) First observe that the following regular expression generates the binary strings with an even

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

### Automata and Rational Numbers

Automata and Rational Numbers Jeffrey Shallit School of Computer Science University of Waterloo Waterloo, Ontario N2L 3G1 Canada shallit@cs.uwaterloo.ca http://www.cs.uwaterloo.ca/~shallit 1/40 Representations

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

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

### Lights and Darks of the Star-Free Star

Lights and Darks of the Star-Free Star Edward Ochmański & Krystyna Stawikowska Nicolaus Copernicus University, Toruń, Poland Introduction: star may destroy recognizability In (finitely generated) trace

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

### 1. Prove that the empty set is a subset of every set.

1. Prove that the empty set is a subset of every set. Basic Topology Written by Men-Gen Tsai email: b89902089@ntu.edu.tw Proof: For any element x of the empty set, x is also an element of every set since

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

### Computing Functions with Turing Machines

CS 30 - Lecture 20 Combining Turing Machines and Turing s Thesis Fall 2008 Review Languages and Grammars Alphabets, strings, languages Regular Languages Deterministic Finite and Nondeterministic Automata

### ω-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,

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

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

### Motivation. Automata = abstract computing devices. Turing studied Turing Machines (= computers) before there were any real computers

Motivation Automata = abstract computing devices Turing studied Turing Machines (= computers) before there were any real computers We will also look at simpler devices than Turing machines (Finite State

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

### OHJ-2306 Fall 2011 Introduction to Theoretical Computer Science

1 OHJ-2306 Fall 2011 Introduction to Theoretical Computer Science 2 3 Organization & timetable Lectures: prof. Tapio Elomaa, M.Sc. Timo Aho Tue and Thu 14 16 TB220 Aug. 30 Dec. 8, 2011 Exceptions: Thu

### CS 164 Programming Languages and Compilers Handout 8. Midterm I

Mterm I Please read all instructions (including these) carefully. There are six questions on the exam, each worth between 15 and 30 points. You have 3 hours to work on the exam. The exam is closed book,

### Lecture 2: Regular Languages [Fa 14]

Caveat lector: This is the first edition of this lecture note. Please send bug reports and suggestions to jeffe@illinois.edu. But the Lord came down to see the city and the tower the people were building.

### PART I. THE REAL NUMBERS

PART I. THE REAL NUMBERS This material assumes that you are already familiar with the real number system and the representation of the real numbers as points on the real line. I.1. THE NATURAL NUMBERS

### A First Investigation of Sturmian Trees

A First Investigation of Sturmian Trees Jean Berstel 2, Luc Boasson 1 Olivier Carton 1, Isabelle Fagnot 2 1 LIAFA, CNRS Université Paris 7 2 IGM, CNRS Université de Marne-la-Vallée Atelier de Combinatoire,

### Full and Complete Binary Trees

Full and Complete Binary Trees Binary Tree Theorems 1 Here are two important types of binary trees. Note that the definitions, while similar, are logically independent. Definition: a binary tree T is full

### Cardinality. The set of all finite strings over the alphabet of lowercase letters is countable. The set of real numbers R is an uncountable set.

Section 2.5 Cardinality (another) Definition: The cardinality of a set A is equal to the cardinality of a set B, denoted A = B, if and only if there is a bijection from A to B. If there is an injection

### Bottom-Up Parsing. An Introductory Example

Bottom-Up Parsing Bottom-up parsing is more general than top-down parsing Just as efficient Builds on ideas in top-down parsing Bottom-up is the preferred method in practice Reading: Section 4.5 An Introductory

### A Brief History of Strahler Numbers

A Brief History of Strahler Numbers Javier Esparza Michael Luttenberger Maximilian Schlund Technical University of Munich Robert E. Horton (945) Robert E. Horton (945) Which is the main stream of a stream

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

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

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

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

### SOLUTIONS TO ASSIGNMENT 1 MATH 576

SOLUTIONS TO ASSIGNMENT 1 MATH 576 SOLUTIONS BY OLIVIER MARTIN 13 #5. Let T be the topology generated by A on X. We want to show T = J B J where B is the set of all topologies J on X with A J. This amounts

### Classification/Decision Trees (II)

Classification/Decision Trees (II) Department of Statistics The Pennsylvania State University Email: jiali@stat.psu.edu Right Sized Trees Let the expected misclassification rate of a tree T be R (T ).

### Ambiguity, closure properties, Overview of ambiguity, and Chomsky s standard form

Ambiguity, closure properties, and Chomsky s normal form Overview of ambiguity, and Chomsky s standard form The notion of ambiguity Convention: we assume that in every substitution, the leftmost remaining

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

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

### Lecture 1: Time Complexity

Computational Complexity Theory, Fall 2010 August 25 Lecture 1: Time Complexity Lecturer: Peter Bro Miltersen Scribe: Søren Valentin Haagerup 1 Introduction to the course The field of Computational Complexity

### SOLUTION Trial Test Grammar & Parsing Deficiency Course for the Master in Software Technology Programme Utrecht University

SOLUTION Trial Test Grammar & Parsing Deficiency Course for the Master in Software Technology Programme Utrecht University Year 2004/2005 1. (a) LM is a language that consists of sentences of L continued

### 26 Integers: Multiplication, Division, and Order

26 Integers: Multiplication, Division, and Order Integer multiplication and division are extensions of whole number multiplication and division. In multiplying and dividing integers, the one new issue

### 4.6 The Primitive Recursive Functions

4.6. THE PRIMITIVE RECURSIVE FUNCTIONS 309 4.6 The Primitive Recursive Functions The class of primitive recursive functions is defined in terms of base functions and closure operations. Definition 4.6.1

### Open and Closed Sets

Open and Closed Sets Definition: A subset S of a metric space (X, d) is open if it contains an open ball about each of its points i.e., if x S : ɛ > 0 : B(x, ɛ) S. (1) Theorem: (O1) and X are open sets.

### GROUPS SUBGROUPS. Definition 1: An operation on a set G is a function : G G G.

Definition 1: GROUPS An operation on a set G is a function : G G G. Definition 2: A group is a set G which is equipped with an operation and a special element e G, called the identity, such that (i) the

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

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

### Automata, languages, and grammars

Automata, languages, and grammars Cristopher Moore January 24, 2015 Abstract These lecture notes are intended as a supplement to Moore and Mertens The Nature of Computation, and are available to anyone

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

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

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

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

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

### Introduction to Theory of Computation

Introduction to Theory of Computation Prof. (Dr.) K.R. Chowdhary Email: kr.chowdhary@iitj.ac.in Formerly at department of Computer Science and Engineering MBM Engineering College, Jodhpur Tuesday 28 th

### A Problem With The Rational Numbers

Solvability of Equations Solvability of Equations 1. In fields, linear equations ax + b = 0 are solvable. Solvability of Equations 1. In fields, linear equations ax + b = 0 are solvable. 2. Quadratic equations

### A single register, called the accumulator, stores the. operand before the operation, and stores the result. Add y # add y from memory to the acc

Other architectures Example. Accumulator-based machines A single register, called the accumulator, stores the operand before the operation, and stores the result after the operation. Load x # into acc

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

### I. GROUPS: BASIC DEFINITIONS AND EXAMPLES

I GROUPS: BASIC DEFINITIONS AND EXAMPLES Definition 1: An operation on a set G is a function : G G G Definition 2: A group is a set G which is equipped with an operation and a special element e G, called

### 3. Equivalence Relations. Discussion

3. EQUIVALENCE RELATIONS 33 3. Equivalence Relations 3.1. Definition of an Equivalence Relations. Definition 3.1.1. A relation R on a set A is an equivalence relation if and only if R is reflexive, symmetric,

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

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

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

### 5.1 Commutative rings; Integral Domains

5.1 J.A.Beachy 1 5.1 Commutative rings; Integral Domains from A Study Guide for Beginner s by J.A.Beachy, a supplement to Abstract Algebra by Beachy / Blair 23. Let R be a commutative ring. Prove the following

### Turing Machine and the Conceptual Problems of Computational Theory

Research Inventy: International Journal of Engineering And Science Vol.4, Issue 4 (April 204), PP 53-60 Issn (e): 2278-472, Issn (p):239-6483, www.researchinventy.com Turing Machine and the Conceptual

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

### A binary heap is a complete binary tree, where each node has a higher priority than its children. This is called heap-order property

CmSc 250 Intro to Algorithms Chapter 6. Transform and Conquer Binary Heaps 1. Definition A binary heap is a complete binary tree, where each node has a higher priority than its children. This is called

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

### Class Notes CS 3137. 1 Creating and Using a Huffman Code. Ref: Weiss, page 433

Class Notes CS 3137 1 Creating and Using a Huffman Code. Ref: Weiss, page 433 1. FIXED LENGTH CODES: Codes are used to transmit characters over data links. You are probably aware of the ASCII code, a fixed-length

### Introduction Proof by unique factorization in Z Proof with Gaussian integers Proof by geometry Applications. Pythagorean Triples

Pythagorean Triples Keith Conrad University of Connecticut August 4, 008 Introduction We seek positive integers a, b, and c such that a + b = c. Plimpton 3 Babylonian table of Pythagorean triples (1800

### INTRODUCTORY SET THEORY

M.Sc. program in mathematics INTRODUCTORY SET THEORY Katalin Károlyi Department of Applied Analysis, Eötvös Loránd University H-1088 Budapest, Múzeum krt. 6-8. CONTENTS 1. SETS Set, equal sets, subset,

### k, then n = p2α 1 1 pα k

Powers of Integers An integer n is a perfect square if n = m for some integer m. Taking into account the prime factorization, if m = p α 1 1 pα k k, then n = pα 1 1 p α k k. That is, n is a perfect square

### Software Analysis (POPA Sec , )

Software Analysis (POPA Sec. 2.2.2, 2.5-2.5.2) Klaus Ostermann Based on slides by Jurriaan Hage Overview Correctness proof Live Variables Analysis The While language with procedures Live Variables Analysis

### Divisor graphs have arbitrary order and size

Divisor graphs have arbitrary order and size arxiv:math/0606483v1 [math.co] 20 Jun 2006 Le Anh Vinh School of Mathematics University of New South Wales Sydney 2052 Australia Abstract A divisor graph G

### An Exponential Gap between LasVegas and Deterministic Sweeping Finite Automata

An Exponential Gap between LasVegas and Deterministic Sweeping Finite Automata Christos Kapoutsis, Richard Královič, and Tobias Mömke Department of Computer Science, ETH Zürich Abstract. A two-way finite

### CHAPTER 5. Product Measures

54 CHAPTER 5 Product Measures Given two measure spaces, we may construct a natural measure on their Cartesian product; the prototype is the construction of Lebesgue measure on R 2 as the product of Lebesgue

### Applications of Methods of Proof

CHAPTER 4 Applications of Methods of Proof 1. Set Operations 1.1. Set Operations. The set-theoretic operations, intersection, union, and complementation, defined in Chapter 1.1 Introduction to Sets are

### PUTNAM TRAINING POLYNOMIALS. Exercises 1. Find a polynomial with integral coefficients whose zeros include 2 + 5.

PUTNAM TRAINING POLYNOMIALS (Last updated: November 17, 2015) Remark. This is a list of exercises on polynomials. Miguel A. Lerma Exercises 1. Find a polynomial with integral coefficients whose zeros include

### Mildly Context Sensitive Grammar Formalisms

Mildly Context Sensitive Grammar Formalisms Petra Schmidt Pfarrer-Lauer-Strasse 23 66386 St. Ingbert petra.schmidt@edeka-suedwest.de Overview 3 Tree-djoining-Grammars 4 Co 7 8 9 CCG 9 LIG 10 TG 13 Linear