Chomsky and Greibach Normal Forms. Chomsky and Greibach Normal Forms p.1/24

Size: px
Start display at page:

Download "Chomsky and Greibach Normal Forms. Chomsky and Greibach Normal Forms p.1/24"

Transcription

1 Chomsky and Greibach Normal Forms Chomsky and Greibach Normal Forms p.1/24

2 Simplifying a CFG It is often convenient to simplify CFG Chomsky and Greibach Normal Forms p.2/24

3 Simplifying a CFG It is often convenient to simplify CFG One of the simplest and most useful simplified forms of CFG is called the Chomsky normal form Chomsky and Greibach Normal Forms p.2/24

4 Simplifying a CFG It is often convenient to simplify CFG One of the simplest and most useful simplified forms of CFG is called the Chomsky normal form Another normal form usually used in algebraic specifications is Greibach normal form Chomsky and Greibach Normal Forms p.2/24

5 Simplifying a CFG It is often convenient to simplify CFG One of the simplest and most useful simplified forms of CFG is called the Chomsky normal form Another normal form usually used in algebraic specifications is Greibach normal form Note the difference between grammar cleaning and simplification Chomsky and Greibach Normal Forms p.2/24

6 Note Normal forms are useful when more advanced topics in computation theory are approached, as we shall see further Chomsky and Greibach Normal Forms p.3/24

7 Definition A context-free grammar every rule is of the form: is in Chomsky normal form if where is a terminal, are nonterminals, and may not be the start variable (the axiom) Chomsky and Greibach Normal Forms p.4/24

8 Note The rule, where is the start variable, is not excluded from a CFG in Chomsky normal form. Chomsky and Greibach Normal Forms p.5/24

9 Theorem 2.9 Any context-free language is generated by a context-free grammar in Chomsky normal form. Chomsky and Greibach Normal Forms p.6/24

10 Theorem 2.9 Any context-free language is generated by a context-free grammar in Chomsky normal form. Proof idea: Chomsky and Greibach Normal Forms p.6/24

11 Theorem 2.9 Any context-free language is generated by a context-free grammar in Chomsky normal form. Proof idea: Show that any CFG Chomsky normal form can be converted into a CFG in Chomsky and Greibach Normal Forms p.6/24

12 Theorem 2.9 Any context-free language is generated by a context-free grammar in Chomsky normal form. Proof idea: Show that any CFG Chomsky normal form can be converted into a CFG in Conversion procedure has several stages where the rules that violate Chomsky normal form conditions are replaced with equivalent rules that satisfy these conditions Chomsky and Greibach Normal Forms p.6/24

13 Theorem 2.9 Any context-free language is generated by a context-free grammar in Chomsky normal form. Proof idea: Show that any CFG Chomsky normal form can be converted into a CFG in Conversion procedure has several stages where the rules that violate Chomsky normal form conditions are replaced with equivalent rules that satisfy these conditions Order of transformations: (1) add a new start variable, (2) eliminate all -rules, (3) eliminate unit-rules, (4) convert other rules Chomsky and Greibach Normal Forms p.6/24

14 Theorem 2.9 Any context-free language is generated by a context-free grammar in Chomsky normal form. Proof idea: Show that any CFG Chomsky normal form can be converted into a CFG in Conversion procedure has several stages where the rules that violate Chomsky normal form conditions are replaced with equivalent rules that satisfy these conditions Order of transformations: (1) add a new start variable, (2) eliminate all -rules, (3) eliminate unit-rules, (4) convert other rules Check that the obtained CFG defines the same language Chomsky and Greibach Normal Forms p.6/24

15 Proof Let be the original CFG. Chomsky and Greibach Normal Forms p.7/24

16 Proof Let be the original CFG. Step 1: add a new start symbol to, and the rule to Chomsky and Greibach Normal Forms p.7/24

17 Proof Let be the original CFG. Step 1: add a new start symbol to, and the rule to Note: this change guarantees that the start symbol of does not occur on the of any rule Chomsky and Greibach Normal Forms p.7/24

18 Step 2: eliminate -rules Repeat 1. Eliminate the rule from where is not the start symbol 2. For each occurrence of on the with that occurrence of deleted Example: replace by replace by of a rule, add a new rule to ; 3. Replace the rule, (if it is present) by rule has been previously eliminated unless the until all rules are eliminated Chomsky and Greibach Normal Forms p.8/24

