CS 154 Section 2: Formal Languages and Computability, Spring 2007

CS 154: Formal Languages and Computability, Section 2, Spring 2007

For contact information please see http://www.cs.sjsu.edu/~taylor/term/spring07/contact.html

Course Information

Information about the course, prerequisites, grading, and policies can be found on the Course Greensheet.

Announcement

Office hours for Wednesday, May 16: 1:30-2:30.

The second midterm was given on April 18.

The first midterm was given on March 7

For those of you who had problems accessing the course survey for the first day of classes: The survey site uses hourly quotas. In the future, they will up their quota, but for now, if the site isn't working, please try back again the next hour. I will take surveys on Wednesday due to this problem. I am sorry for the problem.

For those of you trying to take the course without attending the first day of class: please arrange to see me by Tuesday, January 30, regarding the first homework assignment, due January 31.

Upcoming Classes

Topics for future classes, and a rough course timetable, can be found on the Tentative Schedule.

Classes So Far

Date Topics Covered Readings
(Linz, Formal Languages and Automata, 4th Ed.)
Homework
May 21
Monday, 7:15 a.m.
Final Examination Everything we have seen, especially after chapter 8.
May 14 Review Last Class! Wednesday, we have no class, and no regularly scheduled office hours. I will schedule some office hours: Wednesday, 1:30-2:30 (and I won't kick you at at 2:30 if you are here before then).
May 9 More Explanation of HTM and ATM. Rice's Thm Section 12.1, 12.2 Section 12.2, number 2, using Rice's Theorem. (You don't need to use Rice's Theorem, but it is much easier if you do.) I will not collect this homework.

Also: we have discussed (in brief) Sections 11.4, 12.5, and also some of pages 323-325. Skim them as well.

May 7 More R.E. vs. Recursive Sections 11.1, 11.4 (We have only covered type 0, 2, and 3 in the Chomsky hierarchy.),
12.1, and also read the definition of the Post correspondence problem, pages 309-310
Lots of reading today, not so many written problems
  1. For A = ab, b, aba, aa
    and B = abab, a, b, a
    is there a solution to the P.C.P?
  2. The Turing Acceptance Language (ATM) is defined as follows: For string s = M#w, s is in ATM if and only if string w is accepted by turing machine M.

    Show that the Halting Problem and ATM reduce to each other. Make sure to specify which direction reduction you are showing (you should show both ways, but note which is which. The text covers the definition of the halting problem, and of reductions.)

May 2 Turing Machine Languages Section 11.1 Due 5/7: Section 11.1: 5, 7 (with explanation), 8, 10
Using JFLAP, give a 2-tape Turing Machine for problem 9.1: 8, 9. When finishing, the output should be on the same tape that the input began on. Use labels to identify the functions of any especially important states. Make screen snapshots of your machines after running each on some input. You may allow the tape heads to remain stationary if you wish.
April 30 Turning Machine Variants: (Stationary Option, MultiTrack, MultiTape)
Universal Turing Machines
Intro to JFLAP
Section 10.1 (p 250-253), 10.2 (258-260), 10.4 (all) Due 5/2: 10.4: 2, 5. For 2, also do the following:
  1. What does the machine do on input a1a1a1a1a2a1a2?
  2. Describe what the machine does in general for input strings using only characters a1 and a2.
  3. Suppose that your universal turing machine were to simulate the given machine, on the input string given above. Assume that, as in the description of how the universal turing machine simulates it's input machine, that the machine description is given on virtual tape 1, the input is given on virtual tape 2, and the state of the machine is stored on tape 3. What would the 3 virtual tapes each hold when the simulation ends?
  4. What might the real, single tape contain when the simulation completes on the same input?

Download the jflap software from http://www.jflap.org.
Use the software to build and debug a turing machine for some previously assigned problem. (JFLAP's help pages are useful.)

April 25 More Turing Machines, Building Blocks, Turings Thesis All of Chapter 9 (9.1-9.3) Due 4/30:
Section 9.1: 11a, 11b, 11e
Section 9.2: 3b
The second survey will also be due, and will be graded separately from the rest of the homework.

The second survey for the 9:00 a.m. section can be found at http://www.surveymonkey.com/s.asp?u=98333550068. Use the same ID number that you used for the first survey, and turn in your solutions to questions 7-21. In order to save trees, you do not need to print out screenshots of all of your answers, but instead, please print out the page which has the "done" button at the end of the survey, and on that page, write your name, and your answers to questions 7-21. Please then hit "done" to actually submit your survey. (Note: When the survey asks if you have signed the consent form, this refers to the form you filled in at the beginning of the semester, assuming that you filled one in. If you need your ID number again, please get it from the CS office, but it would be more convenient to them if you could just find the number assigned to you on your own.)

April 23 Second Midterm Returned, Turing Machines Section 9.1 Due 4/25: Section 9.1: 3, 5, 7d, 9
Also, think about 8 (not collected).
April 18 Second Midterm Chapters 1-8, especially 5-8
April 16 Review
April 11 Closure Properties for CFLs, Decision Algorithms Section 8.2 Due 4/16:
Section 8.2: 3, 12, 17
April 9 LL(k) grammars, CFGs, and Determinism Skim Section 7.4, Read Section 8.1 through page 209. Due 4/11:
Section 7.4: 9c
Section 8.1: 8 c, d, e. Proofs encouraged but not required.
April 4 Pushdown Automata, CFGs, and Determinism Sections 7.1-7.3. Pages 190-195, 198+ may be skimmed. Due 4/9:
Section 7.1: 4d, 4j (tricky?)
Section 7.2: 1, 5
Section 7.3: 1
Advance notice (rare): I will either collect this, or give a quiz Monday.
April 2 Pushdown Automata Section 7.1. Due 4/4:
Section 7.1: 4b, 4c
March 21 Chomsky Normal Form Sections 6.1, 6.2 through page 167. Due 4/2:
Section 6.2: 2, 3, 4
March 19 Simplifying CFGs for Parsing Chapter 5 (all, 5.3 on your own) and Section 6.1 Due 3/21:
Section 5.2: 3, 8
Section 6.1: 5, 6, 7
March 14 Context Free Grammars, Derivations, and Ambiguity Sections 5.1, 5.2 Due 3/19:
Section 5.1: 8b, 8c, 13
Section 5.2: 11, 13
March 12 Midterm 1 Returned
"The Big Picture"
Section 5.1 Submit answers to last three test questions
Problem 5.1:7c from text
March 7 Midterm 1 Chapters 1-4
March 5 Review for Midterm 1 Chapters 1-4
February 28 Review and Context Free Grammars Section 5.1 No Homework, but I did give out two handouts in class: homework solutions to all homework so far, and a review for the test. Come on Monday with questions for the test review.
February 26 Pigeon Hole Principle, Pumping Lemma, Non-Regular Languages Section 4.3 Due 2/28, from the textbook: Section 4.3: Problems 4, 5, 6, and 15 are all good (and all long). Pick one or two parts from each one. Questions like these will be on the midterm.
I am assigning this homework late Monday night, so I will not collect the homework or give a quiz on it for Wednesday.
February 21 Regular Language Questions, Regular Grammars,
Closure Properties of Regular Expressions
Sections 4.2, start 4.3 Due 2/26, from the textbook: Section 3.3: 13c, 14 (Note: na(w) is the number of a's in w, as in example 1.13, page 24.)
Section 4.2: 3, 8 (The algorithms can be very short and high-level, allowing for algorithms we have already seen as subprocedures.)
Section 4.3: 4f
February 19 Regular Grammars,
Closure Properties of Regular Languages
Sections 3.3, 4.1, 4.2 Due 2/21, from the textbook: Section 3.3: 1, 2, 3,
Section 4.1: 2b, 6, 9
Also: brows other questions in from section 4.1 just to see how many closure properties we did not mention. Finally, read question 14 from Section 3.3.
February 14 Regular Expression/Regular Language Equivalence
(RegExp to NFA, NFA to RegExp)
Section 3.2 Due 2/19, from the textbook: Section 3.1: 11, 14, 15
Section 3.2: 1, 2, 9, 10c
(Do at least one of 9, 10c by the algorithm, the other can by by observation.)
February 12 DFA minimization and Regular Expressions Sections 2.4, 3.1 Due 2/14, from the textbook: Section 2.4: 4, 5, 7
Section 3.1: 1, 4, 5
February 7 NFAs and equivalence to DFAs Chapters 2.2, 2.3 Due 2/12, from the textbook:
Section 2.1: 11
Section 2.2: 7, 12
Section 2.3: 3, 12
February 5 Languages, Grammars, Automata, Examples.
DFAs and Regular Languages
Chapters 1.2, 1.3, 2.1 Due 2/7, from the textbook:
Section 1.2: 21
Section 2.1: 1, 2, 3
January 31 Review of basics: Equivalence Classes, Graphs, and Proofs
Languages
Chapters 1.1,
1.2 through page 20
Due 2/5, from the textbook:
Section 1.1: 14, 20, 23, 35
Section 1.2: 7
January 29 Review of basics: Counting, Sets, Functions, and Asymptotic Notation Chapter 1.1 See below. Due date extended to 1/31 due to survey administration problems.
January 24 Class Administrivia None so far Email me, subject CS154Spring2007 (no spaces) with your email contact information.

After signing the in-class consent form, use survey questions from
http://www.surveymonkey.com/s.asp?u=83823167733,
printing solutions to Part 1 (questions 7-21) to turn in as your first homework assignment, due 1/29. (The survey can be printed even if you did not fill out that form. Also, if you like, you can download a copy of the text for the Informed Consent Form.)