Summer 1, 2014
CIS 511
Introduction to the Theory of Computation
Jean Gallier
Homework 4
June 24, 2014; Due July 2, 2014
A problems are for practice only, and should not be turned in.
Problem A1. (i) Given any set X, for any two subsets A, B X, prove that
Summer 1, 2014
CIS 511
Introduction to the Theory of Computation
Jean Gallier
Homework 3
June 13, 2014; Due June 23, 2014
A problems are for practice only, and should not be turned in.
Problem A1. Given any two context-free languages L1 and L2 over the sa
Summer 1, 2014
CIS 511
Introduction to the Theory of Computation
Jean Gallier
Homework 2
June 7, 2012; Due June 13, 2014
Beginning of class
A problems are for practice only, and should not be turned in.
Problem A1. Recall that two regular expressions R an
Summer 1, 2014
CIS 511
Introduction to the Theory of Computation
Jean Gallier
Homework 1
May 30, 2014; Due June 6, 2014
Beginning of class
A problems are for practice only, and should not be turned in.
Problem A1. Given an alphabet , prove that the relati
Spring, 2010
CIS 511
Introduction to the Theory of Computation
Jean Gallier
Homework 3
February 18, 2010; Due March 4, 2010,
beginning of class
A problems are for practice only, and should not be turned in.
Problem A1. Prove that every nite language is re
CIS 511: Spring 2012
Problem Set 3 Solutions
(1) Exercise 3.8 (b).
Answer:
1. Scan the tape till you read rst zero. If you reach end of input, scan again to
see if there is any remaining one, if there is any then reject otherwise accept.
2. Cross the zero
CIS 511: Spring 2012
Problem Set 2 Solutions
(1) Exercise 2.6 part (c) has its answer given in the book. That is, the book gives a
grammar generating the language, but does not prove that this grammar actually
generates the desired language. Carefully pro
CIS 511 Spring 2006: Homework 3 Solutions
Problem 1
Consider L1 rst. Observe that x = y i either
(a) |x| < |y|, which can be expressed as x = u1 , y = u2 w, where |u1 | = |u2 |
and w = ; or
(b) |x| > |y|, which can be expressed as x = wu1 , y = u2 , where
Spring, 2010
CIS 511
Introduction to the Theory of Computation
Jean Gallier
Homework 2
February 4, 2010; Due February 18, 2010
A problems are for practice only, and should not be turned in.
Problem A1. Recall that two regular expressions R and S are equiv
CIS 511: Spring 2012
Midterm Practice Problems
Some problems are harder than exam problems, but solving them will sharpen your thinking and
help you tackle the exam questions better. Solutions, perhaps to a subset of the problems, will be
posted prior to
CIS 511: Spring 2011
Problem Set 1 Solutions
(1) In class we discussed the concept of diagonalization, which can be used to show that some
function cannot be computed in some model of computation. Here we apply the concept to
show that there is a language
CIS 511 Spring 2006: Homework 4 Solutions
Problem 1
Consider the binary operator on languages dened as follows: given two languages L1 and L2 over , L1 L2 consists of words of the form uv such that
u L1 , v L2 , and |u| = |v|.
1. Prove: if L1 and L2 are r
Spring 2010
CIS 511
Introduction to the Theory of Computation
Jean Gallier
Homework 1
January 14, 2010; Due February 4, 2010
Beginning of class
A problems are for practice only, and should not be turned in.
Problem A1. Given an alphabet , prove that the r
CIS 511: Spring 2012
Problem Set 4 Solutions
(1) Exercise 5.4
Answer: No. Consider following counter-example.
A = cfw_0n 1n |n > 0
B = cfw_1
Dene f : as below
f (s) = 1 if s A
f (s) = 0 otherwise.
Clearly f is computable. Also note that x , x A f (x) = 1
CIS 511: Spring 2012
Midterm Solutions
(1) Let B be any language over the alphabet . Prove that B = B i BB B and B .
Answer: One direction is easy. If B = B , then BB B = B and B = B .
Suppose now that BB B and B . We prove by induction that B n B for n 2
CIS 511: Spring 2012
Midterm Practice Solutions
We have given sketches for the solutions to the practice problems. You should make sure you
know how to complete the proofs.
(1) Let L be a regular language. Which of the following are regular? Justify your
3.10. TREE DOMAINS AND GORN TREES
3.10
211
Tree Domains and Gorn Trees
Derivation trees play a very important role in parsing
theory and in the proof of a strong version of the pumping
lemma for the context-free languages known as Ogdens
lemma. Thus, it i
3.13. PUSHDOWN AUTOMATA
3.13
237
Pushdown Automata
We have seen that the regular languages are exactly the
languages accepted by DFAs or NFAs. The context-free
languages are exactly the languages accepted by pushdown automata, for short, PDAs. However, al
6.3.
Recursively Enumerable Sets
Recursively . . .
Consider the set
Reducibility and . . .
A = cfw_x N | x (a) is dened,
where a N is any xed natural number.
By Rices Theorem, A is not recursive (check this).
We claim that A is the range of a recursive fu
6.5.
The Recursion Theorem
The Recursion . . .
The recursion Theorem, due to Kleene, is a fundamental result in recursion
theory.
Extended Rice . . .
Creative and . . .
Theorem 6.5.1 (Recursion Theorem, Version 1) Let 0 , 1 , . . . be any
acceptable index
The Class P
More Problems
Propositional Logic . . .
The Class N P, . . .
Chapter 7
Computational Complexity
The Cook-Levin . . .
Home Page
Title Page
Page 421 of 472
Go Back
Full Screen
Close
Quit
7.1.
The Class P
The Class P
More Problems
In the previous
Spring, 2010
CIS 511
Introduction to the Theory of Computation
Jean Gallier
Homework 6
April 8, 2010; Due April 22, 2010
A problems are for practice only, and should not be turned in.
Problem A1. Prove that every context-free language is a recursive set.
CIS511
Notes on the Closure Denition
Of the Regular Languages
Jean Gallier
Department of Computer and Information Science
University of Pennsylvania
Philadelphia, PA 19104, USA
jean@saul.cis.upenn.edu
May 8, 2010
Abstract. The denition of the regular lang
Chapter 3
Context-Free Languages and PDAs
3.1
Context-Free Grammars
A context-free grammar basically consists of a nite set
of grammar rules. In order to dene grammar rules, we
assume that we have two kinds of symbols: the terminals,
which are the symbols
Pairing Functions
Coding of RAM . . .
Kleenes T -Predicate
Chapter 5
Universal RAM Programs and
Undecidability of the Halting
Problem
Home Page
Title Page
Page 307 of 342
Go Back
Full Screen
Close
Quit
5.1.
Pairing Functions
Pairing functions are used to
182
3.6
CHAPTER 3. CONTEXT-FREE LANGUAGES AND PDAS
The Greibach Normal Form
Every CFG G can also be converted to an equivalent
grammar in Greibach Normal Form (for short, GNF).
A context-free grammar G = (V, , P, S) is in Greibach
Normal Form i its produc
Acceptable Indexings
Undecidable Problems
Chapter 6
Elementary Recursive
Function Theory
Home Page
Title Page
Page 343 of 366
Go Back
Full Screen
Close
Quit
6.1.
Acceptable Indexings
In a previous Section, we have exhibited a specic indexing of the partia
3.17. LR(0)-CHARACTERISTIC AUTOMATA
3.17
259
LR(0)-Characteristic Automata
The purpose of LR-parsing, invented by D. Knuth in
the mid sixties, is the following: Given a context-free
grammar G, for any terminal string w , nd out
whether w belongs to the la