19 Step 3: remove unit rules Repeat 1. Remove a unit rule 2. For each rule, add the rule was a unit rule previously removed until all unit rules are eliminated to, unless Note: is a string of variables and terminals Chomsky and Greibach Normal Forms p.9/24

20 Convert all remaining rules Repeat 1. Replace a rule,, where each is a variable or a terminal, by:,,, where,,, are new variables,, 2. If rule replace any terminal with a new variable and add the until no rules of the form with remain Chomsky and Greibach Normal Forms p.10/24

21 Convert all remaining rules Repeat 1. Replace a rule,, where each is a variable or a terminal, by:,,, where,,, are new variables,, 2. If rule replace any terminal with a new variable and add the until no rules of the form with remain Chomsky and Greibach Normal Forms p.10/24

22 Convert all remaining rules Repeat 1. Replace a rule,, where each is a variable or a terminal, by:,,, where,,, are new variables,, 2. If rule replace any terminal with a new variable and add the until no rules of the form with remain Chomsky and Greibach Normal Forms p.10/24

23 Example CFG conversion Consider the grammar whose rules are: Notation: symbols removed are green and those added are red. After first step of transformation we get: Chomsky and Greibach Normal Forms p.11/24

24 Example CFG conversion Consider the grammar whose rules are: Notation: symbols removed are green and those added are red. After first step of transformation we get: Chomsky and Greibach Normal Forms p.11/24

25 Example CFG conversion Consider the grammar whose rules are: Notation: symbols removed are green and those added are red. After first step of transformation we get: Chomsky and Greibach Normal Forms p.11/24

26 Chomsky and Greibach Normal Forms p.12/24 Removing rules : Removing : Removing

27 Chomsky and Greibach Normal Forms p.12/24 Removing rules : Removing : Removing

28 Chomsky and Greibach Normal Forms p.12/24 Removing rules : Removing : Removing

29 Removing unit rule Removing : Removing : Chomsky and Greibach Normal Forms p.13/24

30 Removing unit rule Removing : Removing : Chomsky and Greibach Normal Forms p.13/24

31 Removing unit rule Removing : Removing : Chomsky and Greibach Normal Forms p.13/24

32 More unit rules Removing : Removing : Chomsky and Greibach Normal Forms p.14/24

33 More unit rules Removing : Removing : Chomsky and Greibach Normal Forms p.14/24

34 More unit rules Removing : Removing : Chomsky and Greibach Normal Forms p.14/24

35 Converting remaining rules Chomsky and Greibach Normal Forms p.15/24

36 Converting remaining rules Chomsky and Greibach Normal Forms p.15/24

37 Converting remaining rules Chomsky and Greibach Normal Forms p.15/24

38 Note The conversion procedure produces several variables along with several rules. Since all these represent the same rule, we may simplify the result using a single variable and a single rule Chomsky and Greibach Normal Forms p.16/24

39 Note The conversion procedure produces several variables along with several rules. Since all these represent the same rule, we may simplify the result using a single variable and a single rule Chomsky and Greibach Normal Forms p.16/24

40 Note The conversion procedure produces several variables along with several rules. Since all these represent the same rule, we may simplify the result using a single variable and a single rule Chomsky and Greibach Normal Forms p.16/24

41 Greibach Normal Form A context-free grammar Greibach normal form if each rule property:,,. is in has the and Note: Greibach normal form provides a justification of operator prefix-notation usually employed in algebra. Chomsky and Greibach Normal Forms p.17/24

42 Greibach Normal Form A context-free grammar Greibach normal form if each rule property:,,. is in has the and Note: Greibach normal form provides a justification of operator prefix-notation usually employed in algebra. Chomsky and Greibach Normal Forms p.17/24

43 Greibach Normal Form A context-free grammar Greibach normal form if each rule property:,,. is in has the and Note: Greibach normal form provides a justification of operator prefix-notation usually employed in algebra. Chomsky and Greibach Normal Forms p.17/24

44 Greibach Theorem Every CFL where can be generated by a CFG in Greibach normal form. Proof idea: Let is in Chomsky normal form be a CFG generating. Assume that Let be an ordering of nonterminals. Construct the Greibach normal form from Chomsky normal form Chomsky and Greibach Normal Forms p.18/24

