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)
-
Tuesday, Sept 8
- 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
-
Thursday, Sept 10
- Covered in class: (Deterministic) Finite Automata - definition, examples, (some) closure properties (Section 1.1)
- I posted also the picture of the board where we drew the intersection of the languages accepted by two FA's. (If I am recalling correctly, thanks goes to Ben.)
- Due to delayed posting of the homework, it is due on Thursday of next week instead of the advertised Tuesday due date.
- Homework 1, due Thursday, 09/17 4:00pm:
- Exercise 0.11, page 27 (Make your answer short - just one sentence suffices for full credit :)
- Draw FA (deterministic) for the following languages over {0,1}:
- all strings of length at most 5 that contain at least one 0,
- language containing only the empty string (epsilon), and
- the empty language.
- Problem 1.34, page 89
- Consider the following language over {0,1,#}:
{ u#v | u,v are binary numbers and u > v }
Is the language regular? Reason your answer informally. (We'll do the formal part in a week or so.)
- 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*).
- Let A,B,C be languages over some alphabet Sigma. In each part below, two languages are given.
Say what the relationship is between them. (Are they always equal? If not, is one always a subset of the other?)
Whenever you say that one is NOT always a subset of the other, include a counterexample.
- A(B intersection C), AB intersection AC
- A* intersection B*, (A intersection B)*
- A*B*, (AB)*
- A*(BA*)*,(A*B)*A*
Note: it might be useful to practice drawing more FA's - e.g. those from Exercises 1.4-6.
Copyright: the last two exercises are 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)
-
Tuesday, Sept 15
- Covered in class: finished the construction proving that regular languages are closed under the union operation,
started NFA's (Section 1.2)
- Remember: Hw1 due next class.
-
Thursday, Sept 17
- Covered in class: solutions of Hw1, equivalence of NFA's and DFA's
- Homework 2, due 9/24 4:00pm:
- Exercise 1.7, part c, page 84
- Exercise 1.15, page 85 - 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
- 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 on slide 8 in the Nondeterminism section.
- Problem 1.51, page 90
Note: other useful exercises for drawing NFA's: 1.7-10.
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
-
Tuesday, Sept 22
- Covered in class: finished NFA's, started regular expressions (Section 1.3)
- Hw2 due next class.
-
Thursday, Sept 24
- Covered in class: solutions of Hw2
- Covered in class: regular expressions, Kleene's Theorem
- Homework 3, due 10/1 4:00pm:
- Exercise 1.18, parts b, f, and i, page 86
- Exercise 1.21, part a, page 86
- Exercise 1.25, page 87
- Exercise 1.27, page 88
- Exercise 1.28, part a, page 88
- 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
Week 4
- Slides for this week: Nonregular Languages - see Week 3,
Myhill-Nerode Theorem - pdf
(ppt),
Context-free Grammars - pdf
(ppt)
-
Tuesday, Sept 29
- Covered in class: finished Kleene's Thm (Section 1.3), Pumping Lemma (Section 1.4)
- Hw3 due next class.
-
Thursday, Oct 1
- Covered in class: solutions of Hw 3
- Covered in class: Pumping lemma exercises, started indistinguishability
- Homework 4, due 10/08/09, 4:00pm:
- Exercise 1.30, page 88
- Problem 1.35, page 89
- Problem 1.49, page 90
- Let M be a DFA, we described a contruction of a DFA M2 such that L(M2) is the complement of L(M). (Recall that the only thing we did was to swap accepting and nonaccepting states.)
Does the same construction work for NFAs? In other words, if N is an NFA and we swap its accepting and nonaccepting states, does the new automaton always accept the complement of L(N)?
If you answer yes, reason your answer. If you answer no, give a counterexample.
- Let L be the language of strings over {0,1} that contain 001 as a substring. Find the equivalence classes of the indistinguishability by L relation.
- Let L2 be { w#w | w is a string over {0,1} }. Find the equivalence classes of the indistinguishability by L2 relation.
Bonus problem - no due date: Problem 1.56.
Week 5
- Slides for this week: we'll continue with the slides from the previous week
-
Tuesday, Oct 6
- Covered in class: Myhill-Nerode Thm, homework discussion
- Think about how to minimize a DFA.
- Homework 4 due next class.
- Recall, the midterm will take place next Tuesday, in class. More information will appear here by Friday.
-
Thursday, Oct 8
- Covered in class: solutions of Hw4
- Covered in class: DFA minimization algorithm, Context-free grammars (Section 2.1)
- No homework this week - midterm is next Tuesday, Oct 13.
Information about the midterm can be found here.
Week 6
-
Tuesday, Oct 13
-
Thursday, Oct 15
- In-class: Context-free grammars, including ambiguity and Chomsky normal form
- Homework 5, due 10/25 11:59pm: (I forgot to upload the homework on
Friday, thus to give you a week for its completion, I am accepting written
submissions on Thursday in class and e-mailed submissions in pdf by Sunday 10/25, 11:59pm.)
- 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 |
- Let L be the language from the previous exercise. Find a string from each equivalence class of =L.
- Exercise 2.6, parts b and d, page 129.
- Let D = {xy | x,y are in {0,1}* and x is not equal to yR}. Give a CFG for D.
- Exercise 2.15, page 129.
- Exercise 2.16, page 129.
Week 7
- Slides for this week: Pushdown Automata - pdf
(ppt),
Closure properties of CFLs - pdf
(ppt)
Non-context-free languages - pdf
(ppt)
-
Tuesday, Oct 20
- Covered in class: finished Chomsky normal form, plus PDA's, including their equivalence to CFG
-
Thursday, Oct 22
- Covered in class: equivalence of PDAs and CFGs (both directions), started the Pumping Lemma for CFLs
- Homework 6, due end of the day 10/30:
- 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 yR },
in other words, the language contains even-length strings that are not palindromes.
- 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. Recall that a DPDA is a PDA that, for any state and any combination of input symbol and top of the stack symbol, there is at most one possible state that the PDA moves to.
- 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 }.
Week 8
- Slides for this week:
Turing Machines - pdf
(ppt),
Variants of Turing Machines - pdf
(ppt),
Defining Algorithm - pdf
(ppt),
Decidable Languages - pdf
(ppt),
Halting Problem - pdf
(ppt),
-
Tuesday, Oct 27
- Covered in class: the Pumping Lemma for CFLs, closure properties of CFLs, and deterministic PDAs/CFLs
-
Thursday, Oct 29
- Covered in class: Turing machines
- Homework 7, due Sunday 11/8, 4:00pm:
- 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.
- "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.
Week 9
- Slides for this week: Undecidable problems - pdf
(ppt),
Post Correspondence Problem - pdf
(ppt),
Mapping Reducibility - pdf
(ppt),
-
Tuesday, Nov 3
- Covered in class: variants of TMs, Hilbert's 10th problem, decidability
-
Thursday, Nov 5
- Covered in class: finished decidability, T-recognizable vs T-decidable, Chomsky hierachy, the halting problem
- Homework 8, due Nov 14 11:59pm: (Start early, this homework is probably the hardest we've had! That being said, however,
for the last couple of problems you might want to wait until our Tuesday class.)
- 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 (give a description of the TM S -
be careful to specify how S follows the rules for rewriting).
- 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).
- 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'll do/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)
-
Tuesday, Nov 10
- Covered in class: Undecidability via reductions, the Post Correspondence Problem (Sections 5.1-3)
- Remember: Final exam next week, Monday 11/16/2009, 12:30-2:30pm, room 70-2590.
Information about the exam will appear here soon.
Bring your questions to the next class.
-
Thursday, Nov 12
- Covered in class: P, NP, and NP-completeness (Sections 7.1-4)
- If you are interested in other polynomial-time reductions and NP-complete problems, read Section 7.5.
- Good luck with your finals!