91.301 Homework Assignments

Unless it is explicitly stated otherwise, you must both submit an electronic copy
and turn in a hardcopy.  Be sure to include adequate test data in your
interactions (as they are called in Dr. Scheme --- in MIT Scheme run on unix these
files are called "scripts"), and save your interactions as text files.  All files
that you submit electronically should be text files.  Your programs should be in a
separate file, or files, so that they can be run without extracting them from other
files that you submit.  Be sure to include a README file that states what you are
submitting, limitations of your programs, and any other interesting information.
Use Dr. Scheme unless it is explicitly stated that you are to use MIT Scheme.

1. Due Wednesday, January 30.
    (1) Exercise 1.3, p. 21.
    (2) Exercise 1.4, p. 21.
Use both Dr. Scheme and MIT Scheme to test your programs.

2. Due Wednesday, February 6.
   The mathematical function f is "defined" inductively on the natural numbers as
follows:
             / 4                 if n = 0
     f(n) = |
             \ n + n + 3 + f(n-1)  otherwise (i.e. if n >= 1)
   (1)  Write a Scheme function that computes f.
   (2)  Find a simple mathematical expression cf for f.  (That is, cf is a closed
form for f.)
   (3)  Using mathematical induction, prove that your expression cf is correct.
   (4)  Write a Scheme function that computes cf.
(As indicated above, you need use only Dr. Scheme to test your programs.)

3. Due  Wednesday, February 13.
    (1) Exercise 1.8, p. 26.
    (2) Exercise 1.9, p. 36.

4. Due Thursday, February 21.
    (1) Exercise 1.17, pp.  46-7.  \ Use either Dr. Scheme
    (2) Exercise 1.18, p.     47.  /  or MIT Scheme in (1)-(2).
    (3) Exercise 1.22, p.     54.  Use MIT Scheme in (3).

5. Due Wednesday, March 6.
    (1) Exercise 1.33, p. 61.
    (2) Exercise 1.35, p. 70.

6. Due Wednesday, March 13.
    (1) Exercise 1.46, p.  78.
    (2) Exercise 2.17, p. 103.

7. Due Wednesday, March 27.
    (1) Exercise 2.37,    pp. 120-1.
    (2) Exercise 2.58(a), p.    151.

8. Due Wednesday, April 3.
    (1) Exercise 2.79, p. 193.
    (2) Exercise 2.84, p. 201.

9. Due Monday, April 22.
    (1) Exercise 2.85, p. 201.
    (2) Exercise 3.8,  p. 236.  Use both Dr. Scheme and MIT Scheme in (2).

10. Due Friday, May 3.
    (1) Exercise 4.26,  p. 401.
    (2) Exercise 4.29,  p. 407.