45 Greibach Theorem Every CFL where can be generated by a CFG in Greibach normal form. Proof idea: Let is in Chomsky normal form be a CFG generating. Assume that Let be an ordering of nonterminals. Construct the Greibach normal form from Chomsky normal form Chomsky and Greibach Normal Forms p.18/24

46 Greibach Theorem Every CFL where can be generated by a CFG in Greibach normal form. Proof idea: Let is in Chomsky normal form be a CFG generating. Assume that Let be an ordering of nonterminals. Construct the Greibach normal form from Chomsky normal form Chomsky and Greibach Normal Forms p.18/24

47 Construction 1. Modify the rules in so that if then 2. Starting with and proceeding to this is done as follows: (a) Assume that productions have been modified so that for, only if (b) If is a production with productions substituting for the production, generate a new set of the rhs of each (c) Repeating (b) at most, times we obtain rules of the form (d) Replace rules by removing left-recursive rules Chomsky and Greibach Normal Forms p.19/24

48 Construction 1. Modify the rules in so that if then 2. Starting with and proceeding to this is done as follows: (a) Assume that productions have been modified so that for, only if (b) If is a production with productions substituting for the production, generate a new set of the rhs of each (c) Repeating (b) at most, times we obtain rules of the form (d) Replace rules by removing left-recursive rules Chomsky and Greibach Normal Forms p.19/24

49 Construction 1. Modify the rules in so that if then 2. Starting with and proceeding to this is done as follows: (a) Assume that productions have been modified so that for, only if (b) If is a production with productions substituting for the production, generate a new set of the rhs of each (c) Repeating (b) at most, times we obtain rules of the form (d) Replace rules by removing left-recursive rules Chomsky and Greibach Normal Forms p.19/24

50 Removing left-recursion Left-recursion can be eliminated by the following scheme: If nonterminal, say left recursive rules, and are all remaining -rules then chose a new are all Add the new -rules, Replace the -rules by, This construction preserve the language. Chomsky and Greibach Normal Forms p.20/24

51 Removing left-recursion Left-recursion can be eliminated by the following scheme: If nonterminal, say left recursive rules, and are all remaining -rules then chose a new are all Add the new -rules, Replace the -rules by, This construction preserve the language. Chomsky and Greibach Normal Forms p.20/24

52 Removing left-recursion Left-recursion can be eliminated by the following scheme: If nonterminal, say left recursive rules, and are all remaining -rules then chose a new are all Add the new -rules, Replace the -rules by, This construction preserve the language. Chomsky and Greibach Normal Forms p.20/24

53 21-1

54 More on Greibach NF See Introduction to Automata Theory, Languages, and Computation, J.E, Hopcroft and J.D Ullman, Addison-Wesley 1979, p Chomsky and Greibach Normal Forms p.22/24

55 Chomsky and Greibach Normal Forms p.23/24 Example Convert the CFG where into Greibach normal form.

56 Chomsky and Greibach Normal Forms p.23/24 Example Convert the CFG where into Greibach normal form.

57 Chomsky and Greibach Normal Forms p.23/24 Example Convert the CFG where into Greibach normal form.

58 Solution 1. Step 1: ordering the rules: (Only rules violate ordering conditions, hence only rules need to be changed). Following the procedure we replace rules by: 2. Eliminating left-recursion we get:, 3. All rules start with a terminal. We use them to replace. This introduces the rules 4. Use production to make them start with a terminal Chomsky and Greibach Normal Forms p.24/24

59 Solution 1. Step 1: ordering the rules: (Only rules violate ordering conditions, hence only rules need to be changed). Following the procedure we replace rules by: 2. Eliminating left-recursion we get:, 3. All rules start with a terminal. We use them to replace. This introduces the rules 4. Use production to make them start with a terminal Chomsky and Greibach Normal Forms p.24/24

60 Solution 1. Step 1: ordering the rules: (Only rules violate ordering conditions, hence only rules need to be changed). Following the procedure we replace rules by: 2. Eliminating left-recursion we get:, 3. All rules start with a terminal. We use them to replace. This introduces the rules 4. Use production to make them start with a terminal Chomsky and Greibach Normal Forms p.24/24

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

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

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

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

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

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

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

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

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

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

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

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

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

