Introduction to computability Tutorial 7
|
|
- Angelina Phillips
- 5 years ago
- Views:
Transcription
1 Introduction to computability Tutorial 7 Context free languages and Turing machines November 6 th 2014
2 Context-free languages 1. Show that the following languages are not context-free: a) L ta i b j a k j maxpi, kqu; b) L tw w w P t0, 1u u where w is the complement of w, that is, the word w where every 1 is replaced by a 0 and every 0 is replaced by a 1.
3 Useful techniques for proving that a language is not context free Strong version of the pumping lemma: Let L be a context-free language. Then there exists, a constant K such that for any word w P L satisfying w ě K can be written w uvxyz with v or y ε, vxy ď K and uv n xy n z P L for all ně0 Prove that the intersection of the language L with a regular language L R is not context-free. This implies that L is not context-free.
4 Turing machines 2. Let M pq, Γ, Σ, δ, q 0, 7, Hq be a Turing machine where Q tq 0, q 1, q 2, q 3 u, Γ ta, b, A, B, A 1, B 1 u, Σ ta, bu and δ contains the following transitions: pq 0, aq Ñ pq 1, A 1, Rq pq 1, #q Ñ pq 2, A, Lq pq 2, B 1 q Ñ pq 0, B, Rq pq 0, bq Ñ pq 3, B 1, Rq pq 2, aq Ñ pq 2, a, Lq pq 3, aq Ñ pq 3, a, Rq pq 1, aq Ñ pq 1, a, Rq pq 2, bq Ñ pq 2, b, Lq pq 3, bq Ñ pq 3, b, Rq pq 1, bq Ñ pq 1, b, Rq pq 2, Aq Ñ pq 2, A, Lq pq 3, Aq Ñ pq 3, A, Rq pq 1, Aq Ñ pq 1, A, Rq pq 2, Bq Ñ pq 2, B, Lq pq 3, Bq Ñ pq 3, B, Rq pq 1, Bq Ñ pq 1, B, Rq pq 2, A 1 q Ñ pq 0, A, Rq pq 3, #q Ñ pq 2, B, Lq a) What is on the tape after an execution of M on the word abab? b) Describe what the Turing machine M does on a word w P ta, bu.
5 $ q 0. abab#####
6 $ q 0. abab#####
7 $ q 0. abab#####
8 $ q 0. abab##### $ q 1. A 1 bab#####
9 $ q 0. abab##### $ q 1. A 1 bab##### $ q 2. A 1 baba####
10 $ q 0. abab##### $ q 1. A 1 bab##### $ q 2. A 1 baba#### $ q 2. A 1 baba####
11 $ q 0. abab##### $ q 1. A 1 bab##### $ q 2. A 1 baba#### $ q 2. A 1 baba#### $ q 0. AbabA####
12 $ q 0. abab##### $ q 1. A 1 bab##### $ q 2. A 1 baba#### $ q 2. A 1 baba#### $ q 0. AbabA#### $ q 3. AB 1 aba####
13 $ q 0. abab##### $ q 1. A 1 bab##### $ q 2. A 1 baba#### $ q 2. A 1 baba#### $ q 0. AbabA#### $ q 3. AB 1 aba#### $ q 3. AB 1 aba####
14 $ q 0. abab##### $ q 1. A 1 bab##### $ q 2. A 1 baba#### $ q 2. A 1 baba#### $ q 0. AbabA#### $ q 3. AB 1 aba#### $ q 3. AB 1 aba#### $ q 2. AB 1 abab###
15 $ q 0. abab##### $ q 1. A 1 bab##### $ q 2. A 1 baba#### $ q 2. A 1 baba#### $ q 0. AbabA#### $ q 3. AB 1 aba#### $ q 3. AB 1 aba#### $ q 2. AB 1 abab### $ q 2. AB 1 abab###
16 $ q 0. abab##### $ q 0. ABabAB### $ q 1. A 1 bab##### $ q 2. A 1 baba#### $ q 2. A 1 baba#### $ q 0. AbabA#### $ q 3. AB 1 aba#### $ q 3. AB 1 aba#### $ q 2. AB 1 abab### $ q 2. AB 1 abab###
17 $ q 0. abab##### $ q 0. ABabAB### $ q 1. ABA 1 bab### $ q 1. A 1 bab##### $ q 2. A 1 baba#### $ q 2. A 1 baba#### $ q 0. AbabA#### $ q 3. AB 1 aba#### $ q 3. AB 1 aba#### $ q 2. AB 1 abab### $ q 2. AB 1 abab###
18 $ q 0. abab##### $ q 0. ABabAB### $ q 1. ABA 1 bab### $ q 1. ABA 1 bab### $ q 1. A 1 bab##### $ q 2. A 1 baba#### $ q 2. A 1 baba#### $ q 0. AbabA#### $ q 3. AB 1 aba#### $ q 3. AB 1 aba#### $ q 2. AB 1 abab### $ q 2. AB 1 abab###
19 $ q 0. abab##### $ q 0. ABabAB### $ q 1. ABA 1 bab### $ q 1. ABA 1 bab### $ q 1. A 1 bab##### $ q 2. ABA 1 baba## $ q 2. A 1 baba#### $ q 2. A 1 baba#### $ q 0. AbabA#### $ q 3. AB 1 aba#### $ q 3. AB 1 aba#### $ q 2. AB 1 abab### $ q 2. AB 1 abab###
20 $ q 0. abab##### $ q 0. ABabAB### $ q 1. ABA 1 bab### $ q 1. ABA 1 bab### $ q 1. A 1 bab##### $ q 2. ABA 1 baba## $ q 2. A 1 baba#### $ q 2. ABA 1 baba## $ q 2. A 1 baba#### $ q 0. AbabA#### $ q 3. AB 1 aba#### $ q 3. AB 1 aba#### $ q 2. AB 1 abab### $ q 2. AB 1 abab###
21 $ q 0. abab##### $ q 0. ABabAB### $ q 1. ABA 1 bab### $ q 1. ABA 1 bab### $ q 1. A 1 bab##### $ q 2. ABA 1 baba## $ q 2. A 1 baba#### $ q 2. ABA 1 baba## $ q 2. A 1 baba#### $ q 0. ABAbABA## $ q 0. AbabA#### $ q 3. AB 1 aba#### $ q 3. AB 1 aba#### $ q 2. AB 1 abab### $ q 2. AB 1 abab###
22 $ q 0. abab##### $ q 0. ABabAB### $ q 1. ABA 1 bab### $ q 1. ABA 1 bab### $ q 1. A 1 bab##### $ q 2. ABA 1 baba## $ q 2. A 1 baba#### $ q 2. ABA 1 baba## $ q 2. A 1 baba#### $ q 0. ABAbABA## $ q 0. AbabA#### $ q 3. ABAB 1 ABA## $ q 3. AB 1 aba#### $ q 3. AB 1 aba#### $ q 2. AB 1 abab### $ q 2. AB 1 abab###
23 $ q 0. abab##### $ q 0. ABabAB### $ q 1. ABA 1 bab### $ q 1. ABA 1 bab### $ q 1. A 1 bab##### $ q 2. ABA 1 baba## $ q 2. A 1 baba#### $ q 2. ABA 1 baba## $ q 2. A 1 baba#### $ q 0. ABAbABA## $ q 0. AbabA#### $ q 3. ABAB 1 ABA## $ q 3. AB 1 aba#### $ q 3. ABAB 1 ABA## $ q 3. AB 1 aba#### $ q 2. AB 1 abab### $ q 2. AB 1 abab###
24 $ q 0. abab##### $ q 0. ABabAB### $ q 1. ABA 1 bab### $ q 1. ABA 1 bab### $ q 1. A 1 bab##### $ q 2. ABA 1 baba## $ q 2. A 1 baba#### $ q 2. ABA 1 baba## $ q 2. A 1 baba#### $ q 0. ABAbABA## $ q 0. AbabA#### $ q 3. ABAB 1 ABA## $ q 3. AB 1 aba#### $ q 3. ABAB 1 ABA## $ q 3. AB 1 aba#### $ q 2. ABAB 1 ABAB# $ q 2. AB 1 abab### $ q 2. AB 1 abab###
25 $ q 0. abab##### $ q 0. ABabAB### $ q 1. ABA 1 bab### $ q 1. ABA 1 bab### $ q 1. A 1 bab##### $ q 2. ABA 1 baba## $ q 2. A 1 baba#### $ q 2. ABA 1 baba## $ q 2. A 1 baba#### $ q 0. ABAbABA## $ q 0. AbabA#### $ q 3. ABAB 1 ABA## $ q 3. AB 1 aba#### $ q 3. ABAB 1 ABA## $ q 3. AB 1 aba#### $ q 2. ABAB 1 ABAB# $ q 2. AB 1 abab### $ q 2. ABAB 1 ABAB# $ q 2. AB 1 abab###
26 $ q 0. abab##### $ q 0. ABabAB### $ q 1. ABA 1 bab### $ q 1. ABA 1 bab### $ q 1. A 1 bab##### $ q 2. ABA 1 baba## $ q 2. A 1 baba#### $ q 2. ABA 1 baba## $ q 2. A 1 baba#### $ q 0. ABAbABA## $ q 0. AbabA#### $ q 3. ABAB 1 ABA## $ q 3. AB 1 aba#### $ q 3. ABAB 1 ABA## $ q 3. AB 1 aba#### $ q 2. ABAB 1 ABAB# $ q 2. AB 1 abab### $ q 2. ABAB 1 ABAB# $ q 2. AB 1 abab### $ q 0. ABABABAB#
27 Turing machines 2. Let M pq, Γ, Σ, δ, q 0, 7, Hq be a Turing machine where Q tq 0, q 1, q 2, q 3 u, Γ ta, b, A, B, A 1, B 1 u, Σ ta, bu and δ contains the following transitions: pq 0, aq Ñ pq 1, A 1, Rq pq 1, #q Ñ pq 2, A, Lq pq 2, B 1 q Ñ pq 0, B, Rq pq 0, bq Ñ pq 3, B 1, Rq pq 2, aq Ñ pq 2, a, Lq pq 3, aq Ñ pq 3, a, Rq pq 1, aq Ñ pq 1, a, Rq pq 2, bq Ñ pq 2, b, Lq pq 3, bq Ñ pq 3, b, Rq pq 1, bq Ñ pq 1, b, Rq pq 2, Aq Ñ pq 2, A, Lq pq 3, Aq Ñ pq 3, A, Rq pq 1, Aq Ñ pq 1, A, Rq pq 2, Bq Ñ pq 2, B, Lq pq 3, Bq Ñ pq 3, B, Rq pq 1, Bq Ñ pq 1, B, Rq pq 2, A 1 q Ñ pq 0, A, Rq pq 3, #q Ñ pq 2, B, Lq a) What is on the tape after an execution of M on the word abab? b) Describe what the Turing machine M does on a word w P ta, bu.
28 3. For each of the following languages, give a Turing machine that decides the language: a) ta n b n c n n ě 0u; b) ta n b n c m n ď m ă 2nu.
29 3. For each of the following languages, give a Turing machine that decides the language: a) ta n b n c n n ě 0u; b) ta n b n c m n ď m ă 2nu. 4. Give a Turing machine that for the following initial configuration ps 0, ε, $1 n 01 m $q terminates for any natural numbers n and m with the configuration pq f, ε, $1 n`m $q where s 0 is an initial and q f an accepting state of the machine.
30 5. One can define Turing machines that have the possibility to write a symbol without moving the read head. Such a Turing machine is thus a septuple M pq, Γ, Σ, δ, s, B, F q where Q, Γ, Σ, s, B and F have the usual meaning and where δ : Q ˆ Γ Ñ Q ˆ Γ ˆ tl, R, Su (S meaning "stay in the same place"). a) Define the derivation relation "$ M " (in one step) for these Turing machines. b) Show that this extension of the Turing machines does not change the class of recognized languages.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
15-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY REVIEW for MIDTERM 1 THURSDAY Feb 6 Midterm 1 will cover everything we have seen so far The PROBLEMS will be from Sipser, Chapters 1, 2, 3 It will be
More informationThe Emptiness Problem for Valence Automata or: Another Decidable Extension of Petri Nets
The Emptiness Problem for Valence Automata or: Another Decidable Extension of Petri Nets Georg Zetzsche Technische Universität Kaiserslautern Reachability Problems 2015 Georg Zetzsche (TU KL) Emptiness
More informationSE 3310b Theoretical Foundations of Software Engineering. Turing Machines. Aleksander Essex
SE 3310b Theoretical Foundations of Software Engineering Turing Machines Aleksander Essex 1 / 1 Turing Machines 2 / 1 Introduction We ve finally arrived at a complete model of computation: Turing machines.
More informationClosure Properties of Context-Free Languages. Foundations of Computer Science Theory
Closure Properties of Context-Free Languages Foundations of Computer Science Theory Closure Properties of CFLs CFLs are closed under: Union Concatenation Kleene closure Reversal CFLs are not closed under
More informationCS5371 Theory of Computation. Lecture 9: Automata Theory VII (Pumping Lemma, Non-CFL, DPDA PDA)
CS5371 Theory of Computation Lecture 9: Automata Theory VII (Pumping Lemma, Non-CFL, DPDA PDA) Objectives Introduce the Pumping Lemma for CFL Show that some languages are non- CFL Discuss the DPDA, which
More informationV Honors Theory of Computation
V22.0453-001 Honors Theory of Computation Problem Set 3 Solutions Problem 1 Solution: The class of languages recognized by these machines is the exactly the class of regular languages, thus this TM variant
More informationCliff s notes for equivalence of CFLs and L(PDAs) LisaCFL L = L(M) for some PDA M L=L(M)forsomePDAM L = L(G) for some CFG G
What s on our plate today? Cliff s notes for equivalence of CFLs and L(PDAs) LisaCFL L = L(M) for some PDA M L=L(M)forsomePDAM L = L(G) for some CFG G Pumping Lemma (one last time) Statement of Pumping
More informationCS5371 Theory of Computation. Lecture 9: Automata Theory VII (Pumping Lemma, Non-CFL)
CS5371 Theory of Computation Lecture 9: Automata Theory VII (Pumping Lemma, Non-CFL) Objectives Introduce Pumping Lemma for CFL Apply Pumping Lemma to show that some languages are non-cfl Pumping Lemma
More informationComputability and Complexity
Computability and Complexity Lecture 5 Reductions Undecidable problems from language theory Linear bounded automata given by Jiri Srba Lecture 5 Computability and Complexity 1/14 Reduction Informal Definition
More informationFORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
15-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY THE PUMPING LEMMA FOR REGULAR LANGUAGES and REGULAR EXPRESSIONS TUESDAY Jan 21 WHICH OF THESE ARE REGULAR? B = {0 n 1 n n 0} C = { w w has equal number
More informationPumping Lemma for CFLs
Pumping Lemma for CFLs v y s Here we go again! Intuition: If L is CF, then some CFG G produces strings in L If some string in L is very long, it will have a very tall parse tree If a parse tree is taller
More informationHarvard CS 121 and CSCI E-207 Lecture 10: CFLs: PDAs, Closure Properties, and Non-CFLs
Harvard CS 121 and CSCI E-207 Lecture 10: CFLs: PDAs, Closure Properties, and Non-CFLs Harry Lewis October 8, 2013 Reading: Sipser, pp. 119-128. Pushdown Automata (review) Pushdown Automata = Finite automaton
More informationProblem 2.6(d) [4 pts] Problem 2.12 [3pts] Original CFG:
Problem 2.6(d) [4 pts] S X T#X X#T T#X#T X axa bxb #T# # T at bt #T ε Problem 2.12 [3pts] Original CFG: R XRX S S atb bta T XTX X ε X a b q start ε, ε $ ε, R X ε, ε R ε, ε X ε, R S ε, T X ε, T ε ε, X a
More informationIntro to Theory of Computation
Intro to Theory of Computation 1/26/2016 LECTURE 5 Last time: Closure properties. Equivalence of NFAs, DFAs and regular expressions Today: Conversion from NFAs to regular expressions Proving that a language
More informationDM17. Beregnelighed. Jacob Aae Mikkelsen
DM17 Beregnelighed Jacob Aae Mikkelsen January 12, 2007 CONTENTS Contents 1 Introduction 2 1.1 Operations with languages...................... 2 2 Finite Automata 3 2.1 Regular expressions/languages....................
More information7.2 Turing Machines as Language Acceptors 7.3 Turing Machines that Compute Partial Functions
CSC4510/6510 AUTOMATA 7.1 A General Model of Computation 7.2 Turing Machines as Language Acceptors 7.3 Turing Machines that Compute Partial Functions A General Model of Computation Both FA and PDA are
More informationContext-Free Languages (Pre Lecture)
Context-Free Languages (Pre Lecture) Dr. Neil T. Dantam CSCI-561, Colorado School of Mines Fall 2017 Dantam (Mines CSCI-561) Context-Free Languages (Pre Lecture) Fall 2017 1 / 34 Outline Pumping Lemma
More informationCS 154. Finite Automata vs Regular Expressions, Non-Regular Languages
CS 154 Finite Automata vs Regular Expressions, Non-Regular Languages Deterministic Finite Automata Computation with finite memory Non-Deterministic Finite Automata Computation with finite memory and guessing
More informationTheory of Computation (IV) Yijia Chen Fudan University
Theory of Computation (IV) Yijia Chen Fudan University Review language regular context-free machine DFA/ NFA PDA syntax regular expression context-free grammar Pushdown automata Definition A pushdown automaton
More informationChapter 16: Non-Context-Free Languages
Chapter 16: Non-Context-Free Languages Peter Cappello Department of Computer Science University of California, Santa Barbara Santa Barbara, CA 93106 cappello@cs.ucsb.edu Please read the corresponding chapter
More informationPushdown Automata. We have seen examples of context-free languages that are not regular, and hence can not be recognized by finite automata.
Pushdown Automata We have seen examples of context-free languages that are not regular, and hence can not be recognized by finite automata. Next we consider a more powerful computation model, called a
More informationHW6 Solutions. Micha l Dereziński. March 20, 2015
HW6 Solutions Micha l Dereziński March 20, 2015 1 Exercise 5.5 (a) The PDA accepts odd-length strings whose middle symbol is a and whose other letters are as and bs. Its diagram is below. b, Z 0 /XZ 0
More informationGrade 6 Math Circles October 20/21, Formalism and Languages: Beyond Regular Languages
Faculty of Mathematics Waterloo, Ontario N2L 3G1 Centre for Education in Mathematics and Computing Grade 6 Math Circles October 20/21, 2015 Formalism and Languages: Beyond Regular Languages Dr. Troy Vasiga
More informationCSE 355 Test 2, Fall 2016
CSE 355 Test 2, Fall 2016 28 October 2016, 8:35-9:25 a.m., LSA 191 Last Name SAMPLE ASU ID 1357924680 First Name(s) Ima Regrading of Midterms If you believe that your grade has not been added up correctly,
More informationNotes for Comp 497 (Comp 454) Week 5 2/22/05. Today we will look at some of the rest of the material in Part 1 of the book.
Notes for Comp 497 (Comp 454) Week 5 2/22/05 Today we will look at some of the rest of the material in Part 1 of the book Errata (Chapter 9) Chapter 9 p. 177, line 11, replace "for L 1 " by "for L 2 ".
More informationPUSHDOWN AUTOMATA (PDA)
PUSHDOWN AUTOMATA (PDA) FINITE STATE CONTROL INPUT STACK (Last in, first out) input pop push ε,ε $ 0,ε 0 1,0 ε ε,$ ε 1,0 ε PDA that recognizes L = { 0 n 1 n n 0 } Definition: A (non-deterministic) PDA
More informationSCHEME FOR INTERNAL ASSESSMENT TEST 3
SCHEME FOR INTERNAL ASSESSMENT TEST 3 Max Marks: 40 Subject& Code: Automata Theory & Computability (15CS54) Sem: V ISE (A & B) Note: Answer any FIVE full questions, choosing one full question from each
More information2.1 Solution. E T F a. E E + T T + T F + T a + T a + F a + a
. Solution E T F a E E + T T + T F + T a + T a + F a + a E E + T E + T + T T + T + T F + T + T a + T + T a + F + T a + a + T a + a + F a + a + a E T F ( E) ( T ) ( F) (( E)) (( T )) (( F)) (( a)) . Solution
More informationIntro to Theory of Computation
Intro to Theory of Computation LECTURE 9 Last time: Converting a PDA to a CFG Pumping Lemma for CFLs Today: Pumping Lemma for CFLs Review of CFGs/PDAs Sofya Raskhodnikova 2/9/2016 Sofya Raskhodnikova;
More informationNPDA, CFG equivalence
NPDA, CFG equivalence Theorem A language L is recognized by a NPDA iff L is described by a CFG. Must prove two directions: ( ) L is recognized by a NPDA implies L is described by a CFG. ( ) L is described
More informationTHEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET
THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET Regular Languages and FA A language is a set of strings over a finite alphabet Σ. All languages are finite or countably infinite. The set of all languages
More informationPushdown Automata. Notes on Automata and Theory of Computation. Chia-Ping Chen
Pushdown Automata Notes on Automata and Theory of Computation Chia-Ping Chen Department of Computer Science and Engineering National Sun Yat-Sen University Kaohsiung, Taiwan ROC Pushdown Automata p. 1
More informationCS375: Logic and Theory of Computing
CS375: Logic and Theory of Computing Fuhua (Frank) Cheng Department of Computer Science University of Kentucky 1 Table of Contents: Week 1: Preliminaries (set algebra, relations, functions) (read Chapters
More information3130CIT Theory of Computation
GRIFFITH UNIVERSITY School of Computing and Information Technology 3130CIT Theory of Computation Final Examination, Semester 2, 2006 Details Total marks: 120 (40% of the total marks for this subject) Perusal:
More informationCSE 105 THEORY OF COMPUTATION
CSE 105 THEORY OF COMPUTATION Spring 2016 http://cseweb.ucsd.edu/classes/sp16/cse105-ab/ Today's learning goals Sipser Ch 2 Design a PDA and a CFG for a given language Give informal description for a PDA,
More informationCS 154, Lecture 3: DFA NFA, Regular Expressions
CS 154, Lecture 3: DFA NFA, Regular Expressions Homework 1 is coming out Deterministic Finite Automata Computation with finite memory Non-Deterministic Finite Automata Computation with finite memory and
More informationCS 275 Automata and Formal Language Theory
CS 275 Automata and Formal Language Theory Course Notes Part II: The Recognition Problem (II) Chapter II.4.: Properties of Regular Languages (13) Anton Setzer (Based on a book draft by J. V. Tucker and
More informationCS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine)
CS537 Theory of Computation Lecture : Computability Theory I (Turing Machine) Objectives Introduce the Turing Machine (TM) Proposed by Alan Turing in 936 finite-state control + infinitely long tape A stronger
More informationComputation Histories
208 Computation Histories The computation history for a Turing machine on an input is simply the sequence of configurations that the machine goes through as it processes the input. An accepting computation
More informationContext-Free and Noncontext-Free Languages
Examples: Context-Free and Noncontext-Free Languages a*b* is regular. A n B n = {a n b n : n 0} is context-free but not regular. A n B n C n = {a n b n c n : n 0} is not context-free The Regular and the
More informationCSE 105 THEORY OF COMPUTATION. Spring 2018 review class
CSE 105 THEORY OF COMPUTATION Spring 2018 review class Today's learning goals Summarize key concepts, ideas, themes from CSE 105. Approach your final exam studying with confidence. Identify areas to focus
More informationSolution to CS375 Homework Assignment 11 (40 points) Due date: 4/26/2017
Solution to CS375 Homework Assignment 11 (40 points) Due date: 4/26/2017 1. Find a Greibach normal form for the following given grammar. (10 points) S bab A BAa a B bb Ʌ Solution: (1) Since S does not
More informationValence automata as a generalization of automata with storage
Valence automata as a generalization of automata with storage Georg Zetzsche Technische Universität Kaiserslautern D-CON 2013 Georg Zetzsche (TU KL) Valence automata D-CON 2013 1 / 23 Example (Pushdown
More informationSection 1 (closed-book) Total points 30
CS 454 Theory of Computation Fall 2011 Section 1 (closed-book) Total points 30 1. Which of the following are true? (a) a PDA can always be converted to an equivalent PDA that at each step pops or pushes
More informationOgden s Lemma for CFLs
Ogden s Lemma for CFLs Theorem If L is a context-free language, then there exists an integer l such that for any u L with at least l positions marked, u can be written as u = vwxyz such that 1 x and at
More informationTheory of Computation (Classroom Practice Booklet Solutions)
Theory of Computation (Classroom Practice Booklet Solutions) 1. Finite Automata & Regular Sets 01. Ans: (a) & (c) Sol: (a) The reversal of a regular set is regular as the reversal of a regular expression
More informationFinite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018
Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018 Lecture 14 Ana Bove May 14th 2018 Recap: Context-free Grammars Simplification of grammars: Elimination of ǫ-productions; Elimination of
More informationCPSC 421: Tutorial #1
CPSC 421: Tutorial #1 October 14, 2016 Set Theory. 1. Let A be an arbitrary set, and let B = {x A : x / x}. That is, B contains all sets in A that do not contain themselves: For all y, ( ) y B if and only
More informationCISC 4090 Theory of Computation
CISC 4090 Theory of Computation Context-Free Languages and Push Down Automata Professor Daniel Leeds dleeds@fordham.edu JMH 332 Languages: Regular and Beyond Regular: a b c b d e a Not-regular: c n bd
More informationLecture 4: More on Regexps, Non-Regular Languages
6.045 Lecture 4: More on Regexps, Non-Regular Languages 6.045 Announcements: - Pset 1 is on piazza (as of last night) - If you don t have piazza access but are registered for 6.045, send email to TAs with
More informationUses of finite automata
Chapter 2 :Finite Automata 2.1 Finite Automata Automata are computational devices to solve language recognition problems. Language recognition problem is to determine whether a word belongs to a language.
More informationVTU QUESTION BANK. Unit 1. Introduction to Finite Automata. 1. Obtain DFAs to accept strings of a s and b s having exactly one a.
VTU QUESTION BANK Unit 1 Introduction to Finite Automata 1. Obtain DFAs to accept strings of a s and b s having exactly one a.(5m )( Dec-2014) 2. Obtain a DFA to accept strings of a s and b s having even
More informationProperties of Context-Free Languages. Closure Properties Decision Properties
Properties of Context-Free Languages Closure Properties Decision Properties 1 Closure Properties of CFL s CFL s are closed under union, concatenation, and Kleene closure. Also, under reversal, homomorphisms
More informationcse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska
cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska LECTURE 14 SMALL REVIEW FOR FINAL SOME Y/N QUESTIONS Q1 Given Σ =, there is L over Σ Yes: = {e} and L = {e} Σ Q2 There are uncountably
More informationSolution Scoring: SD Reg exp.: a(a
MA/CSSE 474 Exam 3 Winter 2013-14 Name Solution_with explanations Section: 02(3 rd ) 03(4 th ) 1. (28 points) For each of the following statements, circle T or F to indicate whether it is True or False.
More informationContext-Free Languages
CS:4330 Theory of Computation Spring 2018 Context-Free Languages Non-Context-Free Languages Haniel Barbosa Readings for this lecture Chapter 2 of [Sipser 1996], 3rd edition. Section 2.3. Proving context-freeness
More informationLecture 12: Mapping Reductions
Lecture 12: Mapping Reductions October 18, 2016 CS 1010 Theory of Computation Topics Covered 1. The Language EQ T M 2. Mapping Reducibility 3. The Post Correspondence Problem 1 The Language EQ T M The
More informationHomework Assignment 6 Answers
Homework Assignment 6 Answers CSCI 2670 Introduction to Theory of Computing, Fall 2016 December 2, 2016 This homework assignment is about Turing machines, decidable languages, Turing recognizable languages,
More informationVariations of the Turing Machine
Variations of the Turing Machine 1 The Standard Model Infinite Tape a a b a b b c a c a Read-Write Head (Left or Right) Control Unit Deterministic 2 Variations of the Standard Model Turing machines with:
More informationCSE 105 THEORY OF COMPUTATION
CSE 105 THEORY OF COMPUTATION Spring 2017 http://cseweb.ucsd.edu/classes/sp17/cse105-ab/ Today's learning goals Summarize key concepts, ideas, themes from CSE 105. Approach your final exam studying with
More informationCpSc 421 Final Exam December 15, 2006
CpSc 421 Final Exam December 15, 2006 Do problem zero and six of problems 1 through 9. If you write down solutions for more that six problems, clearly indicate those that you want graded. Note that problems
More informationCISC 4090 Theory of Computation
CISC 4090 Theory of Computation Context-Free Languages and Push Down Automata Professor Daniel Leeds dleeds@fordham.edu JMH 332 Languages: Regular and Beyond Regular: Captured by Regular Operations a b
More informationCS 341 Homework 16 Languages that Are and Are Not Context-Free
CS 341 Homework 16 Languages that Are and Are Not Context-Free 1. Show that the following languages are context-free. You can do this by writing a context free grammar or a PDA, or you can use the closure
More informationCISC4090: Theory of Computation
CISC4090: Theory of Computation Chapter 2 Context-Free Languages Courtesy of Prof. Arthur G. Werschulz Fordham University Department of Computer and Information Sciences Spring, 2014 Overview In Chapter
More informationSFWR ENG 2FA3. Solution to the Assignment #4
SFWR ENG 2FA3. Solution to the Assignment #4 Total = 131, 100%= 115 The solutions below are often very detailed on purpose. Such level of details is not required from students solutions. Some questions
More informationLecture 17: Language Recognition
Lecture 17: Language Recognition Finite State Automata Deterministic and Non-Deterministic Finite Automata Regular Expressions Push-Down Automata Turing Machines Modeling Computation When attempting to
More informationCS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine)
CS537 Theory of Computation Lecture : Computability Theory I (Turing Machine) Objectives Introduce the Turing Machine (TM)? Proposed by Alan Turing in 936 finite-state control + infinitely long tape A
More informationFunctions on languages:
MA/CSSE 474 Final Exam Notation and Formulas page Name (turn this in with your exam) Unless specified otherwise, r,s,t,u,v,w,x,y,z are strings over alphabet Σ; while a, b, c, d are individual alphabet
More informationNOTES WEEK 01 DAY 1 SCOT ADAMS
NOTES WEEK 01 DAY 1 SCOT ADAMS Question: What is Mathematics? Answer: The study of absolute truth. Question: Why is it so hard to teach and to learn? Answer: One must learn to play a variety of games called
More informationUndecidable Problems and Reducibility
University of Georgia Fall 2014 Reducibility We show a problem decidable/undecidable by reducing it to another problem. One type of reduction: mapping reduction. Definition Let A, B be languages over Σ.
More informationFORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
15-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY Chomsky Normal Form and TURING MACHINES TUESDAY Feb 4 CHOMSKY NORMAL FORM A context-free grammar is in Chomsky normal form if every rule is of the form:
More informationFinal exam study sheet for CS3719 Turing machines and decidability.
Final exam study sheet for CS3719 Turing machines and decidability. A Turing machine is a finite automaton with an infinite memory (tape). Formally, a Turing machine is a 6-tuple M = (Q, Σ, Γ, δ, q 0,
More informationHarvard CS 121 and CSCI E-207 Lecture 12: General Context-Free Recognition
Harvard CS 121 and CSCI E-207 Lecture 12: General Context-Free Recognition Salil Vadhan October 11, 2012 Reading: Sipser, Section 2.3 and Section 2.1 (material on Chomsky Normal Form). Pumping Lemma for
More informationTheory of Computation Turing Machine and Pushdown Automata
Theory of Computation Turing Machine and Pushdown Automata 1. What is a Turing Machine? A Turing Machine is an accepting device which accepts the languages (recursively enumerable set) generated by type
More informationSolutions to Problem Set 3
V22.0453-001 Theory of Computation October 8, 2003 TA: Nelly Fazio Solutions to Problem Set 3 Problem 1 We have seen that a grammar where all productions are of the form: A ab, A c (where A, B non-terminals,
More informationOn the coinductive nature of centralizers
On the coinductive nature of centralizers Charles Grellois INRIA & University of Bologna Séminaire du LIFO Jan 16, 2017 Charles Grellois (INRIA & Bologna) On the coinductive nature of centralizers Jan
More informationThe Church-Turing Thesis
The Church-Turing Thesis Huan Long Shanghai Jiao Tong University Acknowledgements Part of the slides comes from a similar course in Fudan University given by Prof. Yijia Chen. http://basics.sjtu.edu.cn/
More informationChomsky Normal Form and TURING MACHINES. TUESDAY Feb 4
Chomsky Normal Form and TURING MACHINES TUESDAY Feb 4 CHOMSKY NORMAL FORM A context-free grammar is in Chomsky normal form if every rule is of the form: A BC A a S ε B and C aren t start variables a is
More informationRumination on the Formal Definition of DPDA
Rumination on the Formal Definition of DPDA In the definition of DPDA, there are some parts that do not agree with our intuition. Let M = (Q, Σ, Γ, δ, q 0, Z 0, F ) be a DPDA. According to the definition,
More informationAC68 FINITE AUTOMATA & FORMULA LANGUAGES DEC 2013
Q.2 a. Prove by mathematical induction n 4 4n 2 is divisible by 3 for n 0. Basic step: For n = 0, n 3 n = 0 which is divisible by 3. Induction hypothesis: Let p(n) = n 3 n is divisible by 3. Induction
More informationCS 301. Lecture 18 Decidable languages. Stephen Checkoway. April 2, 2018
CS 301 Lecture 18 Decidable languages Stephen Checkoway April 2, 2018 1 / 26 Decidable language Recall, a language A is decidable if there is some TM M that 1 recognizes A (i.e., L(M) = A), and 2 halts
More informationTAFL 1 (ECS-403) Unit- II. 2.1 Regular Expression: The Operators of Regular Expressions: Building Regular Expressions
TAFL 1 (ECS-403) Unit- II 2.1 Regular Expression: 2.1.1 The Operators of Regular Expressions: 2.1.2 Building Regular Expressions 2.1.3 Precedence of Regular-Expression Operators 2.1.4 Algebraic laws for
More informationCS500 Homework #2 Solutions
CS500 Homework #2 Solutions 1. Consider the two languages Show that L 1 is context-free but L 2 is not. L 1 = {a i b j c k d l i = j k = l} L 2 = {a i b j c k d l i = k j = l} Answer. L 1 is the concatenation
More information(b) If G=({S}, {a}, {S SS}, S) find the language generated by G. [8+8] 2. Convert the following grammar to Greibach Normal Form G = ({A1, A2, A3},
Code No: 07A50501 R07 Set No. 2 III B.Tech I Semester Examinations,MAY 2011 FORMAL LANGUAGES AND AUTOMATA THEORY Computer Science And Engineering Time: 3 hours Max Marks: 80 Answer any FIVE Questions All
More informationAutomata Theory CS F-13 Unrestricted Grammars
Automata Theory CS411-2015F-13 Unrestricted Grammars David Galles Department of Computer Science University of San Francisco 13-0: Language Hierarchy Regular Languaes Regular Expressions Finite Automata
More informationCS21 Decidability and Tractability
CS21 Decidability and Tractability Lecture 8 January 24, 2018 Outline Turing Machines and variants multitape TMs nondeterministic TMs Church-Turing Thesis So far several models of computation finite automata
More informationHomework 5 - Solution
DCP3122 Introduction to Formal Languages, Spring 2015 Instructor: Prof. Wen-Guey Tzeng Homework 5 - Solution 5-May-2015 Due: 18-May-2015 1. Given Σ = {a, b, c}, find an NPDA that accepts L = {a n b n+m
More informationTuring Machines A Turing Machine is a 7-tuple, (Q, Σ, Γ, δ, q0, qaccept, qreject), where Q, Σ, Γ are all finite
The Church-Turing Thesis CS60001: Foundations of Computing Science Professor, Dept. of Computer Sc. & Engg., Turing Machines A Turing Machine is a 7-tuple, (Q, Σ, Γ, δ, q 0, q accept, q reject ), where
More informationExam 1 CSU 390 Theory of Computation Fall 2007
Exam 1 CSU 390 Theory of Computation Fall 2007 Solutions Problem 1 [10 points] Construct a state transition diagram for a DFA that recognizes the following language over the alphabet Σ = {a, b}: L 1 =
More informationCSCE 551: Chin-Tser Huang. University of South Carolina
CSCE 551: Theory of Computation Chin-Tser Huang huangct@cse.sc.edu University of South Carolina Computation History A computation history of a TM M is a sequence of its configurations C 1, C 2,, C l such
More informationCPS 220 Theory of Computation
CPS 22 Theory of Computation Review - Regular Languages RL - a simple class of languages that can be represented in two ways: 1 Machine description: Finite Automata are machines with a finite number of
More informationLanguages. Non deterministic finite automata with ε transitions. First there was the DFA. Finite Automata. Non-Deterministic Finite Automata (NFA)
Languages Non deterministic finite automata with ε transitions Recall What is a language? What is a class of languages? Finite Automata Consists of A set of states (Q) A start state (q o ) A set of accepting
More informationCS311 Computational Structures Regular Languages and Regular Expressions. Lecture 4. Andrew P. Black Andrew Tolmach
CS311 Computational Structures Regular Languages and Regular Expressions Lecture 4 Andrew P. Black Andrew Tolmach 1 Expressions Weʼre used to using expressions to describe mathematical objects Example:
More informationLecture 24: Randomized Complexity, Course Summary
6.045 Lecture 24: Randomized Complexity, Course Summary 1 1/4 1/16 1/4 1/4 1/32 1/16 1/32 Probabilistic TMs 1/16 A probabilistic TM M is a nondeterministic TM where: Each nondeterministic step is called
More informationThe Pumping Lemma and Closure Properties
The Pumping Lemma and Closure Properties Mridul Aanjaneya Stanford University July 5, 2012 Mridul Aanjaneya Automata Theory 1/ 27 Tentative Schedule HW #1: Out (07/03), Due (07/11) HW #2: Out (07/10),
More informationStudent#: CISC-462 Exam, December XY, 2017 Page 1 of 12
Student#: CISC-462 Exam, December XY, 2017 Page 1 of 12 Queen s University, Faculty of Arts and Science, School of Computing CISC-462 Final Exam, December XY, 2017 (Instructor: Kai Salomaa) INSTRUCTIONS
More informationNOTES WEEK 02 DAY 1. THEOREM 0.3. Let A, B and C be sets. Then
NOTES WEEK 02 DAY 1 SCOT ADAMS LEMMA 0.1. @propositions P, Q, R, rp or pq&rqs rp p or Qq&pP or Rqs. THEOREM 0.2. Let A and B be sets. Then (i) A X B B X A, and (ii) A Y B B Y A THEOREM 0.3. Let A, B and
More informationCSE 105 THEORY OF COMPUTATION
CSE 105 THEORY OF COMPUTATION Spring 2018 http://cseweb.ucsd.edu/classes/sp18/cse105-ab/ Today's learning goals Sipser Ch 5.1, 5.3 Define and explain core examples of computational problems, including
More informationCSE 105 THEORY OF COMPUTATION
CSE 105 THEORY OF COMPUTATION Fall 2016 http://cseweb.ucsd.edu/classes/fa16/cse105-abc/ Today's learning goals Sipser Ch 3 Trace the computation of a Turing machine using its transition function and configurations.
More informationNon-emptiness Testing for TMs
180 5. Reducibility The proof of unsolvability of the halting problem is an example of a reduction: a way of converting problem A to problem B in such a way that a solution to problem B can be used to
More information