4003-389-01: Homeworks, Reading and Slides
Week 1
- Slides for this week: Introduction - pdf
(ppt),
Finite Automata - pdf
(ppt),
Nondeterministic Finite Automata - pdf
(ppt)
-
Monday, Dec 1
- Covered in class: Course logistics.
- Covered in class: Strings & Languages (Chapter 0), Introduction to Finite Automata (Section 1.1) - slides
are uploaded/up-to-date
-
Wednesday, Dec 3
- Covered in class: (Deterministic) Finite Automata - definition, examples, (some) closure properties (Section 1.1);
Basic introduction to Nondeterminism (Section 1.2) - slides are uploaded/up-to-date
- Homework 1, due 12/10 4:00pm:
- Exercise 0.10, page 27 (Make your answer short - just one sentence suffices for full credit :)
- Exercise 0.11, page 27 (Make your answer short - just one sentence suffices for full credit :)
- Exercise 1.6, parts g,h,m, page 84
- Problem 1.32, page 88
- Choose a language C such that proving that C is regular implies that B is also regular. Specify C.
- Give a DFA (deterministic FA) for C. You do not have to prove that your DFA is correct.
- Problem 1.51, page 90
- In each of the following cases give an example of languages A,B over {0,1} such that:
- AB=BA, and neither language is a subset of the other, and neither language is {epsilon}.
- AB=BA, and A is a proper non-empty subset of B, and A is not {epsilon}.
- (A union B)* is not equal (A* union B*).
- Neither language is a subset of the other, and (A union B)* = (A* union B*).
Note: it might be useful to practice drawing more FA's - e.g. those from Exercises 1.4-6.
Copyright: the last exercise is taken from the Martin book, as might be some future exercises.
Week 2
- Slides for this week: Nondeterminism - see Week 1, and Regular Expressions - pdf
(ppt)
-
Monday, Dec 8
- Covered in class: NFA's (Section 1.2) - think about how to get rid of epsilon-transitions
- Remember: Hw1 due next class.
-
Wednesday, Dec 10
- Covered in class: finished NFA's, started regular expressions (Section 1.3) -
think about how to construct an NFA for a given regular expression
- Homework 2, due 12/17 4:00pm:
- Exercise 1.7, part c, page 84; also give a regular expression for the same language
- Exercise 1.15, page 85 (this is the exercise I promised in class :) - give an example of an NFA N1
recognizing language A1 such that, after following the construction, N does not recognize (A1)*.
Give both
- N1, and
- a "witness" string for the fact that N does not recognize (A1)* -
either this string is from (A1)* and it is not recognized by N,
or it is not from (A1)* and it is recognized by N.
- Exercise 1.16, part b, page 86
- Exercise 1.25, page 87
- Exercise 1.27, page 88
- Problem 1.31, page 88 - follow the outline of the constructions from class:
Let A be a regular language, provide a construction that implies that A^R is also regular.
You do not have to prove that your construction is correct.
- Briefly describe the idea behind your construction, in a couple or so sentences. Pictures never hurt.
- Describe your construction formally, e.g. like the red part on slide 12 in the Nondeterminism section.
Note: other useful exercises for drawing NFA's: 1.7-10, and for regular expression: 1.18.
Bonus problems - no due date: Exercise 1.45, page 90, and Exercise 1.57, page 92.
It suffices to give the constructions, you do not have to prove their correctness. (I might ask you for the proof if I am having troubles verifying your construction - but hopefully that will not happen. :)
Please hand in your bonus problems on separate sheets of paper, not with your other homework problems.
(Note: as with most other courses, there is no partial credit for bonus problems.)
Week 3
- Slides for this week: Regular expressions - see week 2, and
Nonregular Lanuages - pdf,
ppt
-
Monday, Dec 15
- Covered in class: Regular Expressions, Kleene's Thm (Section 1.3)
- Hw2 due next class.
-
Wednesday, Dec 17
- Covered in class: Non-regular languages, the Pumping Lemma for regular languages (Section 1.4)
- Enjoy your break!
- Homework 3, due 1/7/09 4:00pm:
- Exercise 1.21, part a, page 86
- Exercise 1.28, part c, page 88
- Exercise 1.30, page 88
- Problem 1.35, page 89
- Problem 1.43, page 90 - give the "proof by picture" and describe the construction,
you do not have to prove that your construction is correct
- Problem 1.49, page 90
Week 4
- Slides for this week: Myhill-Nerode Theorem - pdf
(ppt),
Context-free Grammars - pdf
(ppt)
-
Monday, Jan 5
- Covered in class: Myhill-Nerode Theorem and minimization of DFAs, (very) briefly started context-free grammars
- Hw3 due next class.
-
Wednesday, Jan 7
- Covered in class: solutions to Hw 3
- Covered in class: Context-free grammars (Section 2.1)
- Homework 4, due 1/14/09, 4:00pm:
- Use the Myhill-Nerode Theorem to show that the language from problem 1.49, part a, is regular.
- Use the Myhill-Nerode Theorem to show that the language from Problem 1.46, part b, is nonregular.
- Minimize the following finite automaton: ({q1,q2,q3,q4,q5,q6,q7},{a,b},delta,q1,{q4,q6,q7}), where
|
a |
b |
| q1 |
q2 |
q3 |
| q2 |
q4 |
q5 |
| q3 |
q6 |
q7 |
| q4 |
q4 |
q5 |
| q5 |
q6 |
q7 |
| q6 |
q4 |
q5 |
| q7 |
q6 |
q7 |
- Exercise 2.6, part d, page 129.
- Problem 2.23, page 130.
- Part 1. Look back at all the homework problems related to regular languages (homeworks 1-3 and most problems from this homework)
and give up to three problems for each of the following: (a) the most useful problems - the ones
that helped you understand the material the most; (b) the most difficult problems - the ones that took the longest to solve;
(c) the unhelpful problems - the ones that you would happily skip.
Part 2. Skim through the exercises/problems for Chapter 1. State up to three exercises/problems that you think would be
good homework problems for an honors class.
Bonus problem - no due date: Problem 1.56.
Week 5
- Slides for this week: Pushdown Automata - pdf
(ppt),
Closure properties of CFLs - pdf
(ppt)
-
Monday, Jan 12
- Covered in class: ambiguity of CFGs, started pushdown automata (Section 2.2)
- Homework 4 due next class.
-
Wednesday, Jan 14
- Covered in class: solutions of Hw4
- Covered in class: closure properties of context-free languages (see several exercises in the book; summarized on the
slides),
briefly discussed equivalence of CFGs and PDAs
- No homework this week - midterm is next Wednesday, Jan 21.
Information about the midterm will be posted on this page soon.
Week 6
- Slides for this week: Non-context-free languages - pdf
(ppt)
-
Monday, Jan 19
- Covered in class: solution of Problem 2.23
- Covered in class: equivalence of PDAs and CFGs (Section 2.2)
- Covered in class: deterministics context-free languages, deterministic PDAs (not
in the book - see the slides
- Next class: midterm.
-
Wednesday, Jan 21
- Homework 5, due 1/28 4:00pm: (Update: I forgot to upload the homework on
Thursday, thus to give you a week for its completion, I am accepting written
submissions on Wednesday in class and e-mailed submissions in pdf by Friday 1/30, 11:59pm.)
- Consider the grammar given in Problem 2.19, page 130. Use the construction
from class/book to construct an equivalent PDA.
- Consider the following PDA A = ({0,1,2},{a,b},{&,*},delta,0,{2}) where the
delta function is given by:
delta(0,epsilon,epsilon) = {(1,&)},
delta(1,b,epsilon) = {(1,*)},
delta(1,a,*) = {(1,epsilon)}, and
delta(1,epsilon,&) = {(2,epsilon)}
[& is the closest symbol to a pretzel that I could find :) ]
-
Is this PDA deterministic? Give a short verbal explanation of your answer
(one or two sentences).
-
Use the construction from class/book
to construct an equivalent CFG. If you prefer, you may write a program for this
instead of doing it by hand (though this specific example is not too bad).
Also, notice that the PDA is already in the form satisfying conditions 1-3 and
therefore you do not need to do that part of the construction.
- Draw a PDA for the language { xy | x,y in {a,b}*, |x|=|y| but x is different from y^R },
in other words, the language contains even-length strings that are not palindromes.
- Exercise 2.9, page 129.
- Let G be CFG in Chomsky normal form. Let w be from L(G), |w|=k>0.
How many steps (in the derivation) do you need to use to generate w? Give your answer in terms of k,
include a brief explanation (a short paragraph).
- Let L3 = { w in {0,1}* | w contains twice as many 0's as 1's }. Draw a DPDA
(deterministic PDA) for L3.
Week 7
- Slides for this week: Turing machines - pdf
(ppt)
-
Monday, Jan 26
- Covered in class: solutions to selected Midterm problems
- Covered in class: pumping lemma for context-free languages (Section 2.3)
- Covered in class: briefly discussed closure of deterministic context-free languages under the complement and its implications
for DCFLs are a proper subset of CFLs
-
Wednesday, Jan 28
- Covered in class: Turing machines (Section 3.1, briefly also Section 3.2)
- Eaten in class: pizza! (veggie does not seem to be a favorite :)
- Homework 6, due Feb 4, 4:00pm:
- Use the pumping lemma for context-free languages to show
that the following language is not context-free: L = { aibj | j=i2, i,j>=0 }.
- Draw a TM for the language L = { 0i1j | j is divisible by i, i,j>=0 }. Include a brief explanation that
will help me understand how your TM works. You might either briefly describe each of your states, or explain
the purpose of each block of states.
- Problem 3.13 - just answer the question "What class of languages do these machines recognize?" and
briefly explain your answer.
- First, read the solutions of Problems 3.15, part a, and 3.16, part a. Then, solve
- Problem 3.15, part e
- Problem 3.16, part d
- Problem 3.15, part d
- Would your construction from Problem 3.15d work to prove that the complement of every Turing-recognizable
language is also Turing-recognizable? Explain your answer.
Week 8
- Slides for this week: Variants of Turing Machines - pdf
(ppt),
Defining Algorithm - pdf
(ppt),
Decidable Languages - pdf
(ppt),
Halting Problem - pdf
(ppt),
-
Monday, Feb 2
- Covered in class: Variants of Turing Machines (Section 3.2)
- Covered in class: Hilbert's 10th problem and the Church-Turing Thesis (Section 3.3)
- Covered in class: Decidable languages (Section 4.1)
- No pizza today... Let's hope for Wednesday.
-
Wednesday, Feb 4
- Covered in class: finished Decidable languages related to language theory, plus the Chomsky hierarchy picture
- Covered in class: Halting Problem (Section 4.2), or rather, the acceptance problem
- Covered in class: solutions of Hw5, briefly Hw6 (the pumping lemma is left for Monday)
- Pizza :) Next class: pepperoni and cheese, unless I get vocal objections
- Homework 7, due Feb 11 4:00pm:
- "Dragon" Turing machines:
- Read pages 148-149 in the book about the Turing machine variant with multiple tapes.
- Consider a TM with a single tape but multiple heads. There are many ways how to envision this machine
(artistic drawings included :). Briefly explain (in words, but you may give a formal definition if you prefer)
how your machine works (e.g. what happens when the heads write at the same position of the tape?
what if the heads cross?).
- Give a sketch of the proof that your "dragon" TM is equivalent to the traditional Turing machines. In particular,
give the description of the machine S from the proof, similar to the description at the bottom half of page 149.
- Suppose we have a "write-restricted" Turing machine variant that is allowed to a) rewrite blank symbols into anything,
b) rewrite other symbols into a special '&' symbol, and c) leave symbols untouched
(i.e., the TM reads them and writes back the same symbol). Sketch the proof that shows that this variant
is equivalent to the traditional Turing machines (again, give a description of S as in the previous problem -
but be careful to specify how the S follows the rules for rewriting).
- Consider the problem of deciding whether the language given by a CFG is infinite.
- Phrase the problem as a language (similar to the languages from Section 4.1).
- Show that this problem/language is decidable. Give a reasonably detailed description of your algorithm
(about a paragraph).
- Consider the problem of deciding whether the language given by a CFG over {0,1} contains a
string not of the form 1* (i.e. does it contain a string that contains at least one symbol '0'?).
- Phrase the problem as a language (similar to the languages from Section 4.1).
- Show that this problem/language is decidable. Give a reasonably detailed description of your algorithm
(about a paragraph).
- Look back at homeworks from context-free languages (Chapter 2, plus some extra notes) and Turing machines
(Chapter 3) - roughly Homeworks 4-6.
- Give your favorite CFL and your favorite TM problem(s).
- Give your least favorite CFL and your least favorite TM problem(s).
- Look at the problems in the book and tell me which ones you'd like to see on the homework (at least one
from each chapter but feel free to give more :).
Bonus problem, no due date: Problem 4.14.
Week 9
- Slides for this week: Undecidable problems - pdf
(ppt),
Post Correspondence Problem - pdf
(ppt),
Mapping Reducibility - pdf
(ppt),
-
Monday, Feb 9
- Covered in class: proving undecidability via reductions (Section 5.1)
- Note: we skipped Linear Bounded Automata from Section 5.1
- Covered in class: problem statement of the Post Correspondence Problem (Section 5.2)
- Covered in class: finished solutions of Hw6 (the CFL pumping lemma proof)
-
Wednesday, Feb 11
- Covered in class: PCP, the reduction from the acceptance problem
- Covered in class: mapping reducibility (Section 5.3)
- Next week: Chapter 7 (we're skipping Chapter 6, the advanced topics in computability theory)
- Homework 6: Check your folders for the graded homework that I forgot to give back in class.
- Homework 8, due Feb 18 4:00pm: (Start early, this homework is probably the hardest we've had!)
- We did not get the chance to prove Thm 5.13. Read the proof (it goes via computation histories that we
used for the PCP reduction, see also Def 5.5), and then apply it to the TM given below and w=aabb. More precisely,
draw the PDA described in the proof (or give a CFG if you wish) that arises from w=aabb and this TM over {a,b}:
delta(q0,a) = (q1,*,R)
delta(q1,a) = (q1,b,R)
delta(q1,b) = (q2,b,R)
delta(q2,b) = (q2,b,L)
delta(q2,*) = (qaccept,*,R)
Note that the language accepted by this TM is regular. However, this problem asks for applying the
construction of the PDA from the proof and thus it does not really matter what type of language the TM
accepts.
- Let L11 = { [M] | M is a TM that accepts the string 11 }. Show that L11 is
undecidable by giving a reduction from ATM. Draw a sketch of the reduction, similarly
to what we did in class ("green box, yellow box"-type reductions).
- Read Problem 5.21 that gives a hint for proving that the problem of deciding ambiguity of CFG's is
undecidable. Apply a similar idea to show that the language LCFGint = { [G1,G2] |
G1,G2 are CFG's and L(G1) intersection L(G2) is nonempty } is undecidable. In particular, for an instance of PCP,
create two CFG's such that the intersection of their languages in nonempty iff the PCP has a match.
It suffices to give the contruction (see the hint), you do not have to prove that it is correct.
- Answer the following questions:
- If A≤mB and B is a CFL, does it imply that A is a CFL?
- If A≤mB and B is a decidable, does it imply that A is decidable?
- If A≤mB and A is a CFL, does it imply that B is a CFL?
- If A≤mB and A is a decidable, does it imply that B is decidable?
Give a brief (one sentence to a paragraph) explanation of your answer.
Week 10
- Slides for this week: Complexity - pdf
(ppt),
Classes P and NP - pdf
(ppt)
NP Completeness - pdf
(ppt)
-
Monday, Feb 16
- Covered in class: Time Complexity (Section 7.1), Class P (Section 7.2), and Class NP (Section 7.3)
- Briefly discussed solutions of Problems 3&4 on Hw7. Note about problem 3: I just realized that I might have discussed
the solution to "emptiness of CFGs" instead of "infinitess of CFGs".
I'll come back to the problem next class. We'll also talk about Hw8.
-
- Remember: Final exam next week, Tuesday 02/24/2009, 12:30-230pm, room 70-2690.
Information about the exam will appear here soon.
Bring your questions to the next class.
-
Wednesday, 18
- Covered in class: NP-completeness (Section 7.4)
- If you are interested in other polynomial-time reductions and NP-complete problems, read Section 7.5.
- Discussed in class: solutions of problems from Hw7 and Hw8.
- Good luck with your finals!