2110711 THEORY of COMPUTATION

2110711 THEORY of COMPUTATION 2110711 THEORY of COMPUTATION ATHASIT SURARERKS ELITE Athasit Surarerks ELITE Engineering Laboratory in Theoretical Enumerable System Computer Engineering, Faculty of Engineering Chulalongkorn University

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

9.2 Summation Notation

9.2 Summation Notation 9. Summation Notation 66 9. Summation Notation In the previous section, we introduced sequences and now we shall present notation and theorems concerning the sum of terms of a sequence. We begin with a

More information

Introduction. Compiler Design CSE 504. Overview. Programming problems are easier to solve in high-level languages

Introduction. Compiler Design CSE 504. Overview. Programming problems are easier to solve in high-level languages Introduction Compiler esign CSE 504 1 Overview 2 3 Phases of Translation ast modifled: Mon Jan 28 2013 at 17:19:57 EST Version: 1.5 23:45:54 2013/01/28 Compiled at 11:48 on 2015/01/28 Compiler esign Introduction

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

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

Introduction to Theory of Computation

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

More information

Converting Finite Automata to Regular Expressions

Converting Finite Automata to Regular Expressions Converting Finite Automata to Regular Expressions Alexander Meduna, Lukáš Vrábel, and Petr Zemek Brno University of Technology, Faculty of Information Technology Božetěchova 1/2, 612 00 Brno, CZ http://www.fit.vutbr.cz/

More information

Basic Parsing Algorithms Chart Parsing

Basic Parsing Algorithms Chart Parsing Basic Parsing Algorithms Chart Parsing Seminar Recent Advances in Parsing Technology WS 2011/2012 Anna Schmidt Talk Outline Chart Parsing Basics Chart Parsing Algorithms Earley Algorithm CKY Algorithm

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

CHAPTER 7 GENERAL PROOF SYSTEMS

CHAPTER 7 GENERAL PROOF SYSTEMS CHAPTER 7 GENERAL PROOF SYSTEMS 1 Introduction Proof systems are built to prove statements. They can be thought as an inference machine with special statements, called provable statements, or sometimes

More information

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

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

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

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

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

Irrational Numbers. A. Rational Numbers 1. Before we discuss irrational numbers, it would probably be a good idea to define rational numbers.

Irrational Numbers. A. Rational Numbers 1. Before we discuss irrational numbers, it would probably be a good idea to define rational numbers. Irrational Numbers A. Rational Numbers 1. Before we discuss irrational numbers, it would probably be a good idea to define rational numbers. Definition: Rational Number A rational number is a number that

More information

Grammars and Parsing. 2. A finite nonterminal alphabet N. Symbols in this alphabet are variables of the grammar.

Grammars and Parsing. 2. A finite nonterminal alphabet N. Symbols in this alphabet are variables of the grammar. 4 Grammars and Parsing Formally a language is a set of finite-length strings over a finite alphabet. Because most interesting languages are infinite sets, we cannot define such languages by enumerating

More information

As we have seen, there is a close connection between Legendre symbols of the form

As we have seen, there is a close connection between Legendre symbols of the form Gauss Sums As we have seen, there is a close connection between Legendre symbols of the form 3 and cube roots of unity. Secifically, if is a rimitive cube root of unity, then 2 ± i 3 and hence 2 2 3 In

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

Syntaktická analýza. Ján Šturc. Zima 208

Syntaktická analýza. Ján Šturc. Zima 208 Syntaktická analýza Ján Šturc Zima 208 Position of a Parser in the Compiler Model 2 The parser The task of the parser is to check syntax The syntax-directed translation stage in the compiler s front-end

More information

Lecture 5 Principal Minors and the Hessian

Lecture 5 Principal Minors and the Hessian Lecture 5 Principal Minors and the Hessian Eivind Eriksen BI Norwegian School of Management Department of Economics October 01, 2010 Eivind Eriksen (BI Dept of Economics) Lecture 5 Principal Minors and

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

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

Introduction. W. Buszkowski Type Logics in Grammar

