Home Assignments Lecture Blog Resources Project

91.301 Organization of Programming Languages
Prof. F. Martin

Problem Set 5: Symbolic Differentiation


In this problem set, you'll get more practice with accumulate, and work with the Scheme symbolic differentiator.

Reading for PS5

Before doing this problem set, read the following material:


1. Exercise 2.35 on pp. 120, redefining count-leaves as an accumulation.

2. Exercise 2.36 on pp. 120, accumulating with lists of lists.

3. Exercise 2.53 on pp. 144, testing quote, pair?, and memq.

4. Exercise 2.54 on pp. 145, building your own version of equal?.

5. Exercise 2.55 on pp. 145, pushing the limits of quote.

Small Implementation Projects

For the next two problems, retrieve the symbolic differentiation code.

6. Exercise 2.57 on pp. 151, extending the differentiator to handle arbitrary sums and products.

7. Exercise 2.58 on pp. 151, converting the differentiator to infix. Do subproblem (a) only.

Finally, let's explore this in Python.

8. Implement a version of the basic differentiator (as it stood before the Exercise 6 and 7 extensions) in Python. What data representation do you select? Why?