[syllabus] | [lecture notes] | [HW1-6,Q1] | [HW7-10,Q2,F] | [project]

[simulators/parsers] | [language definitions] | [automata definitions] | [computable definitions]

CS451 Details of homework assignments, Part 2 and Quiz 2

The most important item on all homework is YOUR NAME! No name, no credit. Staple or clip pages together.

Homework must be submitted when due. You loose 10%, one grade, the first day homework is late. Then 10% more per week, each week homework is late. Max of 50% off. A ZERO really hurts your final points. Do and turn in all homework, even if it is late. Paper or EMail to squire@cs.umbc.edu is acceptable. If I can not read or understand your homework, you do not get credit. Type or print if your handwriting is bad. Homework is always due on a scheduled class day within 15 minutes after the start of the class. If class is canceled then homework is due the next time the class meets.

  EMail only plain text! No word processor formats.
       You may use a word processor or other software tools and
       print the results and turn in paper.

Do your own homework!

You can discuss homework with other class members but DO NOT COPY!

Contents

  • Quiz 2
  • HW7 CYK Example
  • HW8 L(NPDA)=CFL=L(CFG)
  • HW9 CFL Pumping Lemma
  • HW10 Turing machines
  • Final Exam
  • Other Links
  • Quiz 2 Information

      Closed book. Multiple choice questions based on lectures,
      reading assignments and homework.
    
      Exam covers book: 1st Ed.  4.1 - 4.7
                        2nd Ed.  5.1 5.2 7.1 7.3 7.4
      Exam covers homework: HW5 and HW6
      Exam covers lectures: 12 -18
    
    

    HW7 CYK example 25 points

      1) Construct a NPDA equivalent to the following grammar:
         G = ( {S, A}, {a, b}, P, S )
           Productions
             S -> a A A
             A -> a S | b S | a
     
      Define all the components M = ( Q, Sigma, Gamma, delta, q0, Z0, F) 
      Show your work, partial credit given
    
    
      2) Construct a grammar equivalent to the following PDA
         M = ({q0, q1}, {0,1}, {Z0, X}, delta, q0, Z0, phi)
        
       delta          Sigma input, Gamma Top of stack
             |    0,Z0   |    0,X   |   1,Z0     |  1,X       |  eps,Z0    | eps,X
         ----+-----------+----------+------------+------------+------------+--
          q0 | phi       | {(q1,X)} | {(q0,XZ0)} | {(q0,XX)}  | {(q0,eps)} | phi
          q1 | {(q0,Z0)} | phi      | phi        | {(q1,eps)} | phi        | phi
    
      eps is short for epsilon the null string.
      Define all components G = ( V, T, P, S)
      Show your work, partial credit given
    
    

    HW8 L(NPDA)=CFL=L(CFG) 25 points

     You are allowed to use the executable 'cykp' and copy the V table.
     You are allowed to look at C++ code in cykp.cpp
    
     1) Given the CFG G = ( {S, A, B, C}, {a, b}, P, S
        with Productions
           S -> AB | BC
           A -> BA | a
           B -> CC | b
           C -> AB | a
     
        Determine if these strings are in the language:
        a) aaaaa
        b) aaaaaa
        c) baabab
    
        You must show the V table.
    
     2) Let G be a CFG in Chomsky Normal Form
        Give an algorithm to determine the number of distinct
        derivations of a string x.
    
        You must show neat pseudo code with comments 
    
    

    HW9 CFL pumping lemma 25 points

     1) write out the steps using the pumping lemma for CFL's to prove that
    
            i  i  i
     L = { a  b  c  | i >= 1 } is not a CFL.
    
     2) Using the steps in 1) [go back and add more if you missed some],
        prove, using the pumping lemma for CFL's that
    
    
            i  j  k
     L = { a  b  c  | i < j < k } is not a CFL.
    
    

    HW10 Turing Machines 25 points

      1) Write the machine description for a Turing machine, including
         delta transition table for the specific machine that
         starts with a number n on the tape and finishes with
         n squared on the tape. n on the input is just n zeros followed
         by blank tape.  tape 000#b
    
         Code your program and test it using the Turing Machine simulator,
         "tm"  The name of your program is to be  'square.t'
         More details are found in Simulators.
    
         Submit your homework on gl using   submit cs451 hw10 square.tm 
         or EMail or turn in on paper.
    
      2) L = { ww | w in Sigma star } is not a CFL.
         L is recognized by a Turing machine.
         What essential feature does a Turing machine have that a NPDA
         did not have to be able to recognize L ?
    
         (You can answer part 2 as a comment in square.tm)
    

    Final Exam

      Closed book. Covers all lectures, all reading assignments, all homework
      and project. Multiple choice and short answer questions.
    
      1) go over the Quiz 1 and Quiz 2
         the final exam will include some of these questions
      2) You may find it helpful to go over the
         Lecture Notes  but not the details of constructions
      3) Understand what classes of languages go with what machines,
         automata and Turing machines,
         and grammars and regular expressions
      4) Understand the statement of the Pumping Lemma for Context Free Languages
      5) Understand the Halting Problem and why it is not computable
      6) Understand the Church Turing Hypothesis
    
    
      last updated  5/25/01
    

    Other links

    Go to top