Assignment 4
COMP 330 Autumn 2013 McGill University
Due Date: 31st Oct 2013
17th October 2013
There are 6 questions for credit and one for your spiritual growth. The
homework is due in class at the beginning of the class.
Question 1[20 points] Consider th
1
CSE2001, Fall 2006
Designing Context-Free Grammars.
Some basic techniques:
Matching enforcing the fact that your grammar generates matching pairs of
symbols.
Example: L = cfw_0n 12n | n 0. The context-free grammar for L is
S 0S 11 |
The grammar force
FACULTY OF SCIENCE
FINAL EXAMINATION
COMPUTER SCIENCE COMP 330
Theoretical Aspects of Computer Science
Examiner: Prof. Prakash Panangaden 8th December 2006
Associate Examiner: Prof. Patrick Hayden 9 am to 12 noon
Instructions:
This exam has 6 question
Name _
Homework 9
SOLUTIONS
1. For each of the language classes: regular, context-free, recursively enumerable,
and recursive, and each operation: complement, union, intersection, concatenation, and
*closure, indicate whether the class is closed under tha
Chapter 5: Reducibility
1
Decidability
A Language L is decidable iff there is a
Turing Machine M such that M accepts
every string in L and rejects every
string in L.
A recursive language is a decidable
language.
2
Recognizability
A Language L is recogniza
The Post Correspondence Problem
Mark Greenstreet, CpSc 421, Term 1, 2008/09
v The Post Correspondence Problem (PCP)
u Denition
u Examples
u Demonstrating undecidability of PCP
v Reductions summary
CpSc 421 12 November 2008 p.1/18
The Post Correspondence P
C OMPUTABILITY AND C OMPLEXITY
T UTORIAL 6
Tutorial 6
Exercise 1 (compulsory)
We know that the problem ALLCF G (does a given context-free grammar recognize all strings from ?)
is undecidable.
def
Consider the problem EQCF G = cfw_ G1 , G2 | G1 and G2 are
Decidable problems concerning regular languages
Adfa = cfw_<B,w> | B is a DFA that accepts input string w
If the language Adfa is decidable => the problem does B accept w is decidable too
Also,
Problem does B accept w = problem is <B,q> in Adfa
We want to
MleH‘Nerboqe
A MWW rvan/lel ww‘comm
For my ﬂleN—L lmhﬂl/lage
ﬁbuila! am au—l—ommhm wH-L lakuje ¢W+f
QM any ﬂaky/W5: L g 2*
we aha—me EL 0m ejwvaqu. Mad-[On
* 6
xi; no V2 6: xz 632 L
Givtn a Macklht We Afﬁrm 0w
equivnhnw r-Pz‘M‘itm r’T/M 2 Xr’Y’Mj ht
57%”
Sample Cover Page
December 2011
Final Examination
VERSION # (Only required for multiple choice exams)
FACULTY OF SCIENCE
FINALCOURSE TITLE
EXAMINATION
COURSE NUMBER & SECTION
DATE & TIME OF EXAM
Examiner:
Assoc Examiner:
COMPUTER SCIENCE COMP 330
Theoreti
Closure properties of RE, Rec
[Section 10.1]
Recall that a language L is
- recursively enumerable (RE) if there exists a TM for L,
- recursive (Rec) if there exists a TM for L which halts on
every input (i.e. also on strings not from L).
Is the class RE c
22C 131 Homework 2 : Solutions
Rajiv Raman March 8, 2007
1. (Problem 5.13) Let U SELESST M = cfw_< M > |M is a TM with one or more useless states. Show that AT M reduces to U SELESST M . Assume for the sake of contradiction that TM R decides U SELESST M .
Chapter 4
Pushdown automata
and context-free languages
99
Introduction
The language anbn cannot be accepted by a nite automaton
On the other hand, Lk = cfw_anbn | n k is accepted for any given n.
Finite memory, innite memory, extendable memory.
Pushdo
Context-free Grammars
[Section 2.1]
- more powerful than regular languages
- originally developed by linguists
- important for compilation of programming languages
Context-free Grammars
Example:
[Section 2.1]
A -> 0A1
A -> B
B -> #
Terminology:
- substitu
Undecidableproblems
for
Recursivelyenumerablelanguages
continued
Takearecursivelyenumerablelanguage
Decisionproblems:
L
isempty?
L
isfinite?
L containstwodifferentstrings
ofthesamelength?
Alltheseproblemsareundecidable
L
Theorem:
Forarecursivelyenumerable
6.8. THE POST CORRESPONDENCE PROBLEM
423
6.8
The Post Correspondence Problem
The Post correspondence problem (due to Emil Post) is another undecidable problem that turns out to be a very helpful tool for proving problems in logic or in formal language the
COMP330 Extra Notes
September -15 -13
4:21 PM
Chapter 1
Transition function example: if the finite automaton has an arrow from a state x to a state y
l abeled with the input symbol 1, that means that, if the automaton is in state x when it reads a 1, it t
COMP 330 Autumn 2013
Assignment 1
Due Date: 19th Sept 2013
Prakash Panangaden
5th September 2013
Please attempt all questions. There are 5 questions for credit and one for your spiritual growth.
The homework is due in class at the beginning of the class.
COMP 330 Autumn 2013
Assignment 2
Due Date: 3rd Oct 2013
Prakash Panangaden
19th September 2013
There are 5 questions for credit and one for your spiritual growth. There are alternate versions of
Q2 and Q4 for the ambitious. The homework is due in class a
COMP 330 Autumn 2013 Assignment 3
Due Date: 17th October 2013
Prakash Panangaden
3rd October 2013
There are 5 questions for credit and one for your spiritual growth. There
are alternate versions of two questions. The homework is due in class at the
beginn
Assignment 5
Prakash Panangaden
COMP 330 Autumn 2013 McGill University
Due Date: 14th Nov 2013
There are 6 questions for credit and one for your spiritual growth. The homework is due in
class at the beginning of the class.
Question 1[10 points] Consider t