Introduction. W. Buszkowski Type Logics in Grammar W. Buszkowski Type Logics in Grammar Introduction Type logics are logics whose formulas are interpreted as types. For instance, A B is a type of functions (procedures) which send inputs of type A to outputs

More information

5.5. Solving linear systems by the elimination method

5.5. Solving linear systems by the elimination method 55 Solving linear systems by the elimination method Equivalent systems The major technique of solving systems of equations is changing the original problem into another one which is of an easier to solve

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

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

Full and Complete Binary Trees

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

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

Notes on Determinant

Notes on Determinant ENGG2012B Advanced Engineering Mathematics Notes on Determinant Lecturer: Kenneth Shum Lecture 9-18/02/2013 The determinant of a system of linear equations determines whether the solution is unique, without

More information

Math Circle Beginners Group October 18, 2015

Math Circle Beginners Group October 18, 2015 Math Circle Beginners Group October 18, 2015 Warm-up problem 1. Let n be a (positive) integer. Prove that if n 2 is odd, then n is also odd. (Hint: Use a proof by contradiction.) Suppose that n 2 is odd

More information

On String Languages Generated by Spiking Neural P Systems

On String Languages Generated by Spiking Neural P Systems On String Languages Generated by Spiking Neural P Systems Haiming Chen 1, Rudolf Freund 2, Mihai Ionescu 3, Gheorghe Păun 4,5, Mario J. Pérez-Jiménez 5 1 Computer Science Laboratory, Institute of Software

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

CS 341: Foundations of Computer Science II elearning Section Syllabus, Spring 2015

