CSU390 08F: Homework 05

Created: Wed 15 Oct 2008
Last modified: 

Assigned: Wed 15 Oct 2008
Due: Mon 27 Oct 2008

Note: This assignment cannot be turned in late. See "Specific Instruction (1)" below.


General Instructions

  1. Please review the grading policy outlined in the course information page.

  2. On the first page of each part of your solution write-up, you must make explicit which problems are to be graded for "regular credit", which problems are to be graded for "extra credit", and which problems you did not attempt. Please use a table something like the following

    Problem01020304 0506070809...
    CreditRCRCRCECRC RCNARCRC...

    where "RC" is "regular credit", "EC" is "extra credit", and "NA" is "not applicable" (not attempted). Failure to do so will result in an arbitrary set of problems being graded for regular credit, no problems being graded for extra credit, and a five percent penalty assessment.

  3. You must also write down with whom you worked on the assignment. If this changes from problem to problem, then you should write down this information separately with each problem.


Specific Instructions

  1. Note: This assignment cannot be handed in late. I will be passing out solutions to this assignment the day it is due, in preparation for the midterm exam.

  2. This is a somewhat longer assignment than usual, and it is worth somewhat more points than usual. You also have more time to complete this assignment than usual: note that it is due on Mon, Oct 27.

  3. In Problems 1, 2, 3, and 4, you are required to construct context-free grammars for given languages. You should consider the five CFG patterns discussed in class and how these patterns can be used to construct CFGs for the languages in question. Your solutions should be modeled after the solution we gave in class for Sipser Exercise 2.6 (c); a handout describing this solution is available here.

    Note: You must describe what each variable in your context-free grammar does, in a manner similar to the solution given in the handout.

  4. In Problem 4 and 5, you are required to construct a PDAs for given languages. You should give finite state diagrams for such PDAs, similar to those given in class and in Figures 2.15, 2.17, and 2.19 from the Sipser text.

  5. In Problem 6, you are to demonstrate that the given grammar is ambiguous. To do so, you must show multiple left-most (or right-most) derivations for a string in the given language. (See pp. 105-106 of the Sipser text.) To attach a "meaning" to any such derivation, you will likely need to consider the parse trees associated with these derivations.

  6. In Problems 7, 8, and 9, you should use the Pumping Lemma for context-free languages to prove that the languages in question are not context-free. See Examples 2.36, 2.37, and 2.38 from the Sipser text for examples of such Pumping Lemma proofs. See also the following handout. We will cover the Pumping Lemma for context-free languages on Monday, Oct 20.

    Note: I would strongly suggest that you attempt more than one of these as you will almost certainly see such a problem on your midterm exam.


Problems

Required: 7 of the following 9 problems
Points: 16 pts per problem

  1. Exercise 2.1; Exercise 2.4 (b,c)

  2. Construct a CFG for the following language

    {0i 1j 2k | i != j or j != k}

    Note: "!=" is "not equal".

  3. Exercises 2.9 and 2.10.

  4. Give finite state diagrams for PDAs that accept the languages described in Exercise 2.4 (d) and Problem 2.28 (a).

    Hint: To construct a PDA for 2.28 (a), consider the PDA that we constructed in class for the language of all strings containing equal numbers of 0s and 1s.

  5. Problem 2.30 (a)

  6. Problem 2.31

  7. Problem 2.32


Switch to:


jaa@ccs.neu.edu