Homework 2 (Due Monday 1/31/11 at 10:00 am)

Submit via OWLSPACE in a single (.ss or .rkt) file that is runnable in DrScheme (so all expository answers must be enclosed in comment blocks or commented out using semi-colons.s into one file and submit this one compressed file. We did not deduct any points for using the wrong format on HW01 but we will deduct points for this error on this assignment. Begin each problem with a comment line containing the number of the problem.

The type "natural number" (N) in this assignment means the natural-number type defined in the text in Section 11.1. Your file should include a data definition for N. Unless the problem statement stipulates otherwise, the only built-in operations you may use with values of this type or variants (such as natural>=1) are the constructors, accessors, and recognizers for the type and the equal? (or =}) operation. For N, the constructor is add1 ; the accessor is sub1, and the recognizers are zero? and positive?.
For variants, the constructor is typically add1 (unless the variant consists of multiples of m > 1 [such as the even numbers]), the accessor is typically sub1, and the recognizers are typically (equal? ... k), where k is the base number, and (> ... k).

Problems from the book (HTDP) with some customization