CS 341: Foundations of Computer Science II elearning Section Syllabus, Spring 2015 CS 341: Foundations of Computer Science II elearning Section Syllabus, Spring 2015 Course Info Instructor: Prof. Marvin K. Nakayama Office: GITC 4312 Phone: 973-596-3398 E-mail: marvin@njit.edu (Be sure

More information

Factorizations: Searching for Factor Strings

Factorizations: Searching for Factor Strings " 1 Factorizations: Searching for Factor Strings Some numbers can be written as the product of several different pairs of factors. For example, can be written as 1, 0,, 0, and. It is also possible to write

More information

Incenter Circumcenter

Incenter Circumcenter TRIANGLE: Centers: Incenter Incenter is the center of the inscribed circle (incircle) of the triangle, it is the point of intersection of the angle bisectors of the triangle. The radius of incircle is

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

26 Integers: Multiplication, Division, and Order

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

More information

5HFDOO &RPSLOHU 6WUXFWXUH

5HFDOO &RPSLOHU 6WUXFWXUH 6FDQQLQJ 2XWOLQH 2. Scanning The basics Ad-hoc scanning FSM based techniques A Lexical Analysis tool - Lex (a scanner generator) 5HFDOO &RPSLOHU 6WUXFWXUH 6RXUFH &RGH /H[LFDO $QDO\VLV6FDQQLQJ 6\QWD[ $QDO\VLV3DUVLQJ

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

FIRST and FOLLOW sets a necessary preliminary to constructing the LL(1) parsing table

FIRST and FOLLOW sets a necessary preliminary to constructing the LL(1) parsing table FIRST and FOLLOW sets a necessary preliminary to constructing the LL(1) parsing table Remember: A predictive parser can only be built for an LL(1) grammar. A grammar is not LL(1) if it is: 1. Left recursive,

More information

Computer Science Theory. From the course description:

Computer Science Theory. From the course description: Computer Science Theory Goals of Course From the course description: Introduction to the theory of computation covering regular, context-free and computable (recursive) languages with finite state machines,

More information

OBTAINING PRACTICAL VARIANTS OF LL (k) AND LR (k) FOR k >1. A Thesis. Submitted to the Faculty. Purdue University.

OBTAINING PRACTICAL VARIANTS OF LL (k) AND LR (k) FOR k >1. A Thesis. Submitted to the Faculty. Purdue University. OBTAINING PRACTICAL VARIANTS OF LL (k) AND LR (k) FOR k >1 BY SPLITTING THE ATOMIC k-tuple A Thesis Submitted to the Faculty of Purdue University by Terence John Parr In Partial Fulfillment of the Requirements

More information

If n is odd, then 3n + 7 is even.

If n is odd, then 3n + 7 is even. Proof: Proof: We suppose... that 3n + 7 is even. that 3n + 7 is even. Since n is odd, there exists an integer k so that n = 2k + 1. that 3n + 7 is even. Since n is odd, there exists an integer k so that

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

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

SIMPLIFYING ALGEBRAIC FRACTIONS

SIMPLIFYING ALGEBRAIC FRACTIONS Tallahassee Community College 5 SIMPLIFYING ALGEBRAIC FRACTIONS In arithmetic, you learned that a fraction is in simplest form if the Greatest Common Factor (GCF) of the numerator and the denominator is

More information

Math/Stats 425 Introduction to Probability. 1. Uncertainty and the axioms of probability

Math/Stats 425 Introduction to Probability. 1. Uncertainty and the axioms of probability Math/Stats 425 Introduction to Probability 1. Uncertainty and the axioms of probability Processes in the real world are random if outcomes cannot be predicted with certainty. Example: coin tossing, stock

More information

Lecture 9 - Message Authentication Codes

Lecture 9 - Message Authentication Codes Lecture 9 - Message Authentication Codes Boaz Barak March 1, 2010 Reading: Boneh-Shoup chapter 6, Sections 9.1 9.3. Data integrity Until now we ve only been interested in protecting secrecy of data. However,

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

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

Unit 3 Boolean Algebra (Continued)

Unit 3 Boolean Algebra (Continued) Unit 3 Boolean Algebra (Continued) 1. Exclusive-OR Operation 2. Consensus Theorem Department of Communication Engineering, NCTU 1 3.1 Multiplying Out and Factoring Expressions Department of Communication

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

Automated Program Behavior Analysis

Automated Program Behavior Analysis Automated Program Behavior Analysis Stacy Prowell sprowell@cs.utk.edu March 2005 SQRL / SEI Motivation: Semantics Development: Most engineering designs are subjected to extensive analysis; software is

More information

JUST THE MATHS UNIT NUMBER 1.8. ALGEBRA 8 (Polynomials) A.J.Hobson

JUST THE MATHS UNIT NUMBER 1.8. ALGEBRA 8 (Polynomials) A.J.Hobson JUST THE MATHS UNIT NUMBER 1.8 ALGEBRA 8 (Polynomials) by A.J.Hobson 1.8.1 The factor theorem 1.8.2 Application to quadratic and cubic expressions 1.8.3 Cubic equations 1.8.4 Long division of polynomials

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

Bottom-Up Parsing. An Introductory Example

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

More information

All the examples in this worksheet and all the answers to questions are available as answer sheets or videos.

All the examples in this worksheet and all the answers to questions are available as answer sheets or videos. BIRKBECK MATHS SUPPORT www.mathsupport.wordpress.com Numbers 3 In this section we will look at - improper fractions and mixed fractions - multiplying and dividing fractions - what decimals mean and exponents

More information

Sequentially Indexed Grammars

Sequentially Indexed Grammars Sequentially Indexed Grammars Jan van Eijck CWI and ILLC, Amsterdam, Uil-OTS, Utrecht To appear in the Journal of Logic and Computation Abstract This paper defines the grammar class of sequentially indexed

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

03 - Lexical Analysis

03 - Lexical Analysis 03 - Lexical Analysis First, let s see a simplified overview of the compilation process: source code file (sequence of char) Step 2: parsing (syntax analysis) arse Tree Step 1: scanning (lexical analysis)

More information

Parsing Beyond Context-Free Grammars: Introduction

Parsing Beyond Context-Free Grammars: Introduction Parsing Beyond Context-Free Grammars: Introduction Laura Kallmeyer Heinrich-Heine-Universität Düsseldorf Sommersemester 2016 Parsing Beyond CFG 1 Introduction Overview 1. CFG and natural languages 2. Polynomial

More information

Automatic Generation of Consistency-Preserving Edit Operations for MDE Tools

Automatic Generation of Consistency-Preserving Edit Operations for MDE Tools Automatic Generation of Consistency-Preserving Edit Operations for MDE Tools Michaela Rindt, Timo Kehrer, Udo Kelter Software Engineering Group University of Siegen {mrindt,kehrer,kelter}@informatik.uni-siegen.de

More information

Parsing Technology and its role in Legacy Modernization. A Metaware White Paper

Parsing Technology and its role in Legacy Modernization. A Metaware White Paper Parsing Technology and its role in Legacy Modernization A Metaware White Paper 1 INTRODUCTION In the two last decades there has been an explosion of interest in software tools that can automate key tasks

More information

LZ77. Example 2.10: Let T = badadadabaab and assume d max and l max are large. phrase b a d adadab aa b

LZ77. Example 2.10: Let T = badadadabaab and assume d max and l max are large. phrase b a d adadab aa b LZ77 The original LZ77 algorithm works as follows: A phrase T j starting at a position i is encoded as a triple of the form distance, length, symbol. A triple d, l, s means that: T j = T [i...i + l] =

More information

Architectural Design Patterns for Language Parsers

Architectural Design Patterns for Language Parsers Architectural Design Patterns for Language Parsers Gábor Kövesdán, Márk Asztalos and László Lengyel Budapest University of Technology and Economics Department of Automation and Applied Informatics Magyar

More information

HOMEWORK 5 SOLUTIONS. n!f n (1) lim. ln x n! + xn x. 1 = G n 1 (x). (2) k + 1 n. (n 1)!

HOMEWORK 5 SOLUTIONS. n!f n (1) lim. ln x n! + xn x. 1 = G n 1 (x). (2) k + 1 n. (n 1)! Math 7 Fall 205 HOMEWORK 5 SOLUTIONS Problem. 2008 B2 Let F 0 x = ln x. For n 0 and x > 0, let F n+ x = 0 F ntdt. Evaluate n!f n lim n ln n. By directly computing F n x for small n s, we obtain the following

More information

CHAPTER 2. Logic. 1. Logic Definitions. Notation: Variables are used to represent propositions. The most common variables used are p, q, and r.

CHAPTER 2. Logic. 1. Logic Definitions. Notation: Variables are used to represent propositions. The most common variables used are p, q, and r. CHAPTER 2 Logic 1. Logic Definitions 1.1. Propositions. Definition 1.1.1. A proposition is a declarative sentence that is either true (denoted either T or 1) or false (denoted either F or 0). Notation:

More information

Numeracy Preparation Guide. for the. VETASSESS Test for Certificate IV in Nursing (Enrolled / Division 2 Nursing) course

Numeracy Preparation Guide. for the. VETASSESS Test for Certificate IV in Nursing (Enrolled / Division 2 Nursing) course Numeracy Preparation Guide for the VETASSESS Test for Certificate IV in Nursing (Enrolled / Division Nursing) course Introduction The Nursing course selection (or entrance) test used by various Registered

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

People have thought about, and defined, probability in different ways. important to note the consequences of the definition:

People have thought about, and defined, probability in different ways. important to note the consequences of the definition: PROBABILITY AND LIKELIHOOD, A BRIEF INTRODUCTION IN SUPPORT OF A COURSE ON MOLECULAR EVOLUTION (BIOL 3046) Probability The subject of PROBABILITY is a branch of mathematics dedicated to building models

More information

3. Mathematical Induction

3. Mathematical Induction 3. MATHEMATICAL INDUCTION 83 3. Mathematical Induction 3.1. First Principle of Mathematical Induction. Let P (n) be a predicate with domain of discourse (over) the natural numbers N = {0, 1,,...}. If (1)

More information

On tie knots. Mikael Vejdemo-Johansson Anders Sandberg, Meredith L. Patterson, Dan Hirsh. Wednesday, March 19, 14

On tie knots. Mikael Vejdemo-Johansson Anders Sandberg, Meredith L. Patterson, Dan Hirsh. Wednesday, March 19, 14 On tie knots Mikael Vejdemo-Johansson Anders Sandberg, Meredith L. Patterson, Dan Hirsh Fink & Mao (2000): There are 85 tie knots Announcement in Nature Classification in Physica A Popularization in The

More information

In mathematics, there are four attainment targets: using and applying mathematics; number and algebra; shape, space and measures, and handling data.

In mathematics, there are four attainment targets: using and applying mathematics; number and algebra; shape, space and measures, and handling data. MATHEMATICS: THE LEVEL DESCRIPTIONS In mathematics, there are four attainment targets: using and applying mathematics; number and algebra; shape, space and measures, and handling data. Attainment target

More information

Approximating Context-Free Grammars for Parsing and Verification

Approximating Context-Free Grammars for Parsing and Verification Approximating Context-Free Grammars for Parsing and Verification Sylvain Schmitz LORIA, INRIA Nancy - Grand Est October 18, 2007 datatype a option = NONE SOME of a fun filter pred l = let fun filterp (x::r,

More information

Automated Induction with Constrained Tree Automata,

Automated Induction with Constrained Tree Automata, Automated Induction with Constrained Tree Automata, Adel Bouhoula 1 and Florent Jacquemard 2 1 Higher School of Communications of Tunis (Sup Com), University of November 7th at Carthage, Tunisia adel.bouhoula@supcom.rnu.tn

More information

Non Uniform Generation of Combinatorial Objects

Non Uniform Generation of Combinatorial Objects Non Uniform Generation of Combinatorial Objects Frank Weinberg and Markus E. Nebel Fachbereich Informatik, Technische Universität Kaiserslautern, Gottlieb-Daimler-Straße 48, D-67663 Kaiserslautern, Germany

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

Dynamic Cognitive Modeling IV

Dynamic Cognitive Modeling IV Dynamic Cognitive Modeling IV CLS2010 - Computational Linguistics Summer Events University of Zadar 23.08.2010 27.08.2010 Department of German Language and Linguistics Humboldt Universität zu Berlin Overview

More information

Lemma 5.2. Let S be a set. (1) Let f and g be two permutations of S. Then the composition of f and g is a permutation of S.

Lemma 5.2. Let S be a set. (1) Let f and g be two permutations of S. Then the composition of f and g is a permutation of S. Definition 51 Let S be a set bijection f : S S 5 Permutation groups A permutation of S is simply a Lemma 52 Let S be a set (1) Let f and g be two permutations of S Then the composition of f and g is a

More information

The Theory of Languages and Computation

The Theory of Languages and Computation The Theory of Languages and Computation Jean Gallier jean@saul.cis.upenn.edu Andrew Hicks rah@grip.cis.upenn.edu Department of Computer and Information Science University of Pennsylvania Preliminary notes

More information

6.3 Conditional Probability and Independence

6.3 Conditional Probability and Independence 222 CHAPTER 6. PROBABILITY 6.3 Conditional Probability and Independence Conditional Probability Two cubical dice each have a triangle painted on one side, a circle painted on two sides and a square painted

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

FROM NUMERICAL EQUIVALENCE TO ALGEBRAIC EQUIVALENCE 1. Rolene Liebenberg, Marlene Sasman and Alwyn Olivier

FROM NUMERICAL EQUIVALENCE TO ALGEBRAIC EQUIVALENCE 1. Rolene Liebenberg, Marlene Sasman and Alwyn Olivier FROM NUMERICAL EQUIVALENCE TO ALGEBRAIC EQUIVALENCE 1 Rolene Liebenberg, Marlene Sasman and Alwyn Olivier Mathematics Learning and Teaching Initiative (MALATI) In this paper we describe Malati s approach

More information

SYMBOL AND MEANING IN MATHEMATICS

SYMBOL AND MEANING IN MATHEMATICS ,,. SYMBOL AND MEANING IN MATHEMATICS ALICE M. DEAN Mathematics and Computer Science Department Skidmore College May 26,1995 There is perhaps no other field of study that uses symbols as plentifully and

More information

Section 1.4 Place Value Systems of Numeration in Other Bases

Section 1.4 Place Value Systems of Numeration in Other Bases Section.4 Place Value Systems of Numeration in Other Bases Other Bases The Hindu-Arabic system that is used in most of the world today is a positional value system with a base of ten. The simplest reason

More information

Basics of Counting. The product rule. Product rule example. 22C:19, Chapter 6 Hantao Zhang. Sample question. Total is 18 * 325 = 5850

Basics of Counting. The product rule. Product rule example. 22C:19, Chapter 6 Hantao Zhang. Sample question. Total is 18 * 325 = 5850 Basics of Counting 22C:19, Chapter 6 Hantao Zhang 1 The product rule Also called the multiplication rule If there are n 1 ways to do task 1, and n 2 ways to do task 2 Then there are n 1 n 2 ways to do

More information