# MCS-177 Homework 8, Fall 2005

## Due: December 9, 2005

• Exercise 9.x1: In DrScheme, you can use the notation `+inf.0` to write the value positive infinity, a special numerical value that is greater than all finite numbers. Operations on this value work as you might expect. For example, if you subtract 1 from it, you stil get positive infinity. Using this fact, demonstrate in DrScheme how you can make a sequence of all the positive integers, starting with 1. Your DrScheme printout should show that the sequence has infinite lengt, and that you can perform operations on it such as selecting element number 1000 or the `head` of the `tail` of the `tail`. Also demonstrate how you can use `sequence-cons` together with your sequence to produce the sequence of nonnegative integers, starting with 0. Show that it too is infinitely long and can be accessed at any position.

• Do Exercise 9.6 on page 252 and demonstrate (with a DrScheme printout) how it can be used together with your solution to Exercise 9.x1 to generate an infinitely long sequence containing all the perfect squares, starting with 0, 1, 4, 9, 16, etc.

• Do Exercise 9.10 on pages 257-258. (Be sure not to overlook part (c) on page 258.)

• Do Exercise 9.12 on page 261.

• Do Exercise 8.31 on page 240. If you are looking for somewhat more challenge, do Exercise 8.32 instead.