CSC 341 Grinnell College Spring, 2008
 
Automata, Formal Languages, and Computational Complexity
 

Assignments

Quick Links:   January   February   March   April   May

The accompanying table indicates assignments and due dates for Computer Science 341 and are subject to the following notes.


Due Date Collaboration Chapter Problems
Mon., Jan. 28
yes
0
0.4, 0.7, 0.9, 0.11
no
0
Supp. Prob. 1, 2
Mon., Feb. 4
yes
1
1.4ceg, 1,6degm 1,6bil, 1.7bc
no
1
Supp. Prob. 3
Mon, Feb. 11 Hour Test 1 Covers pp. 1-69
Mon., Feb. 18
no
1
1.19abc, 1.21 ab, 1.29b, 1.53
Mon., Feb. 25
yes
2
2.4ce, 2.14, 2.26, 2.31
no
2
Supp. Prob. 4
Mon., Mar. 3
yes
3
3.2bc, 3.6, 3.13 (give brief justification)
no
3
Supp. Prob. 5, 6
Mon., Mar. 10
yes (strongly
encouraged)
4
Choose any 3 problems from 4.4, 4.12, 4.16, 4.19, 4.26
Wed, Mar. 12 Hour Test 2 Covers pp. 1-182 (Chapters 1-4)
Wed., Apr. 9
no
  Optional Revision of Test 2 Due
Fri., Apr. 11
yes
5
5.1, 5.2, 5.3, 5.4, 5.9
Fri., Apr. 18
yes
5
do three of 5.12-5.15, 5.21-5.24
Wed., Apr. 23
yes
7
7.1abe (justify briefly), 7.2abe (justify briefly), 7.4, 7.5, 7.8
Fri., May 2
yes
5, 7
Extra Credit: 5.16, 5.17, 5.18, 5.21, 7.9, 7.10, 7.11
(points count toward collaborative-homework score; max 120%)
Fri., May 2
no
5, 7
Extra Credit: 5.19, 5.20, 5.31, 5.34, 7.12, 7.13, 7.24, 7.25
(points count toward noncollaborative-homework score; max 120%)
Mon, May 5 Hour Test 3 Covers pp. 1-210, 247-294 (Chapters 1-5, 7)
Due Date Collaboration Chapter Problems


Supplemental Problems

  1. Prove:
    12 + 22 + ... + n2 = n(n+1)(2n+1)/6
    for all positive integers n.
  2. Definition: The height of a non-empty tree is defined as the number of nodes on the longest path from a leaf of a tree to its root, the height of an empty tree is defined to be 0.

    Nodes in a Binary Tree: Suppose a binary tree T has height h. Prove that T contains at least h nodes and at most 2h - 1 nodes.

  3. Comments in Java: Java allows two types of comments:

    For the purposes of this problem, suppose all characters within a Java program are from the set {/, *, a, b, N}, where N represents the end-of-line character. (In a real Java program, of course, the characters a, b would be extended to all letters, digits, punctuation, etc., but that seems too extensive for this exercise.)

    1. Write an NFA with no more than 10 states that accepts exactly the comments in Java (within this limited alphabet).
    2. Using the construction(s) in the book, translate your NFA from part a into a DFA.
  4. Balanced Parentheses: Let B be the set of strings over the alphabet {a, b, (, ), [, ]}, in which the parentheses and brackets are balanced and appropriately nested. For example, (([ab])) is in B, since there are the same number of left and right parentheses, the same number of left and right brackets, and each left parenthesis or bracket is closed by the corresponding type of parenthesis or bracket. As another example, ([][]()) is in B. However, neither ][ nor (([))] are in B. Note that adding characters a or b anywhere within a string would not affect the balance.

    1. Give a context-free grammar that generates exactly the strings of B.
    2. Write a state diagram of a PDA that accepts exactly the strings of B.
  5. Turing Machine for 2 a's: Design a Turing machine that accepts exactly those strings that contain two consecutive a's. Write out your machine in full, both using a complete transition table and using a state diagram.

    Consider the input alphabet for this problem to be {a, b}.

  6. Turing Machine for Palindromes: Design a Turing machine that reads a string s and returns the string ssR, where sR is the reverse of the string s. For example, given the string "abbaa", the Turing machine should halt after "abbaaaabba" is printed on the tape. As in Supplemental Problem 5, write out your machine in full, both using a complete transition table and using a state diagram, and consider the input alphabet to be {a, b}.


This document is available on the World Wide Web as

http://www.cs.grinnell.edu/~walker/courses/341.sp08/assignments.shtml

created 5 January 1999
last revised 14 April 2008
Valid HTML 4.01! Valid CSS!
For more information, please contact Henry M. Walker at walker@cs.grinnell.edu.