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 7
- Covered in class: Course logistics.
- Covered in class: Strings & Languages (Chapter 0)
- Note: due to a PowerPoint crash in class, we lost our slide annotations (including the beautiful smiley and batman symbols)
- feel free to take a look at the notes from the regular sections, except for the languages notes since I did not get that far in those sections
-
Thursday, Sept 9
- Covered in class: finished operations on languages
- Covered in class: (Deterministic) Finite Automata (Section 1.1)
- Homework 1, due Thursday, 09/16, 4:00pm:
- Draw FA (deterministic) for the following languages over {0,1}:
- the language of all strings of length at most 5 that contain at least one 0,
- the language containing only the empty string (epsilon), and
- the empty language.
- Draw FA (deterministic) for the language over {0,1,2,...,9} of strings representing decimal numbers divisible by three.
No leading zeros are allowed, e.g., 00123 and 000 are not allowed but 123 and 0 are allowed.
- Problem 1.34, page 89
- 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 14
- Covered in class: closure properties of regular languages (finished Section 1.1),
started NFAs (Section 1.2)
- Remember: Hw1 due next class.
-
Thursday, Sept 16
- Covered in class: solutions of Hw1
- Covered in class: formal definition of NFAs, equivalence of NFAs and DFAs
- Homework 2, due 9/24 4:00pm:
- Exercise 1.7, part c, page 84
- Let N1 and N2 be two NFAs. Suppose that we want to construct an NFA N for the union of the languages
L(N1) and L(N2). Suppose we use the following construction: take the start state of N1 and the start state
of N2 and merge them into a single state, while keeping all transitions of both N1 and N2.
- Describe this construction mathematically, i.e., formally define the five components of N in terms of the components of N1 and N2.
- Is this construction correct? That is, does N always accept the union of L(N1) and L(N2)?
If yes, informally reason your answer. If not,
give a concrete example of N1 and N2 and the resulting N (draw the state diagrams of all three NFAs)
such that L(N) is not equal to the union of L(N1) and L(N2).
- Exercise 1.16, part b, page 86 - read ahead on how to get rid of the epsilon-transition, or wait until Tuesday when we wrap it up in class
- 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 AR is also regular.
You do not have to prove that your construction is correct.
- Briefly describe the idea behind your construction, in a couple of sentences or so. Pictures never hurt.
- Describe your construction formally, specifying all five components of the new automaton.
- 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 21
- Covered in class: finished NFA's, started regular expressions (Section 1.3)
- Hw2 due next class.
-
Thursday, Sept 23
- Covered in class: regular expressions, Kleene's Theorem (Section 1.3), started non-regular languages (Section 1.4)
- Homework 3, due 09/30 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)
-
Tuesday, Sept 28
- Covered in class: Pumping Lemma (Section 1.4)
- Hw3 due next class.
-
Thursday, Sept 30
- Covered in class: finished non-regularity by the Pumping lemma examples, covered the Myhill-Nerode Theorem
- Covered in class: solutions of Hw 3
- No homework due next week due to the midterm on Thursday, October 7, 4-5:20pm. The midterm takes 1 hour and 20 minutes to accomodate the institute-wide Honors dinner that starts at 5:30pm. Follow the posted link for more information about the midterm.
Week 5
- Slides for this week: we'll continue with the slides from the previous week
Context-free Grammars - pdf
(ppt)
-
Tuesday, Oct 5
- Covered in class: minimization of DFAs, started context-free grammars (Section 2.1)
- Next class: midterm. More info available on the midterm website.
-
Thursday, Oct 7
- Homework 4, due to delayed posting the homework is due Monday 10/18/10, 10:00am:
- Let L = { wtw | w,t in {0,1}+ }.
- Use the pumping lemma to show that L is not regular.
- Find infinitely many strings that are pairwise distinguishable by L (i.e., find infinitely many equivalence classes of the indistinguishability by L relation).
For every pair of strings show that they are distinguishable by L.
- Exercise 1.49.
- Exercise 2.4, parts b), e), and f).
- Exercise 2.6, part d).
- Show that your CFG for the language from the previous exercise is ambiguous. In other words, find a string in the language and
provide two different left-most derivations or two different parse trees for your string.
- Show that the class of context-free languages is closed under star. Formally specify your construction.
Week 6
- Slides for this week: Pushdown Automata - pdf
(ppt)
-
Tuesday, Oct 12
- Covered in class: solutions of selected midterm problems, including the bonus.
- Covered in class: context-free grammars
-
Thursday, Oct 14
- Covered in class: Chomsky normal form, pushdown automata (Section 2.2)
- Discussed in class: the first homework problem: s = 0p10p does not provide a contradiction in the pumping lemma proof.
- Homework 5, due to delayed posting the homework is due Monday 10/25/10, 10:00am:
- Draw a PDA for the complement of the language { anbn | n ≥ 0 }.
- Draw a PDA for the language {xy | x,y in {0,1}*, |x|=|y| and x is not equal to yR};
in other words, the language contains even-length strings that are not palindromes.
- Exercise 2.11, page 129.
- Exercise 2.14, page 129.
- Problem 2.30, part d, page 131.
- Recall the Cartesian product construction we used to show that the intersection of two regular languages is regular.
Using a Cartesian product construction, show that the intersection of a context-free language and a regular language is
context-free. In particular, given a PDA P and a finite automaton M, construct a PDA P' for the intersection of L(P) and
L(M). Specify whether you assume that M is a DFA or an NFA. Specify all 6 components in the 6-tuple of P'.
Bonus problems, no due date: Problem 2.22, page 130, and Problem 2.42, page 131.
Week 7
- Slides for this week:
Non-context-free languages - pdf
(ppt)
-
Tuesday, Oct 19
- Covered in class: solutions of Hw4
- Covered in class: equivalence of PDAs and CFGs (both ways), the pumping lemma for context-free languages
-
Thursday, Oct 21
- Covered in class: more pumping lemma examples, Turing machines (Section 3.1)
- Homework 6, due 10/31, 10am:
- Problem 2.25, page 130.
-
In particular, given a PDA P for A, give the formal 6-tuple definition of a PDA P' for SUFFIX(A).
-
Also describe the idea behind your construction informally (in English) in a short paragraph.
-
Show how your construction works for the PDA on page 113. Draw the resulting A'.
- 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 { ai | i=2k for some k >= 0 }. Explain the idea behind your Turing machine - follow the style of the answer to Exercise 3.8(a) (page 163).
- Exercise 3.4, page 159. First read about Enumerators on pages 152-3.
- Exercise 3.7, page 160.
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 26
- Covered in class: variants of Turing machines (Section 3.2), Church-turing thesis (Section 3.3)
-
Thursday, Oct 28
- Covered in class: decidability (Section 4.1), uncountably many languages,
undecidability of the acceptance problem, RE intersection coRE = rec (Section 4.2)
- Homework 7, due Friday 11/5, 4:00pm (please bring your homework to the tutoring center and put it in the appropriately marked envelope - careful, do not use the envelope for the regular sections):
- 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 how to simulate a traditional TM on a write-restricted TM.
(This will imply that write-restricted TMs are equivalent to traditional TMs.)
- 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.
- Exercise 4.3.
- Problem 4.19.
- Assume that EQCFG is undecidable. Show that EQCFG,TM = { <G,M> | G is a CFG, M is a TM }
is also undecidable.
Week 9
- Slides for this week: Undecidable problems - pdf
(ppt),
Post Correspondence Problem - pdf
(ppt)
-
Tuesday, Nov 2
- Covered in class: using reduction to prove undecidability (Section 5.1)
- Covered in class: solutions of select homework problems
-
Thursday, Nov 4
- Class canceled due to sickness. We will have a make-up class during the finals week (the final review), on Thursday (the day before the exam) - time and place TBA.
- Homework 8, due Nov 14, 8:00pm:
- 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, blue box"-type reductions).
- Recall 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, you do not have to prove that it is correct.
-
An unrestricted grammar is like a CFG, except that you can now
have any string of variables and terminals containing at
least one variable on the left-hand side of a rule. Surprisingly,
unrestricted grammars generate exactly the recursively enumerable
languages. We will not show this, but we will look at an example.
The following grammar generates the language
{ai | i is a power of 2 greater than 1}.
- S -> ACaB
- Ca -> aaC
- CB -> DB
- CB -> E
- aD -> Da
- AD -> AC
- aE -> Ea
- AE -> &epsilon
Give a derivation of aaaaaaaa.
- Question 1 of the
sample final questions.
- Question 2a of the
sample final questions.
Week 10
- Slides for this week: Complexity - pdf
(ppt),
Classes P and NP - pdf
(ppt),
NP Completeness - pdf
(ppt)
-
Tuesday, Nov 09
- Covered in class: the Post Correspondence Problem (Section 5.2), the classes P and NP (Sections 7.1-3)
- Information about the exam will appear here soon.
-
Thursday, Nov 11
- Covered in class: more on P, NP, 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!